@oxap/cli 0.0.0-stage → 0.1.0-alpha.33

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/oxap.js ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawn } = require("node:child_process");
5
+ const { binaryPath } = require("../index.js");
6
+
7
+ const child = spawn(binaryPath(), process.argv.slice(2), { stdio: "inherit" });
8
+ const forwarded = ["SIGINT", "SIGTERM", "SIGHUP"];
9
+ const forward = (signal) => child.kill(signal);
10
+ for (const signal of forwarded) process.on(signal, forward);
11
+
12
+ child.on("error", (error) => {
13
+ throw error;
14
+ });
15
+ child.on("exit", (code, signal) => {
16
+ for (const name of forwarded) process.off(name, forward);
17
+ if (signal) process.kill(process.pid, signal);
18
+ else process.exit(code ?? 1);
19
+ });
package/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ function binaryPath() {
4
+ const target = `${process.platform}-${process.arch}`;
5
+ const binary = process.platform === "win32" ? "oxap.exe" : "oxap";
6
+ try {
7
+ return require.resolve(`@oxap/cli-${target}/bin/${binary}`);
8
+ } catch {
9
+ throw new Error(`@oxap/cli has no binary for ${target}: @oxap/cli-${target} is not installed`);
10
+ }
11
+ }
12
+
13
+ module.exports = { binaryPath };
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@oxap/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-alpha.33",
4
+ "description": "The oxap runtime, CLI and TUI",
5
+ "bin": {
6
+ "oxap": "bin/oxap.js"
7
+ },
8
+ "main": "index.js",
9
+ "files": [
10
+ "bin/",
11
+ "index.js"
12
+ ],
13
+ "optionalDependencies": {
14
+ "@oxap/cli-darwin-arm64": "0.1.0-alpha.33",
15
+ "@oxap/cli-darwin-x64": "0.1.0-alpha.33",
16
+ "@oxap/cli-linux-arm64": "0.1.0-alpha.33",
17
+ "@oxap/cli-linux-x64": "0.1.0-alpha.33",
18
+ "@oxap/cli-win32-x64": "0.1.0-alpha.33",
19
+ "@oxap/cli-win32-arm64": "0.1.0-alpha.33"
20
+ },
21
+ "license": "ISC",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/lsm/oxap"
25
+ }
6
26
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.