create-thally-docs 0.10.58 → 0.10.59

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.
@@ -13,6 +13,7 @@ import { tmpdir } from "os";
13
13
  import { dirname, isAbsolute, join as join3, relative as relative2, resolve, sep } from "path";
14
14
  import {
15
15
  cloneGitHubRepository,
16
+ hydrateRemoteApiSpecs,
16
17
  migrateRepository,
17
18
  migrateUrl,
18
19
  parseGitHubRepositoryUrl,
@@ -157,13 +158,34 @@ function forEachNonFencedLine(content, visit) {
157
158
  if (!fence) visit(line, index + 1);
158
159
  }
159
160
  }
161
+ function renderedHeadingText(source) {
162
+ let visible = "";
163
+ let inTag = false;
164
+ let quote = null;
165
+ for (let index = 0; index < source.length; index++) {
166
+ const character = source[index];
167
+ if (!inTag) {
168
+ if (character === "<") inTag = true;
169
+ else visible += character;
170
+ continue;
171
+ }
172
+ if (quote) {
173
+ if (character === quote && source[index - 1] !== "\\") quote = null;
174
+ } else if (character === '"' || character === "'") {
175
+ quote = character;
176
+ } else if (character === ">") {
177
+ inTag = false;
178
+ }
179
+ }
180
+ return visible;
181
+ }
160
182
  function extractHeadingAnchors(content) {
161
183
  const anchors = /* @__PURE__ */ new Set();
162
184
  const occurrences = /* @__PURE__ */ new Map();
163
185
  forEachNonFencedLine(content, (line) => {
164
186
  const heading = /^ {0,3}#{1,6}\s+(.+?)\s*#*\s*$/.exec(line);
165
187
  if (heading) {
166
- const base = slugify(heading[1]);
188
+ const base = slugify(renderedHeadingText(heading[1]));
167
189
  const occurrence = (occurrences.get(base) ?? 0) + 1;
168
190
  occurrences.set(base, occurrence);
169
191
  anchors.add(occurrence === 1 ? base : `${base}-${occurrence}`);
@@ -555,7 +577,8 @@ async function discoverMigration(options) {
555
577
  docsDir: options.docsDir ?? (source.docsDir || void 0),
556
578
  platform: options.platform
557
579
  });
558
- return cloneWarnings.length > 0 ? { ...bundle, warnings: [...cloneWarnings, ...bundle.warnings] } : bundle;
580
+ const hydrated = await hydrateRemoteApiSpecs(bundle, options.fetcher);
581
+ return cloneWarnings.length > 0 ? { ...hydrated, warnings: [...cloneWarnings, ...hydrated.warnings] } : hydrated;
559
582
  } finally {
560
583
  rmSync(temporaryRoot, { recursive: true, force: true });
561
584
  }
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  migrateDocs,
4
4
  parseFrontmatter,
5
5
  runCheck
6
- } from "./chunk-4QEJMOQX.js";
6
+ } from "./chunk-GAO436L2.js";
7
7
  import {
8
8
  logo,
9
9
  scaffold,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  migrateDocs
4
- } from "../chunk-4QEJMOQX.js";
4
+ } from "../chunk-GAO436L2.js";
5
5
  import "../chunk-THI3OQRL.js";
6
6
  import "../chunk-XYRM4GAT.js";
7
7
  import "../chunk-YGOSZNE7.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-thally-docs",
3
- "version": "0.10.58",
3
+ "version": "0.10.59",
4
4
  "description": "Scaffold an open-source Thally docs site for people, search engines, and AI tools.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -44,8 +44,8 @@
44
44
  "dependencies": {
45
45
  "@anthropic-ai/sdk": "^0.36.0",
46
46
  "@inquirer/prompts": "^7.0.0",
47
- "@thallylabs/core": "0.2.8",
48
- "@thallylabs/migrate": "0.2.9",
47
+ "@thallylabs/core": "0.2.9",
48
+ "@thallylabs/migrate": "0.2.10",
49
49
  "p-limit": "^6.1.0",
50
50
  "tar": "^7.5.22",
51
51
  "yaml": "^2.6.0"