File tree 10 files changed +32
-50
lines changed
10 files changed +32
-50
lines changed Original file line number Diff line number Diff line change 16
16
"esbuild" ,
17
17
"rollup" ,
18
18
"node" ,
19
- "ts-node" ,
20
19
"typescript" ,
21
20
22
21
// breaking changes
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ hoist-pattern[]=@emotion/*
4
4
hoist-pattern[] = postcss
5
5
hoist-pattern[] = pug
6
6
hoist-pattern[] = source-map-support
7
+ hoist-pattern[] = ts-node
Original file line number Diff line number Diff line change 28
28
"docs-serve" : " vitepress serve docs" ,
29
29
"build" : " pnpm -r --filter=./packages/* run build" ,
30
30
"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" ,
33
33
"ci-docs" : " run-s build docs-build"
34
34
},
35
35
"devDependencies" : {
64
64
"eslint-define-config" : " ^1.4.0" ,
65
65
"eslint-plugin-import" : " ^2.26.0" ,
66
66
"eslint-plugin-node" : " ^11.1.0" ,
67
+ "esno" : " ^0.16.3" ,
67
68
"execa" : " ^5.1.1" ,
68
69
"fs-extra" : " ^10.1.0" ,
69
70
"kill-port" : " ^1.6.1" ,
81
82
"semver" : " ^7.3.7" ,
82
83
"simple-git-hooks" : " ^2.7.0" ,
83
84
"sirv" : " ^2.0.2" ,
84
- "ts-node" : " ^10.7.0" ,
85
85
"tslib" : " ^2.4.0" ,
86
86
"typescript" : " ^4.6.4" ,
87
87
"unbuild" : " ^0.7.4" ,
92
92
},
93
93
"simple-git-hooks" : {
94
94
"pre-commit" : " pnpm exec lint-staged --concurrent false" ,
95
- "commit-msg" : " pnpm exec ts-node scripts/verifyCommit.ts $1"
95
+ "commit-msg" : " pnpm exec esno scripts/verifyCommit.ts $1"
96
96
},
97
97
"lint-staged" : {
98
98
"*" : [
Original file line number Diff line number Diff line change 19
19
"scripts" : {
20
20
"dev" : " unbuild --stub" ,
21
21
"build" : " unbuild && pnpm run patch-cjs" ,
22
- "patch-cjs" : " ts-node ../../scripts/patchCJS.ts" ,
22
+ "patch-cjs" : " esno ../../scripts/patchCJS.ts" ,
23
23
"prepublishOnly" : " npm run build"
24
24
},
25
25
"engines" : {
Original file line number Diff line number Diff line change 23
23
"scripts" : {
24
24
"dev" : " unbuild --stub" ,
25
25
"build" : " unbuild && pnpm run patch-cjs" ,
26
- "patch-cjs" : " ts-node ../../scripts/patchCJS.ts" ,
26
+ "patch-cjs" : " esno ../../scripts/patchCJS.ts" ,
27
27
"prepublishOnly" : " npm run build"
28
28
},
29
29
"engines" : {
Original file line number Diff line number Diff line change 19
19
"scripts" : {
20
20
"dev" : " unbuild --stub" ,
21
21
"build" : " unbuild && pnpm run patch-cjs" ,
22
- "patch-cjs" : " ts-node ../../scripts/patchCJS.ts" ,
22
+ "patch-cjs" : " esno ../../scripts/patchCJS.ts" ,
23
23
"prepublishOnly" : " npm run build"
24
24
},
25
25
"engines" : {
Original file line number Diff line number Diff line change 19
19
"scripts" : {
20
20
"dev" : " unbuild --stub" ,
21
21
"build" : " unbuild && pnpm run patch-cjs" ,
22
- "patch-cjs" : " ts-node ../../scripts/patchCJS.ts" ,
22
+ "patch-cjs" : " esno ../../scripts/patchCJS.ts" ,
23
23
"prepublishOnly" : " npm run build"
24
24
},
25
25
"engines" : {
Original file line number Diff line number Diff line change @@ -7,11 +7,9 @@ import type { File } from '@babel/types'
7
7
import colors from 'picocolors'
8
8
import MagicString from 'magic-string'
9
9
10
- // @ts -ignore
11
- const __dirname = resolve ( fileURLToPath ( import . meta. url ) , '..' )
12
-
13
- const tempDir = resolve ( __dirname , '../temp/node' )
14
- const typesDir = resolve ( __dirname , '../types' )
10
+ const dir = dirname ( fileURLToPath ( import . meta. url ) )
11
+ const tempDir = resolve ( dir , '../temp/node' )
12
+ const typesDir = resolve ( dir , '../types' )
15
13
16
14
// walk through the temp dts dir, find all import/export of types/*
17
15
// and rewrite them into relative imports - so that api-extractor actually
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ module.exports.parseVueRequest = parseVueRequest;
17
17
*/
18
18
19
19
import { readFileSync , writeFileSync } from 'fs'
20
- import { bold , red } from 'picocolors'
20
+ import colors from 'picocolors'
21
21
22
22
const indexPath = 'dist/index.cjs'
23
23
let code = readFileSync ( indexPath , 'utf-8' )
@@ -40,7 +40,7 @@ if (matchMixed) {
40
40
41
41
writeFileSync ( indexPath , lines . join ( '\n' ) )
42
42
43
- console . log ( bold ( `${ indexPath } CJS patched` ) )
43
+ console . log ( colors . bold ( `${ indexPath } CJS patched` ) )
44
44
process . exit ( )
45
45
}
46
46
@@ -49,9 +49,9 @@ const matchDefault = code.match(/\nmodule.exports = (\w+);/)
49
49
if ( matchDefault ) {
50
50
code += `module.exports["default"] = ${ matchDefault [ 1 ] } ;\n`
51
51
writeFileSync ( indexPath , code )
52
- console . log ( bold ( `${ indexPath } CJS patched` ) )
52
+ console . log ( colors . bold ( `${ indexPath } CJS patched` ) )
53
53
process . exit ( )
54
54
}
55
55
56
- console . error ( red ( `${ indexPath } CJS patch failed` ) )
56
+ console . error ( colors . red ( `${ indexPath } CJS patch failed` ) )
57
57
process . exit ( 1 )
You can’t perform that action at this time.
0 commit comments