create-thally-docs 0.10.25 → 0.10.27

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 CHANGED
@@ -1,10 +1,9 @@
1
1
  # create-thally-docs
2
2
 
3
- Scaffold the first customer-facing knowledge surface in a
4
- [Thally](https://github.com/thallylabs/thally) product-knowledge pipeline. The
5
- result is an open documentation site that serves every page to humans as
6
- polished HTML and to agents as structured JSON, JSON-LD, and Markdown from the
7
- same URL.
3
+ Scaffold an open-source [Thally](https://github.com/thallylabs/thally) docs
4
+ site for people, search engines, and AI tools. The result keeps your source in
5
+ Git and publishes each page as HTML, Markdown, structured JSON, JSON-LD, and
6
+ agent discovery files.
8
7
 
9
8
  ## Quick start
10
9
 
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readStarterReleaseManifest
4
- } from "./chunk-2F7CFF5V.js";
4
+ } from "./chunk-X7V4HXPA.js";
5
5
  import {
6
6
  STABLE_SCAFFOLD_RELEASE
7
- } from "./chunk-T7N455IR.js";
7
+ } from "./chunk-XQWVBAUZ.js";
8
8
 
9
9
  // src/download.ts
10
10
  import { Readable, Transform, pipeline } from "stream";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-ORUAMPNF.js";
6
6
  import {
7
7
  downloadStarter
8
- } from "./chunk-FW64PO5S.js";
8
+ } from "./chunk-2XIP4T44.js";
9
9
 
10
10
  // src/scaffold.ts
11
11
  import { existsSync, mkdirSync, readdirSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  STABLE_SCAFFOLD_RELEASE
4
- } from "./chunk-T7N455IR.js";
4
+ } from "./chunk-XQWVBAUZ.js";
5
5
 
6
6
  // src/starter-sync.ts
7
7
  import { createHash } from "crypto";
@@ -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-02.814f1f54.cef2fe3b",
6
+ id: "2026-09-05.ad6e0a75.efeedb73",
7
7
  source: {
8
8
  repository: "thallylabs/starter",
9
- commitSha: "814f1f54f5a53a129c552941124d81307dc8b048",
10
- treeSha: "03f37cd5e7c504f92b517f8b4194f4b9294ed4bf",
11
- archiveUrl: "https://codeload.github.com/thallylabs/starter/tar.gz/814f1f54f5a53a129c552941124d81307dc8b048",
9
+ commitSha: "ad6e0a7570624c33facf19a429a0576208729a4d",
10
+ treeSha: "5c6fa85e771e764c03ac289dc3077a825479e51c",
11
+ archiveUrl: "https://codeload.github.com/thallylabs/starter/tar.gz/ad6e0a7570624c33facf19a429a0576208729a4d",
12
12
  manifestPath: "starter-release.json",
13
- manifestSha256: "46804f563d00e02783c0aa963e5c3dcf932ae11134e2c8f2843faff4fb4e1047"
13
+ manifestSha256: "57b068c4987357716774aaef5c079950aa20195f463556c5b938781eaed5dfeb"
14
14
  },
15
15
  runtime: {
16
16
  repository: "thallylabs/thally",
17
- commitSha: "cef2fe3b11895cf6ce60d17177ac97200f975507",
18
- treeSha: "0edafb000e3fb477f0f2eac93e262b4c07127851",
17
+ commitSha: "efeedb730981391650010c5d4db15374afb15150",
18
+ treeSha: "271d3f01d894e650c8d89296c0b57faa1ad4ee27",
19
19
  contentSource: "assets",
20
20
  identityContractVersion: 1
21
21
  },
@@ -24,6 +24,46 @@ 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-05.b8a69237.2c73d8c3",
30
+ source: {
31
+ repository: "thallylabs/starter",
32
+ commitSha: "b8a6923724e7dd7d16e75b50531e097a47e77682",
33
+ treeSha: "4e0426e44b4216e02e3c7dd50a543a7d1b94e959",
34
+ archiveUrl: "https://codeload.github.com/thallylabs/starter/tar.gz/b8a6923724e7dd7d16e75b50531e097a47e77682",
35
+ manifestPath: "starter-release.json",
36
+ manifestSha256: "e1e7962089419a0de68d513c7153555cf388338b25261ed978332abd581b8589"
37
+ },
38
+ runtime: {
39
+ repository: "thallylabs/thally",
40
+ commitSha: "2c73d8c312b290598a4335ef77c9e04d8cbe1b4b",
41
+ treeSha: "930c8a4974300649852769e4fcdab2798c4b3b79",
42
+ contentSource: "assets",
43
+ identityContractVersion: 1
44
+ },
45
+ starterVersion: 2
46
+ },
47
+ {
48
+ schemaVersion: 1,
49
+ id: "2026-09-02.814f1f54.cef2fe3b",
50
+ source: {
51
+ repository: "thallylabs/starter",
52
+ commitSha: "814f1f54f5a53a129c552941124d81307dc8b048",
53
+ treeSha: "03f37cd5e7c504f92b517f8b4194f4b9294ed4bf",
54
+ archiveUrl: "https://codeload.github.com/thallylabs/starter/tar.gz/814f1f54f5a53a129c552941124d81307dc8b048",
55
+ manifestPath: "starter-release.json",
56
+ manifestSha256: "46804f563d00e02783c0aa963e5c3dcf932ae11134e2c8f2843faff4fb4e1047"
57
+ },
58
+ runtime: {
59
+ repository: "thallylabs/thally",
60
+ commitSha: "cef2fe3b11895cf6ce60d17177ac97200f975507",
61
+ treeSha: "0edafb000e3fb477f0f2eac93e262b4c07127851",
62
+ contentSource: "assets",
63
+ identityContractVersion: 1
64
+ },
65
+ starterVersion: 2
66
+ },
27
67
  {
28
68
  schemaVersion: 1,
29
69
  id: "2026-09-02.e29a6539.b84cbc74",
@@ -3,7 +3,7 @@ import {
3
3
  initGit,
4
4
  installDeps,
5
5
  scaffold
6
- } from "./chunk-SBSYWX2B.js";
6
+ } from "./chunk-DFHL6TNL.js";
7
7
 
8
8
  // src/migrate/index.ts
9
9
  import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "fs";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  migrateDocs
4
- } from "./chunk-GS2JMPTA.js";
4
+ } from "./chunk-XX7RAC2Q.js";
5
5
  import {
6
6
  logo,
7
7
  readDocsJson,
@@ -9,14 +9,15 @@ import {
9
9
  slugify,
10
10
  success,
11
11
  writeDocsJson
12
- } from "./chunk-SBSYWX2B.js";
12
+ } from "./chunk-DFHL6TNL.js";
13
13
  import "./chunk-ORUAMPNF.js";
14
- import "./chunk-FW64PO5S.js";
15
- import "./chunk-2F7CFF5V.js";
16
- import "./chunk-T7N455IR.js";
14
+ import "./chunk-2XIP4T44.js";
15
+ import "./chunk-X7V4HXPA.js";
16
+ import "./chunk-XQWVBAUZ.js";
17
17
 
18
18
  // src/index.ts
19
19
  import { existsSync as existsSync3, readdirSync as readdirSync2 } from "fs";
20
+ import { createRequire } from "module";
20
21
  import { resolve as resolve2 } from "path";
21
22
 
22
23
  // src/prompts.ts
@@ -204,19 +205,30 @@ import { join, extname, relative } from "path";
204
205
  import { execFileSync } from "child_process";
205
206
 
206
207
  // src/frontmatter.ts
207
- import matter from "gray-matter";
208
- var FRONTMATTER_OPTIONS = {
209
- engines: {
210
- javascript: () => ({}),
211
- js: () => ({})
212
- }
213
- };
208
+ import { parse as parseYaml } from "yaml";
214
209
  function parseFrontmatter(raw) {
215
- return matter(raw, FRONTMATTER_OPTIONS);
210
+ const source = raw.charCodeAt(0) === 65279 ? raw.slice(1) : raw;
211
+ const opening = /^---([^\r\n]*)\r?\n/.exec(source);
212
+ if (!opening || opening[1].startsWith("-")) return { content: source, data: {} };
213
+ const language = opening[1].trim().toLowerCase();
214
+ const remainder = source.slice(opening[0].length);
215
+ const closing = /^---[ \t]*\r?$/m.exec(remainder);
216
+ const matter = closing ? remainder.slice(0, closing.index) : remainder;
217
+ let content = closing ? remainder.slice(closing.index + closing[0].length) : "";
218
+ if (content.startsWith("\r\n")) content = content.slice(2);
219
+ else if (content.startsWith("\n")) content = content.slice(1);
220
+ if (matter.trim() === "" || !["", "yaml", "yml"].includes(language)) {
221
+ return { content, data: {} };
222
+ }
223
+ const parsed = parseYaml(matter);
224
+ return {
225
+ content,
226
+ data: parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {}
227
+ };
216
228
  }
217
229
 
218
230
  // src/check.ts
219
- import { parse as parseYaml } from "yaml";
231
+ import { parse as parseYaml2 } from "yaml";
220
232
  function gitLocal(projectDir, args2) {
221
233
  try {
222
234
  const out = execFileSync("git", args2, { cwd: projectDir, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] });
@@ -366,7 +378,7 @@ function validateOpenApi(projectDir, source, issues) {
366
378
  let spec;
367
379
  try {
368
380
  const raw = readFileSync(specPath, "utf8");
369
- spec = source.endsWith(".json") ? JSON.parse(raw) : parseYaml(raw);
381
+ spec = source.endsWith(".json") ? JSON.parse(raw) : parseYaml2(raw);
370
382
  } catch (err) {
371
383
  issues.push({ severity: "error", message: `OpenAPI spec is not valid ${source.endsWith(".json") ? "JSON" : "YAML"}: ${err.message}`, file: source });
372
384
  return;
@@ -427,7 +439,7 @@ async function runCheck(projectDir, options) {
427
439
  if (tab.href.startsWith("/")) navPageIds.add(tab.href.slice(1) || "introduction");
428
440
  continue;
429
441
  }
430
- if (tab.api && tab.api.navigation !== false) continue;
442
+ if (tab.api && tab.api.navigation !== false && !hasNavigationNodes) continue;
431
443
  if (!hasNavigationNodes) {
432
444
  issues.push({ severity: "error", message: `Tab "${tab.tab}" has no groups and no href \u2014 it will render empty` });
433
445
  continue;
@@ -792,8 +804,10 @@ async function runTranslateCommand(locale, pages, force, apiKey, model, yes, pro
792
804
  }
793
805
 
794
806
  // src/index.ts
807
+ var packageMetadata = createRequire(import.meta.url)("../package.json");
795
808
  var args = process.argv.slice(2);
796
809
  var flags = args.filter((a) => a.startsWith("-"));
810
+ var versionArguments = /* @__PURE__ */ new Set(["--version", "-v", "-V", "version"]);
797
811
  var valueFlags = /* @__PURE__ */ new Set([
798
812
  "--api-key",
799
813
  "--branch",
@@ -805,6 +819,92 @@ var valueFlags = /* @__PURE__ */ new Set([
805
819
  "--pages",
806
820
  "--platform"
807
821
  ]);
822
+ var commandFlags = {
823
+ scaffold: /* @__PURE__ */ new Set(["--help", "-h", "--yes", "-y", "--install", "--no-install"]),
824
+ migrate: /* @__PURE__ */ new Set([
825
+ "--help",
826
+ "-h",
827
+ "--api-key",
828
+ "--branch",
829
+ "--docs-dir",
830
+ "--into",
831
+ "--max-pages",
832
+ "--platform",
833
+ "--yes",
834
+ "-y"
835
+ ]),
836
+ check: /* @__PURE__ */ new Set(["--help", "-h", "--fix", "--ci", "--external", "--drift"]),
837
+ translate: /* @__PURE__ */ new Set([
838
+ "--help",
839
+ "-h",
840
+ "--api-key",
841
+ "--force",
842
+ "--locale",
843
+ "--model",
844
+ "--pages",
845
+ "--yes",
846
+ "-y"
847
+ ])
848
+ };
849
+ var mainHelp = `
850
+ Usage:
851
+ create-thally-docs [project-dir] [options]
852
+ create-thally-docs <command> [arguments] [options]
853
+
854
+ Commands:
855
+ migrate <source> [output-dir] Import an existing documentation project
856
+ check [project-dir] Validate content and navigation
857
+ translate [project-dir] Translate documentation into another locale
858
+
859
+ Scaffold options:
860
+ -y, --yes Accept defaults and skip interactive prompts
861
+ --install Install project dependencies after scaffolding
862
+ --no-install Skip dependency installation without prompting
863
+ -h, --help Show this help
864
+ -v, -V, --version Show the installed version
865
+
866
+ Run create-thally-docs <command> --help for command-specific options.
867
+ `;
868
+ var commandHelp = {
869
+ migrate: `
870
+ Usage:
871
+ create-thally-docs migrate <github-or-docs-url> [output-dir] [options]
872
+
873
+ Options:
874
+ --into <dir> Migrate into an existing Thally project
875
+ --branch <name> Override the detected Git branch
876
+ --docs-dir <path> Override the detected documentation directory
877
+ --max-pages <count> Limit a public URL crawl to 1-1000 pages
878
+ --platform <name> Use mintlify, docusaurus, or auto
879
+ --api-key <key> Anthropic API key for non-Markdown conversion
880
+ -y, --yes Skip interactive prompts
881
+ -h, --help Show this help
882
+ `,
883
+ check: `
884
+ Usage:
885
+ create-thally-docs check [project-dir] [options]
886
+
887
+ Options:
888
+ --fix Add orphan pages to navigation when possible
889
+ --ci Use CI-oriented validation behavior
890
+ --external Check external links
891
+ --drift Check documentation provenance and freshness
892
+ -h, --help Show this help
893
+ `,
894
+ translate: `
895
+ Usage:
896
+ create-thally-docs translate [project-dir] --locale <code> [options]
897
+
898
+ Options:
899
+ --locale <code> Target locale code (required)
900
+ --pages <ids> Translate only the comma-separated page IDs
901
+ --force Overwrite existing translations
902
+ --api-key <key> Anthropic API key (defaults to ANTHROPIC_API_KEY)
903
+ --model <id> Claude model to use
904
+ -y, --yes Skip the confirmation prompt
905
+ -h, --help Show this help
906
+ `
907
+ };
808
908
  var positional = [];
809
909
  for (let i = 0; i < args.length; i++) {
810
910
  if (args[i].startsWith("-")) {
@@ -822,6 +922,21 @@ function getFlagValue(flag) {
822
922
  }
823
923
  return void 0;
824
924
  }
925
+ function resolveCommand(subcommand) {
926
+ if (subcommand === "migrate" || subcommand === "check" || subcommand === "translate") {
927
+ return subcommand;
928
+ }
929
+ return "scaffold";
930
+ }
931
+ function printHelp(command) {
932
+ console.log(command === "scaffold" ? mainHelp : commandHelp[command]);
933
+ }
934
+ function validateFlags(command) {
935
+ const unknownFlag = flags.find((flag) => !commandFlags[command].has(flag));
936
+ if (!unknownFlag) return;
937
+ const helpCommand = command === "scaffold" ? "" : ` ${command}`;
938
+ throw new Error(`Unknown option "${unknownFlag}". Run create-thally-docs${helpCommand} --help for usage.`);
939
+ }
825
940
  async function runMigrateCommand() {
826
941
  let sourceUrl = positional[1];
827
942
  if (!sourceUrl) {
@@ -944,7 +1059,17 @@ async function runTranslateSubcommand() {
944
1059
  await runTranslateCommand(locale, pages, force, apiKey, model, yes, projectDir);
945
1060
  }
946
1061
  async function main() {
1062
+ if (args.length === 1 && versionArguments.has(args[0])) {
1063
+ console.log(packageMetadata.version);
1064
+ return;
1065
+ }
947
1066
  const subcommand = positional[0];
1067
+ const command = resolveCommand(subcommand);
1068
+ if (flags.includes("--help") || flags.includes("-h")) {
1069
+ printHelp(command);
1070
+ return;
1071
+ }
1072
+ validateFlags(command);
948
1073
  if (subcommand === "migrate") {
949
1074
  await runMigrateCommand();
950
1075
  } else if (subcommand === "check") {
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  migrateDocs
4
- } from "../chunk-GS2JMPTA.js";
5
- import "../chunk-SBSYWX2B.js";
4
+ } from "../chunk-XX7RAC2Q.js";
5
+ import "../chunk-DFHL6TNL.js";
6
6
  import "../chunk-ORUAMPNF.js";
7
- import "../chunk-FW64PO5S.js";
8
- import "../chunk-2F7CFF5V.js";
9
- import "../chunk-T7N455IR.js";
7
+ import "../chunk-2XIP4T44.js";
8
+ import "../chunk-X7V4HXPA.js";
9
+ import "../chunk-XQWVBAUZ.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-T7N455IR.js";
6
+ } from "./chunk-XQWVBAUZ.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-SBSYWX2B.js";
4
+ } from "./chunk-DFHL6TNL.js";
5
5
  import "./chunk-ORUAMPNF.js";
6
6
  import {
7
7
  STARTER_ARCHIVE_ROOT,
8
8
  STARTER_COMMIT_SHA,
9
9
  STARTER_REPOSITORY,
10
10
  validateStarterArchiveEntry
11
- } from "./chunk-FW64PO5S.js";
12
- import "./chunk-2F7CFF5V.js";
11
+ } from "./chunk-2XIP4T44.js";
12
+ import "./chunk-X7V4HXPA.js";
13
13
  import {
14
14
  STABLE_SCAFFOLD_RELEASE
15
- } from "./chunk-T7N455IR.js";
15
+ } from "./chunk-XQWVBAUZ.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-2F7CFF5V.js";
12
- import "./chunk-T7N455IR.js";
11
+ } from "./chunk-X7V4HXPA.js";
12
+ import "./chunk-XQWVBAUZ.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-FW64PO5S.js";
4
+ } from "./chunk-2XIP4T44.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-2F7CFF5V.js";
12
+ } from "./chunk-X7V4HXPA.js";
13
13
  import {
14
14
  STABLE_SCAFFOLD_RELEASE,
15
15
  SUPPORTED_SCAFFOLD_RELEASES
16
- } from "./chunk-T7N455IR.js";
16
+ } from "./chunk-XQWVBAUZ.js";
17
17
 
18
18
  // src/starter-update.ts
19
19
  import {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-thally-docs",
3
- "version": "0.10.25",
4
- "description": "Scaffold the first documentation surface in a Thally product-knowledge pipeline.",
3
+ "version": "0.10.27",
4
+ "description": "Scaffold an open-source Thally docs site for people, search engines, and AI tools.",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=18"
@@ -44,8 +44,7 @@
44
44
  "dependencies": {
45
45
  "@anthropic-ai/sdk": "^0.36.0",
46
46
  "@inquirer/prompts": "^7.0.0",
47
- "@thallylabs/migrate": "0.2.3",
48
- "gray-matter": "^4.0.3",
47
+ "@thallylabs/migrate": "0.2.4",
49
48
  "p-limit": "^6.1.0",
50
49
  "tar": "^7.5.22",
51
50
  "yaml": "^2.6.0"
@@ -64,7 +63,7 @@
64
63
  "mdx",
65
64
  "nextjs",
66
65
  "ai",
67
- "agent-native",
66
+ "product-knowledge",
68
67
  "mcp",
69
68
  "create"
70
69
  ],