Skip to content

Commit ac82837

Browse files
committed
update componentizeJS to v0.19.2
Signed-off-by: Karthik Ganeshram <[email protected]>
1 parent cc30aca commit ac82837

File tree

7 files changed

+27
-12
lines changed

7 files changed

+27
-12
lines changed

packages/build-tools/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/build-tools/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@spinframework/build-tools",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "",
55
"main": "index.js",
66
"scripts": {
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@ampproject/remapping": "^2.3.0",
33-
"@bytecodealliance/componentize-js": "^0.19.0",
33+
"@bytecodealliance/componentize-js": "^0.19.2",
3434
"@bytecodealliance/jco": "^1.10.2",
3535
"acorn-walk": "^8.3.4",
3636
"acron": "^1.0.5",

packages/build-tools/src/cli.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface CliArgs {
66
output: string;
77
aot?: boolean;
88
debug?: boolean;
9+
initLocation?: string;
910
}
1011

1112
export function getCliArgs(): CliArgs {
@@ -30,6 +31,10 @@ export function getCliArgs(): CliArgs {
3031
describe: 'Enable JavaScript debugging',
3132
type: 'boolean',
3233
})
34+
.option('initLocation', {
35+
describe: 'Location during top level initialization',
36+
type: 'string',
37+
})
3338
.argv as CliArgs;
3439

3540
return args;

packages/build-tools/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ async function main() {
2626
let CliArgs = getCliArgs();
2727
let src = CliArgs.input;
2828
let outputPath = CliArgs.output;
29-
let runtimeArgs = CliArgs.debug ? '--enable-script-debugging' : '';
29+
let runtimeArgs = [
30+
CliArgs.debug && '--enable-script-debugging',
31+
CliArgs.initLocation && `--init-location ${CliArgs.initLocation}`
32+
].filter(Boolean).join(' ');
3033

3134
// generate wit world string
3235
let wasiDeps = getPackagesWithWasiDeps(process.cwd(), new Set(), true);

test/test-app/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/test-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"keywords": [],
88
"license": "Apache-2.0",
99
"scripts": {
10-
"build": "node build.mjs && mkdirp dist && j2w -i build/bundle.js -o dist/test-app.wasm",
10+
"build": "node build.mjs && mkdirp dist && j2w -i build/bundle.js -o dist/test-app.wasm --initLocation http://foo.bar",
1111
"test": "echo \"Error: no test specified\" && exit 1"
1212
},
1313
"devDependencies": {

test/test-app/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { AutoRouter } from "itty-router"
22
import { headersTest, health, kvTest, kvTestUint8Array, outboundHttp, statusTest, stream, streamTest, testFunctionality } from "./test";
33

4+
// Verify top level init location
5+
if (globalThis.location.href != "http://foo.bar/") {
6+
throw new Error(`Expected top-level init location to be "top-level", got "${globalThis.location}"`);
7+
} else {
8+
console.log("Top-level init location verified:", globalThis.location.href);
9+
}
10+
411
let router = AutoRouter()
512

613
router.get("/health", health)

0 commit comments

Comments
 (0)