conduit-onboard 0.1.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.
- package/README.md +20 -0
- package/bin/conduit-onboard.js +77 -0
- package/package.json +21 -0
- package/vendor/aarch64-apple-darwin/conduit-onboard +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# conduit-onboard
|
|
2
|
+
|
|
3
|
+
Thin `npx` launcher for the Conduit host onboarding helper.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npx conduit-onboard
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The npm package resolves the current platform and executes the bundled `conduit-onboard` binary. The Rust binary remains the source of truth for onboarding behavior, service installation, QR payload generation, and uninstall cleanup.
|
|
10
|
+
|
|
11
|
+
To publish from this repository, run the audited deploy path from `tools/conduit-onboard`:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm deploy --dry-run
|
|
15
|
+
npm deploy
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Stock npm rejects bare `npm deploy` before package scripts run. This checkout's interactive shell maps `npm deploy` to `npm run deploy`; in shells without that mapping, use `npm run deploy`.
|
|
19
|
+
|
|
20
|
+
Direct `npm publish` from this package is blocked unless it is launched by the deploy script.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
|
|
7
|
+
function platformTriple(platform = process.platform, arch = process.arch) {
|
|
8
|
+
const platformPart = {
|
|
9
|
+
darwin: "apple-darwin",
|
|
10
|
+
linux: "unknown-linux-gnu",
|
|
11
|
+
}[platform];
|
|
12
|
+
|
|
13
|
+
const archPart = {
|
|
14
|
+
arm64: "aarch64",
|
|
15
|
+
x64: "x86_64",
|
|
16
|
+
}[arch];
|
|
17
|
+
|
|
18
|
+
if (!platformPart || !archPart) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return `${archPart}-${platformPart}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function executableName() {
|
|
26
|
+
return "conduit-onboard";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function candidateBinaries(env = process.env) {
|
|
30
|
+
const candidates = [];
|
|
31
|
+
if (env.CONDUIT_ONBOARD_BIN) {
|
|
32
|
+
candidates.push(env.CONDUIT_ONBOARD_BIN);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const triple = platformTriple();
|
|
36
|
+
if (triple) {
|
|
37
|
+
candidates.push(path.join(__dirname, "..", "vendor", triple, executableName()));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return candidates;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function run(command, commandArgs) {
|
|
44
|
+
const result = spawnSync(command, commandArgs, { stdio: "inherit" });
|
|
45
|
+
if (result.error) {
|
|
46
|
+
console.error(result.error.message);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
process.exit(result.status ?? 1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function executableNameFor(command, platform = process.platform) {
|
|
53
|
+
return platform === "win32" ? `${command}.exe` : command;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function main(args = process.argv.slice(2)) {
|
|
57
|
+
for (const candidate of candidateBinaries()) {
|
|
58
|
+
if (fs.existsSync(candidate)) {
|
|
59
|
+
run(candidate, args);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
console.error(
|
|
64
|
+
"conduit-onboard binary is missing for this platform. Install a package with a matching vendor binary, or set CONDUIT_ONBOARD_BIN."
|
|
65
|
+
);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (require.main === module) {
|
|
70
|
+
main();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
module.exports = {
|
|
74
|
+
executableName,
|
|
75
|
+
executableNameFor,
|
|
76
|
+
platformTriple,
|
|
77
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "conduit-onboard",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Thin launcher for the Conduit onboarding helper",
|
|
5
|
+
"bin": {
|
|
6
|
+
"conduit-onboard": "bin/conduit-onboard.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"prepublishOnly": "node scripts/prepublish-only.js",
|
|
10
|
+
"test": "node --test"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"bin",
|
|
14
|
+
"vendor"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"type": "commonjs"
|
|
21
|
+
}
|
|
Binary file
|