@casualjim/heimdall-sandbox 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/bin/heimdall-sandbox.js +31 -0
- package/package.json +23 -0
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawnSync } = require('node:child_process');
|
|
3
|
+
const process = require('node:process');
|
|
4
|
+
|
|
5
|
+
const packages = {
|
|
6
|
+
'linux:x64': '@casualjim/heimdall-sandbox-linux-x64',
|
|
7
|
+
'linux:arm64': '@casualjim/heimdall-sandbox-linux-arm64',
|
|
8
|
+
'darwin:arm64': '@casualjim/heimdall-sandbox-darwin-arm64',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const key = `${process.platform}:${process.arch}`;
|
|
12
|
+
const packageName = packages[key];
|
|
13
|
+
if (!packageName) {
|
|
14
|
+
console.error(`Unsupported platform ${key}. Supported platforms: ${Object.keys(packages).join(', ')}`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let binary;
|
|
19
|
+
try {
|
|
20
|
+
binary = require.resolve(`${packageName}/bin/heimdall-sandbox`);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error(`Missing Heimdall platform package ${packageName}. Reinstall @casualjim/heimdall-sandbox and ensure optional dependencies are enabled.`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
|
|
27
|
+
if (result.error) {
|
|
28
|
+
console.error(`Failed to execute ${binary}: ${result.error.message}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
process.exit(result.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@casualjim/heimdall-sandbox",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Process sandbox runtime for Heimdall.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/casualjim/heimdall-sandbox.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/casualjim/heimdall-sandbox",
|
|
11
|
+
"bin": {
|
|
12
|
+
"heimdall-sandbox": "bin/heimdall-sandbox.js"
|
|
13
|
+
},
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"@casualjim/heimdall-sandbox-linux-x64": "0.1.8",
|
|
16
|
+
"@casualjim/heimdall-sandbox-linux-arm64": "0.1.8",
|
|
17
|
+
"@casualjim/heimdall-sandbox-darwin-arm64": "0.1.8"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"bin",
|
|
21
|
+
"README.md"
|
|
22
|
+
]
|
|
23
|
+
}
|