Skip to content

Commit 2728141

Browse files
author
Guy Bedford
authored
feat: ship --debug-build CLI flag as public (#907)
1 parent 9a581d0 commit 2728141

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

integration-tests/cli/help.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ test('--help should return help on stdout and zero exit code', async function (t
3232
'--engine-wasm <engine-wasm> The JS engine Wasm file path',
3333
'--enable-experimental-high-resolution-time-methods Enable experimental high-resolution fastly.now() method',
3434
'--enable-experimental-top-level-await Enable experimental top level await',
35+
'--debug-build Use the debug build of the JS engine with C++ stack traces',
3536
'ARGS:',
3637
"<input> The input JS script's file path [default: bin/index.js]",
3738
'<output> The file path to write the output Wasm module to [default: bin/main.wasm]'
@@ -58,6 +59,7 @@ test('-h should return help on stdout and zero exit code', async function (t) {
5859
'--engine-wasm <engine-wasm> The JS engine Wasm file path',
5960
'--enable-experimental-high-resolution-time-methods Enable experimental high-resolution fastly.now() method',
6061
'--enable-experimental-top-level-await Enable experimental top level await',
62+
'--debug-build Use the debug build of the JS engine with C++ stack traces',
6163
'ARGS:',
6264
"<input> The input JS script's file path [default: bin/index.js]",
6365
'<output> The file path to write the output Wasm module to [default: bin/main.wasm]'

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"types",
1818
"js-compute-runtime-cli.js",
1919
"fastly.wasm",
20+
"fastly.debug.wasm",
2021
"fastly-weval.wasm",
2122
"starling-ics.wevalcache",
2223
"src",
@@ -25,9 +26,6 @@
2526
"README.md",
2627
"CHANGELOG.md"
2728
],
28-
"ignore": [
29-
"starling.debug.wasm"
30-
],
3129
"scripts": {
3230
"test": "npm run test:types && npm run test:cli",
3331
"test:cli": "brittle --bail integration-tests/cli/**.test.js",

src/parseInputs.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { fileURLToPath } from "node:url";
22
import { dirname, join, isAbsolute } from "node:path";
33
import { unknownArgument } from "./unknownArgument.js";
44
import { tooManyEngines } from "./tooManyEngines.js";
5-
import { existsSync } from "node:fs";
65

76
export async function parseInputs(cliInputs) {
87
const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -55,10 +54,6 @@ export async function parseInputs(cliInputs) {
5554
}
5655
case "--debug-build": {
5756
wasmEngine = join(__dirname, "../fastly.debug.wasm");
58-
if (!existsSync(wasmEngine)) {
59-
console.error('Debug builds are not currently available for published releases');
60-
process.exit(1);
61-
}
6257
console.log('Building with the debug engine');
6358
break;
6459
}
@@ -131,7 +126,7 @@ export async function parseInputs(cliInputs) {
131126
}
132127

133128
if (!customEngineSet && enableAOT) {
134-
wasmEngine = join(__dirname, "../fastly-weval.wasm");
129+
wasmEngine = join(__dirname, "../fastly-weval.wasm");
135130
}
136131

137132
return {

src/printHelp.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ OPTIONS:
1616
--engine-wasm <engine-wasm> The JS engine Wasm file path
1717
--enable-experimental-high-resolution-time-methods Enable experimental high-resolution fastly.now() method
1818
--enable-experimental-top-level-await Enable experimental top level await
19+
--debug-build Use the debug build of the JS engine with C++ stack traces
1920
2021
ARGS:
2122
<input> The input JS script's file path [default: bin/index.js]

0 commit comments

Comments
 (0)