@vector-metis/cli 0.1.1
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/bin/metis.js +34 -0
- package/package.json +25 -0
package/bin/metis.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
|
|
5
|
+
const platformPackages = {
|
|
6
|
+
"linux-x64": "@vector-metis/cli-linux-x64",
|
|
7
|
+
"linux-arm64": "@vector-metis/cli-linux-arm64",
|
|
8
|
+
"darwin-x64": "@vector-metis/cli-darwin-x64",
|
|
9
|
+
"darwin-arm64": "@vector-metis/cli-darwin-arm64",
|
|
10
|
+
"win32-x64": "@vector-metis/cli-win32-x64",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const key = `${process.platform}-${process.arch}`;
|
|
14
|
+
const packageName = platformPackages[key];
|
|
15
|
+
if (!packageName) {
|
|
16
|
+
console.error(`@vector-metis/cli does not support ${key}`);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let binary;
|
|
21
|
+
try {
|
|
22
|
+
binary = require(packageName).bin;
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.error(`@vector-metis/cli is missing its platform package ${packageName}`);
|
|
25
|
+
console.error("Reinstall the package with npm so optional dependencies are installed.");
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
30
|
+
if (result.error) {
|
|
31
|
+
console.error(`failed to start metis: ${result.error.message}`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
process.exit(result.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vector-metis/cli",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Metis application development CLI",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/vector-metis/metis-cli.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"type": "commonjs",
|
|
11
|
+
"bin": {
|
|
12
|
+
"metis": "bin/metis.js"
|
|
13
|
+
},
|
|
14
|
+
"files": ["bin"],
|
|
15
|
+
"optionalDependencies": {
|
|
16
|
+
"@vector-metis/cli-linux-x64": "0.1.1",
|
|
17
|
+
"@vector-metis/cli-linux-arm64": "0.1.1",
|
|
18
|
+
"@vector-metis/cli-darwin-x64": "0.1.1",
|
|
19
|
+
"@vector-metis/cli-darwin-arm64": "0.1.1",
|
|
20
|
+
"@vector-metis/cli-win32-x64": "0.1.1"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
}
|
|
25
|
+
}
|