onefollowup-cli 0.0.0-stage → 0.2.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 +6 -2
- package/bin/onefollowup.js +82 -0
- package/package.json +33 -4
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# onefollowup-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `onefollowup` command, as a prebuilt binary: `npm install -g onefollowup-cli`. npm
|
|
4
|
+
installs only the carrier package for your platform (`onefollowup-cli-<platform>-<arch>`),
|
|
5
|
+
and this launcher runs it. The package carries the CLI executable alone — there is no
|
|
6
|
+
JavaScript API. See https://github.com/nickderobertis/onefollowup for the command surface
|
|
7
|
+
and its configuration.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Launcher for the `onefollowup` command installed from the
|
|
3
|
+
// `onefollowup-cli` npm package.
|
|
4
|
+
//
|
|
5
|
+
// Like the PyPI wheels (maturin `bindings = "bin"`, see pyproject.toml), the npm
|
|
6
|
+
// distribution carries the *prebuilt* Rust binary — no Rust toolchain, no
|
|
7
|
+
// compile, no download at install time. The platform-specific binary ships
|
|
8
|
+
// inside a per-platform package (`onefollowup-cli-<platform>-<arch>`) declared
|
|
9
|
+
// in this package's `optionalDependencies`; npm installs only the one whose
|
|
10
|
+
// `os`/`cpu` match the host, and this shim resolves it and execs it with the
|
|
11
|
+
// caller's argv.
|
|
12
|
+
//
|
|
13
|
+
// This file is committed source; the version and the optionalDependency versions
|
|
14
|
+
// are stamped from Cargo.toml at publish time by scripts/npm-build.mjs, which
|
|
15
|
+
// also generates the per-platform packages from the release binaries.
|
|
16
|
+
|
|
17
|
+
const path = require("node:path");
|
|
18
|
+
const { spawnSync } = require("node:child_process");
|
|
19
|
+
|
|
20
|
+
// process.platform-process.arch -> the platform package that carries the binary.
|
|
21
|
+
// The keys mirror the targets of .github/workflows/release.yml, the TARGETS table in
|
|
22
|
+
// scripts/npm-build.mjs, the optionalDependencies in package.json and release-targets.toml;
|
|
23
|
+
// npm/test/release-targets.test.mjs holds the five in lockstep.
|
|
24
|
+
const PACKAGES = {
|
|
25
|
+
"linux-x64": "onefollowup-cli-linux-x64",
|
|
26
|
+
"linux-arm64": "onefollowup-cli-linux-arm64",
|
|
27
|
+
"darwin-arm64": "onefollowup-cli-darwin-arm64",
|
|
28
|
+
"win32-x64": "onefollowup-cli-win32-x64",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Every failure here is a failed install, so say what to do about it rather than
|
|
32
|
+
// only what went wrong.
|
|
33
|
+
const OTHER_INSTALLS =
|
|
34
|
+
"Install another way instead: 'pip install onefollowup-cli', or " +
|
|
35
|
+
"'cargo install onefollowup --locked'.";
|
|
36
|
+
|
|
37
|
+
function fail(message) {
|
|
38
|
+
process.stderr.write(`onefollowup: ${message}\n`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function binaryPath() {
|
|
43
|
+
const key = `${process.platform}-${process.arch}`;
|
|
44
|
+
const pkg = PACKAGES[key];
|
|
45
|
+
if (!pkg) {
|
|
46
|
+
fail(
|
|
47
|
+
`unsupported platform ${key}. Prebuilt binaries exist for: ` +
|
|
48
|
+
`${Object.keys(PACKAGES).join(", ")}. ${OTHER_INSTALLS}`,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const binName = process.platform === "win32" ? "onefollowup.exe" : "onefollowup";
|
|
53
|
+
try {
|
|
54
|
+
// Resolve the platform package's manifest, then locate the binary beside it.
|
|
55
|
+
// Resolving package.json (rather than the binary file directly) is portable
|
|
56
|
+
// across Node resolution modes and does not require an `exports` entry for a
|
|
57
|
+
// non-JS asset.
|
|
58
|
+
const manifest = require.resolve(`${pkg}/package.json`);
|
|
59
|
+
return path.join(path.dirname(manifest), "bin", binName);
|
|
60
|
+
} catch (_err) {
|
|
61
|
+
return fail(
|
|
62
|
+
`the platform package ${pkg} is not installed. This usually means npm ` +
|
|
63
|
+
"skipped optional dependencies (e.g. --no-optional / --omit=optional) " +
|
|
64
|
+
"or the install was for a different platform. Reinstall with optional " +
|
|
65
|
+
`dependencies enabled. ${OTHER_INSTALLS}`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const result = spawnSync(binaryPath(), process.argv.slice(2), { stdio: "inherit" });
|
|
71
|
+
|
|
72
|
+
if (result.error) {
|
|
73
|
+
fail(`failed to launch the onefollowup binary: ${result.error.message}`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Re-raise a terminating signal so callers observe the true cause; otherwise
|
|
77
|
+
// propagate the child's exit code verbatim — the CLI assigns meaning to 1 and 2,
|
|
78
|
+
// and a caller reads them.
|
|
79
|
+
if (result.signal) {
|
|
80
|
+
process.kill(process.pid, result.signal);
|
|
81
|
+
}
|
|
82
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onefollowup-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The follow-up loop for any orchestrator repository: draft, verify, file one ticket per root cause, and answer comments, over onetaskgraph.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"follow-up",
|
|
7
|
+
"tickets",
|
|
8
|
+
"triage",
|
|
9
|
+
"onetaskgraph",
|
|
10
|
+
"cli"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/nickderobertis/onefollowup",
|
|
13
|
+
"bugs": "https://github.com/nickderobertis/onefollowup/issues",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/nickderobertis/onefollowup.git"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "Nick DeRobertis",
|
|
20
|
+
"bin": {
|
|
21
|
+
"onefollowup": "bin/onefollowup.js"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin/onefollowup.js"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"optionalDependencies": {
|
|
30
|
+
"onefollowup-cli-linux-x64": "0.2.0",
|
|
31
|
+
"onefollowup-cli-linux-arm64": "0.2.0",
|
|
32
|
+
"onefollowup-cli-darwin-arm64": "0.2.0",
|
|
33
|
+
"onefollowup-cli-win32-x64": "0.2.0"
|
|
34
|
+
}
|
|
35
|
+
}
|