rulebookguard 0.5.1 → 0.7.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/README.md +149 -81
- package/dist/{anchors-BFJCm1NU.mjs → anchors-C2j9c5MI.mjs} +1 -1
- package/dist/cli.mjs +99 -36
- package/dist/index.d.mts +43 -8
- package/dist/index.mjs +3 -3
- package/dist/lint-DfibQDW3.mjs +1042 -0
- package/dist/{site-BiiOPVEe.mjs → site-DmY5YVte.mjs} +5 -5
- package/package.json +3 -3
- package/dist/lint-C1yUeLOq.mjs +0 -755
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CliError,
|
|
1
|
+
import { _ as expandGlobs, a as CliError, b as runGit, c as openCatalog, d as scanTestRegions, n as lintCatalog, s as gitFallbackWarning, u as writeLines } from "./lint-DfibQDW3.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { readFile, readdir, stat, writeFile } from "node:fs/promises";
|
|
4
4
|
import { dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
@@ -7,7 +7,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
7
7
|
// src/site/data.ts
|
|
8
8
|
const FIELD = "";
|
|
9
9
|
async function siteData(catalog, onGitFallback) {
|
|
10
|
-
const
|
|
10
|
+
const scan = await scanTestRegions(catalog.root, catalog.config.testGlobs, onGitFallback);
|
|
11
11
|
const byId = new Map(catalog.rules.map((rule) => [rule.id, rule]));
|
|
12
12
|
const rules = [...catalog.rules].sort((a, b) => compare(a.id, b.id));
|
|
13
13
|
return {
|
|
@@ -15,12 +15,12 @@ async function siteData(catalog, onGitFallback) {
|
|
|
15
15
|
rules: await Promise.all(rules.map(async (rule) => ({
|
|
16
16
|
rule,
|
|
17
17
|
files: await expandGlobs(catalog.root, rule.anchors, onGitFallback),
|
|
18
|
-
tests: tags.get(rule.id) ?? [],
|
|
18
|
+
tests: scan.tags.get(rule.id) ?? [],
|
|
19
19
|
history: await history(catalog.root, rule.file),
|
|
20
20
|
supersedes: chain(rule, byId),
|
|
21
21
|
supersededBy: rules.find((other) => other.supersedes === rule.id)?.id
|
|
22
22
|
}))),
|
|
23
|
-
findings: await lintCatalog(catalog,
|
|
23
|
+
findings: await lintCatalog(catalog, scan, onGitFallback)
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
function chain(rule, byId) {
|
|
@@ -440,7 +440,7 @@ async function importSitePackage(from) {
|
|
|
440
440
|
throw new CliError(`The site commands need the ${SITE_PACKAGE} package. Install it next to rulebookguard: npm install --save-dev ${SITE_PACKAGE}`);
|
|
441
441
|
}
|
|
442
442
|
async function buildSite(site, catalog, out, language, base, io) {
|
|
443
|
-
const files = sitePages(await siteData(catalog, gitFallbackWarning(io)), {
|
|
443
|
+
const files = sitePages(await siteData(catalog, gitFallbackWarning(io, language)), {
|
|
444
444
|
language,
|
|
445
445
|
base
|
|
446
446
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rulebookguard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Keep business rules as the single source of truth, bound to code and tests.",
|
|
5
5
|
"homepage": "https://github.com/JuanCJR/rulebookguard#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@modelcontextprotocol/client": "2.3.1",
|
|
39
|
-
"@rulebookguard/site": "0.
|
|
39
|
+
"@rulebookguard/site": "0.7.0",
|
|
40
40
|
"@types/node": "^20.19.43",
|
|
41
41
|
"@types/picomatch": "^4.0.3",
|
|
42
42
|
"typescript": "^7.0.2",
|
|
43
43
|
"vite-plus": "^1.4.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@rulebookguard/site": "^0.
|
|
46
|
+
"@rulebookguard/site": "^0.7.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"@rulebookguard/site": {
|