Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "command-pack-exe-error",
"version": "1.0.0",
"type": "module",
"engines": {
"node": "22.22.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[1]> vp pack src/index.ts --exe
ℹ entry: src/index.ts
ℹ target: node22.22.0

ERROR Error: Node.js version v<semver> does not support `exe` option. Please upgrade to Node.js <semver> or later.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const hello = 'world';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ignoredPlatforms": ["win32"],
"env": {
"VITE_DISABLE_AUTO_INSTALL": "1"
},
"commands": ["vp pack src/index.ts --exe"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {};
8 changes: 8 additions & 0 deletions packages/cli/snap-tests-global/command-pack-exe/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "command-pack-exe",
"version": "1.0.0",
"type": "module",
"engines": {
"node": "25.7.0"
}
}
17 changes: 17 additions & 0 deletions packages/cli/snap-tests-global/command-pack-exe/snap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
> vp pack src/index.ts --exe
ℹ entry: src/index.ts
ℹ target: node25.7.0
ℹ `exe` option is experimental and may change in future releases.
ℹ Build start
ℹ dist/index.mjs <variable> kB │ gzip: <variable> kB
ℹ 1 files, total: <variable> kB
✔ Build complete in <variable>ms
ℹ dist/index <variable> MB
✔ Built executable: dist/index (<variable>ms)

> ls dist
index
index.mjs

> ./dist/index
hello from exe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('hello from exe');
8 changes: 8 additions & 0 deletions packages/cli/snap-tests-global/command-pack-exe/steps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ignoredPlatforms": ["win32"],
"env": {
"VITE_DISABLE_AUTO_INSTALL": "1"
},
"commands": ["vp pack src/index.ts --exe", "ls dist", "./dist/index"],
"after": ["rm -rf dist"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {};
1 change: 1 addition & 0 deletions packages/cli/snap-tests/command-helper/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Options:
-W, --workspace [dir] Enable workspace mode
-F, --filter <pattern> Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name
--exports Generate export-related metadata for package.json (experimental)
--exe Bundle as executable using Node.js SEA (experimental)
-h, --help Display this message

> vp fmt -h # fmt help message
Expand Down
1 change: 1 addition & 0 deletions packages/cli/snap-tests/command-pack/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Options:
-W, --workspace [dir] Enable workspace mode
-F, --filter <pattern> Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name
--exports Generate export-related metadata for package.json (experimental)
--exe Bundle as executable using Node.js SEA (experimental)
-h, --help Display this message

> vp run pack # should build the library
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/pack-bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ cli
.option('-W, --workspace [dir]', 'Enable workspace mode')
.option('-F, --filter <pattern>', 'Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name')
.option('--exports', 'Generate export-related metadata for package.json (experimental)')
.option('--exe', 'Bundle as executable using Node.js SEA (experimental)')
.action(async (input: string[], flags: InlineConfig) => {
if (input.length > 0) {
flags.entry = input;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,6 @@
"bundledVersions": {
"vite": "8.0.0-beta.15",
"rolldown": "1.0.0-rc.5",
"tsdown": "0.20.3"
"tsdown": "0.21.0-beta.2"
}
}
4 changes: 2 additions & 2 deletions packages/tools/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ export function replaceUnstableOutput(output: string, cwd?: string) {
// vite modules transformed count
.replaceAll(/✓ \d+ modules? transformed/g, '✓ <variable> modules transformed')
// replace size for tsdown
.replaceAll(/ \d+(\.\d+)? ([km]?B)/g, ' <variable> $2')
.replaceAll(/ \d+(\.\d+)? ([kKmMgG]?B)/g, ' <variable> $2')
// replace npm notice size:
// "npm notice 5.6kB snap.txt"
// "npm notice 619B steps.json"
.replaceAll(/ \d+(\.\d+)?([km]?B) /g, ' <variable>$2 ')
.replaceAll(/ \d+(\.\d+)?([kKmMgG]?B) /g, ' <variable>$2 ')
// '"size": 821' => '"size": <variable>'
// '"unpackedSize": 2720' => '"unpackedSize": <variable>'
.replaceAll(/"(size|unpackedSize)": \d+/g, '"$1": <variable>')
Expand Down
Loading
Loading