@revturbine/cli 0.15.0 → 0.16.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/dist/cli.js +45 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9705,6 +9705,36 @@ function fail(cls, message) {
|
|
|
9705
9705
|
process.exit(cls);
|
|
9706
9706
|
}
|
|
9707
9707
|
|
|
9708
|
+
// src/lib/pin-drift.ts
|
|
9709
|
+
function isRecord5(value) {
|
|
9710
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9711
|
+
}
|
|
9712
|
+
function pinOf(pkg, name) {
|
|
9713
|
+
for (const field of ["devDependencies", "dependencies"]) {
|
|
9714
|
+
const deps = pkg[field];
|
|
9715
|
+
if (isRecord5(deps) && typeof deps[name] === "string") return deps[name];
|
|
9716
|
+
}
|
|
9717
|
+
return void 0;
|
|
9718
|
+
}
|
|
9719
|
+
var EXACT = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/;
|
|
9720
|
+
function checkPinDrift(pkg) {
|
|
9721
|
+
if (!isRecord5(pkg)) return [];
|
|
9722
|
+
const warnings = [];
|
|
9723
|
+
const cliPin = pinOf(pkg, "@revturbine/cli");
|
|
9724
|
+
if (cliPin !== void 0 && !EXACT.test(cliPin)) {
|
|
9725
|
+
warnings.push(
|
|
9726
|
+
`@revturbine/cli is pinned "${cliPin}" \u2014 the repo-pinned CLI must be EXACT (e.g. "0.14.0"): delegation runs the repo's version, and a range makes the running CLI drift from the committed one.`
|
|
9727
|
+
);
|
|
9728
|
+
}
|
|
9729
|
+
const sdkPin = pinOf(pkg, "@revturbine/sdk");
|
|
9730
|
+
if (sdkPin !== void 0 && !sdkPin.startsWith("^")) {
|
|
9731
|
+
warnings.push(
|
|
9732
|
+
`@revturbine/sdk is pinned "${sdkPin}" \u2014 use a caret (e.g. "^${sdkPin.replace(/^[~>=\s]*/, "")}") so additive SDK releases flow in. (Note: on 0.x, ^ spans PATCH releases only.)`
|
|
9733
|
+
);
|
|
9734
|
+
}
|
|
9735
|
+
return warnings;
|
|
9736
|
+
}
|
|
9737
|
+
|
|
9708
9738
|
// src/lib/selectors.ts
|
|
9709
9739
|
var SelectorError = class extends Error {
|
|
9710
9740
|
code = "STATE_REQUIRED";
|
|
@@ -10627,7 +10657,7 @@ program.command("evaluate").description("Run placement/entitlement decisions for
|
|
|
10627
10657
|
);
|
|
10628
10658
|
var generateCmd = program.command("generate").description("Code generation from a config version (see: generate types).");
|
|
10629
10659
|
generateCmd.command("types").description(
|
|
10630
|
-
"Generate a TypeScript module of
|
|
10660
|
+
"Generate a TypeScript module of Playbook handles \u2014 entitlements (namespaced by type), plans, segments, surface-template ids, and ui-path action types \u2014 for type-safe call sites."
|
|
10631
10661
|
).argument("[file...]", "Path to a Config File").option("--draft", "The tenant's open draft").option("--live", "The current live Release").option("--release <id>", "A specific playbook version / Release").option("-o, --out <path>", "Write the generated module to this path (parent dirs created); default stdout").option("--json", "Emit the handle map as JSON instead of TypeScript").option("-u, --url <url>", "RevTurbine instance URL", DEFAULT_URL).option("-t, --tenant-id <id>", "x-tenant-id (defaults to the stored token tenant)").action(
|
|
10632
10662
|
async (files, opts) => {
|
|
10633
10663
|
const [sel] = requireSelectors(opts, files, {
|
|
@@ -10796,6 +10826,20 @@ function gitRootOf(from) {
|
|
|
10796
10826
|
process.exit(child.status ?? EXIT.UNEXPECTED);
|
|
10797
10827
|
}
|
|
10798
10828
|
}
|
|
10829
|
+
if (process.argv.includes("-V") || process.argv.includes("--version")) {
|
|
10830
|
+
process.stdout.write(`${pkgVersion} (schema ${SCHEMA_VERSION})
|
|
10831
|
+
`);
|
|
10832
|
+
try {
|
|
10833
|
+
const pkgPath = path2.resolve("package.json");
|
|
10834
|
+
if (existsSync2(pkgPath)) {
|
|
10835
|
+
for (const warning of checkPinDrift(JSON.parse(readFileSync2(pkgPath, "utf8")))) {
|
|
10836
|
+
diag(`\u26A0 pin drift: ${warning}`);
|
|
10837
|
+
}
|
|
10838
|
+
}
|
|
10839
|
+
} catch {
|
|
10840
|
+
}
|
|
10841
|
+
process.exit(EXIT.OK);
|
|
10842
|
+
}
|
|
10799
10843
|
program.exitOverride();
|
|
10800
10844
|
try {
|
|
10801
10845
|
await program.parseAsync(process.argv);
|
package/package.json
CHANGED