File tree Expand file tree Collapse file tree 10 files changed +32
-50
lines changed
Expand file tree Collapse file tree 10 files changed +32
-50
lines changed Original file line number Diff line number Diff line change 1616 "esbuild" ,
1717 "rollup" ,
1818 "node" ,
19- "ts-node" ,
2019 "typescript" ,
2120
2221 // breaking changes
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ hoist-pattern[]=@emotion/*
44hoist-pattern[] = postcss
55hoist-pattern[] = pug
66hoist-pattern[] = source-map-support
7+ hoist-pattern[] = ts-node
Original file line number Diff line number Diff line change 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" : {
6464 "eslint-define-config" : " ^1.4.0" ,
6565 "eslint-plugin-import" : " ^2.26.0" ,
6666 "eslint-plugin-node" : " ^11.1.0" ,
67+ "esno" : " ^0.16.3" ,
6768 "execa" : " ^5.1.1" ,
6869 "fs-extra" : " ^10.1.0" ,
6970 "kill-port" : " ^1.6.1" ,
8182 "semver" : " ^7.3.7" ,
8283 "simple-git-hooks" : " ^2.7.0" ,
8384 "sirv" : " ^2.0.2" ,
84- "ts-node" : " ^10.7.0" ,
8585 "tslib" : " ^2.4.0" ,
8686 "typescript" : " ^4.6.4" ,
8787 "unbuild" : " ^0.7.4" ,
9292 },
9393 "simple-git-hooks" : {
9494 "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"
9696 },
9797 "lint-staged" : {
9898 "*" : [
Original file line number Diff line number Diff line change 1919 "scripts" : {
2020 "dev" : " unbuild --stub" ,
2121 "build" : " unbuild && pnpm run patch-cjs" ,
22- "patch-cjs" : " ts-node ../../scripts/patchCJS.ts" ,
22+ "patch-cjs" : " esno ../../scripts/patchCJS.ts" ,
2323 "prepublishOnly" : " npm run build"
2424 },
2525 "engines" : {
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change 1919 "scripts" : {
2020 "dev" : " unbuild --stub" ,
2121 "build" : " unbuild && pnpm run patch-cjs" ,
22- "patch-cjs" : " ts-node ../../scripts/patchCJS.ts" ,
22+ "patch-cjs" : " esno ../../scripts/patchCJS.ts" ,
2323 "prepublishOnly" : " npm run build"
2424 },
2525 "engines" : {
Original file line number Diff line number Diff line change 1919 "scripts" : {
2020 "dev" : " unbuild --stub" ,
2121 "build" : " unbuild && pnpm run patch-cjs" ,
22- "patch-cjs" : " ts-node ../../scripts/patchCJS.ts" ,
22+ "patch-cjs" : " esno ../../scripts/patchCJS.ts" ,
2323 "prepublishOnly" : " npm run build"
2424 },
2525 "engines" : {
Original file line number Diff line number Diff line change @@ -7,11 +7,9 @@ import type { File } from '@babel/types'
77import colors from 'picocolors'
88import MagicString from 'magic-string'
99
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' )
1513
1614// walk through the temp dts dir, find all import/export of types/*
1715// 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;
1717*/
1818
1919import { readFileSync , writeFileSync } from 'fs'
20- import { bold , red } from 'picocolors'
20+ import colors from 'picocolors'
2121
2222const indexPath = 'dist/index.cjs'
2323let 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+);/)
4949if ( 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` ) )
5757process . exit ( 1 )
You can’t perform that action at this time.
0 commit comments