create-thally-docs 0.10.56 → 0.10.58

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.
@@ -5,7 +5,7 @@ import {
5
5
  readDocsJson,
6
6
  scaffold,
7
7
  writeDocsJson
8
- } from "./chunk-45YUNA3U.js";
8
+ } from "./chunk-THI3OQRL.js";
9
9
 
10
10
  // src/migrate/index.ts
11
11
  import { existsSync as existsSync3, mkdirSync, mkdtempSync, readFileSync as readFileSync3, rmSync, writeFileSync } from "fs";
@@ -144,6 +144,7 @@ function addOrphanToNav(projectDir, pageId) {
144
144
  }
145
145
  }
146
146
  var EXPLICIT_ID_ATTRIBUTE = /\bid=(?:"([^"]*)"|'([^']*)'|\{["']([^"'}]*)["']\})/g;
147
+ var NAMED_ANCHOR = /<a\b[^>]*\bname=(?:"([^"]*)"|'([^']*)')/g;
147
148
  function forEachNonFencedLine(content, visit) {
148
149
  let fence;
149
150
  for (const [index, line] of content.split("\n").entries()) {
@@ -158,16 +159,33 @@ function forEachNonFencedLine(content, visit) {
158
159
  }
159
160
  function extractHeadingAnchors(content) {
160
161
  const anchors = /* @__PURE__ */ new Set();
162
+ const occurrences = /* @__PURE__ */ new Map();
161
163
  forEachNonFencedLine(content, (line) => {
162
164
  const heading = /^ {0,3}#{1,6}\s+(.+?)\s*#*\s*$/.exec(line);
163
- if (heading) anchors.add(slugify(heading[1]));
165
+ if (heading) {
166
+ const base = slugify(heading[1]);
167
+ const occurrence = (occurrences.get(base) ?? 0) + 1;
168
+ occurrences.set(base, occurrence);
169
+ anchors.add(occurrence === 1 ? base : `${base}-${occurrence}`);
170
+ }
164
171
  for (const idMatch of line.matchAll(EXPLICIT_ID_ATTRIBUTE)) {
165
172
  const id = idMatch[1] ?? idMatch[2] ?? idMatch[3];
166
173
  if (id) anchors.add(id);
167
174
  }
175
+ for (const nameMatch of line.matchAll(NAMED_ANCHOR)) {
176
+ const name = nameMatch[1] ?? nameMatch[2];
177
+ if (name) anchors.add(name);
178
+ }
168
179
  });
169
180
  return anchors;
170
181
  }
182
+ function decodedFragment(fragment) {
183
+ try {
184
+ return decodeURIComponent(fragment);
185
+ } catch {
186
+ return fragment;
187
+ }
188
+ }
171
189
  function extractLinks(content) {
172
190
  const links = [];
173
191
  forEachNonFencedLine(content, (rawLine, lineNumber) => {
@@ -308,15 +326,6 @@ async function runCheck(projectDir, options) {
308
326
  for (const filePath of allFiles) {
309
327
  const rel = filePath.slice(contentDir.length + 1).replace(/\.mdx$/, "").replace(/\\/g, "/");
310
328
  const pageId = rel.endsWith("/index") ? rel.slice(0, -6) : rel;
311
- const { navPageId } = localizedPage(pageId, secondaryLocales);
312
- if (!navPageIds.has(navPageId)) {
313
- if (fix) {
314
- addOrphanToNav(projectDir, pageId);
315
- fixedOrphans.push(pageId);
316
- } else {
317
- issues.push({ severity: "warning", message: `"${pageId}" is not in docs.json nav (orphan)`, file: relative(projectDir, filePath) });
318
- }
319
- }
320
329
  let data = {};
321
330
  let content = "";
322
331
  let lineOffset = 0;
@@ -330,6 +339,15 @@ async function runCheck(projectDir, options) {
330
339
  issues.push({ severity: "error", message: `Could not parse frontmatter`, file: relative(projectDir, filePath) });
331
340
  continue;
332
341
  }
342
+ const { navPageId } = localizedPage(pageId, secondaryLocales);
343
+ if (!navPageIds.has(navPageId) && data.hidden !== true) {
344
+ if (fix) {
345
+ addOrphanToNav(projectDir, pageId);
346
+ fixedOrphans.push(pageId);
347
+ } else {
348
+ issues.push({ severity: "warning", message: `"${pageId}" is not in docs.json nav (orphan)`, file: relative(projectDir, filePath) });
349
+ }
350
+ }
333
351
  const rel2 = relative(projectDir, filePath);
334
352
  if (!data.title) issues.push({ severity: "warning", message: `Missing "title" in frontmatter`, file: rel2 });
335
353
  if (!data.description) issues.push({ severity: "warning", message: `Missing "description" in frontmatter`, file: rel2 });
@@ -360,7 +378,7 @@ async function runCheck(projectDir, options) {
360
378
  if (/^(https?:|mailto:|tel:)/i.test(target)) continue;
361
379
  if (target.startsWith("#")) {
362
380
  const anchor2 = target.slice(1);
363
- if (anchor2 && !anchors.has(anchor2)) {
381
+ if (anchor2 && !anchors.has(decodedFragment(anchor2))) {
364
382
  issues.push({ severity: "warning", message: `Broken anchor: "${target}" not found on this page`, file, line });
365
383
  }
366
384
  continue;
@@ -374,7 +392,7 @@ async function runCheck(projectDir, options) {
374
392
  if (!cycle && (isGeneratedApiPath || path.startsWith("/_next") || /\.[a-z0-9]+$/i.test(path))) continue;
375
393
  if (cycle || !validPaths.has(path)) {
376
394
  issues.push({ severity: "error", message: `Broken link: "${target}" \u2014 no page at "${path}"`, file, line });
377
- } else if (anchor && !anchorsByPath.get(path)?.has(anchor)) {
395
+ } else if (anchor && !anchorsByPath.get(path)?.has(decodedFragment(anchor))) {
378
396
  issues.push({ severity: "warning", message: `Broken anchor: "${target}" \u2014 no heading "#${anchor}" on that page`, file, line });
379
397
  }
380
398
  }
@@ -566,6 +584,9 @@ async function migrateDocs(options) {
566
584
  if (!options.into) {
567
585
  const starterConfig = readExistingConfig(projectDir);
568
586
  if (starterConfig?.markdown) bundle.docsConfig.markdown = starterConfig.markdown;
587
+ if (!bundle.docsConfig.navbar?.primary) {
588
+ bundle.docsConfig.navbar = { ...bundle.docsConfig.navbar, primary: null };
589
+ }
569
590
  bundle.docsConfig.i18n ??= { defaultLocale: "en", locales: [{ code: "en", label: "English" }] };
570
591
  }
571
592
  const rendered = renderMigrationFiles(bundle, {
@@ -3,19 +3,19 @@
3
3
  // src/stable-scaffold-release.json
4
4
  var stable_scaffold_release_default = {
5
5
  schemaVersion: 1,
6
- id: "2026-09-28.9729212c.c28e9504",
6
+ id: "2026-09-28.b0612637.c9291377",
7
7
  source: {
8
8
  repository: "thallylabs/starter",
9
- commitSha: "9729212cf5ab3455cfdbd2fc284da5d4126068f9",
10
- treeSha: "7f28f290c40006051a02de92672ec936b898105f",
11
- archiveUrl: "https://codeload.github.com/thallylabs/starter/tar.gz/9729212cf5ab3455cfdbd2fc284da5d4126068f9",
9
+ commitSha: "b0612637313a7e032742f9be2a6fae2c886420bf",
10
+ treeSha: "a241556c50f660d6e3c7c864886b645c480d2044",
11
+ archiveUrl: "https://codeload.github.com/thallylabs/starter/tar.gz/b0612637313a7e032742f9be2a6fae2c886420bf",
12
12
  manifestPath: "starter-release.json",
13
- manifestSha256: "0ced61d232d02d73ec46ed9334ce660b2bfdad6cc0476ab93f6e64b90eac6214"
13
+ manifestSha256: "41ec28a22acb6ec724af665a8db7879ea03ea2b4aa7d74828d7ad7afb9f41c06"
14
14
  },
15
15
  runtime: {
16
16
  repository: "thallylabs/thally",
17
- commitSha: "c28e9504e473e6ee3e502f35968568b821479520",
18
- treeSha: "8fbb42629955add398fdfd9236999d3e3f3cd29a",
17
+ commitSha: "c929137720df1226134f560773a43accbbcdb742",
18
+ treeSha: "e2958e51167e6cbf2873658ddd50f776cf2c4ab1",
19
19
  contentSource: "assets",
20
20
  identityContractVersion: 1
21
21
  },
@@ -24,6 +24,26 @@ var stable_scaffold_release_default = {
24
24
 
25
25
  // src/previous-scaffold-releases.json
26
26
  var previous_scaffold_releases_default = [
27
+ {
28
+ schemaVersion: 1,
29
+ id: "2026-09-28.9729212c.c28e9504",
30
+ source: {
31
+ repository: "thallylabs/starter",
32
+ commitSha: "9729212cf5ab3455cfdbd2fc284da5d4126068f9",
33
+ treeSha: "7f28f290c40006051a02de92672ec936b898105f",
34
+ archiveUrl: "https://codeload.github.com/thallylabs/starter/tar.gz/9729212cf5ab3455cfdbd2fc284da5d4126068f9",
35
+ manifestPath: "starter-release.json",
36
+ manifestSha256: "0ced61d232d02d73ec46ed9334ce660b2bfdad6cc0476ab93f6e64b90eac6214"
37
+ },
38
+ runtime: {
39
+ repository: "thallylabs/thally",
40
+ commitSha: "c28e9504e473e6ee3e502f35968568b821479520",
41
+ treeSha: "8fbb42629955add398fdfd9236999d3e3f3cd29a",
42
+ contentSource: "assets",
43
+ identityContractVersion: 1
44
+ },
45
+ starterVersion: 2
46
+ },
27
47
  {
28
48
  schemaVersion: 1,
29
49
  id: "2026-09-28.974e64cc.4715564f",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  STABLE_SCAFFOLD_RELEASE
4
- } from "./chunk-YX3DTSOG.js";
4
+ } from "./chunk-HCLGCJOH.js";
5
5
 
6
6
  // src/starter-sync.ts
7
7
  import { createHash } from "crypto";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-XYRM4GAT.js";
6
6
  import {
7
7
  downloadStarter
8
- } from "./chunk-AQACEZTT.js";
8
+ } from "./chunk-YGOSZNE7.js";
9
9
 
10
10
  // src/scaffold.ts
11
11
  import { existsSync, mkdirSync, readdirSync } from "fs";
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readStarterReleaseManifest
4
- } from "./chunk-H57USRQO.js";
4
+ } from "./chunk-JBOFGGFQ.js";
5
5
  import {
6
6
  STABLE_SCAFFOLD_RELEASE
7
- } from "./chunk-YX3DTSOG.js";
7
+ } from "./chunk-HCLGCJOH.js";
8
8
 
9
9
  // src/download.ts
10
10
  import { Readable, Transform, pipeline } from "stream";
package/dist/index.js CHANGED
@@ -3,17 +3,17 @@ import {
3
3
  migrateDocs,
4
4
  parseFrontmatter,
5
5
  runCheck
6
- } from "./chunk-LAJAKDNB.js";
6
+ } from "./chunk-4QEJMOQX.js";
7
7
  import {
8
8
  logo,
9
9
  scaffold,
10
10
  slugify,
11
11
  success
12
- } from "./chunk-45YUNA3U.js";
12
+ } from "./chunk-THI3OQRL.js";
13
13
  import "./chunk-XYRM4GAT.js";
14
- import "./chunk-AQACEZTT.js";
15
- import "./chunk-H57USRQO.js";
16
- import "./chunk-YX3DTSOG.js";
14
+ import "./chunk-YGOSZNE7.js";
15
+ import "./chunk-JBOFGGFQ.js";
16
+ import "./chunk-HCLGCJOH.js";
17
17
 
18
18
  // src/index.ts
19
19
  import { existsSync as existsSync2, readdirSync } from "fs";
@@ -638,6 +638,10 @@ async function runMigrateCommand() {
638
638
  yes,
639
639
  skipValidation: flags.includes("--skip-validation")
640
640
  });
641
+ console.log("");
642
+ console.log(` Migrated docs: ${result.projectDir}`);
643
+ const quotedDir = process.platform === "win32" ? `"${result.projectDir.replace(/"/g, '""')}"` : `'${result.projectDir.replace(/'/g, "'\\''")}'`;
644
+ console.log(` To preview: cd ${quotedDir} && npm run dev`);
641
645
  if (result.validation.content === "failed" || result.validation.build === "failed") process.exitCode = 1;
642
646
  }
643
647
  async function runScaffoldCommand() {
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  migrateDocs
4
- } from "../chunk-LAJAKDNB.js";
5
- import "../chunk-45YUNA3U.js";
4
+ } from "../chunk-4QEJMOQX.js";
5
+ import "../chunk-THI3OQRL.js";
6
6
  import "../chunk-XYRM4GAT.js";
7
- import "../chunk-AQACEZTT.js";
8
- import "../chunk-H57USRQO.js";
9
- import "../chunk-YX3DTSOG.js";
7
+ import "../chunk-YGOSZNE7.js";
8
+ import "../chunk-JBOFGGFQ.js";
9
+ import "../chunk-HCLGCJOH.js";
10
10
  export {
11
11
  migrateDocs
12
12
  };
package/dist/release.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  STABLE_SCAFFOLD_RELEASE,
4
4
  SUPPORTED_SCAFFOLD_RELEASES,
5
5
  isStableScaffoldRelease
6
- } from "./chunk-YX3DTSOG.js";
6
+ } from "./chunk-HCLGCJOH.js";
7
7
  export {
8
8
  STABLE_SCAFFOLD_RELEASE,
9
9
  SUPPORTED_SCAFFOLD_RELEASES,
package/dist/scaffold.js CHANGED
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  scaffold
4
- } from "./chunk-45YUNA3U.js";
4
+ } from "./chunk-THI3OQRL.js";
5
5
  import "./chunk-XYRM4GAT.js";
6
6
  import {
7
7
  STARTER_ARCHIVE_ROOT,
8
8
  STARTER_COMMIT_SHA,
9
9
  STARTER_REPOSITORY,
10
10
  validateStarterArchiveEntry
11
- } from "./chunk-AQACEZTT.js";
12
- import "./chunk-H57USRQO.js";
11
+ } from "./chunk-YGOSZNE7.js";
12
+ import "./chunk-JBOFGGFQ.js";
13
13
  import {
14
14
  STABLE_SCAFFOLD_RELEASE
15
- } from "./chunk-YX3DTSOG.js";
15
+ } from "./chunk-HCLGCJOH.js";
16
16
  export {
17
17
  STABLE_SCAFFOLD_RELEASE,
18
18
  STARTER_ARCHIVE_ROOT,
@@ -8,8 +8,8 @@ import {
8
8
  planStarterRuntimeSync,
9
9
  readStarterReleaseManifest,
10
10
  starterManifestSha256
11
- } from "./chunk-H57USRQO.js";
12
- import "./chunk-YX3DTSOG.js";
11
+ } from "./chunk-JBOFGGFQ.js";
12
+ import "./chunk-HCLGCJOH.js";
13
13
  export {
14
14
  applyStarterRuntimeSyncPlan,
15
15
  classifyStarterPath,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  downloadStarter
4
- } from "./chunk-AQACEZTT.js";
4
+ } from "./chunk-YGOSZNE7.js";
5
5
  import {
6
6
  applyStarterRuntimeSyncPlan,
7
7
  mergeStarterOwnershipContracts,
@@ -9,11 +9,11 @@ import {
9
9
  planStarterRuntimeSync,
10
10
  readStarterReleaseManifest,
11
11
  starterManifestSha256
12
- } from "./chunk-H57USRQO.js";
12
+ } from "./chunk-JBOFGGFQ.js";
13
13
  import {
14
14
  STABLE_SCAFFOLD_RELEASE,
15
15
  SUPPORTED_SCAFFOLD_RELEASES
16
- } from "./chunk-YX3DTSOG.js";
16
+ } from "./chunk-HCLGCJOH.js";
17
17
 
18
18
  // src/starter-update.ts
19
19
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-thally-docs",
3
- "version": "0.10.56",
3
+ "version": "0.10.58",
4
4
  "description": "Scaffold an open-source Thally docs site for people, search engines, and AI tools.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -45,7 +45,7 @@
45
45
  "@anthropic-ai/sdk": "^0.36.0",
46
46
  "@inquirer/prompts": "^7.0.0",
47
47
  "@thallylabs/core": "0.2.8",
48
- "@thallylabs/migrate": "0.2.8",
48
+ "@thallylabs/migrate": "0.2.9",
49
49
  "p-limit": "^6.1.0",
50
50
  "tar": "^7.5.22",
51
51
  "yaml": "^2.6.0"