Skip to content

Commit 5587f2c

Browse files
authored
chore: replace esno with tsx, migrate release script and playground to TypeScript (#29)
* Replaces esno with tsx. Quoting esno: "From v0.15, esno is essentially an alias of tsx, with automated CJS/ESM mode and caching.". * There are no benefits of caching here since we're only parsing one TS file at a time. * Updated tsx version uses same esbuild version as Vite, reducing the number of dependencies. * Migrates release script to TypeScript * require() is dead! * Minimal changes were required * Migrates playground to TypeScript * Set "type" to "module" - no more deprecated CJS Vite API warning! * Removed "setupCounter(document.querySelector('#counter'))" leftover - neither #counter or setupCounter function were present.
1 parent 2266824 commit 5587f2c

7 files changed

Lines changed: 45 additions & 278 deletions

File tree

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
},
1818
"scripts": {
1919
"dev": "unbuild --stub",
20-
"build": "unbuild && esno scripts/patchCJS.ts",
20+
"build": "unbuild && tsx scripts/patchCJS.ts",
2121
"test": "vitest run",
22-
"release": "node scripts/release.js",
22+
"release": "tsx scripts/release.ts",
2323
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
2424
},
2525
"engines": {
@@ -40,16 +40,16 @@
4040
"devDependencies": {
4141
"conventional-changelog-cli": "^2.2.2",
4242
"enquirer": "^2.4.1",
43-
"esno": "^0.17.0",
4443
"execa": "^4.1.0",
4544
"minimist": "^1.2.8",
45+
"node-forge": "^1.3.1",
4646
"picocolors": "^1.0.0",
4747
"prettier": "^2.8.8",
4848
"rollup": "^2.79.1",
4949
"semver": "^7.6.0",
50+
"tsx": "^4.7.1",
5051
"unbuild": "^2.0.0",
5152
"vite": "^5.0.0",
52-
"vitest": "^0.34.6",
53-
"node-forge": "^1.3.1"
53+
"vitest": "^0.34.6"
5454
}
5555
}

playground/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

playground/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</head>
99
<body>
1010
<div id="app"></div>
11-
<script type="module" src="/main.js"></script>
11+
<script type="module" src="/main.ts"></script>
1212
</body>
1313
</html>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import './style.css'
22
import viteLogo from '/vite.svg'
33
import lockIcon from '/lock.svg'
44

5-
document.querySelector('#app').innerHTML = `
5+
const root = document.querySelector('#app')!
6+
7+
root.innerHTML = `
68
<div>
79
<a href="https://vitejs.dev" target="_blank">
810
<img src="${viteLogo}" class="logo" alt="Vite logo" />
@@ -12,9 +14,7 @@ document.querySelector('#app').innerHTML = `
1214
</a>
1315
<h1>Hello Vite + Basic SSL!</h1>
1416
<p class="read-the-docs">
15-
Example of a basic ssl setup using an automatically generated self-signed certificate
17+
Example of a basic ssl setup using an automatically generated self-signed certificate
1618
</p>
1719
</div>
1820
`
19-
20-
setupCounter(document.querySelector('#counter'))

playground/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"private": true,
55
"description": "Example of a basic ssl setup using an automatically generated self-signed certificate",
6+
"type": "module",
67
"scripts": {
78
"dev": "vite",
89
"build": "vite build",

0 commit comments

Comments
 (0)