@publicodes/cli-linux-arm64 0.0.0-stage → 2.0.0-alpha.0
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/compiler +0 -0
- package/bin/publicodes.js +33 -0
- package/package.json +27 -5
- package/README.md +0 -3
package/bin/compiler
ADDED
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from "child_process";
|
|
3
|
+
import { dirname, join } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { existsSync } from "fs";
|
|
6
|
+
|
|
7
|
+
//#region ../cli-template/dst/src/bin/index.ts
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const binPath = join(__dirname, "compiler");
|
|
10
|
+
if (!existsSync(binPath)) {
|
|
11
|
+
console.error(`Error: Could not find the publicodes binary at ${binPath}`);
|
|
12
|
+
if (process.env.NODE_ENV === "development") console.error("Please make sure the compiler is built with \"yarn run build:compiler\" first");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
const env = {
|
|
17
|
+
...process.env,
|
|
18
|
+
PUBLICODESPATH: "./node_modules:node_modules"
|
|
19
|
+
};
|
|
20
|
+
const child = spawn(binPath, args, {
|
|
21
|
+
stdio: "inherit",
|
|
22
|
+
env
|
|
23
|
+
});
|
|
24
|
+
child.on("error", (err) => {
|
|
25
|
+
console.error(`Failed to start publicodes: ${err.message}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
});
|
|
28
|
+
child.on("exit", (code) => {
|
|
29
|
+
process.exit(code ?? 0);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@publicodes/cli-linux-arm64",
|
|
3
|
+
"version": "2.0.0-alpha.0",
|
|
4
|
+
"description": "A CLI tool for Publicodes (platform specific)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"os": [
|
|
7
|
+
"linux"
|
|
8
|
+
],
|
|
9
|
+
"cpu": [
|
|
10
|
+
"arm64"
|
|
11
|
+
],
|
|
12
|
+
"bin": {
|
|
13
|
+
"publicodes2": "./bin/publicodes.js"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"clean": "rm -rf bin",
|
|
17
|
+
"build:compiler": "rolldown -c && install -m755 ../compiler/_build/default/bin/main.exe bin/compiler",
|
|
18
|
+
"dev": "rolldown -c -w"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"bin"
|
|
22
|
+
],
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/bun": "^1",
|
|
25
|
+
"bun": "^1.2.22",
|
|
26
|
+
"rolldown": "1.0.0-beta.36"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/README.md
DELETED