@series-inc/rundot-3d-engine 0.4.2 → 0.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@series-inc/rundot-3d-engine",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "scripts": {
@@ -10,7 +10,8 @@
10
10
  "lint:fix": "eslint src --fix",
11
11
  "format": "prettier --write .",
12
12
  "format:check": "prettier --check .",
13
- "postinstall": "node scripts/postinstall.mjs"
13
+ "postinstall": "node scripts/postinstall.mjs",
14
+ "gen-docs-index": "node scripts/gen-docs-index.mjs && node scripts/update-docs-index.mjs"
14
15
  },
15
16
  "repository": {
16
17
  "type": "git",
@@ -9,16 +9,25 @@ export function updateDocsIndex(cwd = resolve(import.meta.dirname, "..")) {
9
9
  }
10
10
 
11
11
  const fresh = readFileSync(indexPath, "utf-8").trimEnd();
12
- const label = "Docs Index";
13
- const escaped = label.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
12
+
13
+ // Extract the label from the index line, e.g. [Run.3DEngine Docs Index]|...
14
+ const labelMatch = fresh.match(/^\[([^\]]+)\]/);
15
+ if (!labelMatch) {
16
+ console.warn("Could not parse label from docs-index.txt, skipping");
17
+ return;
18
+ }
19
+ const escaped = labelMatch[1].replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
14
20
  const re = new RegExp(`\\[${escaped}\\][^\\n]*(?:\\n(?![\\[<])[^\\n]*)*`);
15
21
 
16
22
  const targets = ["AGENTS.md", "CLAUDE.md"];
17
23
 
18
24
  for (const file of targets) {
19
25
  const filePath = resolve(cwd, file);
26
+
20
27
  if (!existsSync(filePath)) {
21
- console.log(`${file} not found, skipping`);
28
+ // Create the file with just the index line
29
+ writeFileSync(filePath, fresh + "\n");
30
+ console.log(`Created ${file}`);
22
31
  continue;
23
32
  }
24
33