diff --git a/package.json b/package.json index 6d3cb3d1..11586d58 100644 --- a/package.json +++ b/package.json @@ -48,8 +48,8 @@ "test:bun": "bun --bun test test/bun" }, "devDependencies": { - "@babel/helper-module-imports": "^7.24.7", "@babel/core": "^7.24.9", + "@babel/helper-module-imports": "^7.24.7", "@babel/helper-module-transforms": "^7.24.9", "@babel/helper-plugin-utils": "^7.24.8", "@babel/helper-simple-access": "^7.24.7", @@ -79,7 +79,6 @@ "eslint": "^9.7.0", "eslint-config-unjs": "^0.3.2", "estree-walker": "^3.0.3", - "execa": "^9.3.0", "fast-glob": "^3.3.2", "mlly": "^1.7.1", "pathe": "^1.1.2", @@ -88,6 +87,7 @@ "reflect-metadata": "^0.2.2", "std-env": "^3.7.0", "terser-webpack-plugin": "^5.3.10", + "tinyexec": "^0.2.0", "ts-loader": "^9.5.1", "typescript": "^5.5.4", "vitest": "^2.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6819b8ea..abee59f0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,9 +101,6 @@ importers: estree-walker: specifier: ^3.0.3 version: 3.0.3 - execa: - specifier: ^9.3.0 - version: 9.3.0 fast-glob: specifier: ^3.3.2 version: 3.3.2 @@ -128,6 +125,9 @@ importers: terser-webpack-plugin: specifier: ^5.3.10 version: 5.3.10(webpack@5.93.0(webpack-cli@5.1.4)) + tinyexec: + specifier: ^0.2.0 + version: 0.2.0 ts-loader: specifier: ^9.5.1 version: 9.5.1(typescript@5.5.4)(webpack@5.93.0(webpack-cli@5.1.4)) @@ -649,13 +649,6 @@ packages: cpu: [x64] os: [win32] - '@sec-ant/readable-stream@0.4.1': - resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} - - '@sindresorhus/merge-streams@4.0.0': - resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} - engines: {node: '>=18'} - '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} @@ -1281,10 +1274,6 @@ packages: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} - execa@9.3.0: - resolution: {integrity: sha512-l6JFbqnHEadBoVAVpN5dl2yCyfX28WoBAGaoQcNmLLSedOxTxcn2Qa83s8I/PA5i56vWru2OHOtrwF7Om2vqlg==} - engines: {node: ^18.19.0 || >=20.5.0} - fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -1305,10 +1294,6 @@ packages: fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - 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'} @@ -1367,10 +1352,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'} - giget@1.2.3: resolution: {integrity: sha512-8EHPljDvs7qKykr6uw8b+lqLiUc/vUg+KVTI0uND4s63TdsZM2Xus3mflvF0DDG9SiM4RlCkFGL+7aAjRmV7KA==} hasBin: true @@ -1446,10 +1427,6 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - human-signals@7.0.0: - resolution: {integrity: sha512-74kytxOUSvNbjrT9KisAbaTZ/eJwD/LrbM/kh5j0IhPuJzwuA19dWvniFGwBzN9rVjg+O/e+F310PjObDXS+9Q==} - engines: {node: '>=18.18.0'} - iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -1541,10 +1518,6 @@ packages: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} - is-plain-obj@4.1.0: - resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} - engines: {node: '>=12'} - is-plain-object@2.0.4: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} @@ -1557,14 +1530,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-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} - engines: {node: '>=18'} - is-wsl@2.2.0: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} engines: {node: '>=8'} @@ -1876,10 +1841,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'} - path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -1944,10 +1905,6 @@ packages: engines: {node: '>=14'} hasBin: true - pretty-ms@9.1.0: - resolution: {integrity: sha512-o1piW0n3tgKIKCwk2vpM/vOV13zjJzvP37Ioze54YlTHE06m4tjEbzg9WsKkvTuyYln2DHjo5pY4qrZGI0otpw==} - engines: {node: '>=18'} - punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -2142,10 +2099,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'} @@ -2209,6 +2162,9 @@ packages: tinybench@2.8.0: resolution: {integrity: sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==} + tinyexec@0.2.0: + resolution: {integrity: sha512-au8dwv4xKSDR+Fw52csDo3wcDztPdne2oM1o/7LFro4h6bdFmvyUAeAfX40pwDtzHgRFqz1XWaUqgKS2G83/ig==} + tinypool@1.0.0: resolution: {integrity: sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ==} engines: {node: ^18.0.0 || >=20.0.0} @@ -2937,10 +2893,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.19.0': optional: true - '@sec-ant/readable-stream@0.4.1': {} - - '@sindresorhus/merge-streams@4.0.0': {} - '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.24.8 @@ -3716,21 +3668,6 @@ snapshots: signal-exit: 4.1.0 strip-final-newline: 3.0.0 - execa@9.3.0: - dependencies: - '@sindresorhus/merge-streams': 4.0.0 - cross-spawn: 7.0.3 - figures: 6.1.0 - get-stream: 9.0.1 - human-signals: 7.0.0 - is-plain-obj: 4.1.0 - is-stream: 4.0.1 - npm-run-path: 5.3.0 - pretty-ms: 9.1.0 - signal-exit: 4.1.0 - strip-final-newline: 4.0.0 - yoctocolors: 2.1.1 - fast-deep-equal@3.1.3: {} fast-glob@3.3.2: @@ -3751,10 +3688,6 @@ snapshots: dependencies: reusify: 1.0.4 - figures@6.1.0: - dependencies: - is-unicode-supported: 2.0.0 - file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -3804,11 +3737,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 - giget@1.2.3: dependencies: citty: 0.1.6 @@ -3880,8 +3808,6 @@ snapshots: human-signals@5.0.0: {} - human-signals@7.0.0: {} - iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -3949,8 +3875,6 @@ snapshots: is-path-inside@3.0.3: {} - is-plain-obj@4.1.0: {} - is-plain-object@2.0.4: dependencies: isobject: 3.0.1 @@ -3959,10 +3883,6 @@ snapshots: is-stream@3.0.0: {} - is-stream@4.0.1: {} - - is-unicode-supported@2.0.0: {} - is-wsl@2.2.0: dependencies: is-docker: 2.2.1 @@ -4270,8 +4190,6 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - parse-ms@4.0.0: {} - path-exists@4.0.0: {} path-key@3.1.1: {} @@ -4319,10 +4237,6 @@ snapshots: prettier@3.3.3: {} - pretty-ms@9.1.0: - dependencies: - parse-ms: 4.0.0 - punycode@2.3.1: {} queue-microtask@1.2.3: {} @@ -4516,8 +4430,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 @@ -4575,6 +4487,8 @@ snapshots: tinybench@2.8.0: {} + tinyexec@0.2.0: {} + tinypool@1.0.0: {} tinyrainbow@1.2.0: {} diff --git a/test/fixtures.test.ts b/test/fixtures.test.ts index f6f882bc..5dc27579 100644 --- a/test/fixtures.test.ts +++ b/test/fixtures.test.ts @@ -1,5 +1,5 @@ import { join, resolve, dirname } from "node:path"; -import { execa } from "execa"; +import { x } from "tinyexec"; import { describe, it, expect } from "vitest"; import fg from "fast-glob"; @@ -47,12 +47,13 @@ describe("fixtures", async () => { ); } - const { stdout, stderr } = await execa("node", [jitiPath, fixtureEntry], { - cwd, - stdio: "pipe", - reject: false, - env: { - JITI_CACHE: "false", + const { stdout, stderr } = await x("node", [jitiPath, fixtureEntry], { + nodeOptions: { + cwd, + stdio: "pipe", + env: { + JITI_CACHE: "false", + }, }, });