okforest 0.15.0 → 0.16.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 +2 -2
- package/dist/cli.mjs +12 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# okforest
|
|
2
2
|
|
|
3
3
|
The OKForest CLI: validate, inventory, and scaffold
|
|
4
|
-
[Open Knowledge Format (OKF)](https://github.com/
|
|
5
|
-
|
|
4
|
+
[Open Knowledge Format (OKF)](https://github.com/open-knowledge-format/open-knowledge-format)
|
|
5
|
+
trees, 0.2 and 0.3.
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
npx okforest validate . # exit 1 on errors; warnings never fail
|
package/dist/cli.mjs
CHANGED
|
@@ -58,7 +58,7 @@ function starterFiles(name, date) {
|
|
|
58
58
|
<!-- Started by \`okforest init\`. Make it yours: add how your team works with
|
|
59
59
|
this repository, and remove anything that doesn't apply. -->
|
|
60
60
|
|
|
61
|
-
${name}: an [OKF
|
|
61
|
+
${name}: an [OKF 0.3](https://github.com/open-knowledge-format/open-knowledge-format)
|
|
62
62
|
bundle in \`okf/\`, managed with [OKForest](https://www.okforest.ai). People
|
|
63
63
|
read it to learn; AI assistants use it to answer questions. Write for both.
|
|
64
64
|
|
|
@@ -119,8 +119,8 @@ from the repository root.
|
|
|
119
119
|
`,
|
|
120
120
|
"README.md": `# ${name}
|
|
121
121
|
|
|
122
|
-
${name}: an [Open Knowledge Format (OKF)](https://github.com/
|
|
123
|
-
|
|
122
|
+
${name}: an [Open Knowledge Format (OKF)](https://github.com/open-knowledge-format/open-knowledge-format)
|
|
123
|
+
0.3 bundle in [\`okf/\`](okf/index.md), one markdown file per concept, with
|
|
124
124
|
YAML frontmatter. Start at [\`okf/index.md\`](okf/index.md).
|
|
125
125
|
|
|
126
126
|
## Getting started
|
|
@@ -169,7 +169,7 @@ New pages are drafts (\`status: draft\`): fill them in and mark them \`stable\`.
|
|
|
169
169
|
Never commit secrets; record where each is kept instead.
|
|
170
170
|
`,
|
|
171
171
|
[`okf/index.md`]: `---
|
|
172
|
-
okf_version: "0.
|
|
172
|
+
okf_version: "0.3"
|
|
173
173
|
---
|
|
174
174
|
|
|
175
175
|
# ${name}
|
|
@@ -295,7 +295,7 @@ matchesAny(finding["secret"], [\`^/\`, \`://\`])
|
|
|
295
295
|
const COMPANY_TEMPLATE = "okforest/template-company-knowledge";
|
|
296
296
|
const HELP$6 = `Usage: okforest init [path] [--name <name>]
|
|
297
297
|
|
|
298
|
-
Create a repository for an OKF
|
|
298
|
+
Create a repository for an OKF 0.3 tree at path (default: the current
|
|
299
299
|
directory, which must be empty apart from .git): an empty bundle in okf/
|
|
300
300
|
(its index.md, log.md, and .okforest/settings.yaml), with a README.md, an
|
|
301
301
|
AGENTS.md for AI agents, a .gitignore, and GitHub workflows that scan for
|
|
@@ -389,7 +389,7 @@ const REASONS = {
|
|
|
389
389
|
function inventoryText(inventory, io) {
|
|
390
390
|
const out = [];
|
|
391
391
|
const { statuses: s, trustTiers: t } = inventory;
|
|
392
|
-
out.push(`${inventory.concepts} concepts · ${inventory.types.length} types · ${inventory.tags.length} tags · ${inventory.keys.length} frontmatter keys`, `Status: ${s.stable} stable, ${s.draft} draft, ${s.deprecated} deprecated · Trust: ${t["human-reviewed"]} human-reviewed, ${t["machine-confirmed"]} machine-confirmed, ${t.unverified} unverified · ${inventory.stale} stale`);
|
|
392
|
+
out.push(`${inventory.concepts} concepts · ${inventory.types.length} types · ${inventory.tags.length} tags · ${inventory.keys.length} frontmatter keys`, `Status: ${s.stable} stable, ${s.draft} draft, ${s.deprecated} deprecated${s.unrecognized > 0 ? `, ${s.unrecognized} unrecognized` : ""} · Trust: ${t["human-reviewed"]} human-reviewed, ${t["machine-confirmed"]} machine-confirmed, ${t.unverified} unverified · ${inventory.stale} stale`);
|
|
393
393
|
if (inventory.untyped > 0) out.push(paint(io, "yellow", `${inventory.untyped} concepts have no usable type`));
|
|
394
394
|
const section = (title, counts) => {
|
|
395
395
|
out.push("", paint(io, "bold", title));
|
|
@@ -412,8 +412,9 @@ function inventoryText(inventory, io) {
|
|
|
412
412
|
// src/commands/validate.ts
|
|
413
413
|
const HELP$4 = `Usage: okforest validate [path] [--format text|json]
|
|
414
414
|
|
|
415
|
-
Check the OKF
|
|
416
|
-
OKF specification
|
|
415
|
+
Check the OKF tree at path (default: the current directory) against the
|
|
416
|
+
OKF specification, by the version its root index.md declares (0.2, or 0.3),
|
|
417
|
+
and OKForest conventions. Exits 1 when there are errors;
|
|
417
418
|
warnings and info are reported but never fail.
|
|
418
419
|
|
|
419
420
|
Options
|
|
@@ -848,7 +849,7 @@ function slug(type) {
|
|
|
848
849
|
return type.toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "") || "type";
|
|
849
850
|
}
|
|
850
851
|
// src/main.ts
|
|
851
|
-
const HELP = `okforest ${VERSION}: validate, inventory, and scaffold Open Knowledge Format (OKF)
|
|
852
|
+
const HELP = `okforest ${VERSION}: validate, inventory, and scaffold Open Knowledge Format (OKF) trees
|
|
852
853
|
|
|
853
854
|
Usage
|
|
854
855
|
okforest validate [path] [--format text|json]
|
|
@@ -859,7 +860,8 @@ Usage
|
|
|
859
860
|
okforest types init [path] [--type <type>]... [--dry-run]
|
|
860
861
|
|
|
861
862
|
Commands
|
|
862
|
-
validate Check a tree against OKF
|
|
863
|
+
validate Check a tree against OKF, by the version it declares, and
|
|
864
|
+
OKForest conventions.
|
|
863
865
|
Exits 1 when there are errors; warnings and info never fail.
|
|
864
866
|
inventory List every type, tag, and frontmatter key in use, with counts
|
|
865
867
|
and likely near-duplicates.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "okforest",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The OKForest CLI: validate Open Knowledge Format (OKF)
|
|
3
|
+
"version": "0.16.0",
|
|
4
|
+
"description": "The OKForest CLI: validate Open Knowledge Format (OKF) trees, 0.2 and 0.3, inventory their metadata, and scaffold new trees and pages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"okf",
|
|
7
7
|
"open-knowledge-format",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"node": ">=22"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@okforest/okf": "0.
|
|
35
|
-
"@okforest/validate": "0.
|
|
34
|
+
"@okforest/okf": "0.16.0",
|
|
35
|
+
"@okforest/validate": "0.16.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^26.6.6",
|