Skip to content

Commit f32313a

Browse files
authored
chore(deps): use esno to replace ts-node (#8152)
1 parent 863fd7d commit f32313a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"docs-serve": "vitepress serve docs",
2929
"build": "pnpm -r --filter=./packages/* run build",
3030
"dev": "pnpm -r --parallel --filter=./packages/* run dev",
31-
"release": "ts-node scripts/release.ts",
32-
"ci-publish": "ts-node scripts/publishCI.ts",
31+
"release": "esno scripts/release.ts",
32+
"ci-publish": "esno scripts/publishCI.ts",
3333
"ci-docs": "run-s build docs-build"
3434
},
3535
"devDependencies": {
@@ -63,6 +63,7 @@
6363
"eslint-define-config": "^1.4.0",
6464
"eslint-plugin-import": "^2.26.0",
6565
"eslint-plugin-node": "^11.1.0",
66+
"esno": "^0.15.0",
6667
"execa": "^5.1.1",
6768
"fs-extra": "^10.1.0",
6869
"kill-port": "^1.6.1",
@@ -79,7 +80,6 @@
7980
"semver": "^7.3.7",
8081
"simple-git-hooks": "^2.7.0",
8182
"sirv": "^2.0.2",
82-
"ts-node": "^10.7.0",
8383
"typescript": "^4.6.4",
8484
"unbuild": "^0.7.4",
8585
"vite": "workspace:*",
@@ -89,7 +89,7 @@
8989
},
9090
"simple-git-hooks": {
9191
"pre-commit": "pnpm exec lint-staged --concurrent false",
92-
"commit-msg": "pnpm exec ts-node scripts/verifyCommit.ts $1"
92+
"commit-msg": "pnpm exec esno scripts/verifyCommit.ts $1"
9393
},
9494
"lint-staged": {
9595
"*": [

packages/plugin-react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"scripts": {
2424
"dev": "unbuild --stub",
2525
"build": "unbuild && pnpm run patch-cjs",
26-
"patch-cjs": "ts-node ../../scripts/patchCJS.ts",
26+
"patch-cjs": "esno ../../scripts/patchCJS.ts",
2727
"prepublishOnly": "npm run build"
2828
},
2929
"engines": {

scripts/patchCJS.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports.parseVueRequest = parseVueRequest;
1717
*/
1818

1919
import { readFileSync, writeFileSync } from 'fs'
20-
import { bold, red } from 'picocolors'
20+
import colors from 'picocolors'
2121

2222
const indexPath = 'dist/index.cjs'
2323
let code = readFileSync(indexPath, 'utf-8')
@@ -40,7 +40,7 @@ if (matchMixed) {
4040

4141
writeFileSync(indexPath, lines.join('\n'))
4242

43-
console.log(bold(`${indexPath} CJS patched`))
43+
console.log(colors.bold(`${indexPath} CJS patched`))
4444
process.exit()
4545
}
4646

@@ -49,9 +49,9 @@ const matchDefault = code.match(/\nmodule.exports = (\w+);/)
4949
if (matchDefault) {
5050
code += `module.exports["default"] = ${matchDefault[1]};\n`
5151
writeFileSync(indexPath, code)
52-
console.log(bold(`${indexPath} CJS patched`))
52+
console.log(colors.bold(`${indexPath} CJS patched`))
5353
process.exit()
5454
}
5555

56-
console.error(red(`${indexPath} CJS patch failed`))
56+
console.error(colors.red(`${indexPath} CJS patch failed`))
5757
process.exit(1)

0 commit comments

Comments
 (0)