From 9f8d79b9897427882bb7da1bdb7862a15938c865 Mon Sep 17 00:00:00 2001 From: Percy Ma Date: Wed, 7 Sep 2022 16:00:54 +0800 Subject: [PATCH] chore: use pnpm `shell-emulator` instead of `cross-env` (#10023) --- .npmrc | 1 + package.json | 13 +++++------ playground/env/package.json | 7 ++---- playground/json/package.json | 3 +-- playground/react-sourcemap/package.json | 7 +++--- playground/ssr-deps/package.json | 3 +-- playground/ssr-html/package.json | 3 +-- playground/ssr-pug/package.json | 3 +-- playground/ssr-react/package.json | 3 +-- playground/ssr-vue/package.json | 3 +-- playground/ssr-webworker/package.json | 3 +-- playground/worker/package.json | 24 +++++++++---------- pnpm-lock.yaml | 31 +------------------------ 13 files changed, 32 insertions(+), 72 deletions(-) diff --git a/.npmrc b/.npmrc index 6d64ed708da7d4..148b202c642b5e 100644 --- a/.npmrc +++ b/.npmrc @@ -6,3 +6,4 @@ hoist-pattern[]=pug hoist-pattern[]=source-map-support hoist-pattern[]=ts-node strict-peer-dependencies=false +shell-emulator=true \ No newline at end of file diff --git a/package.json b/package.json index b2d0409cbce6a8..3f5145d12a99b4 100644 --- a/package.json +++ b/package.json @@ -20,17 +20,17 @@ "typecheck": "tsc -p scripts --noEmit && tsc -p playground --noEmit", "test": "run-s test-unit test-serve test-build", "test-serve": "vitest run -c vitest.config.e2e.ts", - "test-build": "cross-env VITE_TEST_BUILD=1 vitest run -c vitest.config.e2e.ts", - "test-build-without-plugin-commonjs": "cross-env VITE_TEST_WITHOUT_PLUGIN_COMMONJS=1 pnpm test-build", + "test-build": "VITE_TEST_BUILD=1 vitest run -c vitest.config.e2e.ts", + "test-build-without-plugin-commonjs": "VITE_TEST_WITHOUT_PLUGIN_COMMONJS=1 pnpm test-build", "test-unit": "vitest run", "test-docs": "pnpm run docs-build", - "debug-serve": "cross-env VITE_DEBUG_SERVE=1 vitest run -c vitest.config.e2e.ts", - "debug-build": "cross-env VITE_TEST_BUILD=1 VITE_PRESERVE_BUILD_ARTIFACTS=1 vitest run -c vitest.config.e2e.ts", + "debug-serve": "VITE_DEBUG_SERVE=1 vitest run -c vitest.config.e2e.ts", + "debug-build": "VITE_TEST_BUILD=1 VITE_PRESERVE_BUILD_ARTIFACTS=1 vitest run -c vitest.config.e2e.ts", "docs": "vitepress dev docs", "docs-build": "vitepress build docs", "docs-serve": "vitepress serve docs", - "build": "pnpm -r --filter=./packages/* run build", - "dev": "pnpm -r --parallel --filter=./packages/* run dev", + "build": "pnpm -r --filter='./packages/*' run build", + "dev": "pnpm -r --parallel --filter='./packages/*' run dev", "release": "tsx scripts/release.ts", "ci-publish": "tsx scripts/publishCI.ts", "ci-docs": "run-s build docs-build" @@ -60,7 +60,6 @@ "@typescript-eslint/eslint-plugin": "^5.36.1", "@typescript-eslint/parser": "^5.36.1", "conventional-changelog-cli": "^2.2.2", - "cross-env": "^7.0.3", "esbuild": "^0.14.47", "eslint": "^8.23.0", "eslint-define-config": "^1.7.0", diff --git a/playground/env/package.json b/playground/env/package.json index 271cbf0a7d20c0..091afe4bd08a88 100644 --- a/playground/env/package.json +++ b/playground/env/package.json @@ -3,12 +3,9 @@ "private": true, "version": "0.0.0", "scripts": { - "dev": "cross-env VITE_INLINE=inline-serve vite", - "build": "cross-env VITE_INLINE=inline-build vite build", + "dev": "VITE_INLINE=inline-serve vite", + "build": "VITE_INLINE=inline-build vite build", "debug": "node --inspect-brk ../../packages/vite/bin/vite", "preview": "vite preview" - }, - "devDependencies": { - "cross-env": "^7.0.3" } } diff --git a/playground/json/package.json b/playground/json/package.json index ee851285a0945c..b2c29d3e6f494d 100644 --- a/playground/json/package.json +++ b/playground/json/package.json @@ -8,11 +8,10 @@ "debug": "node --inspect-brk ../../packages/vite/bin/vite", "preview": "vite preview", "dev:ssr": "node server", - "serve:ssr": "cross-env NODE_ENV=production node server", + "serve:ssr": "NODE_ENV=production node server", "debug:ssr": "node --inspect-brk server" }, "devDependencies": { - "cross-env": "^7.0.3", "express": "^4.18.1", "json-module": "file:./json-module", "vue": "^3.2.38" diff --git a/playground/react-sourcemap/package.json b/playground/react-sourcemap/package.json index 91aa3331b877b4..70398d97257914 100644 --- a/playground/react-sourcemap/package.json +++ b/playground/react-sourcemap/package.json @@ -4,9 +4,9 @@ "version": "0.0.0", "scripts": { "dev": "vite", - "dev:classic": "cross-env USE_CLASSIC=1 vite", + "dev:classic": "USE_CLASSIC=1 vite", "build": "vite build", - "build:classic": "cross-env USE_CLASSIC=1 vite build", + "build:classic": "USE_CLASSIC=1 vite build", "debug": "node --inspect-brk ../../packages/vite/bin/vite", "preview": "vite preview" }, @@ -15,7 +15,6 @@ "react-dom": "^18.2.0" }, "devDependencies": { - "@vitejs/plugin-react": "workspace:*", - "cross-env": "^7.0.3" + "@vitejs/plugin-react": "workspace:*" } } diff --git a/playground/ssr-deps/package.json b/playground/ssr-deps/package.json index ac82dadbcead63..785806c3bab816 100644 --- a/playground/ssr-deps/package.json +++ b/playground/ssr-deps/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "dev": "node server", - "serve": "cross-env NODE_ENV=production node server", + "serve": "NODE_ENV=production node server", "debug": "node --inspect-brk server" }, "dependencies": { @@ -32,7 +32,6 @@ "pkg-exports": "file:./pkg-exports" }, "devDependencies": { - "cross-env": "^7.0.3", "express": "^4.18.1" } } diff --git a/playground/ssr-html/package.json b/playground/ssr-html/package.json index 73614bab95ca5a..a800fe8477a416 100644 --- a/playground/ssr-html/package.json +++ b/playground/ssr-html/package.json @@ -5,12 +5,11 @@ "type": "module", "scripts": { "dev": "node server", - "serve": "cross-env NODE_ENV=production node server", + "serve": "NODE_ENV=production node server", "debug": "node --inspect-brk server" }, "dependencies": {}, "devDependencies": { - "cross-env": "^7.0.3", "express": "^4.18.1" } } diff --git a/playground/ssr-pug/package.json b/playground/ssr-pug/package.json index 547e8cbf7e94b2..5b64c6535cbfe9 100644 --- a/playground/ssr-pug/package.json +++ b/playground/ssr-pug/package.json @@ -5,11 +5,10 @@ "type": "module", "scripts": { "dev": "node server", - "serve": "cross-env NODE_ENV=production node server", + "serve": "NODE_ENV=production node server", "debug": "node --inspect-brk server" }, "devDependencies": { - "cross-env": "^7.0.3", "express": "^4.18.1", "pug": "^3.0.2" } diff --git a/playground/ssr-react/package.json b/playground/ssr-react/package.json index 3fd0f7134a2de9..ea03ab80086d47 100644 --- a/playground/ssr-react/package.json +++ b/playground/ssr-react/package.json @@ -9,7 +9,7 @@ "build:client": "vite build --outDir dist/client", "build:server": "vite build --ssr src/entry-server.jsx --outDir dist/server", "generate": "vite build --outDir dist/static && npm run build:server && node prerender", - "serve": "cross-env NODE_ENV=production node server", + "serve": "NODE_ENV=production node server", "debug": "node --inspect-brk server" }, "dependencies": { @@ -20,7 +20,6 @@ "devDependencies": { "@vitejs/plugin-react": "workspace:*", "compression": "^1.7.4", - "cross-env": "^7.0.3", "express": "^4.18.1", "serve-static": "^1.15.0" } diff --git a/playground/ssr-vue/package.json b/playground/ssr-vue/package.json index 5c450d10d62d60..f3869dc9c1fdf3 100644 --- a/playground/ssr-vue/package.json +++ b/playground/ssr-vue/package.json @@ -11,7 +11,7 @@ "build:server": "vite build --ssr src/entry-server.js --outDir dist/server", "build:server:noExternal": "vite build --config vite.config.noexternal.js --ssr src/entry-server.js --outDir dist/server", "generate": "vite build --ssrManifest --outDir dist/static && npm run build:server && node prerender", - "serve": "cross-env NODE_ENV=production node server", + "serve": "NODE_ENV=production node server", "debug": "node --inspect-brk server" }, "dependencies": { @@ -24,7 +24,6 @@ "@vitejs/plugin-vue": "workspace:*", "@vitejs/plugin-vue-jsx": "workspace:*", "compression": "^1.7.4", - "cross-env": "^7.0.3", "dep-import-type": "link:./dep-import-type", "express": "^4.18.1", "serve-static": "^1.15.0" diff --git a/playground/ssr-webworker/package.json b/playground/ssr-webworker/package.json index 9f6c8c00534eab..66fdc8b7afaa99 100644 --- a/playground/ssr-webworker/package.json +++ b/playground/ssr-webworker/package.json @@ -4,14 +4,13 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "cross-env DEV=1 node worker", + "dev": "DEV=1 node worker", "build:worker": "vite build --ssr src/entry-worker.jsx --outDir dist/worker" }, "dependencies": { "react": "^18.2.0" }, "devDependencies": { - "cross-env": "^7.0.3", "miniflare": "^1.4.1", "resolve-linked": "workspace:*" } diff --git a/playground/worker/package.json b/playground/worker/package.json index 701fca25628e76..e3fe8121a49d46 100644 --- a/playground/worker/package.json +++ b/playground/worker/package.json @@ -9,18 +9,18 @@ "dev:es": "vite --config ./vite.config-es.js dev", "build:es": "vite --config ./vite.config-es.js build", "preview:es": "vite --config ./vite.config-es.js preview", - "dev:sourcemap": "cross-env WORKER_MODE=sourcemap vite --config ./vite.config-sourcemap.js dev", - "build:sourcemap": "cross-env WORKER_MODE=sourcemap vite --config ./vite.config-sourcemap.js build", - "preview:sourcemap": "cross-env WORKER_MODE=sourcemap vite --config ./vite.config-sourcemap.js preview", - "dev:sourcemap-hidden": "cross-env WORKER_MODE=hidden vite --config ./vite.config-sourcemap.js dev", - "build:sourcemap-hidden": "cross-env WORKER_MODE=hidden vite --config ./vite.config-sourcemap.js build", - "preview:sourcemap-hidden": "cross-env WORKER_MODE=hidden vite --config ./vite.config-sourcemap.js preview", - "dev:sourcemap-inline": "cross-env WORKER_MODE=inline vite --config ./vite.config-sourcemap.js dev", - "build:sourcemap-inline": "cross-env WORKER_MODE=inline vite --config ./vite.config-sourcemap.js build", - "preview:sourcemap-inline": "cross-env WORKER_MODE=inline vite --config ./vite.config-sourcemap.js preview", - "dev:relative-base": "cross-env WORKER_MODE=inline vite --config ./vite.config-relative-base.js dev", - "build:relative-base": "cross-env WORKER_MODE=inline vite --config ./vite.config-relative-base.js build", - "preview:relative-base": "cross-env WORKER_MODE=inline vite --config ./vite.config-relative-base.js preview", + "dev:sourcemap": "WORKER_MODE=sourcemap vite --config ./vite.config-sourcemap.js dev", + "build:sourcemap": "WORKER_MODE=sourcemap vite --config ./vite.config-sourcemap.js build", + "preview:sourcemap": "WORKER_MODE=sourcemap vite --config ./vite.config-sourcemap.js preview", + "dev:sourcemap-hidden": "WORKER_MODE=hidden vite --config ./vite.config-sourcemap.js dev", + "build:sourcemap-hidden": "WORKER_MODE=hidden vite --config ./vite.config-sourcemap.js build", + "preview:sourcemap-hidden": "WORKER_MODE=hidden vite --config ./vite.config-sourcemap.js preview", + "dev:sourcemap-inline": "WORKER_MODE=inline vite --config ./vite.config-sourcemap.js dev", + "build:sourcemap-inline": "WORKER_MODE=inline vite --config ./vite.config-sourcemap.js build", + "preview:sourcemap-inline": "WORKER_MODE=inline vite --config ./vite.config-sourcemap.js preview", + "dev:relative-base": "WORKER_MODE=inline vite --config ./vite.config-relative-base.js dev", + "build:relative-base": "WORKER_MODE=inline vite --config ./vite.config-relative-base.js build", + "preview:relative-base": "WORKER_MODE=inline vite --config ./vite.config-relative-base.js preview", "debug": "node --inspect-brk ../../packages/vite/bin/vite" }, "dependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dfd5fe3955fc31..ca8db4b26b25a4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,6 @@ importers: '@typescript-eslint/eslint-plugin': ^5.36.1 '@typescript-eslint/parser': ^5.36.1 conventional-changelog-cli: ^2.2.2 - cross-env: ^7.0.3 esbuild: ^0.14.47 eslint: ^8.23.0 eslint-define-config: ^1.7.0 @@ -90,7 +89,6 @@ importers: '@typescript-eslint/eslint-plugin': 5.36.1_g2qdd2k5igsxhudjjarcmw5o7e '@typescript-eslint/parser': 5.36.1_pyvvhc3zqdua4akflcggygkl44 conventional-changelog-cli: 2.2.2 - cross-env: 7.0.3 esbuild: 0.14.47 eslint: 8.23.0 eslint-define-config: 1.7.0 @@ -457,10 +455,7 @@ importers: specifiers: {} playground/env: - specifiers: - cross-env: ^7.0.3 - devDependencies: - cross-env: 7.0.3 + specifiers: {} playground/env-nested: specifiers: {} @@ -533,12 +528,10 @@ importers: playground/json: specifiers: - cross-env: ^7.0.3 express: ^4.18.1 json-module: file:./json-module vue: ^3.2.38 devDependencies: - cross-env: 7.0.3 express: 4.18.1 json-module: file:playground/json/json-module vue: 3.2.38 @@ -850,7 +843,6 @@ importers: playground/react-sourcemap: specifiers: '@vitejs/plugin-react': workspace:* - cross-env: ^7.0.3 react: ^18.2.0 react-dom: ^18.2.0 dependencies: @@ -858,7 +850,6 @@ importers: react-dom: 18.2.0_react@18.2.0 devDependencies: '@vitejs/plugin-react': link:../../packages/plugin-react - cross-env: 7.0.3 playground/react/jsx-entry: specifiers: {} @@ -936,7 +927,6 @@ importers: specifiers: '@vitejs/css-lib': file:./css-lib bcrypt: ^5.0.1 - cross-env: ^7.0.3 define-properties-exports: file:./define-properties-exports define-property-exports: file:./define-property-exports express: ^4.18.1 @@ -980,7 +970,6 @@ importers: require-absolute: file:playground/ssr-deps/require-absolute ts-transpiled-exports: file:playground/ssr-deps/ts-transpiled-exports devDependencies: - cross-env: 7.0.3 express: 4.18.1 playground/ssr-deps/css-lib: @@ -1063,19 +1052,15 @@ importers: playground/ssr-html: specifiers: - cross-env: ^7.0.3 express: ^4.18.1 devDependencies: - cross-env: 7.0.3 express: 4.18.1 playground/ssr-pug: specifiers: - cross-env: ^7.0.3 express: ^4.18.1 pug: ^3.0.2 devDependencies: - cross-env: 7.0.3 express: 4.18.1 pug: 3.0.2 @@ -1083,7 +1068,6 @@ importers: specifiers: '@vitejs/plugin-react': workspace:* compression: ^1.7.4 - cross-env: ^7.0.3 express: ^4.18.1 react: ^18.2.0 react-dom: ^18.2.0 @@ -1096,7 +1080,6 @@ importers: devDependencies: '@vitejs/plugin-react': link:../../packages/plugin-react compression: 1.7.4 - cross-env: 7.0.3 express: 4.18.1 serve-static: 1.15.0 @@ -1105,7 +1088,6 @@ importers: '@vitejs/plugin-vue': workspace:* '@vitejs/plugin-vue-jsx': workspace:* compression: ^1.7.4 - cross-env: ^7.0.3 dep-import-type: link:./dep-import-type example-external-component: file:example-external-component express: ^4.18.1 @@ -1122,7 +1104,6 @@ importers: '@vitejs/plugin-vue': link:../../packages/plugin-vue '@vitejs/plugin-vue-jsx': link:../../packages/plugin-vue-jsx compression: 1.7.4 - cross-env: 7.0.3 dep-import-type: link:dep-import-type express: 4.18.1 serve-static: 1.15.0 @@ -1135,14 +1116,12 @@ importers: playground/ssr-webworker: specifiers: - cross-env: ^7.0.3 miniflare: ^1.4.1 react: ^18.2.0 resolve-linked: workspace:* dependencies: react: 18.2.0 devDependencies: - cross-env: 7.0.3 miniflare: 1.4.1 resolve-linked: link:../resolve-linked @@ -4029,14 +4008,6 @@ packages: /create-require/1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - /cross-env/7.0.3: - resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} - engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} - hasBin: true - dependencies: - cross-spawn: 7.0.3 - dev: true - /cross-spawn/6.0.5: resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} engines: {node: '>=4.8'}