@nusoft/nuos-build-catalogue 0.14.1 → 0.14.2
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/dist/indexer/crawl.d.ts +16 -8
- package/dist/indexer/crawl.js +32 -16
- package/package.json +1 -1
package/dist/indexer/crawl.d.ts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Crawler — walks the
|
|
2
|
+
* Crawler — walks the catalogue's `docs/` tree picking up indexable .md files.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* Default behaviour (0.14.2+): recursive crawl of EVERYTHING under
|
|
5
|
+
* `docs/`, including top-level loose markdown files and every subdirectory.
|
|
6
|
+
* The earlier hardcoded allowlist of four subdirs (`build/`, `contracts/`,
|
|
7
|
+
* `philosophy/`, `guides/`) silently excluded strategic content that lives
|
|
8
|
+
* elsewhere — top-level docs like `THE-NUOS-BUILD-METHOD.md`,
|
|
9
|
+
* `MVP-NEXT-STEPS.md`, `PHASE-4-SIGNOFF.md`, and subdirs like
|
|
10
|
+
* `architecture/`, `integration/`, `investor/`, `wireframes/`. Those are
|
|
11
|
+
* load-bearing strategic context and need to be searchable.
|
|
12
|
+
*
|
|
13
|
+
* Skipped:
|
|
14
|
+
* - `_index.md` (derived; adds noise to ranking)
|
|
15
|
+
* - `*-template.md` (templates, not real content)
|
|
16
|
+
* - `done/`, `archive/`, `superseded/` subdirs (opt-in via includeArchived)
|
|
17
|
+
* - `node_modules/`, `.git/`, `.nuos-catalogue/`
|
|
18
|
+
* - non-`.md` files (binaries, .excalidraw, etc.)
|
|
11
19
|
*/
|
|
12
20
|
export interface CrawlOptions {
|
|
13
21
|
catalogueRoot: string;
|
package/dist/indexer/crawl.js
CHANGED
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Crawler — walks the
|
|
2
|
+
* Crawler — walks the catalogue's `docs/` tree picking up indexable .md files.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* Default behaviour (0.14.2+): recursive crawl of EVERYTHING under
|
|
5
|
+
* `docs/`, including top-level loose markdown files and every subdirectory.
|
|
6
|
+
* The earlier hardcoded allowlist of four subdirs (`build/`, `contracts/`,
|
|
7
|
+
* `philosophy/`, `guides/`) silently excluded strategic content that lives
|
|
8
|
+
* elsewhere — top-level docs like `THE-NUOS-BUILD-METHOD.md`,
|
|
9
|
+
* `MVP-NEXT-STEPS.md`, `PHASE-4-SIGNOFF.md`, and subdirs like
|
|
10
|
+
* `architecture/`, `integration/`, `investor/`, `wireframes/`. Those are
|
|
11
|
+
* load-bearing strategic context and need to be searchable.
|
|
12
|
+
*
|
|
13
|
+
* Skipped:
|
|
14
|
+
* - `_index.md` (derived; adds noise to ranking)
|
|
15
|
+
* - `*-template.md` (templates, not real content)
|
|
16
|
+
* - `done/`, `archive/`, `superseded/` subdirs (opt-in via includeArchived)
|
|
17
|
+
* - `node_modules/`, `.git/`, `.nuos-catalogue/`
|
|
18
|
+
* - non-`.md` files (binaries, .excalidraw, etc.)
|
|
11
19
|
*/
|
|
12
20
|
import { readdir, stat } from 'node:fs/promises';
|
|
13
21
|
import path from 'node:path';
|
|
14
|
-
const
|
|
15
|
-
|
|
22
|
+
const SKIPPED_DIR_NAMES = new Set([
|
|
23
|
+
'node_modules',
|
|
24
|
+
'.git',
|
|
25
|
+
'.nuos-catalogue',
|
|
26
|
+
'.opencode',
|
|
27
|
+
'.claude',
|
|
28
|
+
'.agents',
|
|
29
|
+
]);
|
|
16
30
|
const ARCHIVED_DIR_NAMES = new Set(['done', 'archive', 'superseded']);
|
|
17
31
|
const INDEX_FILENAMES = new Set(['_index.md']);
|
|
32
|
+
function isTemplateName(name) {
|
|
33
|
+
// Catches `001-template-simple.md`, `module-template.md`, `_template.md`,
|
|
34
|
+
// `99-template-power-user-operational-plan.md`, etc.
|
|
35
|
+
return /template\.md$/.test(name) || name === '_template.md';
|
|
36
|
+
}
|
|
18
37
|
export async function crawl(options) {
|
|
19
38
|
const out = [];
|
|
20
|
-
|
|
21
|
-
const start = path.join(options.catalogueRoot, top);
|
|
22
|
-
if (await exists(start)) {
|
|
23
|
-
await walkDir(start, options, out);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
39
|
+
await walkDir(options.catalogueRoot, options, out);
|
|
26
40
|
return out.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
27
41
|
}
|
|
28
42
|
async function walkDir(dir, options, out) {
|
|
@@ -49,6 +63,8 @@ async function walkDir(dir, options, out) {
|
|
|
49
63
|
continue;
|
|
50
64
|
if (INDEX_FILENAMES.has(entry.name))
|
|
51
65
|
continue;
|
|
66
|
+
if (isTemplateName(entry.name))
|
|
67
|
+
continue;
|
|
52
68
|
out.push({
|
|
53
69
|
absolutePath: full,
|
|
54
70
|
relativePath: path.relative(options.catalogueRoot, full),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nusoft/nuos-build-catalogue",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"description": "NuOS build-catalogue tooling: semantic search (WU 110) + migration runner that lifts markdown artefacts into JSON-backed workflow records (WU 111, Phase G).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|