diff --git a/package.json b/package.json index bc3ac5087c..bc5479a32b 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,6 @@ "eslint-plugin-no-only-tests": "3.3.0", "eslint-plugin-perfectionist": "3.2.0", "eslint-typegen": "0.3.1", - "execa": "9.3.1", "globby": "14.0.2", "h3": "1.12.0", "happy-dom": "15.0.0", @@ -88,6 +87,7 @@ "rimraf": "6.0.1", "semver": "7.6.3", "std-env": "3.7.0", + "tinyexec": "0.2.0", "typescript": "5.5.4", "ufo": "1.5.4", "vitest": "2.0.5", diff --git a/packages/ui-templates/package.json b/packages/ui-templates/package.json index 44bd47e2ed..1e277c26e3 100644 --- a/packages/ui-templates/package.json +++ b/packages/ui-templates/package.json @@ -22,7 +22,6 @@ "@types/lodash-es": "4.17.12", "@unocss/reset": "0.62.3", "critters": "0.0.24", - "execa": "9.3.1", "globby": "14.0.2", "html-minifier": "4.0.0", "html-validate": "8.21.0", @@ -32,6 +31,7 @@ "pathe": "1.1.2", "prettier": "3.3.3", "scule": "1.3.0", + "tinyexec": "0.2.0", "unocss": "0.62.3", "vite": "5.4.2" } diff --git a/packages/ui-templates/test/templates.spec.ts b/packages/ui-templates/test/templates.spec.ts index a5c9e902f2..6cc4071c73 100644 --- a/packages/ui-templates/test/templates.spec.ts +++ b/packages/ui-templates/test/templates.spec.ts @@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url' import { readFileSync } from 'node:fs' import { rm } from 'node:fs/promises' import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { execaCommand } from 'execa' +import { exec } from 'tinyexec' import { format } from 'prettier' import createJiti from 'jiti' // @ts-expect-error types not valid for bundler resolution @@ -12,10 +12,12 @@ const distDir = fileURLToPath(new URL('../node_modules/.temp/dist/templates', im describe('template', () => { beforeAll(async () => { - await execaCommand('pnpm build', { - cwd: fileURLToPath(new URL('..', import.meta.url)), - env: { - OUTPUT_DIR: './node_modules/.temp/dist', + await exec('pnpm', ['build'], { + nodeOptions: { + cwd: fileURLToPath(new URL('..', import.meta.url)), + env: { + OUTPUT_DIR: './node_modules/.temp/dist', + }, }, }) }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad079a46f7..27eba6cef4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,9 +96,6 @@ importers: eslint-typegen: specifier: 0.3.1 version: 0.3.1(eslint@9.9.1(jiti@1.21.6)) - execa: - specifier: 9.3.1 - version: 9.3.1 globby: specifier: 14.0.2 version: 14.0.2 @@ -144,6 +141,9 @@ importers: std-env: specifier: 3.7.0 version: 3.7.0 + tinyexec: + specifier: 0.2.0 + version: 0.2.0 typescript: specifier: 5.5.4 version: 5.5.4 @@ -603,9 +603,6 @@ importers: critters: specifier: 0.0.24 version: 0.0.24 - execa: - specifier: 9.3.1 - version: 9.3.1 globby: specifier: 14.0.2 version: 14.0.2 @@ -633,6 +630,9 @@ importers: scule: specifier: 1.3.0 version: 1.3.0 + tinyexec: + specifier: 0.2.0 + version: 0.2.0 unocss: specifier: 0.62.3 version: 0.62.3(@unocss/webpack@0.62.2(rollup@4.21.0)(webpack@5.94.0(esbuild@0.23.1)))(postcss@8.4.41)(rollup@4.21.0)(vite@5.4.2(@types/node@20.16.1)(sass@1.69.4)(terser@5.27.0)) @@ -2354,9 +2354,6 @@ packages: '@rushstack/eslint-patch@1.10.4': resolution: {integrity: sha512-WJgX9nzTqknM393q1QJDJmoW28kUfEnybeTfVNcNAPnIx210RXm2DiXiHzfNPJNIUUb1tJnz/l4QGtJ30PgWmA==} - '@sec-ant/readable-stream@0.4.1': - resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} - '@shikijs/core@1.1.2': resolution: {integrity: sha512-ERVzNQz88ZkDqUpWeC57Kp+Kmx5RjqeDBR1M8AGWGom4yrkITiTfXCGmjchlDSw12MhDTuPYR4HVFW8uT61RaQ==} @@ -2392,10 +2389,6 @@ packages: resolution: {integrity: sha512-UTce8mUwUW0RikMb/eseJ7ys0BRkZVFB86orHzrfW12ZmFtym5zua8joZ4L7okH2dDFHkcFjqnZ5GocWBXOFtA==} engines: {node: '>=18'} - '@sindresorhus/merge-streams@4.0.0': - resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} - engines: {node: '>=18'} - '@stylistic/eslint-plugin-js@2.6.4': resolution: {integrity: sha512-kx1hS3xTvzxZLdr/DCU/dLBE++vcP97sHeEFX2QXhk1Ipa4K1rzPOLw1HCbf4mU3s+7kHP5eYpDe+QteEOFLug==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -3614,7 +3607,7 @@ packages: resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} engines: {node: '>=14'} peerDependencies: - typescript: 5.5.4 + typescript: '>=4.9.5' peerDependenciesMeta: typescript: optional: true @@ -3623,7 +3616,7 @@ packages: resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: - typescript: 5.5.4 + typescript: '>=4.9.5' peerDependenciesMeta: typescript: optional: true @@ -4232,10 +4225,6 @@ packages: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} - execa@9.3.1: - resolution: {integrity: sha512-gdhefCCNy/8tpH/2+ajP9IQc14vXchNdd0weyzSJEFURhRMGncQ+zKFxwjAufIewPEJm9BPOaJnvg2UtlH2gPQ==} - engines: {node: ^18.19.0 || >=20.5.0} - extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -4280,10 +4269,6 @@ packages: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -4422,10 +4407,6 @@ packages: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} - get-stream@9.0.1: - resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} - engines: {node: '>=18'} - get-tsconfig@4.7.6: resolution: {integrity: sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==} @@ -4673,10 +4654,6 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - human-signals@8.0.0: - resolution: {integrity: sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==} - engines: {node: '>=18.18.0'} - hyperdyperid@1.2.0: resolution: {integrity: sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==} engines: {node: '>=10.18'} @@ -4887,10 +4864,6 @@ packages: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - is-stream@4.0.1: - resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} - engines: {node: '>=18'} - is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} @@ -4903,10 +4876,6 @@ packages: resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} engines: {node: '>= 0.4'} - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - is-weakmap@2.0.1: resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} @@ -5743,10 +5712,6 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - parse-path@7.0.0: resolution: {integrity: sha512-Euf9GG8WT9CdqwuWJGdf3RkUcTBArppHABkO7Lm8IzRQp0e2r/kkFnmhu4TSK30Wcu5rVAZLmfPKSBBi9tWFog==} @@ -6097,10 +6062,6 @@ packages: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - pretty-ms@9.0.0: - resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} - engines: {node: '>=18'} - pretty-time@1.1.0: resolution: {integrity: sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==} engines: {node: '>=4'} @@ -6625,10 +6586,6 @@ packages: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} - strip-final-newline@4.0.0: - resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} - engines: {node: '>=18'} - strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -7346,7 +7303,7 @@ packages: vue@3.4.38: resolution: {integrity: sha512-f0ZgN+mZ5KFgVv9wz0f4OgVKukoXtS3nwET4c2vLBGQR50aI8G0cqbFtLlX9Yiyg3LFGBitruPHt2PxwTduJEw==} peerDependencies: - typescript: 5.5.4 + typescript: '*' peerDependenciesMeta: typescript: optional: true @@ -7520,10 +7477,6 @@ packages: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} engines: {node: '>=12.20'} - yoctocolors@2.0.0: - resolution: {integrity: sha512-esbDnt0Z1zI1KgvOZU90hJbL6BkoUbrP9yy7ArNZ6TmxBxydMJTYMf9FZjmwwcA8ZgEQzriQ3hwZ0NYXhlFo8Q==} - engines: {node: '>=18'} - zhead@2.2.4: resolution: {integrity: sha512-8F0OI5dpWIA5IGG5NHUg9staDwz/ZPxZtvGVf01j7vHqSyZ0raHY+78atOVxRqb73AotX22uV1pXt3gYSstGag==} @@ -8834,8 +8787,6 @@ snapshots: '@rushstack/eslint-patch@1.10.4': {} - '@sec-ant/readable-stream@0.4.1': {} - '@shikijs/core@1.1.2': {} '@shikijs/core@1.12.1': @@ -8886,8 +8837,6 @@ snapshots: '@sindresorhus/merge-streams@2.2.0': {} - '@sindresorhus/merge-streams@4.0.0': {} - '@stylistic/eslint-plugin-js@2.6.4(eslint@9.9.1(jiti@1.21.6))': dependencies: '@types/eslint': 9.6.0 @@ -11275,21 +11224,6 @@ snapshots: signal-exit: 4.1.0 strip-final-newline: 3.0.0 - execa@9.3.1: - dependencies: - '@sindresorhus/merge-streams': 4.0.0 - cross-spawn: 7.0.3 - figures: 6.1.0 - get-stream: 9.0.1 - human-signals: 8.0.0 - is-plain-obj: 4.1.0 - is-stream: 4.0.1 - npm-run-path: 5.3.0 - pretty-ms: 9.0.0 - signal-exit: 4.1.0 - strip-final-newline: 4.0.0 - yoctocolors: 2.0.0 - extend@3.0.2: {} externality@1.0.2: @@ -11331,10 +11265,6 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -11475,11 +11405,6 @@ snapshots: get-stream@8.0.1: {} - get-stream@9.0.1: - dependencies: - '@sec-ant/readable-stream': 0.4.1 - is-stream: 4.0.1 - get-tsconfig@4.7.6: dependencies: resolve-pkg-maps: 1.0.0 @@ -11790,8 +11715,6 @@ snapshots: human-signals@5.0.0: {} - human-signals@8.0.0: {} - hyperdyperid@1.2.0: {} iconv-lite@0.6.3: @@ -11988,8 +11911,6 @@ snapshots: is-stream@3.0.0: {} - is-stream@4.0.1: {} - is-string@1.0.7: dependencies: has-tostringtag: 1.0.2 @@ -12002,8 +11923,6 @@ snapshots: dependencies: which-typed-array: 1.1.14 - is-unicode-supported@2.0.0: {} - is-weakmap@2.0.1: {} is-weakset@2.0.2: @@ -13121,8 +13040,6 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - parse-ms@4.0.0: {} - parse-path@7.0.0: dependencies: protocols: 2.0.1 @@ -13429,10 +13346,6 @@ snapshots: ansi-styles: 5.2.0 react-is: 18.2.0 - pretty-ms@9.0.0: - dependencies: - parse-ms: 4.0.0 - pretty-time@1.1.0: {} process-nextick-args@2.0.1: {} @@ -14075,8 +13988,6 @@ snapshots: strip-final-newline@3.0.0: {} - strip-final-newline@4.0.0: {} - strip-indent@3.0.0: dependencies: min-indent: 1.0.1 @@ -15143,8 +15054,6 @@ snapshots: yocto-queue@1.0.0: {} - yoctocolors@2.0.0: {} - zhead@2.2.4: {} zip-stream@6.0.1: diff --git a/scripts/_utils.ts b/scripts/_utils.ts index 9e7737f506..0ca3f1d673 100644 --- a/scripts/_utils.ts +++ b/scripts/_utils.ts @@ -3,7 +3,7 @@ import { promises as fsp } from 'node:fs' import { $fetch } from 'ofetch' import { resolve } from 'pathe' import { globby } from 'globby' -import { execaSync } from 'execa' +import { exec } from 'tinyexec' import { determineSemverChange, getGitDiff, loadChangelogConfig, parseCommits } from 'changelogen' export interface Dep { @@ -108,7 +108,7 @@ export async function determineBumpType () { export async function getLatestCommits () { const config = await loadChangelogConfig(process.cwd()) - const latestTag = execaSync('git', ['describe', '--tags', '--abbrev=0']).stdout + const { stdout: latestTag } = await exec('git', ['describe', '--tags', '--abbrev=0']) return parseCommits(await getGitDiff(latestTag), config) } diff --git a/test/bundle.test.ts b/test/bundle.test.ts index 4df2585eb3..1324204cce 100644 --- a/test/bundle.test.ts +++ b/test/bundle.test.ts @@ -1,7 +1,7 @@ import { fileURLToPath } from 'node:url' import fsp from 'node:fs/promises' import { beforeAll, describe, expect, it } from 'vitest' -import { execaCommand } from 'execa' +import { exec } from 'tinyexec' import { globby } from 'globby' import { join } from 'pathe' @@ -10,8 +10,8 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM beforeAll(async () => { await Promise.all([ - execaCommand(`pnpm nuxi build ${rootDir}`, { env: { EXTERNAL_VUE: 'false' } }), - execaCommand(`pnpm nuxi build ${rootDir}`, { env: { EXTERNAL_VUE: 'true' } }), + exec('pnpm', ['nuxi', 'build', rootDir], { nodeOptions: { env: { EXTERNAL_VUE: 'false' } } }), + exec('pnpm', ['nuxi', 'build', rootDir], { nodeOptions: { env: { EXTERNAL_VUE: 'true' } } }), ]) }, 120 * 1000) diff --git a/test/prepare.ts b/test/prepare.ts index e4442a18ac..31d6d72d49 100644 --- a/test/prepare.ts +++ b/test/prepare.ts @@ -3,7 +3,7 @@ import { rm } from 'node:fs/promises' import { globby } from 'globby' -import { execa } from 'execa' +import { exec } from 'tinyexec' async function initTesting () { const dirs = await globby('*', { @@ -20,7 +20,7 @@ async function initTesting () { ]) await Promise.all( - dirs.map(dir => execa('pnpm', ['nuxi', 'prepare'], { cwd: dir })), + dirs.map(dir => exec('pnpm', ['nuxi', 'prepare'], { nodeOptions: { cwd: dir } })), ) }