@tplog/zendcli 1.3.0 → 1.4.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.
Files changed (3) hide show
  1. package/bin/zend.js +39 -0
  2. package/package.json +9 -5
  3. package/dist/zend +0 -0
package/bin/zend.js ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execFileSync } = require("child_process");
4
+ const os = require("os");
5
+ const path = require("path");
6
+
7
+ const PLATFORMS = {
8
+ "darwin-arm64": "@tplog/zendcli-darwin-arm64",
9
+ "darwin-x64": "@tplog/zendcli-darwin-x64",
10
+ "linux-x64": "@tplog/zendcli-linux-x64",
11
+ "linux-arm64": "@tplog/zendcli-linux-arm64",
12
+ };
13
+
14
+ const platform = os.platform();
15
+ const arch = os.arch();
16
+ const key = `${platform}-${arch}`;
17
+ const pkg = PLATFORMS[key];
18
+
19
+ if (!pkg) {
20
+ console.error(`Unsupported platform: ${key}`);
21
+ console.error(`Supported: ${Object.keys(PLATFORMS).join(", ")}`);
22
+ process.exit(1);
23
+ }
24
+
25
+ let binPath;
26
+ try {
27
+ binPath = path.join(require.resolve(`${pkg}/package.json`), "..", "zend");
28
+ } catch {
29
+ console.error(`Could not find package ${pkg}. Try reinstalling @tplog/zendcli.`);
30
+ process.exit(1);
31
+ }
32
+
33
+ try {
34
+ const result = execFileSync(binPath, process.argv.slice(2), {
35
+ stdio: "inherit",
36
+ });
37
+ } catch (e) {
38
+ process.exit(e.status || 1);
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplog/zendcli",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Minimal Zendesk CLI for tickets and comments (Rust)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,14 +11,18 @@
11
11
  "url": "https://github.com/tplog/zendcli/issues"
12
12
  },
13
13
  "bin": {
14
- "zend": "dist/zend"
14
+ "zend": "bin/zend.js"
15
15
  },
16
16
  "files": [
17
- "dist/"
17
+ "bin/"
18
18
  ],
19
19
  "scripts": {
20
- "build": "cargo build --release && mkdir -p dist && cp target/release/zend dist/zend",
21
- "prepublishOnly": "npm run build",
22
20
  "test": "cargo test"
21
+ },
22
+ "optionalDependencies": {
23
+ "@tplog/zendcli-darwin-arm64": "1.4.0",
24
+ "@tplog/zendcli-darwin-x64": "1.4.0",
25
+ "@tplog/zendcli-linux-x64": "1.4.0",
26
+ "@tplog/zendcli-linux-arm64": "1.4.0"
23
27
  }
24
28
  }
package/dist/zend DELETED
Binary file