From 34fb0ac615eb42041446ab79bad658eaf30edc35 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 16:45:06 +0800 Subject: [PATCH 01/12] remove unused .gitmodules --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ab8b378fe1..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "crates/fspy_detours_sys/detours"] - path = crates/fspy_detours_sys/detours - url = https://github.com/microsoft/Detours From 12a06ec5660c201e773f23d6aa606f3a62b778e3 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 16:50:09 +0800 Subject: [PATCH 02/12] remove unused mise.toml --- mise.toml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 mise.toml diff --git a/mise.toml b/mise.toml deleted file mode 100644 index 362c01a265..0000000000 --- a/mise.toml +++ /dev/null @@ -1,5 +0,0 @@ -[settings] -idiomatic_version_file_enable_tools = [] - -[tools] -node = "22.18.0" From 2504f5857b040f68b4fd36462608d04d26ce9394 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 16:50:29 +0800 Subject: [PATCH 03/12] add @yarnpkg/shell --- packages/tools/package.json | 3 + pnpm-lock.yaml | 185 +++++++++++++++++++++++++++++++++++- pnpm-workspace.yaml | 1 + 3 files changed, 187 insertions(+), 2 deletions(-) diff --git a/packages/tools/package.json b/packages/tools/package.json index 167034708a..212681db69 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -16,5 +16,8 @@ }, "scripts": { "snap-test": "tool snap-test" + }, + "dependencies": { + "@yarnpkg/shell": "catalog:" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8d0bee2838..742c271870 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,9 @@ catalogs: '@vitest/browser-playwright': specifier: ^4.0.6 version: 4.0.6 + '@yarnpkg/shell': + specifier: ^4.1.3 + version: 4.1.3 create-tsdown: specifier: 0.0.3 version: 0.0.3 @@ -254,6 +257,10 @@ importers: version: 0.15.12(typescript@5.9.3) packages/tools: + dependencies: + '@yarnpkg/shell': + specifier: 'catalog:' + version: 4.1.3(typanion@3.14.0) devDependencies: '@oxc-node/cli': specifier: 'catalog:' @@ -988,6 +995,18 @@ packages: resolution: {integrity: sha512-enkZYyuCdo+9jneCPE/0fjIta4wWnvVN9hBo2HuiMpRF0q3lzv1J6b/cl7i0mxZUKhBrV3aCKDBQnCOhwKbPmQ==} engines: {node: '>= 10'} + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + '@octokit/auth-token@6.0.0': resolution: {integrity: sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==} engines: {node: '>= 20'} @@ -1764,6 +1783,19 @@ packages: peerDependencies: vue: ^3.5.0 + '@yarnpkg/fslib@3.1.3': + resolution: {integrity: sha512-LqfyD3r/8SJm8rPPfmGVHfp4Ag2xTKscDwihOJt+QNrtOeaLykikqKWoBVRBw1cCIbtU7kjT7l1JcWW26hAKtA==} + engines: {node: '>=18.12.0'} + + '@yarnpkg/parsers@3.0.3': + resolution: {integrity: sha512-mQZgUSgFurUtA07ceMjxrWkYz8QtDuYkvPlu0ZqncgjopQ0t6CNEo/OSealkmnagSUx8ZD5ewvezUwUuMqutQg==} + engines: {node: '>=18.12.0'} + + '@yarnpkg/shell@4.1.3': + resolution: {integrity: sha512-5igwsHbPtSAlLdmMdKqU3atXjwhtLFQXsYAG0sn1XcPb3yF8WxxtWxN6fycBoUvFyIHFz1G0KeRefnAy8n6gdw==} + engines: {node: '>=18.12.0'} + hasBin: true + ansi-escapes@7.1.1: resolution: {integrity: sha512-Zhl0ErHcSRUaVfGUeUdDuLgpkEo8KIFjB4Y9uAc46ScOpdDiU1Dbyplh7qWJeJ/ZHpbyMSM26+X3BySgnIz40Q==} engines: {node: '>=18'} @@ -1788,6 +1820,9 @@ packages: resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==} engines: {node: '>=14'} + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -1820,6 +1855,10 @@ packages: resolution: {integrity: sha512-aUTnJc/JipRzJrNADXVvpVqi6CO0dn3nx4EVPxijri+fj3LUUDyZQOgVeW54Ob3Y1Xh9Iz8f+CgaCl8v0mn9bA==} engines: {node: '>=18'} + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + character-entities-html4@2.1.0: resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} @@ -1976,6 +2015,11 @@ packages: engines: {node: '>=18'} hasBin: true + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -1995,9 +2039,16 @@ packages: fast-content-type-parse@3.0.0: resolution: {integrity: sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==} + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} + fast-string-truncated-width@1.2.1: resolution: {integrity: sha512-Q9acT/+Uu3GwGj+5w/zsGuQjh9O1TyywhIwAxHudtWrgF09nHOPrvTLhQevPbttcxjr/SNN7mJmfOw/B1bXgow==} + fastq@1.19.1: + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} + fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -2035,6 +2086,14 @@ packages: resolution: {integrity: sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==} hasBin: true + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + hast-util-to-html@9.0.5: resolution: {integrity: sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==} @@ -2056,6 +2115,10 @@ packages: resolution: {integrity: sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==} engines: {node: '>=0.10.0'} + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} @@ -2064,6 +2127,10 @@ packages: resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} engines: {node: '>=18'} + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -2079,6 +2146,10 @@ packages: resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} hasBin: true + js-yaml@3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -2184,6 +2255,10 @@ packages: mdast-util-to-hast@13.2.0: resolution: {integrity: sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==} + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + micromark-util-character@2.1.1: resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==} @@ -2347,6 +2422,9 @@ packages: quansync@0.2.11: resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + readdirp@4.1.2: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} @@ -2367,6 +2445,10 @@ packages: resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} engines: {node: '>=18'} + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} @@ -2434,6 +2516,9 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} hasBin: true + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -2482,6 +2567,9 @@ packages: resolution: {integrity: sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==} engines: {node: '>=0.10.0'} + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -2519,6 +2607,10 @@ packages: resolution: {integrity: sha512-5JRxVqC8I8NuOUjzBbvVJAKNM8qoVuH0O77h4WInc/qC2q5IreqKxYwgkga3PfA22OayK2ikceb/B26dztPl+Q==} engines: {node: '>=16'} + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + tabbable@6.2.0: resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} @@ -3249,6 +3341,18 @@ snapshots: '@napi-rs/wasm-tools-win32-ia32-msvc': 1.0.1 '@napi-rs/wasm-tools-win32-x64-msvc': 1.0.1 + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.19.1 + '@octokit/auth-token@6.0.0': {} '@octokit/core@7.0.3': @@ -3863,6 +3967,28 @@ snapshots: dependencies: vue: 3.5.21(typescript@5.9.3) + '@yarnpkg/fslib@3.1.3': + dependencies: + tslib: 2.8.1 + + '@yarnpkg/parsers@3.0.3': + dependencies: + js-yaml: 3.14.1 + tslib: 2.8.1 + + '@yarnpkg/shell@4.1.3(typanion@3.14.0)': + dependencies: + '@yarnpkg/fslib': 3.1.3 + '@yarnpkg/parsers': 3.0.3 + chalk: 4.1.2 + clipanion: 4.0.0-rc.4(typanion@3.14.0) + cross-spawn: 7.0.6 + fast-glob: 3.3.3 + micromatch: 4.0.8 + tslib: 2.8.1 + transitivePeerDependencies: + - typanion + ansi-escapes@7.1.1: dependencies: environment: 1.1.0 @@ -3879,6 +4005,10 @@ snapshots: ansis@4.2.0: {} + argparse@1.0.10: + dependencies: + sprintf-js: 1.0.3 + argparse@2.0.1: {} assertion-error@2.0.1: {} @@ -3902,6 +4032,11 @@ snapshots: chai@6.2.0: {} + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + character-entities-html4@2.1.0: {} character-entities-legacy@3.0.0: {} @@ -4039,6 +4174,8 @@ snapshots: '@esbuild/win32-x64': 0.25.8 optional: true + esprima@4.0.1: {} + estree-walker@2.0.2: {} estree-walker@3.0.3: @@ -4053,8 +4190,20 @@ snapshots: fast-content-type-parse@3.0.0: {} + fast-glob@3.3.3: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + fast-string-truncated-width@1.2.1: {} + fastq@1.19.1: + dependencies: + reusify: 1.1.0 + fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 @@ -4088,6 +4237,12 @@ snapshots: nypm: 0.6.2 pathe: 2.0.3 + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + has-flag@4.0.0: {} + hast-util-to-html@9.0.5: dependencies: '@types/hast': 3.0.4 @@ -4116,12 +4271,18 @@ snapshots: dependencies: safer-buffer: 2.1.2 + is-extglob@2.1.1: {} + is-fullwidth-code-point@3.0.0: {} is-fullwidth-code-point@5.1.0: dependencies: get-east-asian-width: 1.4.0 + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + is-number@7.0.0: {} is-what@4.1.16: {} @@ -4130,6 +4291,11 @@ snapshots: jiti@2.6.1: {} + js-yaml@3.14.1: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + js-yaml@4.1.0: dependencies: argparse: 2.0.1 @@ -4230,6 +4396,8 @@ snapshots: unist-util-visit: 5.0.0 vfile: 6.0.3 + merge2@1.4.1: {} + micromark-util-character@2.1.1: dependencies: micromark-util-symbol: 2.0.1 @@ -4411,6 +4579,8 @@ snapshots: quansync@0.2.11: {} + queue-microtask@1.2.3: {} + readdirp@4.1.2: {} regex-recursion@6.0.2: @@ -4430,6 +4600,8 @@ snapshots: onetime: 7.0.0 signal-exit: 4.1.0 + reusify@1.1.0: {} + rfdc@1.4.1: {} rolldown-plugin-dts@0.17.3(rolldown@1.0.0-beta.45)(typescript@5.9.3): @@ -4486,6 +4658,10 @@ snapshots: '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.45 '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.45 + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + safer-buffer@2.1.2: {} semver@7.7.3: {} @@ -4530,6 +4706,8 @@ snapshots: speakingurl@14.0.1: {} + sprintf-js@1.0.3: {} + stackback@0.0.2: {} std-env@3.10.0: {} @@ -4570,6 +4748,10 @@ snapshots: dependencies: copy-anything: 3.0.5 + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + tabbable@6.2.0: {} tinybench@2.9.0: {} @@ -4620,8 +4802,7 @@ snapshots: - supports-color - vue-tsc - tslib@2.8.1: - optional: true + tslib@2.8.1: {} typanion@3.14.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 85e345f9c0..a0c0a14f84 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -15,6 +15,7 @@ catalog: '@types/semver': ^7.7.1 '@vitest/browser': ^4.0.6 '@vitest/browser-playwright': ^4.0.6 + '@yarnpkg/shell': ^4.1.3 create-tsdown: 0.0.3 create-vite: ^8.0.0 cross-spawn: ^7.0.5 From fcd087c9d7cb4d93d2e6734c72c98c5991b21507 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 17:36:58 +0800 Subject: [PATCH 04/12] run snapshot steps using @yarnpkg/shell --- packages/tools/package.json | 3 +- packages/tools/src/snap-test.ts | 67 ++++++++++++++++++++------------- pnpm-lock.yaml | 6 +++ pnpm-workspace.yaml | 1 + 4 files changed, 50 insertions(+), 27 deletions(-) diff --git a/packages/tools/package.json b/packages/tools/package.json index 212681db69..c9e21dc01d 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -9,8 +9,8 @@ "devDependencies": { "@oxc-node/cli": "catalog:", "@oxc-node/core": "catalog:", - "@types/semver": "catalog:", "@std/yaml": "catalog:", + "@types/semver": "catalog:", "minimatch": "catalog:", "semver": "catalog:" }, @@ -18,6 +18,7 @@ "snap-test": "tool snap-test" }, "dependencies": { + "@yarnpkg/fslib": "catalog:", "@yarnpkg/shell": "catalog:" } } diff --git a/packages/tools/src/snap-test.ts b/packages/tools/src/snap-test.ts index b2f4194449..102b64690a 100755 --- a/packages/tools/src/snap-test.ts +++ b/packages/tools/src/snap-test.ts @@ -1,20 +1,25 @@ -import cp from 'node:child_process'; +import { npath } from '@yarnpkg/fslib'; +import { execute } from '@yarnpkg/shell'; import { randomUUID } from 'node:crypto'; import fs from 'node:fs'; import fsPromises from 'node:fs/promises'; import { cpus, tmpdir } from 'node:os'; import path from 'node:path'; -import { debuglog, parseArgs, promisify } from 'node:util'; +import { PassThrough } from 'node:stream'; +import { text } from 'node:stream/consumers'; +import { debuglog, parseArgs } from 'node:util'; import { isPassThroughEnv, replaceUnstableOutput } from './utils'; const debug = debuglog('vite-plus/snap-test'); -const cpExec = promisify(cp.exec); -const exec = async (command: string, options: cp.ExecOptionsWithStringEncoding) => - cpExec( - command, - process.platform === 'win32' ? { ...options, shell: 'pwsh.exe' } : options, - ); + +// Remove comments (starting with ' #') from command strings +// `@yarnpkg/shell` doesn't parse comments. +// This doesn't handle all edge cases (such as ' #' in quoted strings), but is good enough for our test cases. +function stripComments(command: string): string { + const commentStart = command.indexOf(' #'); + return commentStart === -1 ? command : command.slice(0, commentStart); +} /** * Run tasks with limited concurrency based on CPU count. @@ -142,26 +147,36 @@ async function runTestCase(name: string, tempTmpDir: string, casesDir: string) { const newSnap: string[] = []; + const cwd = npath.toPortablePath(caseTmpDir); for (const command of steps.commands) { debug('running command: %s, cwd: %s, env: %o', command, caseTmpDir, env); - try { - const { stdout, stderr } = await exec(command, { env, cwd: caseTmpDir, encoding: 'utf-8' }); - newSnap.push(`> ${command}`); - if (stdout) { - newSnap.push(replaceUnstableOutput(stdout, caseTmpDir)); - } - if (stderr) { - newSnap.push(replaceUnstableOutput(stderr, caseTmpDir)); - } - } catch (error: any) { - // add error exit code to the command - newSnap.push(`[${error.code}]> ${command}`); - if (error.stdout) { - newSnap.push(replaceUnstableOutput(error.stdout, caseTmpDir)); - } - if (error.stderr) { - newSnap.push(replaceUnstableOutput(error.stderr, caseTmpDir)); - } + const stdoutStream = new PassThrough(); + const stderrStream = new PassThrough(); + + const exitCode = await execute(stripComments(command), [], { + env, + cwd, + stdin: null, + stderr: stderrStream, + stdout: stdoutStream, + }); + + stdoutStream.end(); + const stdout = await text(stdoutStream); + + stderrStream.end(); + const stderr = await text(stderrStream); + + let commandLine = `> ${command}`; + if (exitCode !== 0) { + commandLine = `[${exitCode}]` + commandLine; + } + newSnap.push(commandLine); + if (stdout.length > 0) { + newSnap.push(replaceUnstableOutput(stdout, caseTmpDir)); + } + if (stderr.length > 0) { + newSnap.push(replaceUnstableOutput(stderr, caseTmpDir)); } } const newSnapContent = newSnap.join('\n'); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 742c271870..f219eb38c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,9 @@ catalogs: '@vitest/browser-playwright': specifier: ^4.0.6 version: 4.0.6 + '@yarnpkg/fslib': + specifier: ^3.1.3 + version: 3.1.3 '@yarnpkg/shell': specifier: ^4.1.3 version: 4.1.3 @@ -258,6 +261,9 @@ importers: packages/tools: dependencies: + '@yarnpkg/fslib': + specifier: 'catalog:' + version: 3.1.3 '@yarnpkg/shell': specifier: 'catalog:' version: 4.1.3(typanion@3.14.0) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a0c0a14f84..fa016e6150 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -15,6 +15,7 @@ catalog: '@types/semver': ^7.7.1 '@vitest/browser': ^4.0.6 '@vitest/browser-playwright': ^4.0.6 + '@yarnpkg/fslib': ^3.1.3 '@yarnpkg/shell': ^4.1.3 create-tsdown: 0.0.3 create-vite: ^8.0.0 From 50bbcb9c33f5eb4676e60e52905c1072f480753b Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 17:43:52 +0800 Subject: [PATCH 05/12] handle empty command with comments --- packages/tools/src/snap-test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/tools/src/snap-test.ts b/packages/tools/src/snap-test.ts index 102b64690a..8aa986223d 100755 --- a/packages/tools/src/snap-test.ts +++ b/packages/tools/src/snap-test.ts @@ -17,6 +17,9 @@ const debug = debuglog('vite-plus/snap-test'); // `@yarnpkg/shell` doesn't parse comments. // This doesn't handle all edge cases (such as ' #' in quoted strings), but is good enough for our test cases. function stripComments(command: string): string { + if (command.trim().startsWith('#')) { + return ''; + } const commentStart = command.indexOf(' #'); return commentStart === -1 ? command : command.slice(0, commentStart); } From a599f8ad77dbb4b2c22da7e3f1587fe7efd4a131 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 18:20:21 +0800 Subject: [PATCH 06/12] collect stdout/stderr in the same stream --- packages/cli/snap-tests/command-doc/snap.txt | 10 ++++----- .../replay-logs-chronological-order/snap.txt | 10 ++++----- .../steps.json | 10 ++++----- packages/tools/src/snap-test.ts | 21 +++++++------------ 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/packages/cli/snap-tests/command-doc/snap.txt b/packages/cli/snap-tests/command-doc/snap.txt index b3c35c3f5e..4755bc6a44 100644 --- a/packages/cli/snap-tests/command-doc/snap.txt +++ b/packages/cli/snap-tests/command-doc/snap.txt @@ -2,23 +2,21 @@ vitepress v -build complete in ms. - - - building client + server bundles... βœ“ building client + server bundles... - rendering pages... βœ“ rendering pages... +build complete in ms. + > vite doc build # build documentation again should hit the cache βœ“ cache hit, replaying vitepress v -build complete in ms. - - - building client + server bundles... βœ“ building client + server bundles... - rendering pages... βœ“ rendering pages... +build complete in ms. + diff --git a/packages/cli/snap-tests/replay-logs-chronological-order/snap.txt b/packages/cli/snap-tests/replay-logs-chronological-order/snap.txt index 37ea529663..abf0066634 100644 --- a/packages/cli/snap-tests/replay-logs-chronological-order/snap.txt +++ b/packages/cli/snap-tests/replay-logs-chronological-order/snap.txt @@ -1,4 +1,4 @@ -> vite run build 2>&1 # initial run, create the cache +> vite run build # initial run, create the cache $ node build.js [build.js] -------------------------------- [build.js] start @@ -108,7 +108,7 @@ Task Details: β†’ Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run build 2>&1 # should hit the cache +> vite run build # should hit the cache $ node build.js (βœ“ cache hit, replaying) [build.js] -------------------------------- [build.js] start @@ -218,7 +218,7 @@ Task Details: β†’ Cache hit - output replayed - ms saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run build 2>&1 # should hit the cache and make sure the replay order is chronological +> vite run build # should hit the cache and make sure the replay order is chronological $ node build.js (βœ“ cache hit, replaying) [build.js] -------------------------------- [build.js] start @@ -328,7 +328,7 @@ Task Details: β†’ Cache hit - output replayed - ms saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run build 2>&1 # should hit the cache and make sure the replay order is chronological again +> vite run build # should hit the cache and make sure the replay order is chronological again $ node build.js (βœ“ cache hit, replaying) [build.js] -------------------------------- [build.js] start @@ -438,7 +438,7 @@ Task Details: β†’ Cache hit - output replayed - ms saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run build 2>&1 # should hit the cache and make sure the replay order is chronological again +> vite run build # should hit the cache and make sure the replay order is chronological again $ node build.js (βœ“ cache hit, replaying) [build.js] -------------------------------- [build.js] start diff --git a/packages/cli/snap-tests/replay-logs-chronological-order/steps.json b/packages/cli/snap-tests/replay-logs-chronological-order/steps.json index 191875d8e6..ce9422f8ba 100644 --- a/packages/cli/snap-tests/replay-logs-chronological-order/steps.json +++ b/packages/cli/snap-tests/replay-logs-chronological-order/steps.json @@ -3,10 +3,10 @@ "VITE_DISABLE_AUTO_INSTALL": "1" }, "commands": [ - "vite run build 2>&1 # initial run, create the cache", - "vite run build 2>&1 # should hit the cache", - "vite run build 2>&1 # should hit the cache and make sure the replay order is chronological", - "vite run build 2>&1 # should hit the cache and make sure the replay order is chronological again", - "vite run build 2>&1 # should hit the cache and make sure the replay order is chronological again" + "vite run build # initial run, create the cache", + "vite run build # should hit the cache", + "vite run build # should hit the cache and make sure the replay order is chronological", + "vite run build # should hit the cache and make sure the replay order is chronological again", + "vite run build # should hit the cache and make sure the replay order is chronological again" ] } diff --git a/packages/tools/src/snap-test.ts b/packages/tools/src/snap-test.ts index 8aa986223d..3ff39a9350 100755 --- a/packages/tools/src/snap-test.ts +++ b/packages/tools/src/snap-test.ts @@ -153,33 +153,26 @@ async function runTestCase(name: string, tempTmpDir: string, casesDir: string) { const cwd = npath.toPortablePath(caseTmpDir); for (const command of steps.commands) { debug('running command: %s, cwd: %s, env: %o', command, caseTmpDir, env); - const stdoutStream = new PassThrough(); - const stderrStream = new PassThrough(); + const outputStream = new PassThrough(); const exitCode = await execute(stripComments(command), [], { env, cwd, stdin: null, - stderr: stderrStream, - stdout: stdoutStream, + stderr: outputStream, + stdout: outputStream, }); - stdoutStream.end(); - const stdout = await text(stdoutStream); - - stderrStream.end(); - const stderr = await text(stderrStream); + outputStream.end(); + const output = await text(outputStream); let commandLine = `> ${command}`; if (exitCode !== 0) { commandLine = `[${exitCode}]` + commandLine; } newSnap.push(commandLine); - if (stdout.length > 0) { - newSnap.push(replaceUnstableOutput(stdout, caseTmpDir)); - } - if (stderr.length > 0) { - newSnap.push(replaceUnstableOutput(stderr, caseTmpDir)); + if (output.length > 0) { + newSnap.push(replaceUnstableOutput(output, caseTmpDir)); } } const newSnapContent = newSnap.join('\n'); From e79cc88370386a7e5571259fb5e3f80d42a2fc42 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 20:41:01 +0800 Subject: [PATCH 07/12] redirect stdout/stderr to file --- packages/tools/src/snap-test.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/tools/src/snap-test.ts b/packages/tools/src/snap-test.ts index 3ff39a9350..356d63ff32 100755 --- a/packages/tools/src/snap-test.ts +++ b/packages/tools/src/snap-test.ts @@ -1,12 +1,11 @@ import { npath } from '@yarnpkg/fslib'; import { execute } from '@yarnpkg/shell'; import { randomUUID } from 'node:crypto'; -import fs from 'node:fs'; +import fs, { readFileSync } from 'node:fs'; import fsPromises from 'node:fs/promises'; +import { open } from 'node:fs/promises'; import { cpus, tmpdir } from 'node:os'; import path from 'node:path'; -import { PassThrough } from 'node:stream'; -import { text } from 'node:stream/consumers'; import { debuglog, parseArgs } from 'node:util'; import { isPassThroughEnv, replaceUnstableOutput } from './utils'; @@ -153,18 +152,20 @@ async function runTestCase(name: string, tempTmpDir: string, casesDir: string) { const cwd = npath.toPortablePath(caseTmpDir); for (const command of steps.commands) { debug('running command: %s, cwd: %s, env: %o', command, caseTmpDir, env); - const outputStream = new PassThrough(); + const outpuStreamPath = path.join(caseTmpDir, 'output.log'); + const outputStream = await open(outpuStreamPath, 'w'); const exitCode = await execute(stripComments(command), [], { env, cwd, stdin: null, - stderr: outputStream, - stdout: outputStream, + stderr: outputStream as any, + stdout: outputStream as any, }); - outputStream.end(); - const output = await text(outputStream); + outputStream.close(); + + const output = readFileSync(outpuStreamPath, 'utf-8'); let commandLine = `> ${command}`; if (exitCode !== 0) { From f480b1b26a62b14b22249561577481ed9a184e56 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 21:32:17 +0800 Subject: [PATCH 08/12] disable globbing --- packages/tools/src/snap-test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/tools/src/snap-test.ts b/packages/tools/src/snap-test.ts index 356d63ff32..57cc146b1d 100755 --- a/packages/tools/src/snap-test.ts +++ b/packages/tools/src/snap-test.ts @@ -161,6 +161,10 @@ async function runTestCase(name: string, tempTmpDir: string, casesDir: string) { stdin: null, stderr: outputStream as any, stdout: outputStream as any, + glob: { + isGlobPattern: () => false, + match: async () => [], + }, }); outputStream.close(); From 68b99ca3bde4817520867dcb87e30a97620df9c3 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 21:33:17 +0800 Subject: [PATCH 09/12] update snapshots --- .../command-add-pnpm9-with-workspace/snap.txt | 2 -- .../global/snap-tests/command-add-pnpm9/snap.txt | 1 - .../command-update-npm10-with-workspace/snap.txt | 13 +++++-------- .../global/snap-tests/command-update-npm10/snap.txt | 9 ++++----- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/packages/global/snap-tests/command-add-pnpm9-with-workspace/snap.txt b/packages/global/snap-tests/command-add-pnpm9-with-workspace/snap.txt index 78e39bd980..9898aad2a0 100644 --- a/packages/global/snap-tests/command-add-pnpm9-with-workspace/snap.txt +++ b/packages/global/snap-tests/command-add-pnpm9-with-workspace/snap.txt @@ -145,14 +145,12 @@ packages: [1]> vp add --filter app test-vite-plus-package-optional --save-catalog-name v1 # should error because save-catalog-name is not supported at pnpm@9 Running: pnpm --filter app add --save-catalog-name=v1 test-vite-plus-package-optional -  ERROR  Unknown option: 'save-catalog-name' Did you mean 'save-optional'? Use "--config.unknown=value" to force an unknown option. For help, run: pnpm help add [1]> vp add --filter=./packages/utils test-vite-plus-package-optional -O --save-catalog v2 # should error because save-catalog is not supported at pnpm@9 Running: pnpm --filter ./packages/utils add --save-optional --save-catalog test-vite-plus-package-optional v2 -  ERROR  Unknown option: 'save-catalog' Did you mean 'save-exact', or 'save-prod'? Use "--config.unknown=value" to force an unknown option. For help, run: pnpm help add diff --git a/packages/global/snap-tests/command-add-pnpm9/snap.txt b/packages/global/snap-tests/command-add-pnpm9/snap.txt index 65460b6c3b..26c6810698 100644 --- a/packages/global/snap-tests/command-add-pnpm9/snap.txt +++ b/packages/global/snap-tests/command-add-pnpm9/snap.txt @@ -78,7 +78,6 @@ Done in ms using pnpm v [1]> vp add testnpm2 test-vite-plus-install --allow-build=test-vite-plus-install # should error because allow-build is not supported at pnpm@9 Running: pnpm add --allow-build=test-vite-plus-install testnpm2 test-vite-plus-install -  ERROR  Unknown option: 'allow-build' For help, run: pnpm help add diff --git a/packages/global/snap-tests/command-update-npm10-with-workspace/snap.txt b/packages/global/snap-tests/command-update-npm10-with-workspace/snap.txt index cf5c46fbdc..244433a439 100644 --- a/packages/global/snap-tests/command-update-npm10-with-workspace/snap.txt +++ b/packages/global/snap-tests/command-update-npm10-with-workspace/snap.txt @@ -32,6 +32,7 @@ up to date in ms > vp up -D --filter app -- --no-audit && cat packages/app/package.json # should update dev dependencies in app Running: npm update --workspace app --include=dev --no-audit +npm warn workspaces app in filter set, but no workspace folder present up to date in ms { @@ -45,10 +46,10 @@ up to date in ms } } -npm warn workspaces app in filter set, but no workspace folder present - > vp update --filter "*" -- --no-audit && cat packages/app/package.json packages/utils/package.json # should update in all packages Running: npm update --workspace * --no-audit +npm warn workspaces app in filter set, but no workspace folder present +npm warn workspaces @vite-plus-test/utils in filter set, but no workspace folder present up to date in ms { @@ -69,11 +70,10 @@ up to date in ms } } -npm warn workspaces app in filter set, but no workspace folder present -npm warn workspaces @vite-plus-test/utils in filter set, but no workspace folder present - > vp update -r --no-save -- --no-audit && cat package.json packages/app/package.json # should update recursively without saving Running: npm update --include-workspace-root --workspaces --no-save --no-audit +npm warn workspaces app in filter set, but no workspace folder present +npm warn workspaces @vite-plus-test/utils in filter set, but no workspace folder present up to date in ms { @@ -98,9 +98,6 @@ up to date in ms } } -npm warn workspaces app in filter set, but no workspace folder present -npm warn workspaces @vite-plus-test/utils in filter set, but no workspace folder present - > vp update --workspace --filter app @vite-plus-test/utils -- --no-audit && cat packages/app/package.json # should update workspace dependency Running: npm update --workspace app --no-audit @vite-plus-test/utils diff --git a/packages/global/snap-tests/command-update-npm10/snap.txt b/packages/global/snap-tests/command-update-npm10/snap.txt index 221457c19b..2f883829bc 100644 --- a/packages/global/snap-tests/command-update-npm10/snap.txt +++ b/packages/global/snap-tests/command-update-npm10/snap.txt @@ -84,6 +84,10 @@ Running: npm install --save-optional --no-audit testnpm2@ added 1 package in ms Warning: npm doesn't support --latest flag. Updating within semver range only. Running: npm update --no-optional --no-audit +npm warn config optional Use `--omit=optional` to exclude optional dependencies, or +npm warn config `--include=optional` to include them. +npm warn config +npm warn config Default value does install optional deps unless otherwise omitted. changed 1 package in ms { @@ -99,11 +103,6 @@ changed 1 package in ms } } -npm warn config optional Use `--omit=optional` to exclude optional dependencies, or -npm warn config `--include=optional` to include them. -npm warn config -npm warn config Default value does install optional deps unless otherwise omitted. - > vp update -- --no-audit && cat package.json # should update all packages but won't change the package.json Running: npm update --no-audit From 6f6bc4a5c8cc8f7160a7c3a58dbe9480656f0504 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 21:41:40 +0800 Subject: [PATCH 10/12] add some comments --- packages/tools/src/snap-test.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/tools/src/snap-test.ts b/packages/tools/src/snap-test.ts index 57cc146b1d..61cf770c83 100755 --- a/packages/tools/src/snap-test.ts +++ b/packages/tools/src/snap-test.ts @@ -152,16 +152,22 @@ async function runTestCase(name: string, tempTmpDir: string, casesDir: string) { const cwd = npath.toPortablePath(caseTmpDir); for (const command of steps.commands) { debug('running command: %s, cwd: %s, env: %o', command, caseTmpDir, env); - const outpuStreamPath = path.join(caseTmpDir, 'output.log'); - const outputStream = await open(outpuStreamPath, 'w'); + + /// While `@yarnpkg/shell` supports capturing output via in-memory `Writable` streams, + /// it seems not to have stable ordering of stdout/stderr chunks. + /// To ensure stable ordering, we redirect outputs to a file instead. + const outputStreamPath = path.join(caseTmpDir, 'output.log'); + const outputStream = await open(outputStreamPath, 'w'); const exitCode = await execute(stripComments(command), [], { env, cwd, stdin: null, + // Declared to be `Writable` but `FileHandle` works too. stderr: outputStream as any, stdout: outputStream as any, glob: { + // Disable glob expansion. Pass args like '--filter=*' as-is. isGlobPattern: () => false, match: async () => [], }, @@ -169,7 +175,7 @@ async function runTestCase(name: string, tempTmpDir: string, casesDir: string) { outputStream.close(); - const output = readFileSync(outpuStreamPath, 'utf-8'); + const output = readFileSync(outputStreamPath, 'utf-8'); let commandLine = `> ${command}`; if (exitCode !== 0) { From a2030a0d1cb13e3f49fef522943d786d7e697204 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 5 Nov 2025 21:52:27 +0800 Subject: [PATCH 11/12] resolve comments --- packages/tools/src/snap-test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/tools/src/snap-test.ts b/packages/tools/src/snap-test.ts index 61cf770c83..f9d99c9233 100755 --- a/packages/tools/src/snap-test.ts +++ b/packages/tools/src/snap-test.ts @@ -153,9 +153,9 @@ async function runTestCase(name: string, tempTmpDir: string, casesDir: string) { for (const command of steps.commands) { debug('running command: %s, cwd: %s, env: %o', command, caseTmpDir, env); - /// While `@yarnpkg/shell` supports capturing output via in-memory `Writable` streams, - /// it seems not to have stable ordering of stdout/stderr chunks. - /// To ensure stable ordering, we redirect outputs to a file instead. + // While `@yarnpkg/shell` supports capturing output via in-memory `Writable` streams, + // it seems not to have stable ordering of stdout/stderr chunks. + // To ensure stable ordering, we redirect outputs to a file instead. const outputStreamPath = path.join(caseTmpDir, 'output.log'); const outputStream = await open(outputStreamPath, 'w'); @@ -173,7 +173,7 @@ async function runTestCase(name: string, tempTmpDir: string, casesDir: string) { }, }); - outputStream.close(); + await outputStream.close(); const output = readFileSync(outputStreamPath, 'utf-8'); From 70d633182c4f7ab8742be3c069464cbe9284adcb Mon Sep 17 00:00:00 2001 From: branchseer Date: Thu, 6 Nov 2025 12:06:45 +0800 Subject: [PATCH 12/12] @ts-expect-error instead of any --- packages/tools/src/snap-test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/tools/src/snap-test.ts b/packages/tools/src/snap-test.ts index f9d99c9233..d9c85c0a8b 100755 --- a/packages/tools/src/snap-test.ts +++ b/packages/tools/src/snap-test.ts @@ -164,8 +164,10 @@ async function runTestCase(name: string, tempTmpDir: string, casesDir: string) { cwd, stdin: null, // Declared to be `Writable` but `FileHandle` works too. - stderr: outputStream as any, - stdout: outputStream as any, + // @ts-expect-error + stderr: outputStream, + // @ts-expect-error + stdout: outputStream, glob: { // Disable glob expansion. Pass args like '--filter=*' as-is. isGlobPattern: () => false,