spec-controller 0.1.266 → 0.1.268

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.
Files changed (2) hide show
  1. package/dist/cli.js +17 -14
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -140,15 +140,13 @@ var init_messages_en = __esm({
140
140
  "ci-step-record-shape": "of a CI run's record of its steps",
141
141
  "package-manifest-shape": "of a package.json manifest",
142
142
  "not-valid-json": "{subject} is not valid JSON: {path} ({reason})",
143
- "not-valid-json-in-shape": "{subject} is not valid JSON, so not in the shape {shape}: {path} ({reason})",
144
143
  "not-valid-xml": "{subject} is not valid XML, so not in the shape {shape}: {path} ({reason})",
145
144
  "xml-fault-at-line": "{fault} at line {line}",
146
145
  "not-in-shape": "{subject} is not in the shape {shape}: {path} ({fault})",
147
146
  "corpus-file-unparseable": "{corpus} contains a feature file that could not be parsed: {file}\n{message}",
148
147
  "workflow-not-yaml": "{workflows} contain a workflow that is not valid YAML: {file}\n{message}",
149
148
  "report-not-written": "The {format} report could not be written: {path} ({reason})",
150
- "unexpected-error": "spec-controller stopped on an unexpected error [unexpected-error], and gives no verdict: {name}: {firstLine}",
151
- "unexpected-error-after-verdict": "spec-controller hit an unexpected error [unexpected-error-after-verdict] after its verdict: {name}: {firstLine}",
149
+ "unexpected-error": "spec-controller hit an unexpected error [unexpected-error]: {name}: {firstLine}",
152
150
  "shape-kind-list": "a list",
153
151
  "shape-kind-object": "an object",
154
152
  "shape-kind-of-type": "a {type}",
@@ -253,15 +251,14 @@ function settleUnexpectedError(err, proc, stderr) {
253
251
  if (run.lineWritten) return;
254
252
  run.lineWritten = true;
255
253
  settleExitCode(proc);
256
- standardError(stderr).error(unexpectedErrorLine(err, run.finished));
254
+ standardError(stderr).error(unexpectedErrorLine(err));
257
255
  }
258
256
  function settleExitCode(proc) {
259
257
  if (run.finished) return;
260
258
  endRunOn(UNEXPECTED_ERROR, proc);
261
259
  }
262
- function unexpectedErrorLine(err, afterVerdict) {
263
- const code = afterVerdict ? "unexpected-error-after-verdict" /* UnexpectedErrorAfterVerdict */ : "unexpected-error" /* UnexpectedError */;
264
- return filled(CRASH_TEXTS[code], { name: nameOf(err), firstLine: firstLineOf(err) });
260
+ function unexpectedErrorLine(err) {
261
+ return filled(CRASH_TEXTS["unexpected-error" /* UnexpectedError */], { name: nameOf(err), firstLine: firstLineOf(err) });
265
262
  }
266
263
  function filled(text, values) {
267
264
  return text.replace(/\{(name|firstLine)\}/g, (_, key) => values[key]);
@@ -30879,7 +30876,7 @@ var init_inputKinds = __esm({
30879
30876
  },
30880
30877
  jest: {
30881
30878
  reader: "jest",
30882
- format: "json-naming-its-shape",
30879
+ format: "json",
30883
30880
  shape: VITEST_REPORT,
30884
30881
  subject: "flagged-report" /* FlaggedReport */,
30885
30882
  writer: "jest-report-shape" /* JestReportShape */
@@ -30894,7 +30891,7 @@ var init_inputKinds = __esm({
30894
30891
  },
30895
30892
  rspec: {
30896
30893
  reader: "rspec",
30897
- format: "json-naming-its-shape",
30894
+ format: "json",
30898
30895
  shape: RSPEC_REPORT,
30899
30896
  subject: "flagged-report" /* FlaggedReport */,
30900
30897
  writer: "rspec-report-shape" /* RspecReportShape */
@@ -35317,7 +35314,6 @@ var init_reportReading = __esm({
35317
35314
  init_inputReading();
35318
35315
  PARSER_OF = {
35319
35316
  json: (text) => JSON.parse(text),
35320
- "json-naming-its-shape": (text) => JSON.parse(text),
35321
35317
  "junit-xml": parseJunitXml,
35322
35318
  "junit-xml-or-one-suite": parseJunitXmlLiftingBareSuite
35323
35319
  };
@@ -35412,7 +35408,6 @@ var init_unreadableInputs = __esm({
35412
35408
  init_refusal();
35413
35409
  NOT_VALID_IN = {
35414
35410
  json: (subject, _shape, path, reason) => refusal("not-valid-json" /* NotValidJson */, { subject, path, reason }),
35415
- "json-naming-its-shape": (subject, shape, path, reason) => refusal("not-valid-json-in-shape" /* NotValidJsonInShape */, { subject, shape, path, reason }),
35416
35411
  "junit-xml": (subject, shape, path, reason) => refusal("not-valid-xml" /* NotValidXml */, { subject, shape, path, reason }),
35417
35412
  "junit-xml-or-one-suite": (subject, shape, path, reason) => refusal("not-valid-xml" /* NotValidXml */, { subject, shape, path, reason })
35418
35413
  };
@@ -35421,6 +35416,14 @@ var init_unreadableInputs = __esm({
35421
35416
 
35422
35417
  // src/inputs/inputsRead.ts
35423
35418
  import { existsSync as existsSync3 } from "node:fs";
35419
+ function featureFilesIn(dir) {
35420
+ try {
35421
+ return corpusFeatureFiles(dir).map(({ path }) => path);
35422
+ } catch (err) {
35423
+ if (err instanceof MissingFeatureCorpusError) return [];
35424
+ throw err;
35425
+ }
35426
+ }
35424
35427
  function inputsReadFrom(args, given, reader, defaults) {
35425
35428
  const reports = jsonInputsOf(given, reader.exists, defaults.packageJson).map(({ path }) => ({ subject: message("read-report" /* ReadReport */), path }));
35426
35429
  return [...reports, ...featureInputs(args["features"], reader, defaults.features), ...workflowInputs(args["ci"], reader, defaults.ci)];
@@ -35442,7 +35445,7 @@ var init_inputsRead = __esm({
35442
35445
  init_unreadableInputs();
35443
35446
  NODE_INPUT_READER = {
35444
35447
  exists: existsSync3,
35445
- featureFiles: (dir) => corpusFeatureFiles(dir).map(({ path }) => path),
35448
+ featureFiles: featureFilesIn,
35446
35449
  workflowFiles: (path) => ciSourcePathsOf(path)
35447
35450
  };
35448
35451
  }
@@ -36232,11 +36235,11 @@ function refuseUsage(error) {
36232
36235
  function answerRequest({ featureCode, isNew }) {
36233
36236
  const cwd = process.cwd();
36234
36237
  const top = repositoryTop(cwd);
36235
- const featureCodes = readFeatureCodes(featureFilesIn(join8(top ?? cwd, DEFAULT_FEATURES_DIR)));
36238
+ const featureCodes = readFeatureCodes(featureFilesIn2(join8(top ?? cwd, DEFAULT_FEATURES_DIR)));
36236
36239
  const answer = nextClaimCode({ featureCode, featureCodes, isNew }, occurrencesFrom(cwd, featureCode, top));
36237
36240
  ANSWERED[answer.kind](answer, cwd);
36238
36241
  }
36239
- function featureFilesIn(dir) {
36242
+ function featureFilesIn2(dir) {
36240
36243
  try {
36241
36244
  return corpusFeatureFiles(dir);
36242
36245
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-controller",
3
- "version": "0.1.266",
3
+ "version": "0.1.268",
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.266"
29
+ "@3f-consulting/spec-controller-core": "0.1.268"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"