@filez/filez-wb-cli 0.2.13 → 0.2.14-darwin-x64

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.
Binary file
package/package.json CHANGED
@@ -1,35 +1,21 @@
1
1
  {
2
2
  "name": "@filez/filez-wb-cli",
3
- "version": "0.2.13",
4
- "description": "Filez enterprise drive CLI for WorkBuddy",
3
+ "version": "0.2.14-darwin-x64",
4
+ "description": "macOS x64 binary for Filez WorkBuddy CLI",
5
5
  "license": "UNLICENSED",
6
- "type": "commonjs",
7
- "bin": {
8
- "filez-wb-cli": "bin/filez-wb-cli.cjs"
9
- },
10
- "files": [
11
- "bin/filez-wb-cli.cjs"
12
- ],
13
- "engines": {
14
- "node": ">=20"
15
- },
16
6
  "os": [
17
- "linux",
18
- "win32",
19
7
  "darwin"
20
8
  ],
21
9
  "cpu": [
22
- "x64",
23
- "arm64"
10
+ "x64"
11
+ ],
12
+ "files": [
13
+ "bin/filez-wb-cli",
14
+ "THIRD_PARTY_NOTICES.txt"
24
15
  ],
25
- "optionalDependencies": {
26
- "@filez/filez-wb-cli-linux-x64": "npm:@filez/filez-wb-cli@0.2.13-linux-x64",
27
- "@filez/filez-wb-cli-win32-x64": "npm:@filez/filez-wb-cli@0.2.13-win32-x64",
28
- "@filez/filez-wb-cli-darwin-arm64": "npm:@filez/filez-wb-cli@0.2.13-darwin-arm64",
29
- "@filez/filez-wb-cli-darwin-x64": "npm:@filez/filez-wb-cli@0.2.13-darwin-x64"
30
- },
31
16
  "publishConfig": {
32
17
  "access": "public",
33
- "registry": "https://registry.npmjs.org/"
18
+ "registry": "https://registry.npmjs.org/",
19
+ "tag": "darwin-x64"
34
20
  }
35
21
  }
@@ -1,94 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const { spawn } = require('node:child_process');
5
- const fs = require('node:fs');
6
- const path = require('node:path');
7
- const { createRequire } = require('node:module');
8
- const metadata = require('../package.json');
9
-
10
- const targets = {
11
- 'darwin-arm64': [`${metadata.name}-darwin-arm64`, 'filez-wb-cli'],
12
- 'darwin-x64': [`${metadata.name}-darwin-x64`, 'filez-wb-cli'],
13
- 'linux-x64': [`${metadata.name}-linux-x64`, 'filez-wb-cli'],
14
- 'win32-x64': [`${metadata.name}-win32-x64`, 'filez-wb-cli.exe'],
15
- };
16
-
17
- function resolveBinary(options = {}) {
18
- const platform = options.platform ?? process.platform;
19
- const arch = options.arch ?? process.arch;
20
- const target = targets[`${platform}-${arch}`];
21
- if (!target) {
22
- throw new Error(`Unsupported platform: ${platform}/${arch}; this release supports Linux x64, Windows x64, and macOS x64/arm64.`);
23
- }
24
- const [name, executable] = target;
25
- const resolve = options.resolve ?? require.resolve;
26
- let manifest;
27
- try {
28
- manifest = resolve(`${name}/package.json`);
29
- } catch (error) {
30
- if (error.code !== 'MODULE_NOT_FOUND') throw error;
31
- throw new Error(`Missing platform dependency ${name}; reinstall ${metadata.name}@${metadata.version} with --include=optional --ignore-scripts.`);
32
- }
33
- const installed = JSON.parse(fs.readFileSync(manifest, 'utf8'));
34
- if (installed.name !== metadata.name || installed.version !== `${metadata.version}-${platform}-${arch}`) {
35
- throw new Error(`Platform package ${name} must match CLI version ${metadata.version}; reinstall the exact version.`);
36
- }
37
- const binary = path.join(path.dirname(manifest), 'bin', executable);
38
- if (!fs.statSync(binary).isFile()) throw new Error(`Missing executable in ${name}; reinstall the exact version.`);
39
- fs.accessSync(binary, platform === 'win32' ? fs.constants.F_OK : fs.constants.X_OK);
40
- return binary;
41
- }
42
-
43
- // Used by the Skill to call the installed native binary directly, without a
44
- // PowerShell shim, global PATH changes, or a second download.
45
- function installedBinary(prefix) {
46
- const manifest = path.join(path.resolve(prefix), 'node_modules', metadata.name, 'package.json');
47
- const installed = JSON.parse(fs.readFileSync(manifest, 'utf8'));
48
- if (installed.name !== metadata.name || installed.version !== metadata.version) {
49
- throw new Error(`Expected ${metadata.name}@${metadata.version} in the installation directory.`);
50
- }
51
- return resolveBinary({ resolve: createRequire(manifest).resolve });
52
- }
53
-
54
- function run() {
55
- let binary;
56
- try {
57
- binary = resolveBinary();
58
- } catch (error) {
59
- console.error(`filez-wb-cli: ${error.message}`);
60
- process.exitCode = 1;
61
- return;
62
- }
63
- const child = spawn(binary, process.argv.slice(2), {
64
- shell: false,
65
- stdio: 'inherit',
66
- env: process.env,
67
- windowsHide: true,
68
- });
69
- const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
70
- const handlers = new Map();
71
- for (const signal of signals) {
72
- const handler = () => {
73
- if (child.exitCode === null && child.signalCode === null) child.kill(signal);
74
- };
75
- handlers.set(signal, handler);
76
- process.on(signal, handler);
77
- }
78
- function cleanup() {
79
- for (const [signal, handler] of handlers) process.removeListener(signal, handler);
80
- }
81
- child.once('error', (error) => {
82
- cleanup();
83
- console.error(`filez-wb-cli: cannot start native CLI (${error.code ?? 'unknown error'})`);
84
- process.exitCode = 1;
85
- });
86
- child.once('exit', (code, signal) => {
87
- cleanup();
88
- if (signal && process.platform !== 'win32') process.kill(process.pid, signal);
89
- else process.exitCode = code ?? 1;
90
- });
91
- }
92
-
93
- module.exports = { resolveBinary, installedBinary };
94
- if (require.main === module) run();