eyeprolog 1.5.95 → 1.5.96

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 CHANGED
@@ -96,8 +96,7 @@ npm test
96
96
  The npm command list is deliberately small:
97
97
 
98
98
  - `npm test` (or `npm run test`): run the release gate, including live upstream conformity checks (WG17 syntax among them).
99
- - `npm run generate`: rebuild generated library and book files.
100
99
 
101
- Use `npm test -- --offline` for a network-free local pass (this also skips the live-discovered WG17 syntax check, since it has no offline snapshot). Focused checks remain available directly, for example `node test/run-regression.mjs docs`; see [test runners](test/README.md). The automatic version hooks still run the release gate, refresh and stage conformance reports, and push the release. Detailed upstream report maintenance is documented in the [conformance guide](test/conformance/README.md).
100
+ Use `npm test -- --offline` for a network-free local pass (this also skips the live-discovered WG17 syntax check, since it has no offline snapshot). Focused checks remain available directly, for example `node test/run-regression.mjs docs`; see [test runners](test/README.md). The automatic version hooks rebuild generated library and book files, run the release gate, refresh and stage conformance reports, and push the release. Detailed upstream report maintenance is documented in the [conformance guide](test/conformance/README.md).
102
101
 
103
102
  EyeProlog is released under the [MIT License](LICENSE.md).
@@ -8,9 +8,11 @@ not extracted.
8
8
  Regenerate them from the repository root with:
9
9
 
10
10
  ```sh
11
- npm run generate
11
+ node tools/extract-book-examples.mjs
12
12
  ```
13
13
 
14
+ `npm version` regenerates this directory automatically as part of its release checks.
15
+
14
16
  ## Chapter 1: A program is a little theory
15
17
 
16
18
  - [01-parent.pl](chapter-01/01-parent.pl)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.5.95",
6
+ "version": "1.5.96",
7
7
  "description": "EyeProlog turns facts and rules into answers and proofs.",
8
8
  "type": "module",
9
9
  "main": "./index.js",
@@ -46,8 +46,7 @@
46
46
  },
47
47
  "scripts": {
48
48
  "test": "node test/run-all.mjs",
49
- "generate": "node tools/generate-library-autoload-index.mjs && node tools/generate-predicate-reference.mjs && node tools/extract-book-examples.mjs",
50
- "preversion": "npm test && node test/run-neumerkel.mjs --cached --update-report && node test/run-conformance-report.mjs conformance-report.md && git add test/conformance/NEUMERKEL-LATEST.md conformance-report.md",
49
+ "preversion": "node tools/generate-library-autoload-index.mjs && node tools/generate-predicate-reference.mjs && node tools/extract-book-examples.mjs && npm test && node test/run-neumerkel.mjs --cached --update-report && node test/run-conformance-report.mjs conformance-report.md && git add src/library-autoload-index.js the-art-of-eyeprolog.md examples/book test/conformance/NEUMERKEL-LATEST.md conformance-report.md",
51
50
  "postversion": "git push origin HEAD --follow-tags"
52
51
  }
53
52
  }
@@ -629,7 +629,7 @@ ${profile}`;
629
629
  const publishIndex = publishWorkflow.indexOf('run: npm publish');
630
630
  assertEqual(testIndex >= 0 && testIndex < publishIndex, true, 'publish workflow test gate');
631
631
  assertEqual(packIndex >= 0 && packIndex < publishIndex, true, 'publish workflow package gate');
632
- assertArrayEqual(Object.keys(pkg.scripts).sort(), ['generate', 'postversion', 'preversion', 'test'], 'small npm command surface');
632
+ assertArrayEqual(Object.keys(pkg.scripts).sort(), ['postversion', 'preversion', 'test'], 'small npm command surface');
633
633
  assertEqual(pkg.scripts.test, 'node test/run-all.mjs', 'full release gate');
634
634
  const runner = fs.readFileSync(path.join(packageRoot, 'test', 'run-all.mjs'), 'utf8');
635
635
  assertIncludes(runner, 'runOpenRuleBenchChecks(reporter)', 'OpenRuleBench remains in release gate');
@@ -126,12 +126,18 @@ export function runNeumerkelHarnessTests(reporter = new TestReporter()) {
126
126
  const pkg = JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'));
127
127
  const scripts = pkg.scripts ?? {};
128
128
  const releaseSteps = String(scripts.preversion ?? '').split(' && ');
129
- if (releaseSteps[0] !== 'npm test' || releaseSteps[1] !== 'node test/run-neumerkel.mjs --cached --update-report') {
129
+ if (releaseSteps[0] !== 'node tools/generate-library-autoload-index.mjs' ||
130
+ releaseSteps[1] !== 'node tools/generate-predicate-reference.mjs' ||
131
+ releaseSteps[2] !== 'node tools/extract-book-examples.mjs') {
132
+ throw new Error('preversion must regenerate the library index, predicate reference, and book examples first');
133
+ }
134
+ if (releaseSteps[3] !== 'npm test' || releaseSteps[4] !== 'node test/run-neumerkel.mjs --cached --update-report') {
130
135
  throw new Error('preversion must synchronize the tracked report from the successful npm test snapshot');
131
136
  }
132
- if (releaseSteps[2] !== 'node test/run-conformance-report.mjs conformance-report.md' ||
133
- releaseSteps[3] !== 'git add test/conformance/NEUMERKEL-LATEST.md conformance-report.md' || releaseSteps.length !== 4) {
134
- throw new Error('preversion must generate and stage both reports without another fetch');
137
+ if (releaseSteps[5] !== 'node test/run-conformance-report.mjs conformance-report.md' ||
138
+ releaseSteps[6] !== 'git add src/library-autoload-index.js the-art-of-eyeprolog.md examples/book ' +
139
+ 'test/conformance/NEUMERKEL-LATEST.md conformance-report.md' || releaseSteps.length !== 7) {
140
+ throw new Error('preversion must generate and stage the library index, book files, and both reports without another fetch');
135
141
  }
136
142
  });
137
143
 
@@ -86,9 +86,11 @@ const readme = [
86
86
  'Regenerate them from the repository root with:',
87
87
  '',
88
88
  '```sh',
89
- 'npm run generate',
89
+ 'node tools/extract-book-examples.mjs',
90
90
  '```',
91
91
  '',
92
+ '`npm version` regenerates this directory automatically as part of its release checks.',
93
+ '',
92
94
  ];
93
95
 
94
96
  let total = 0;
@@ -97,7 +97,7 @@ const text = `// Generated by tools/generate-library-autoload-index.mjs.\n` +
97
97
  if (process.argv.includes('--check')) {
98
98
  const current = fs.existsSync(outputFile) ? fs.readFileSync(outputFile, 'utf8') : '';
99
99
  if (current !== text) {
100
- console.error(`${path.relative(root, outputFile)} is stale; run npm run generate`);
100
+ console.error(`${path.relative(root, outputFile)} is stale; run node tools/generate-library-autoload-index.mjs (npm version regenerates it automatically)`);
101
101
  process.exit(1);
102
102
  }
103
103
  console.log(`${path.relative(root, outputFile)} is up to date`);
@@ -209,7 +209,7 @@ const wanted = expectedBook(book, generated);
209
209
 
210
210
  if (process.argv.includes('--check')) {
211
211
  if (wanted !== book) {
212
- console.error(`${path.relative(root, bookFile)} predicate reference is stale; run npm run generate`);
212
+ console.error(`${path.relative(root, bookFile)} predicate reference is stale; run node tools/generate-predicate-reference.mjs (npm version regenerates it automatically)`);
213
213
  process.exit(1);
214
214
  }
215
215
  console.log(`${path.relative(root, bookFile)} predicate reference is up to date (${surface.indicators.length} predicates)`);