spec-controller 0.1.241 → 0.1.242
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 +16 -10
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -11434,12 +11434,13 @@ function isFeaturePart(text) {
|
|
|
11434
11434
|
function headerFeatureCode(featureTags) {
|
|
11435
11435
|
return featureTags.find(isFeaturePart) ?? null;
|
|
11436
11436
|
}
|
|
11437
|
-
var FEATURE_PART_SOURCE, PREFIX_SOURCE, SCN_ID_SOURCE, SCN_CODE, FEATURE_CODE_OF, FEATURE_PART;
|
|
11437
|
+
var FEATURE_PART_SOURCE, CLAIM_CODE_PREFIXES, PREFIX_SOURCE, SCN_ID_SOURCE, SCN_CODE, FEATURE_CODE_OF, FEATURE_PART;
|
|
11438
11438
|
var init_featureCode = __esm({
|
|
11439
11439
|
"../core/dist/domain/featureCode.js"() {
|
|
11440
11440
|
"use strict";
|
|
11441
11441
|
FEATURE_PART_SOURCE = "[A-Z0-9]{2,5}";
|
|
11442
|
-
|
|
11442
|
+
CLAIM_CODE_PREFIXES = ["CLM", "SCN"];
|
|
11443
|
+
PREFIX_SOURCE = `(?:${CLAIM_CODE_PREFIXES.join("|")})`;
|
|
11443
11444
|
SCN_ID_SOURCE = `${PREFIX_SOURCE}-${FEATURE_PART_SOURCE}-\\d+`;
|
|
11444
11445
|
SCN_CODE = new RegExp(`^${SCN_ID_SOURCE}$`);
|
|
11445
11446
|
FEATURE_CODE_OF = new RegExp(`^${PREFIX_SOURCE}-(${FEATURE_PART_SOURCE})-\\d+$`);
|
|
@@ -12538,7 +12539,7 @@ function nextScnCode(request, occurrences) {
|
|
|
12538
12539
|
}
|
|
12539
12540
|
const highest = highestOf(request.part, occurrences);
|
|
12540
12541
|
const next = (highest === null ? 0 : numberOf(highest.code)) + 1;
|
|
12541
|
-
const code = `
|
|
12542
|
+
const code = `CLM-${request.part}-${String(next).padStart(NUMBER_WIDTH, "0")}`;
|
|
12542
12543
|
return headed && request.isNew === true ? { kind: "allocated", code, highest, alreadyHeaded: true } : { kind: "allocated", code, highest };
|
|
12543
12544
|
}
|
|
12544
12545
|
function unknownPartCarried(unknown) {
|
|
@@ -38986,7 +38987,7 @@ import { lstatSync as lstatSync3, readFileSync as readFileSync7 } from "node:fs"
|
|
|
38986
38987
|
import { dirname as dirname5, join as join8 } from "node:path";
|
|
38987
38988
|
function readHistory(cwd, part) {
|
|
38988
38989
|
proveRefsReadable(cwd);
|
|
38989
|
-
const args = ["log", "--all", "-p", "-U0", "--no-color", "--no-ext-diff", "--format=%x01%h", "-G", `
|
|
38990
|
+
const args = ["log", "--all", "-p", "-U0", "--no-color", "--no-ext-diff", "--format=%x01%h", "-G", `(${CLAIM_CODE_PREFIXES.join("|")})-${part}-`];
|
|
38990
38991
|
const result = spawnSync2("git", args, { cwd, encoding: "utf8", maxBuffer: MAX_OUTPUT_BYTES });
|
|
38991
38992
|
if (result.error !== void 0) refuse2("history" /* History */, cwd, result.error);
|
|
38992
38993
|
if (result.status !== 0) {
|
|
@@ -39072,6 +39073,7 @@ var MAX_OUTPUT_BYTES, COMMIT_MARKER;
|
|
|
39072
39073
|
var init_readHistory = __esm({
|
|
39073
39074
|
"src/cli-allocate/readHistory.ts"() {
|
|
39074
39075
|
"use strict";
|
|
39076
|
+
init_dist3();
|
|
39075
39077
|
init_refStore();
|
|
39076
39078
|
init_messages();
|
|
39077
39079
|
init_unreadable();
|
|
@@ -39088,7 +39090,7 @@ function readTree(top, part) {
|
|
|
39088
39090
|
const listed = gitListing(top, ["ls-files", "-z", "--cached", "--others", "--exclude-standard"]);
|
|
39089
39091
|
const ignored = gitListing(top, ["ls-files", "-z", "--others", "--ignored", "--exclude-standard", "--directory"]);
|
|
39090
39092
|
proveListable(top, "", new Set(ignored.filter(isDirectoryEntry).map((entry) => entry.slice(0, -1))));
|
|
39091
|
-
return listed.flatMap((path) => occurrencesInListed(top, path,
|
|
39093
|
+
return listed.flatMap((path) => occurrencesInListed(top, path, needlesFor(part)));
|
|
39092
39094
|
}
|
|
39093
39095
|
function gitListing(top, args) {
|
|
39094
39096
|
const result = spawnSync3("git", args, { cwd: top, encoding: "utf8", maxBuffer: MAX_OUTPUT_BYTES2 });
|
|
@@ -39114,15 +39116,18 @@ function listedAndEntered(path) {
|
|
|
39114
39116
|
accessSync(path, constants2.R_OK | constants2.X_OK);
|
|
39115
39117
|
return readdirSync4(path, { withFileTypes: true });
|
|
39116
39118
|
}
|
|
39117
|
-
function
|
|
39119
|
+
function needlesFor(part) {
|
|
39120
|
+
return CLAIM_CODE_PREFIXES.map((prefix) => `${prefix}-${part}-`);
|
|
39121
|
+
}
|
|
39122
|
+
function occurrencesInListed(top, path, needles) {
|
|
39118
39123
|
const file = join9(top, path);
|
|
39119
39124
|
const kind = readOrRefuse("tree-file" /* TreeFile */, file, () => lstatSync4(file, { throwIfNoEntry: false }));
|
|
39120
39125
|
if (kind === void 0 || !kind.isFile()) return [];
|
|
39121
|
-
return linesCarrying(path, readOrRefuse("tree-file" /* TreeFile */, file, () => readFileSync8(file)),
|
|
39126
|
+
return linesCarrying(path, readOrRefuse("tree-file" /* TreeFile */, file, () => readFileSync8(file)), needles);
|
|
39122
39127
|
}
|
|
39123
|
-
function linesCarrying(path, content,
|
|
39128
|
+
function linesCarrying(path, content, needles) {
|
|
39124
39129
|
if (content.subarray(0, BINARY_PROBE_BYTES).includes(0)) return [];
|
|
39125
|
-
return content.toString("utf8").split("\n").flatMap((line, i) => line.includes(needle) ? [{ path, line: i + 1, text: line }] : []);
|
|
39130
|
+
return content.toString("utf8").split("\n").flatMap((line, i) => needles.some((needle) => line.includes(needle)) ? [{ path, line: i + 1, text: line }] : []);
|
|
39126
39131
|
}
|
|
39127
39132
|
function isWalkedDirectory(name) {
|
|
39128
39133
|
return name !== "node_modules" && !name.startsWith(".");
|
|
@@ -39130,7 +39135,7 @@ function isWalkedDirectory(name) {
|
|
|
39130
39135
|
function walkTree(root, part) {
|
|
39131
39136
|
return filesUnder(root).flatMap((file) => {
|
|
39132
39137
|
const content = readOrRefuse("tree-file" /* TreeFile */, file, () => readFileSync8(file));
|
|
39133
|
-
return linesCarrying(relative2(root, file).split(sep4).join("/"), content,
|
|
39138
|
+
return linesCarrying(relative2(root, file).split(sep4).join("/"), content, needlesFor(part));
|
|
39134
39139
|
});
|
|
39135
39140
|
}
|
|
39136
39141
|
function filesUnder(dir) {
|
|
@@ -39145,6 +39150,7 @@ var MAX_OUTPUT_BYTES2, BINARY_PROBE_BYTES;
|
|
|
39145
39150
|
var init_readTree = __esm({
|
|
39146
39151
|
"src/cli-allocate/readTree.ts"() {
|
|
39147
39152
|
"use strict";
|
|
39153
|
+
init_dist3();
|
|
39148
39154
|
init_messages();
|
|
39149
39155
|
init_unreadable();
|
|
39150
39156
|
MAX_OUTPUT_BYTES2 = 1024 * 1024 * 1024;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-controller",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.242",
|
|
4
4
|
"description": "Reconcile the behaviour your scenarios name against the evidence that actually ran — the deterministic `balance` CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reconciliation",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"fast-xml-parser": "^5.11.2",
|
|
27
27
|
"ts-json-schema-generator": "^2.9.0",
|
|
28
28
|
"yaml": "^2.9.0",
|
|
29
|
-
"@3f-consulting/spec-controller-core": "0.1.
|
|
29
|
+
"@3f-consulting/spec-controller-core": "0.1.242"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|