@glossarist/concept-browser 0.7.114 → 0.7.115
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 +45 -2
- package/cli/index.mjs +15 -15
- package/cli/index.ts +9 -11
- package/data/concept-model/shapes/glossarist.concept.yaml.schema.json +255 -0
- package/package.json +14 -12
- package/scripts/__tests__/{bibliography.test.mjs → bibliography.test.ts} +1 -1
- package/scripts/__tests__/{cli-script-contract.test.mjs → cli-script-contract.test.ts} +3 -3
- package/scripts/__tests__/{concept-groups.test.mjs → concept-groups.test.ts} +1 -1
- package/scripts/__tests__/{doctor.test.mjs → doctor.test.ts} +1 -1
- package/scripts/__tests__/{fetch-datasets.test.mjs → fetch-datasets.test.ts} +1 -1
- package/scripts/__tests__/{first-non-empty.test.mjs → first-non-empty.test.ts} +1 -1
- package/scripts/__tests__/{process-about-pages.test.mjs → process-about-pages.test.ts} +1 -1
- package/scripts/{bridge-to-astro.mjs → bridge-to-astro.ts} +2 -4
- package/scripts/{build-edges.js → build-edges.ts} +11 -13
- package/scripts/{check-syntax.mjs → check-syntax.ts} +20 -13
- package/scripts/{fetch-datasets.mjs → fetch-datasets.ts} +2 -2
- package/scripts/{generate-data.mjs → generate-data.ts} +73 -460
- package/scripts/{generate-ontology-schema.mjs → generate-ontology-schema.ts} +2 -2
- package/scripts/lib/{build-cache.mjs → build-cache.ts} +3 -2
- package/scripts/lib/concept-formats.ts +206 -0
- package/scripts/lib/concept-uri.ts +14 -0
- package/scripts/lib/{dataset-turtle.mjs → dataset-turtle.ts} +4 -3
- package/scripts/lib/harmonize-concept.ts +86 -0
- package/scripts/lib/jsonld-emitter.ts +169 -0
- package/scripts/lib/{local-path-safety.mjs → local-path-safety.ts} +6 -2
- package/scripts/lib/yaml-types.ts +262 -0
- package/scripts/{process-about-pages.mjs → process-about-pages.ts} +1 -1
- package/scripts/{smoke.mjs → smoke.ts} +4 -3
- package/scripts/{validate-shacl.mjs → validate-shacl.ts} +5 -5
- package/scripts/validate-yaml.ts +144 -0
- package/src/__tests__/extract-source-refs.test.ts +2 -3
- package/src/__tests__/perf/serialization-perf.test.ts +5 -5
- package/src/__tests__/scripts/agents-turtle.test.ts +1 -1
- package/src/__tests__/scripts/bibliography-turtle.test.ts +1 -1
- package/src/__tests__/scripts/build-activity-turtle.test.ts +1 -1
- package/src/__tests__/scripts/build-cache.test.ts +1 -1
- package/src/__tests__/scripts/build-integration.test.ts +19 -19
- package/src/__tests__/scripts/dataset-turtle.test.ts +1 -1
- package/src/__tests__/scripts/migrate-v1-to-v3.test.ts +1 -1
- package/src/__tests__/scripts/normalize-yaml.test.ts +1 -1
- package/src/__tests__/scripts/turtle-escape.test.ts +1 -1
- package/src/__tests__/scripts/validate-yaml.test.ts +76 -0
- package/src/__tests__/scripts/version-turtle.test.ts +1 -1
- package/src/__tests__/scripts/vocab-turtle.test.ts +1 -1
- package/src/__tests__/scripts-syntax.test.ts +2 -2
- package/src/__tests__/use-rdf-document.test.ts +2 -3
- package/src/__tests__/utils/content-renderer-xss.test.ts +57 -0
- package/src/__tests__/validate-shacl.test.ts +3 -3
- package/src/adapters/wire/index.ts +69 -0
- package/src/utils/content-renderer.ts +7 -3
- package/src/utils/url-safety.ts +1 -5
- package/tsconfig.json +2 -2
- package/vite.config.ts +1 -1
- package/src/__tests__/composables/use-concept-edges-v2.test.ts +0 -167
- package/src/__tests__/composables/use-concept-edges-v2.test.ts.bak +0 -166
- package/src/types/agents-version-turtle.d.ts +0 -27
- package/src/types/bibliography-turtle.d.ts +0 -12
- package/src/types/build-activity-turtle.d.ts +0 -16
- package/src/types/build-cache.d.ts +0 -20
- package/src/types/dataset-turtle.d.ts +0 -32
- package/src/types/normalize-yaml.d.ts +0 -16
- package/src/types/turtle-escape.d.ts +0 -6
- package/src/types/vocab-turtle.d.ts +0 -13
- /package/scripts/{doctor.mjs → doctor.ts} +0 -0
- /package/scripts/{extract-source-refs.js → extract-source-refs.ts} +0 -0
- /package/scripts/{generate-404.js → generate-404.ts} +0 -0
- /package/scripts/{generate-ontology-data.mjs → generate-ontology-data.ts} +0 -0
- /package/scripts/lib/{agents-turtle.mjs → agents-turtle.ts} +0 -0
- /package/scripts/lib/{bibliography-turtle.mjs → bibliography-turtle.ts} +0 -0
- /package/scripts/lib/{bibliography.mjs → bibliography.ts} +0 -0
- /package/scripts/lib/build/{image-assets.mjs → image-assets.ts} +0 -0
- /package/scripts/lib/build/{non-verbal-consumer.mjs → non-verbal-consumer.ts} +0 -0
- /package/scripts/lib/{build-activity-turtle.mjs → build-activity-turtle.ts} +0 -0
- /package/scripts/lib/{concept-groups.mjs → concept-groups.ts} +0 -0
- /package/scripts/lib/{first-non-empty.mjs → first-non-empty.ts} +0 -0
- /package/scripts/lib/{turtle-escape.mjs → turtle-escape.ts} +0 -0
- /package/scripts/lib/{version-turtle.mjs → version-turtle.ts} +0 -0
- /package/scripts/lib/{vocab-turtle.mjs → vocab-turtle.ts} +0 -0
- /package/scripts/{load-site-config.mjs → load-site-config.ts} +0 -0
- /package/scripts/{migrate-v1-to-v3.mjs → migrate-v1-to-v3.ts} +0 -0
- /package/scripts/{normalize-yaml.mjs → normalize-yaml.ts} +0 -0
- /package/scripts/{sync-concept-model.mjs → sync-concept-model.ts} +0 -0
|
@@ -7,7 +7,8 @@ import process from "node:process";
|
|
|
7
7
|
const ROOT = path.resolve(path.dirname(new URL(import.meta.url).pathname), "..");
|
|
8
8
|
|
|
9
9
|
const TARGET_DIRS = ["scripts", "cli"];
|
|
10
|
-
const
|
|
10
|
+
const JS_EXTENSIONS = new Set([".mjs", ".js", ".cjs"]);
|
|
11
|
+
const ALL_EXTENSIONS = new Set([".ts", ...JS_EXTENSIONS]);
|
|
11
12
|
const SKIP_DIRS = new Set(["__tests__", "node_modules"]);
|
|
12
13
|
|
|
13
14
|
function walk(dir) {
|
|
@@ -18,7 +19,7 @@ function walk(dir) {
|
|
|
18
19
|
const st = statSync(full);
|
|
19
20
|
if (st.isDirectory()) {
|
|
20
21
|
out.push(...walk(full));
|
|
21
|
-
} else if (
|
|
22
|
+
} else if (ALL_EXTENSIONS.has(path.extname(entry))) {
|
|
22
23
|
out.push(full);
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -39,15 +40,24 @@ export function checkAllScripts({ root = ROOT } = {}) {
|
|
|
39
40
|
files.sort();
|
|
40
41
|
|
|
41
42
|
const failures = [];
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
|
|
44
|
+
// JS files: syntax-check with node --check
|
|
45
|
+
for (const file of files.filter(f => JS_EXTENSIONS.has(path.extname(f)))) {
|
|
46
|
+
const result = spawnSync(process.execPath, ["--check", file], { encoding: "utf8" });
|
|
47
|
+
if (result.status !== 0) {
|
|
48
|
+
failures.push({ file: path.relative(root, file), stderr: result.stderr || "" });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// TS files: type-check with tsc (authoritative for TypeScript)
|
|
53
|
+
if (files.some(f => path.extname(f) === ".ts")) {
|
|
54
|
+
const tsconfig = path.join(root, "tsconfig.scripts.json");
|
|
55
|
+
const result = spawnSync("npx", ["tsc", "-p", tsconfig, "--noEmit"], {
|
|
44
56
|
encoding: "utf8",
|
|
57
|
+
cwd: root,
|
|
45
58
|
});
|
|
46
59
|
if (result.status !== 0) {
|
|
47
|
-
failures.push({
|
|
48
|
-
file: path.relative(root, file),
|
|
49
|
-
stderr: result.stderr || "",
|
|
50
|
-
});
|
|
60
|
+
failures.push({ file: "tsconfig.scripts.json (tsc)", stderr: result.stdout || result.stderr || "" });
|
|
51
61
|
}
|
|
52
62
|
}
|
|
53
63
|
|
|
@@ -60,9 +70,7 @@ function main() {
|
|
|
60
70
|
process.stdout.write(`syntax OK: ${files.length} file(s) checked\n`);
|
|
61
71
|
return;
|
|
62
72
|
}
|
|
63
|
-
process.stderr.write(
|
|
64
|
-
`syntax check failed: ${failures.length} of ${files.length} file(s)\n\n`,
|
|
65
|
-
);
|
|
73
|
+
process.stderr.write(`syntax check failed: ${failures.length} of ${files.length} file(s)\n\n`);
|
|
66
74
|
for (const { file, stderr } of failures) {
|
|
67
75
|
process.stderr.write(`--- ${file} ---\n${stderr}\n`);
|
|
68
76
|
}
|
|
@@ -70,8 +78,7 @@ function main() {
|
|
|
70
78
|
}
|
|
71
79
|
|
|
72
80
|
const isDirectEntry = process.argv[1] &&
|
|
73
|
-
path.resolve(process.argv[1]) ===
|
|
74
|
-
path.resolve(new URL(import.meta.url).pathname);
|
|
81
|
+
path.resolve(process.argv[1]) === path.resolve(new URL(import.meta.url).pathname);
|
|
75
82
|
|
|
76
83
|
if (isDirectEntry) {
|
|
77
84
|
main();
|
|
@@ -20,8 +20,8 @@ import JSZip from 'jszip';
|
|
|
20
20
|
import { loadGcr } from 'glossarist';
|
|
21
21
|
import { execFileSync } from 'child_process';
|
|
22
22
|
import { fileURLToPath } from 'url';
|
|
23
|
-
import { loadSiteConfig } from './load-site-config
|
|
24
|
-
import { assertLocalPathSafe } from './lib/local-path-safety
|
|
23
|
+
import { loadSiteConfig } from './load-site-config';
|
|
24
|
+
import { assertLocalPathSafe } from './lib/local-path-safety';const ROOT = process.cwd();
|
|
25
25
|
const DATASETS_DIR = path.join(ROOT, '.datasets');
|
|
26
26
|
const GCR_DIR = path.join(ROOT, '.gcr');
|
|
27
27
|
|