Skip to content

Commit 00b971b

Browse files
authored
feat: Include in the wasm metadata whether we are using StarlingMonkey and/or PBL (#828)
1 parent ae42634 commit 00b971b

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

js-compute-runtime-cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ if (version) {
4040
enableExperimentalTopLevelAwait,
4141
starlingMonkey
4242
);
43-
await addSdkMetadataField(output);
43+
await addSdkMetadataField(output, enablePBL, starlingMonkey);
4444
}

src/addSdkMetadataField.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ import { dirname, join } from "node:path";
44
import { fileURLToPath } from "node:url";
55
const __dirname = dirname(fileURLToPath(import.meta.url));
66

7-
export async function addSdkMetadataField(wasmPath) {
7+
export async function addSdkMetadataField(wasmPath, usingPBL, usingStarlingMonkey) {
88
const packageJson = await readFile(join(__dirname, "../package.json"), {
99
encoding: "utf-8",
1010
});
11-
const { name, version } = JSON.parse(packageJson);
11+
12+
let { name, version } = JSON.parse(packageJson);
13+
14+
if (usingStarlingMonkey && usingPBL) {
15+
name += '(using StarlingMonkey and PBL)'
16+
} else if (usingStarlingMonkey) {
17+
name += '(using StarlingMonkey)'
18+
} else if (usingPBL) {
19+
name += '(with PBL)'
20+
}
21+
1222
const metadata = [
1323
[
14-
"sdk",
24+
"sdk",
1525
[
16-
[name, version],
26+
[`${name}`, version],
1727
],
1828
],
1929
];

0 commit comments

Comments
 (0)