@fabr-client/core 0.0.1

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/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # Fabr Client
2
+
3
+ Cross-platform launcher for Fabr Client.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @fabr-client/core
9
+ ```
10
+
11
+ ## Pair And Run
12
+
13
+ Copy the pairing command from Navinora system settings, then run:
14
+
15
+ ```bash
16
+ fabr-client login --server https://pivot.enclaws.com --pairing-code <code>
17
+ fabr-client run
18
+ ```
19
+
20
+ The main package is a thin launcher. It installs the matching native payload
21
+ through platform-specific optional dependencies, so end users only need the one
22
+ global install command above.
23
+
24
+ ## Platform Support
25
+
26
+ Published platform packages:
27
+
28
+ - `@fabr-client/core-win32-x64`
29
+ - `@fabr-client/core-darwin-x64`
30
+ - `@fabr-client/core-darwin-arm64`
31
+
32
+ ## Publish Checklist
33
+
34
+ For maintainers:
35
+
36
+ ```bash
37
+ # Build and stage the native payload for the current platform package.
38
+ pwsh ./scripts/package-fabr-client.ps1 -Profile release -PackNpm
39
+
40
+ # Validate the main package locally.
41
+ node ./packaging/npm/bin/fabr-client.js --help
42
+ npm pack ./packaging/npm
43
+
44
+ # Publish platform packages first, then the main launcher package.
45
+ npm publish ./packaging/npm-platforms/win32-x64 --access public
46
+ npm publish ./packaging/npm-platforms/darwin-x64 --access public
47
+ npm publish ./packaging/npm-platforms/darwin-arm64 --access public
48
+ npm publish ./packaging/npm --access public
49
+ ```
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawnSync } = require("node:child_process");
5
+ const fs = require("node:fs");
6
+ const path = require("node:path");
7
+
8
+ const platform = process.platform;
9
+ const arch = process.arch;
10
+ const exe = platform === "win32" ? "fabr-client.exe" : "fabr-client";
11
+ const platformDir = `${platform}-${arch}`;
12
+ const packageByPlatform = {
13
+ "win32-x64": "@fabr-client/core-win32-x64",
14
+ "darwin-x64": "@fabr-client/core-darwin-x64",
15
+ "darwin-arm64": "@fabr-client/core-darwin-arm64",
16
+ };
17
+
18
+ function resolvePlatformPackageBinary() {
19
+ const pkg = packageByPlatform[platformDir];
20
+ if (!pkg) {
21
+ return null;
22
+ }
23
+ try {
24
+ return path.join(path.dirname(require.resolve(`${pkg}/package.json`)), "bin", exe);
25
+ } catch {
26
+ return null;
27
+ }
28
+ }
29
+
30
+ const candidates = [
31
+ process.env.FABR_CLIENT_BIN,
32
+ resolvePlatformPackageBinary(),
33
+ // Local development fallback: package payloads staged next to this repo.
34
+ path.join(__dirname, "..", "..", "npm-platforms", platformDir, "bin", exe),
35
+ path.join(__dirname, platformDir, exe),
36
+ path.join(__dirname, "..", platformDir, exe),
37
+ path.join(__dirname, exe),
38
+ ].filter(Boolean);
39
+
40
+ const binary = candidates.find((candidate) => fs.existsSync(candidate));
41
+
42
+ if (!binary) {
43
+ console.error(
44
+ `Fabr Client does not include a binary for ${platformDir}.\n` +
45
+ "Please reinstall @fabr-client/core, or install the matching platform package."
46
+ );
47
+ process.exit(1);
48
+ }
49
+
50
+ const result = spawnSync(binary, process.argv.slice(2), {
51
+ stdio: "inherit",
52
+ windowsHide: false,
53
+ });
54
+
55
+ if (result.error) {
56
+ console.error(result.error.message);
57
+ process.exit(1);
58
+ }
59
+
60
+ process.exit(result.status ?? 0);
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@fabr-client/core",
3
+ "version": "0.0.1",
4
+ "description": "Cross-platform launcher for Fabr Client",
5
+ "license": "MIT",
6
+ "homepage": "https://pivot.enclaws.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/hashSTACS-Global/fabr-client.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/hashSTACS-Global/fabr-client/issues"
13
+ },
14
+ "bin": {
15
+ "fabr-client": "bin/fabr-client.js"
16
+ },
17
+ "scripts": {
18
+ "smoke": "node bin/fabr-client.js --help"
19
+ },
20
+ "optionalDependencies": {
21
+ "@fabr-client/core-win32-x64": "0.0.1",
22
+ "@fabr-client/core-darwin-x64": "0.0.1",
23
+ "@fabr-client/core-darwin-arm64": "0.0.1"
24
+ },
25
+ "files": [
26
+ "bin/",
27
+ "README.md"
28
+ ],
29
+ "engines": {
30
+ "node": ">=18"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "os": [
36
+ "darwin",
37
+ "win32"
38
+ ],
39
+ "cpu": [
40
+ "arm64",
41
+ "x64"
42
+ ]
43
+ }