Skip to content

Commit 85b8b55

Browse files
authored
chore: revert #8152 (#8161)
This reverts commit 2363bd3.
1 parent 2363bd3 commit 85b8b55

File tree

11 files changed

+51
-64
lines changed

11 files changed

+51
-64
lines changed

.github/renovate.json5

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"esbuild",
1717
"rollup",
1818
"node",
19+
"ts-node",
1920
"typescript",
2021

2122
// breaking changes

.npmrc

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ hoist-pattern[]=@emotion/*
44
hoist-pattern[]=postcss
55
hoist-pattern[]=pug
66
hoist-pattern[]=source-map-support
7-
hoist-pattern[]=ts-node

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": "esno scripts/release.ts",
32-
"ci-publish": "esno scripts/publishCI.ts",
31+
"release": "ts-node scripts/release.ts",
32+
"ci-publish": "ts-node scripts/publishCI.ts",
3333
"ci-docs": "run-s build docs-build"
3434
},
3535
"devDependencies": {
@@ -63,7 +63,6 @@
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",
6766
"execa": "^5.1.1",
6867
"fs-extra": "^10.1.0",
6968
"kill-port": "^1.6.1",
@@ -80,6 +79,7 @@
8079
"semver": "^7.3.7",
8180
"simple-git-hooks": "^2.7.0",
8281
"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 esno scripts/verifyCommit.ts $1"
92+
"commit-msg": "pnpm exec ts-node scripts/verifyCommit.ts $1"
9393
},
9494
"lint-staged": {
9595
"*": [

packages/plugin-legacy/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"scripts": {
2020
"dev": "unbuild --stub",
2121
"build": "unbuild && pnpm run patch-cjs",
22-
"patch-cjs": "esno ../../scripts/patchCJS.ts",
22+
"patch-cjs": "ts-node ../../scripts/patchCJS.ts",
2323
"prepublishOnly": "npm run build"
2424
},
2525
"engines": {

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": "esno ../../scripts/patchCJS.ts",
26+
"patch-cjs": "ts-node ../../scripts/patchCJS.ts",
2727
"prepublishOnly": "npm run build"
2828
},
2929
"engines": {

packages/plugin-vue-jsx/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"scripts": {
2020
"dev": "unbuild --stub",
2121
"build": "unbuild && pnpm run patch-cjs",
22-
"patch-cjs": "esno ../../scripts/patchCJS.ts",
22+
"patch-cjs": "ts-node ../../scripts/patchCJS.ts",
2323
"prepublishOnly": "npm run build"
2424
},
2525
"engines": {

packages/plugin-vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"scripts": {
2020
"dev": "unbuild --stub",
2121
"build": "unbuild && pnpm run patch-cjs",
22-
"patch-cjs": "esno ../../scripts/patchCJS.ts",
22+
"patch-cjs": "ts-node ../../scripts/patchCJS.ts",
2323
"prepublishOnly": "npm run build"
2424
},
2525
"engines": {

packages/vite/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"build-bundle": "rollup -c",
3535
"build-types": "run-s build-temp-types patch-types roll-types",
3636
"build-temp-types": "tsc --emitDeclarationOnly --outDir temp/node -p src/node",
37-
"patch-types": "esno scripts/patchTypes.ts",
37+
"patch-types": "ts-node scripts/patchTypes.ts",
3838
"roll-types": "api-extractor run && rimraf temp",
3939
"lint": "eslint --ext .ts src/**",
4040
"format": "prettier --write --parser typescript \"src/**/*.ts\"",

packages/vite/scripts/patchTypes.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import { readFileSync, readdirSync, statSync, writeFileSync } from 'fs'
2-
import { dirname, relative, resolve } from 'path'
3-
import { fileURLToPath } from 'url'
41
import type { ParseResult } from '@babel/parser'
52
import { parse } from '@babel/parser'
63
import type { File } from '@babel/types'
74
import colors from 'picocolors'
5+
import { readdirSync, readFileSync, statSync, writeFileSync } from 'fs'
86
import MagicString from 'magic-string'
7+
import { dirname, relative, resolve } from 'path'
98

10-
const dir = dirname(fileURLToPath(import.meta.url))
11-
const tempDir = resolve(dir, '../temp/node')
12-
const typesDir = resolve(dir, '../types')
9+
const tempDir = resolve(__dirname, '../temp/node')
10+
const typesDir = resolve(__dirname, '../types')
1311

1412
// walk through the temp dts dir, find all import/export of types/*
1513
// and rewrite them into relative imports - so that api-extractor actually

pnpm-lock.yaml

+33-44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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 colors from 'picocolors'
20+
import { bold, red } 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(colors.bold(`${indexPath} CJS patched`))
43+
console.log(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(colors.bold(`${indexPath} CJS patched`))
52+
console.log(bold(`${indexPath} CJS patched`))
5353
process.exit()
5454
}
5555

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

0 commit comments

Comments
 (0)