@zeroxsolutions/calibarn 0.0.0-stage → 0.0.2

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.
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ // npm installs only the optional dependency whose `os` and `cpu` match this machine, so the binary is
3
+ // found by the platform's package name.
4
+ 'use strict';
5
+
6
+ const { spawn } = require('node:child_process');
7
+
8
+ const platformPackage = `@zeroxsolutions/calibarn-${process.platform}-${process.arch}`;
9
+
10
+ let binary;
11
+ try {
12
+ binary = require.resolve(`${platformPackage}/bin/calibarn`);
13
+ } catch {
14
+ console.error(
15
+ `calibarn has no build for ${process.platform}-${process.arch}, or ${platformPackage} was not installed. ` +
16
+ 'Reinstall without --no-optional or --omit=optional.',
17
+ );
18
+ process.exit(1);
19
+ }
20
+
21
+ const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit' });
22
+
23
+ // Ctrl+C already reaches the binary through the terminal's process group; passing it on would make
24
+ // it a second one.
25
+ process.on('SIGINT', () => {});
26
+ for (const signal of ['SIGTERM', 'SIGHUP']) {
27
+ process.on(signal, () => child.kill(signal));
28
+ }
29
+
30
+ child.on('exit', (code, signal) => {
31
+ if (signal) {
32
+ process.removeAllListeners(signal);
33
+ process.kill(process.pid, signal);
34
+ } else {
35
+ process.exit(code ?? 1);
36
+ }
37
+ });
package/package.json CHANGED
@@ -1,6 +1,95 @@
1
1
  {
2
2
  "name": "@zeroxsolutions/calibarn",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.2",
4
+ "description": "Runs terminal sessions on this machine and serves them to a browser.",
5
+ "license": "UNLICENSED",
6
+ "bin": {
7
+ "calibarn": "bin/calibarn.js"
8
+ },
9
+ "files": [
10
+ "bin"
11
+ ],
12
+ "optionalDependencies": {
13
+ "@zeroxsolutions/calibarn-darwin-arm64": "0.0.2",
14
+ "@zeroxsolutions/calibarn-darwin-x64": "0.0.2",
15
+ "@zeroxsolutions/calibarn-linux-arm64": "0.0.2",
16
+ "@zeroxsolutions/calibarn-linux-x64": "0.0.2"
17
+ },
18
+ "devDependencies": {
19
+ "@zeroxsolutions/web-app": "0.0.1"
20
+ },
21
+ "nx": {
22
+ "tags": [
23
+ "scope:calibarn",
24
+ "type:app"
25
+ ],
26
+ "targets": {
27
+ "build": {
28
+ "executor": "nx:run-commands",
29
+ "cache": true,
30
+ "dependsOn": [
31
+ "@zeroxsolutions/web-app:build"
32
+ ],
33
+ "inputs": [
34
+ "{projectRoot}/**/*",
35
+ "{workspaceRoot}/Cargo.toml",
36
+ "{workspaceRoot}/Cargo.lock",
37
+ {
38
+ "dependentTasksOutputFiles": "**/*",
39
+ "transitive": false
40
+ }
41
+ ],
42
+ "outputs": [
43
+ "{workspaceRoot}/target/release/calibarn"
44
+ ],
45
+ "options": {
46
+ "cwd": "{workspaceRoot}",
47
+ "command": "cargo build --release -p calibarn"
48
+ }
49
+ },
50
+ "typecheck": {
51
+ "executor": "nx:run-commands",
52
+ "cache": true,
53
+ "inputs": [
54
+ "{projectRoot}/**/*",
55
+ "{workspaceRoot}/Cargo.toml",
56
+ "{workspaceRoot}/Cargo.lock"
57
+ ],
58
+ "options": {
59
+ "cwd": "{workspaceRoot}",
60
+ "command": "cargo check --workspace --all-targets"
61
+ }
62
+ },
63
+ "lint": {
64
+ "executor": "nx:run-commands",
65
+ "cache": true,
66
+ "inputs": [
67
+ "{projectRoot}/**/*",
68
+ "{workspaceRoot}/Cargo.toml",
69
+ "{workspaceRoot}/Cargo.lock"
70
+ ],
71
+ "options": {
72
+ "cwd": "{workspaceRoot}",
73
+ "commands": [
74
+ "cargo fmt --all --check",
75
+ "cargo clippy --workspace --all-targets -- -D warnings"
76
+ ],
77
+ "parallel": false
78
+ }
79
+ },
80
+ "test": {
81
+ "executor": "nx:run-commands",
82
+ "cache": true,
83
+ "inputs": [
84
+ "{projectRoot}/**/*",
85
+ "{workspaceRoot}/Cargo.toml",
86
+ "{workspaceRoot}/Cargo.lock"
87
+ ],
88
+ "options": {
89
+ "cwd": "{workspaceRoot}",
90
+ "command": "cargo test --workspace"
91
+ }
92
+ }
93
+ }
94
+ }
6
95
  }
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.