spec-controller 0.1.76 → 0.1.78

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 3F Consulting Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -380,3 +380,29 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
380
380
  OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
381
381
  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
382
382
  THIS SOFTWARE.
383
+
384
+ ------------------------------------------------------------------------
385
+
386
+ @3f-consulting/spec-controller-core (MIT)
387
+
388
+ MIT License
389
+
390
+ Copyright (c) 2026 3F Consulting Ltd
391
+
392
+ Permission is hereby granted, free of charge, to any person obtaining a copy
393
+ of this software and associated documentation files (the "Software"), to deal
394
+ in the Software without restriction, including without limitation the rights
395
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
396
+ copies of the Software, and to permit persons to whom the Software is
397
+ furnished to do so, subject to the following conditions:
398
+
399
+ The above copyright notice and this permission notice shall be included in all
400
+ copies or substantial portions of the Software.
401
+
402
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
403
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
404
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
405
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
406
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
407
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
408
+ SOFTWARE.
package/dist/cli.js CHANGED
@@ -12868,17 +12868,14 @@ var init_cucumber = __esm({
12868
12868
  function wordsOf(text) {
12869
12869
  return text.trim().split(/\s+/);
12870
12870
  }
12871
- function opensWith(words, phrase) {
12872
- return words.slice(0, wordsOf(phrase).length).join(" ") === phrase;
12873
- }
12874
12871
  function commandHeads(line) {
12875
- return line.split(COMMAND_SEPARATOR).map((command) => {
12872
+ return subshellsSpaced(line).split(COMMAND_SEPARATOR).map((command) => {
12876
12873
  const words = wordsOf(command);
12877
12874
  return words.slice(words.findIndex((word) => !ASSIGNMENT.test(word)));
12878
12875
  });
12879
12876
  }
12880
12877
  function handedOn(words) {
12881
- const prefix = LAUNCHERS.find((row) => opensWithWords(words, row.words));
12878
+ const prefix = LAUNCHERS.find((row) => opensWith(words, row.words));
12882
12879
  return prefix === void 0 ? void 0 : words.slice(prefix.words.length + prefix.operands);
12883
12880
  }
12884
12881
  function launched(words) {
@@ -12892,17 +12889,16 @@ function afterSelections(head, at, invocations) {
12892
12889
  return at;
12893
12890
  return afterSelections(head, at + (option === head[at] ? 1 + valueWords : 1), invocations);
12894
12891
  }
12895
- function fromRun(words) {
12896
- const at = words.indexOf("run");
12897
- return at === -1 ? [] : words.slice(at);
12898
- }
12899
12892
  function scriptsNamedBy(head) {
12900
12893
  const invocations = SCRIPT_INVOCATIONS.get(head[0]);
12901
12894
  if (invocations === void 0)
12902
12895
  return void 0;
12903
- const command = head.slice(afterSelections(head, 1, invocations));
12904
- const foreach = invocations.optionsUpToRun !== void 0 && opensWith(command, invocations.optionsUpToRun);
12905
- const [word, next] = foreach ? fromRun(command) : command;
12896
+ const each = invocations.eachWorkspace;
12897
+ if (each !== void 0 && opensWith(head, each.words)) {
12898
+ const [word2, next2] = head.slice(pastOptions(head, each.words.length, each));
12899
+ return isOneOf(invocations.runWords, word2) ? [next2] : void 0;
12900
+ }
12901
+ const [word, next] = head.slice(afterSelections(head, 1, invocations));
12906
12902
  if (isOneOf(invocations.runWords, word))
12907
12903
  return [next];
12908
12904
  return [isOneOf(invocations.testShortcuts, word) ? "test" : void 0, invocations.runsBareName ? word : void 0];
@@ -12914,7 +12910,7 @@ function pastOptions(words, at, prefix) {
12914
12910
  return pastOptions(words, at + (prefix.valued.includes(word) ? 2 : 1), prefix);
12915
12911
  }
12916
12912
  function passedOn(words) {
12917
- const prefix = COMMAND_PREFIXES.find((row) => opensWithWords(words, row.words));
12913
+ const prefix = COMMAND_PREFIXES.find((row) => opensWith(words, row.words));
12918
12914
  return prefix === void 0 ? void 0 : words.slice(pastOptions(words, prefix.words.length, prefix) + prefix.operands);
12919
12915
  }
12920
12916
  function runsScript(head, script) {
@@ -12923,26 +12919,31 @@ function runsScript(head, script) {
12923
12919
  const next = passedOn(head);
12924
12920
  return next !== void 0 && runsScript(next, script);
12925
12921
  }
12922
+ function headsOf(command) {
12923
+ return command.split(/\r?\n/).flatMap((line) => quotedSeparatorsBlanked(line).split(BACKGROUND).flatMap(commandHeads));
12924
+ }
12926
12925
  function commandInvokesScript(command, script) {
12927
- return command.split(/\r?\n/).some((line) => line.split(BACKGROUND).some((list) => commandHeads(list).some((head) => runsScript(head, script))));
12926
+ return headsOf(command).some((head) => runsScript(head, script));
12928
12927
  }
12929
12928
  function runs(command, invocation, scripts, depth, lineRuns) {
12930
12929
  if (command.split(/\r?\n/).some((line) => lineRuns(line, invocation)))
12931
12930
  return true;
12932
- if (depth === 0)
12931
+ const entries = Object.entries(scripts);
12932
+ if (depth === 0 || entries.length === 0)
12933
12933
  return false;
12934
- return Object.entries(scripts).some(([name, body]) => commandInvokesScript(command, name) && runs(body, invocation, scripts, depth - 1, lineRuns));
12934
+ const heads = headsOf(command);
12935
+ return entries.some(([name, body]) => heads.some((head) => runsScript(head, name)) && runs(body, invocation, scripts, depth - 1, lineRuns));
12935
12936
  }
12936
12937
  function runsBy(lineRuns) {
12937
12938
  return (command, invocation, scripts) => {
12938
- const text = wordsOf(invocation).join(" ");
12939
- return text !== "" && runs(command, text, scripts, SCRIPT_CHAIN_DEPTH, lineRuns);
12939
+ const words = wordsOf(invocation);
12940
+ return words.join(" ") !== "" && runs(command, words, scripts, SCRIPT_CHAIN_DEPTH, lineRuns);
12940
12941
  };
12941
12942
  }
12942
12943
  function finalStages(command) {
12943
12944
  return command.replace(/\\\r?\n/g, " ").split(/\r?\n/).map((line) => line.replace(UP_TO_LAST_PIPE, "")).join("\n");
12944
12945
  }
12945
- var SCRIPT_CHAIN_DEPTH, UP_TO_LAST_PIPE, COMMAND_SEPARATOR, BACKGROUND, ASSIGNMENT, launcher, runsNext, SHELL_WORDS, COMMAND_PREFIXES, LAUNCHERS, SCRIPT_INVOCATIONS, opensWithWords, anywhere, isOneOf, asCommand, commandRuns, commandRunsAsCommand, shellReading;
12946
+ var SCRIPT_CHAIN_DEPTH, UP_TO_LAST_PIPE, COMMAND_SEPARATOR, BACKGROUND, ASSIGNMENT, launcher, runsNext, YARN_FOREACH, SHELL_WORDS, COMMAND_PREFIXES, LAUNCHERS, SCRIPT_INVOCATIONS, opensAt, opensWith, anywhere, subshellsSpaced, isOneOf, QUOTED, quotedSeparatorsBlanked, asCommand, commandRuns, commandRunsAsCommand, shellReading;
12946
12947
  var init_commandRuns = __esm({
12947
12948
  "../core/dist/parse/commandRuns.js"() {
12948
12949
  "use strict";
@@ -12963,6 +12964,7 @@ var init_commandRuns = __esm({
12963
12964
  operands: 0,
12964
12965
  valued
12965
12966
  });
12967
+ YARN_FOREACH = runsNext(["yarn", "workspaces", "foreach"], "--from", "--include", "--exclude", "-j", "--jobs");
12966
12968
  SHELL_WORDS = ["!", "(", "{", "if", "then", "elif", "else", "while", "until", "do"];
12967
12969
  COMMAND_PREFIXES = [
12968
12970
  { ...launcher(["timeout"], "-k", "--kill-after", "-s", "--signal"), operands: 1 },
@@ -12973,7 +12975,7 @@ var init_commandRuns = __esm({
12973
12975
  launcher(["pnpm"]),
12974
12976
  runsNext(["yarn", "exec"]),
12975
12977
  runsNext(["yarn", "dlx"], "-p", "--package"),
12976
- runsNext(["yarn", "workspaces", "foreach"], "--from", "--include", "--exclude", "-j", "--jobs"),
12978
+ YARN_FOREACH,
12977
12979
  launcher(["yarn"]),
12978
12980
  launcher(["bunx"], "-p", "--package"),
12979
12981
  launcher(["python", "-m"]),
@@ -13029,16 +13031,20 @@ var init_commandRuns = __esm({
13029
13031
  runWords: ["run"],
13030
13032
  runsBareName: true,
13031
13033
  selections: /* @__PURE__ */ new Map([["workspace", 1]]),
13032
- optionsUpToRun: "workspaces foreach"
13034
+ eachWorkspace: YARN_FOREACH
13033
13035
  }
13034
13036
  ]
13035
13037
  ]);
13036
- opensWithWords = (words, prefix) => prefix.every((word, at) => words[at] === word);
13038
+ opensAt = (words, prefix, from) => prefix.every((word, at) => words[from + at] === word);
13039
+ opensWith = (words, prefix) => opensAt(words, prefix, 0);
13037
13040
  anywhere = (line, invocation) => {
13038
13041
  const words = wordsOf(line);
13039
- return words.some((_, at) => opensWith(words.slice(at), invocation));
13042
+ return words.some((_, at) => opensAt(words, invocation, at));
13040
13043
  };
13044
+ subshellsSpaced = (line) => line.replace(/(^|\s)\(/g, "$1( ").replace(/\)(?=[\s;&|]|$)/g, " )");
13041
13045
  isOneOf = (words, word) => words?.some((each) => each === word) === true;
13046
+ QUOTED = /"[^"]*"|'[^']*'/g;
13047
+ quotedSeparatorsBlanked = (line) => line.replace(QUOTED, (quoted) => quoted.replace(/[&;|]/g, " "));
13042
13048
  asCommand = (line, invocation) => commandHeads(line).some((head) => opensWith(launched(head), invocation));
13043
13049
  commandRuns = runsBy(anywhere);
13044
13050
  commandRunsAsCommand = runsBy(asCommand);
@@ -28980,21 +28986,3 @@ var init_main = __esm({
28980
28986
  // src/cli.ts
28981
28987
  init_crashGuards();
28982
28988
  void boot(process, process.stdout, process.stderr, process.argv.slice(2), () => Promise.resolve().then(() => (init_main(), main_exports)));
28983
- /*! Bundled license information:
28984
-
28985
- reflect-metadata/Reflect.js:
28986
- (*! *****************************************************************************
28987
- Copyright (C) Microsoft. All rights reserved.
28988
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
28989
- this file except in compliance with the License. You may obtain a copy of the
28990
- License at http://www.apache.org/licenses/LICENSE-2.0
28991
-
28992
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
28993
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
28994
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
28995
- MERCHANTABLITY OR NON-INFRINGEMENT.
28996
-
28997
- See the Apache Version 2.0 License for specific language governing permissions
28998
- and limitations under the License.
28999
- ***************************************************************************** *)
29000
- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.76",
3
+ "version": "0.1.78",
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",
@@ -21,18 +21,16 @@
21
21
  "files": [
22
22
  "dist"
23
23
  ],
24
- "dependencies": {
24
+ "devDependencies": {
25
+ "esbuild": "0.28.1",
25
26
  "fast-xml-parser": "^5.11.2",
26
27
  "yaml": "^2.9.0",
27
- "@3f-consulting/spec-controller-core": "0.1.76"
28
- },
29
- "devDependencies": {
30
- "esbuild": "0.28.1"
28
+ "@3f-consulting/spec-controller-core": "0.1.78"
31
29
  },
32
30
  "publishConfig": {
33
31
  "access": "public"
34
32
  },
35
33
  "scripts": {
36
- "build": "tsc -p tsconfig.build.json --noEmit && node bundle.mjs"
34
+ "build": "node bundle.mjs"
37
35
  }
38
36
  }