create-thally-docs 0.10.78 → 0.10.80
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 +24 -0
- package/dist/{chunk-VGGE6JIL.js → chunk-DIX4EUI4.js} +33 -354
- package/dist/chunk-J7255UQA.js +34 -0
- package/dist/chunk-KDLP27DS.js +87 -0
- package/dist/chunk-KGKSB3PU.js +222 -0
- package/dist/chunk-L2YCVQBR.js +249 -0
- package/dist/chunk-VGE5L66Z.js +349 -0
- package/dist/{chunk-W5WQ2V7P.js → chunk-WWIATVAD.js} +14 -4
- package/dist/index.js +134 -50
- package/dist/migrate/index.d.ts +3 -1
- package/dist/migrate/index.js +6 -3
- package/dist/migration-worker.d.ts +2 -0
- package/dist/migration-worker.js +37 -0
- package/dist/scaffold.d.ts +6 -0
- package/dist/scaffold.js +4 -2
- package/dist/starter-update.js +2 -1
- package/dist/terminal.d.ts +75 -0
- package/dist/terminal.js +17 -0
- package/package.json +8 -3
- package/dist/chunk-QLMRRNLL.js +0 -162
package/dist/index.js
CHANGED
|
@@ -1,27 +1,88 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
migrateDocs
|
|
3
|
+
migrateDocs
|
|
4
|
+
} from "./chunk-VGE5L66Z.js";
|
|
5
|
+
import {
|
|
4
6
|
parseFrontmatter,
|
|
5
7
|
runCheck
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DIX4EUI4.js";
|
|
9
|
+
import "./chunk-KDLP27DS.js";
|
|
7
10
|
import {
|
|
8
11
|
logo,
|
|
12
|
+
previewCommand,
|
|
9
13
|
scaffold,
|
|
10
14
|
slugify,
|
|
11
15
|
success
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KGKSB3PU.js";
|
|
13
17
|
import "./chunk-4VKRBJV2.js";
|
|
14
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-J7255UQA.js";
|
|
19
|
+
import "./chunk-WWIATVAD.js";
|
|
15
20
|
import "./chunk-RI56XMBI.js";
|
|
16
21
|
import "./chunk-BP2REWTO.js";
|
|
22
|
+
import {
|
|
23
|
+
acquireTerminalAccent,
|
|
24
|
+
formatHelp,
|
|
25
|
+
terminal
|
|
26
|
+
} from "./chunk-L2YCVQBR.js";
|
|
17
27
|
|
|
18
28
|
// src/index.ts
|
|
19
29
|
import { existsSync as existsSync2, readdirSync } from "fs";
|
|
20
30
|
import { createRequire } from "module";
|
|
21
31
|
import { resolve as resolve2 } from "path";
|
|
22
32
|
|
|
33
|
+
// src/interactive-prompts.ts
|
|
34
|
+
import * as clack from "@clack/prompts";
|
|
35
|
+
import * as inquirer from "@inquirer/prompts";
|
|
36
|
+
async function withAccent(prompt) {
|
|
37
|
+
const release = acquireTerminalAccent();
|
|
38
|
+
try {
|
|
39
|
+
return await prompt();
|
|
40
|
+
} finally {
|
|
41
|
+
release();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function answerOrCancel(answer) {
|
|
45
|
+
if (clack.isCancel(answer)) {
|
|
46
|
+
throw Object.assign(new Error("Cancelled."), { exitCode: 130 });
|
|
47
|
+
}
|
|
48
|
+
return answer;
|
|
49
|
+
}
|
|
50
|
+
async function input2(options) {
|
|
51
|
+
if (!terminal.isRich) return inquirer.input(options);
|
|
52
|
+
return answerOrCancel(await withAccent(() => clack.text({
|
|
53
|
+
message: options.message.trim(),
|
|
54
|
+
initialValue: options.default,
|
|
55
|
+
// Clack otherwise finalizes an empty answer as undefined. Optional fields
|
|
56
|
+
// such as the repository URL must keep Inquirer's empty-string contract.
|
|
57
|
+
defaultValue: "",
|
|
58
|
+
validate: options.validate ? (value) => {
|
|
59
|
+
const result = options.validate(value);
|
|
60
|
+
return result === true ? void 0 : result;
|
|
61
|
+
} : void 0
|
|
62
|
+
})));
|
|
63
|
+
}
|
|
64
|
+
async function select3(options) {
|
|
65
|
+
if (!terminal.isRich) return inquirer.select(options);
|
|
66
|
+
return answerOrCancel(await withAccent(() => clack.select({
|
|
67
|
+
message: options.message.trim(),
|
|
68
|
+
initialValue: options.default,
|
|
69
|
+
// Every existing choice has a label, including nonprimitive values such as
|
|
70
|
+
// undefined; Clack's conditional Option type cannot infer this for a generic.
|
|
71
|
+
options: options.choices.map((choice) => ({
|
|
72
|
+
label: choice.name,
|
|
73
|
+
value: choice.value
|
|
74
|
+
}))
|
|
75
|
+
})));
|
|
76
|
+
}
|
|
77
|
+
async function confirm3(options) {
|
|
78
|
+
if (!terminal.isRich) return inquirer.confirm(options);
|
|
79
|
+
return answerOrCancel(await withAccent(() => clack.confirm({
|
|
80
|
+
message: options.message.trim(),
|
|
81
|
+
initialValue: options.default ?? true
|
|
82
|
+
})));
|
|
83
|
+
}
|
|
84
|
+
|
|
23
85
|
// src/prompts.ts
|
|
24
|
-
import { confirm, input, select } from "@inquirer/prompts";
|
|
25
86
|
import { basename, resolve } from "path";
|
|
26
87
|
import {
|
|
27
88
|
parseGitHubRepositoryUrl
|
|
@@ -43,7 +104,7 @@ async function gatherMigrationPlatform(value, useDefaults) {
|
|
|
43
104
|
);
|
|
44
105
|
return void 0;
|
|
45
106
|
}
|
|
46
|
-
return
|
|
107
|
+
return select3({
|
|
47
108
|
message: " Which platform currently hosts these docs?",
|
|
48
109
|
choices: [
|
|
49
110
|
{ name: "Mintlify", value: "mintlify" },
|
|
@@ -69,7 +130,7 @@ async function resolveAutoDetectedMigrationSource(sourceUrl, shouldPrompt) {
|
|
|
69
130
|
console.warn(`
|
|
70
131
|
\u26A0 ${LIVE_URL_MIGRATION_WARNING}`);
|
|
71
132
|
if (!shouldPrompt) return sourceUrl;
|
|
72
|
-
const sourcePreference = await
|
|
133
|
+
const sourcePreference = await select3({
|
|
73
134
|
message: " Which source should Thally migrate?",
|
|
74
135
|
choices: [
|
|
75
136
|
{
|
|
@@ -84,14 +145,14 @@ async function resolveAutoDetectedMigrationSource(sourceUrl, shouldPrompt) {
|
|
|
84
145
|
default: "github"
|
|
85
146
|
});
|
|
86
147
|
if (sourcePreference === "github") {
|
|
87
|
-
const repositoryUrl = await
|
|
148
|
+
const repositoryUrl = await input2({
|
|
88
149
|
message: " GitHub repository URL:",
|
|
89
150
|
validate: validateGitHubRepositorySource
|
|
90
151
|
});
|
|
91
152
|
parseGitHubRepositoryUrl(repositoryUrl);
|
|
92
153
|
return repositoryUrl;
|
|
93
154
|
}
|
|
94
|
-
const hasAcceptedAlignment = await
|
|
155
|
+
const hasAcceptedAlignment = await confirm3({
|
|
95
156
|
message: " Continue knowing the migration may need manual alignment, using the Thally MCP afterward if needed?",
|
|
96
157
|
default: false
|
|
97
158
|
});
|
|
@@ -119,23 +180,23 @@ async function gatherAnswers(dirArg, useDefaults, installPreference) {
|
|
|
119
180
|
} else if (useDefaults) {
|
|
120
181
|
projectDir = resolve("my-docs");
|
|
121
182
|
} else {
|
|
122
|
-
const dirName = await
|
|
183
|
+
const dirName = await input2({
|
|
123
184
|
message: " Project directory:",
|
|
124
185
|
default: "my-docs"
|
|
125
186
|
});
|
|
126
187
|
projectDir = resolve(dirName);
|
|
127
188
|
}
|
|
128
189
|
const defaultName = basename(projectDir).replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
129
|
-
const projectName = useDefaults ? defaultName : await
|
|
190
|
+
const projectName = useDefaults ? defaultName : await input2({
|
|
130
191
|
message: " Project name:",
|
|
131
192
|
default: defaultName
|
|
132
193
|
});
|
|
133
194
|
const defaultDesc = `Documentation for ${projectName}.`;
|
|
134
|
-
const description = useDefaults ? defaultDesc : await
|
|
195
|
+
const description = useDefaults ? defaultDesc : await input2({
|
|
135
196
|
message: " Description:",
|
|
136
197
|
default: defaultDesc
|
|
137
198
|
});
|
|
138
|
-
const brandPreset = useDefaults ? "primary" : await
|
|
199
|
+
const brandPreset = useDefaults ? "primary" : await select3({
|
|
139
200
|
message: " Brand preset:",
|
|
140
201
|
choices: [
|
|
141
202
|
{ name: "primary", value: "primary" },
|
|
@@ -143,18 +204,18 @@ async function gatherAnswers(dirArg, useDefaults, installPreference) {
|
|
|
143
204
|
],
|
|
144
205
|
default: "primary"
|
|
145
206
|
});
|
|
146
|
-
const repoUrl = useDefaults ? "" : await
|
|
207
|
+
const repoUrl = useDefaults ? "" : await input2({
|
|
147
208
|
message: " GitHub repo URL (optional):",
|
|
148
209
|
default: ""
|
|
149
210
|
});
|
|
150
211
|
let trackRepos;
|
|
151
212
|
if (!useDefaults) {
|
|
152
|
-
const enableTrack = await
|
|
213
|
+
const enableTrack = await input2({
|
|
153
214
|
message: " Keep your docs in sync automatically with Thally Track? When a PR merges in a repo you list,\n the docs agent drafts the doc updates as a PR for you to review. (y/N):",
|
|
154
215
|
default: "N"
|
|
155
216
|
});
|
|
156
217
|
if (enableTrack.trim().toLowerCase() === "y") {
|
|
157
|
-
const reposInput = await
|
|
218
|
+
const reposInput = await input2({
|
|
158
219
|
message: " Which repo(s) should Thally watch? (comma-separated owner/repo or GitHub URLs, e.g. acme/api,acme/web):",
|
|
159
220
|
default: ""
|
|
160
221
|
});
|
|
@@ -165,7 +226,7 @@ async function gatherAnswers(dirArg, useDefaults, installPreference) {
|
|
|
165
226
|
}
|
|
166
227
|
let doInstall = installPreference ?? false;
|
|
167
228
|
if (!useDefaults && installPreference === void 0) {
|
|
168
|
-
const shouldInstall = await
|
|
229
|
+
const shouldInstall = await input2({
|
|
169
230
|
message: " Install dependencies now? (y/N):",
|
|
170
231
|
default: "N"
|
|
171
232
|
});
|
|
@@ -173,12 +234,12 @@ async function gatherAnswers(dirArg, useDefaults, installPreference) {
|
|
|
173
234
|
}
|
|
174
235
|
let i18nLocales;
|
|
175
236
|
if (!useDefaults) {
|
|
176
|
-
const enableI18n = await
|
|
237
|
+
const enableI18n = await input2({
|
|
177
238
|
message: " Add another documentation language? (y/N):",
|
|
178
239
|
default: "N"
|
|
179
240
|
});
|
|
180
241
|
if (enableI18n.toLowerCase() === "y") {
|
|
181
|
-
const localesInput = await
|
|
242
|
+
const localesInput = await input2({
|
|
182
243
|
message: " Which additional locales? (comma-separated codes, e.g. fr,de,ja):",
|
|
183
244
|
default: "fr"
|
|
184
245
|
});
|
|
@@ -207,12 +268,12 @@ async function gatherAnswers(dirArg, useDefaults, installPreference) {
|
|
|
207
268
|
}
|
|
208
269
|
|
|
209
270
|
// src/index.ts
|
|
210
|
-
import { parseGitHubRepositoryUrl as parseGitHubRepositoryUrl2 } from "@thallylabs/migrate";
|
|
271
|
+
import { parseGitHubRepositoryUrl as parseGitHubRepositoryUrl2, parseSourceRefFlags } from "@thallylabs/migrate";
|
|
211
272
|
|
|
212
273
|
// src/translate.ts
|
|
213
274
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
214
275
|
import { join, dirname } from "path";
|
|
215
|
-
import { input as
|
|
276
|
+
import { input as input3 } from "@inquirer/prompts";
|
|
216
277
|
import Anthropic from "@anthropic-ai/sdk";
|
|
217
278
|
import pLimit from "p-limit";
|
|
218
279
|
|
|
@@ -480,7 +541,7 @@ ${examples.maskedSource}`
|
|
|
480
541
|
}
|
|
481
542
|
]
|
|
482
543
|
});
|
|
483
|
-
const
|
|
544
|
+
const text2 = message.content.filter((block) => block.type === "text").map((block) => block.text).join("");
|
|
484
545
|
const values = [];
|
|
485
546
|
for (let start = 0; start < examples.segments.length; start += 32) {
|
|
486
547
|
const sourceSegments = examples.segments.slice(start, start + 32);
|
|
@@ -498,7 +559,7 @@ ${examples.maskedSource}`
|
|
|
498
559
|
}
|
|
499
560
|
values.push(...translated);
|
|
500
561
|
}
|
|
501
|
-
return examples.restore(
|
|
562
|
+
return examples.restore(text2.trim(), values);
|
|
502
563
|
}
|
|
503
564
|
async function runTranslateCommand(locale, pages, force, apiKey, model, yes, projectDir) {
|
|
504
565
|
const config = readDocsJson(projectDir);
|
|
@@ -569,11 +630,11 @@ async function runTranslateCommand(locale, pages, force, apiKey, model, yes, pro
|
|
|
569
630
|
}
|
|
570
631
|
console.log("");
|
|
571
632
|
if (!yes) {
|
|
572
|
-
const
|
|
633
|
+
const confirm4 = await input3({
|
|
573
634
|
message: " Proceed? (Y/n):",
|
|
574
635
|
default: "Y"
|
|
575
636
|
});
|
|
576
|
-
if (
|
|
637
|
+
if (confirm4.toLowerCase() === "n") {
|
|
577
638
|
console.log("\n Aborted.");
|
|
578
639
|
return;
|
|
579
640
|
}
|
|
@@ -629,10 +690,11 @@ var valueFlags = /* @__PURE__ */ new Set([
|
|
|
629
690
|
"--max-pages",
|
|
630
691
|
"--model",
|
|
631
692
|
"--pages",
|
|
632
|
-
"--platform"
|
|
693
|
+
"--platform",
|
|
694
|
+
"--source-ref"
|
|
633
695
|
]);
|
|
634
696
|
var commandFlags = {
|
|
635
|
-
scaffold: /* @__PURE__ */ new Set(["--help", "-h", "--yes", "-y", "--install", "--no-install"]),
|
|
697
|
+
scaffold: /* @__PURE__ */ new Set(["--help", "-h", "--yes", "-y", "--install", "--no-install", "--verbose"]),
|
|
636
698
|
migrate: /* @__PURE__ */ new Set([
|
|
637
699
|
"--help",
|
|
638
700
|
"-h",
|
|
@@ -643,6 +705,8 @@ var commandFlags = {
|
|
|
643
705
|
"--max-pages",
|
|
644
706
|
"--platform",
|
|
645
707
|
"--skip-validation",
|
|
708
|
+
"--source-ref",
|
|
709
|
+
"--verbose",
|
|
646
710
|
"--yes",
|
|
647
711
|
"-y"
|
|
648
712
|
]),
|
|
@@ -673,6 +737,7 @@ Scaffold options:
|
|
|
673
737
|
-y, --yes Accept defaults and skip interactive prompts
|
|
674
738
|
--install Install project dependencies after scaffolding
|
|
675
739
|
--no-install Skip dependency installation without prompting
|
|
740
|
+
--verbose Show detailed installation and Git output
|
|
676
741
|
-h, --help Show this help
|
|
677
742
|
-v, -V, --version Show the installed version
|
|
678
743
|
|
|
@@ -689,7 +754,10 @@ Options:
|
|
|
689
754
|
--docs-dir <path> Override the detected documentation directory
|
|
690
755
|
--max-pages <count> Limit a public URL crawl to 1-1000 pages
|
|
691
756
|
--platform <name> Use mintlify, docusaurus, fern, or auto
|
|
757
|
+
--source-ref <owner/repo>=<path>
|
|
758
|
+
Import a Mintlify sourceRef repository under <path> (repeatable)
|
|
692
759
|
--skip-validation Import only; explicitly skip content and build verification
|
|
760
|
+
--verbose Show detailed installation, build, and Git output
|
|
693
761
|
--api-key <key> Anthropic API key for non-Markdown conversion
|
|
694
762
|
-y, --yes Skip interactive prompts
|
|
695
763
|
-h, --help Show this help
|
|
@@ -743,7 +811,7 @@ function resolveCommand(subcommand) {
|
|
|
743
811
|
return "scaffold";
|
|
744
812
|
}
|
|
745
813
|
function printHelp(command) {
|
|
746
|
-
console.log(command === "scaffold" ? mainHelp : commandHelp[command]);
|
|
814
|
+
console.log(formatHelp(command === "scaffold" ? mainHelp : commandHelp[command]));
|
|
747
815
|
}
|
|
748
816
|
function validateFlags(command) {
|
|
749
817
|
const unknownFlag = flags.find((flag) => !commandFlags[command].has(flag));
|
|
@@ -772,10 +840,11 @@ async function runMigrateCommand() {
|
|
|
772
840
|
const branch = getFlagValue("--branch");
|
|
773
841
|
const docsDir = getFlagValue("--docs-dir");
|
|
774
842
|
const yes = flags.includes("--yes") || flags.includes("-y");
|
|
843
|
+
terminal.intro("migrate", packageMetadata.version, "Bring your docs to Thally. Built for people and AI tools.");
|
|
775
844
|
const platformFlag = getFlagValue("--platform");
|
|
776
845
|
const platform = await gatherMigrationPlatform(platformFlag, yes);
|
|
777
846
|
if (platform === void 0) {
|
|
778
|
-
const shouldPromptForSource = platformFlag === void 0 && !yes;
|
|
847
|
+
const shouldPromptForSource = platformFlag === void 0 && !yes && Boolean(process.stdin.isTTY);
|
|
779
848
|
sourceUrl = await resolveAutoDetectedMigrationSource(sourceUrl, shouldPromptForSource);
|
|
780
849
|
source = new URL(sourceUrl);
|
|
781
850
|
}
|
|
@@ -797,15 +866,25 @@ async function runMigrateCommand() {
|
|
|
797
866
|
console.error("\n \u274C --max-pages must be an integer between 1 and 1000.");
|
|
798
867
|
process.exit(1);
|
|
799
868
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
869
|
+
terminal.detail("Source", `${source.origin}${source.pathname}`);
|
|
870
|
+
terminal.detail("Output", projectDir);
|
|
871
|
+
if (branch) terminal.detail("Branch", branch);
|
|
872
|
+
if (docsDir) terminal.detail("Docs dir", docsDir);
|
|
873
|
+
terminal.detail("Platform", platform ?? "auto-detect");
|
|
874
|
+
let sourceRefs;
|
|
875
|
+
try {
|
|
876
|
+
const sourceRefValues = args.flatMap((arg, index) => {
|
|
877
|
+
if (arg !== "--source-ref") return [];
|
|
878
|
+
const value = args[index + 1];
|
|
879
|
+
if (value === void 0 || value.startsWith("-")) throw new Error("--source-ref needs a value such as owner/repo=client-sdks/typescript.");
|
|
880
|
+
return [value];
|
|
881
|
+
});
|
|
882
|
+
sourceRefs = parseSourceRefFlags(sourceRefValues);
|
|
883
|
+
} catch (err) {
|
|
884
|
+
console.error(`
|
|
885
|
+
\u274C ${err instanceof Error ? err.message : err}`);
|
|
886
|
+
process.exit(1);
|
|
887
|
+
}
|
|
809
888
|
const result = await migrateDocs({
|
|
810
889
|
sourceUrl,
|
|
811
890
|
projectDir,
|
|
@@ -816,16 +895,23 @@ async function runMigrateCommand() {
|
|
|
816
895
|
maxPages,
|
|
817
896
|
platform,
|
|
818
897
|
yes,
|
|
819
|
-
skipValidation: flags.includes("--skip-validation")
|
|
898
|
+
skipValidation: flags.includes("--skip-validation"),
|
|
899
|
+
sourceRefs
|
|
820
900
|
});
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
901
|
+
terminal.section("Migration summary", [
|
|
902
|
+
`${result.pagesWritten} pages \xB7 ${result.assetsWritten} assets \xB7 ${result.platform}`,
|
|
903
|
+
`Content: ${result.validation.content} \xB7 Build: ${result.validation.build}`,
|
|
904
|
+
`${result.warnings.length} migration warning(s)`
|
|
905
|
+
]);
|
|
906
|
+
terminal.detail("Output", result.projectDir);
|
|
907
|
+
terminal.detail("Report", result.reportPath);
|
|
908
|
+
const isVerified = result.validation.content === "passed" && result.validation.build === "passed";
|
|
909
|
+
terminal.outro(isVerified ? "Migration verified. Review any warnings before publishing." : "Import saved. Validation is incomplete; review the migration report.");
|
|
910
|
+
terminal.nextAction("Preview locally", previewCommand(result.projectDir, !existsSync2(resolve2(result.projectDir, "node_modules"))));
|
|
825
911
|
if (result.validation.content === "failed" || result.validation.build === "failed") process.exitCode = 1;
|
|
826
912
|
}
|
|
827
913
|
async function runScaffoldCommand() {
|
|
828
|
-
const useDefaults = flags.includes("--yes") || flags.includes("-y");
|
|
914
|
+
const useDefaults = flags.includes("--yes") || flags.includes("-y") || !process.stdin.isTTY;
|
|
829
915
|
const installPreference = flags.includes("--install") ? true : flags.includes("--no-install") ? false : void 0;
|
|
830
916
|
const dirArg = positional[0];
|
|
831
917
|
if (dirArg) {
|
|
@@ -873,9 +959,7 @@ async function runTranslateSubcommand() {
|
|
|
873
959
|
const model = getFlagValue("--model") ?? "claude-sonnet-4-6";
|
|
874
960
|
const yes = flags.includes("--yes") || flags.includes("-y");
|
|
875
961
|
const projectDir = resolve2(positional[1] ?? ".");
|
|
876
|
-
|
|
877
|
-
console.log(" \u{1F310} Thally Translate");
|
|
878
|
-
console.log("");
|
|
962
|
+
terminal.intro("translate", packageMetadata.version, "Make your docs available in another language.");
|
|
879
963
|
await runTranslateCommand(locale, pages, force, apiKey, model, yes, projectDir);
|
|
880
964
|
}
|
|
881
965
|
async function main() {
|
|
@@ -897,11 +981,11 @@ async function main() {
|
|
|
897
981
|
} else if (subcommand === "translate") {
|
|
898
982
|
await runTranslateSubcommand();
|
|
899
983
|
} else {
|
|
900
|
-
logo();
|
|
984
|
+
logo(packageMetadata.version);
|
|
901
985
|
await runScaffoldCommand();
|
|
902
986
|
}
|
|
903
987
|
}
|
|
904
988
|
main().catch((err) => {
|
|
905
|
-
|
|
906
|
-
process.exit(1);
|
|
989
|
+
terminal.error(err.message);
|
|
990
|
+
process.exit(err.exitCode ?? 1);
|
|
907
991
|
});
|
package/dist/migrate/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MigrationPlatform, MigrationFetcher, MigrationBundle, MigrationWarning } from '@thallylabs/migrate';
|
|
1
|
+
import { MigrationPlatform, MigrationFetcher, SourceRefMapping, MigrationBundle, MigrationWarning } from '@thallylabs/migrate';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Validate authored navigation and links against the routes the runtime can
|
|
@@ -42,6 +42,8 @@ interface MigrateOptions {
|
|
|
42
42
|
fetcher?: MigrationFetcher;
|
|
43
43
|
/** Explicitly opt out of content/build gates; the report remains unverified. */
|
|
44
44
|
skipValidation?: boolean;
|
|
45
|
+
/** Mintlify `sourceRef` repositories to import, from `--source-ref owner/repo=<path>`. */
|
|
46
|
+
sourceRefs?: Array<SourceRefMapping>;
|
|
45
47
|
}
|
|
46
48
|
interface MigrateResult {
|
|
47
49
|
pagesWritten: number;
|
package/dist/migrate/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
migrateDocs
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-VGE5L66Z.js";
|
|
5
|
+
import "../chunk-KDLP27DS.js";
|
|
6
|
+
import "../chunk-KGKSB3PU.js";
|
|
6
7
|
import "../chunk-4VKRBJV2.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-J7255UQA.js";
|
|
9
|
+
import "../chunk-WWIATVAD.js";
|
|
8
10
|
import "../chunk-RI56XMBI.js";
|
|
9
11
|
import "../chunk-BP2REWTO.js";
|
|
12
|
+
import "../chunk-L2YCVQBR.js";
|
|
10
13
|
export {
|
|
11
14
|
migrateDocs
|
|
12
15
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
runCheck
|
|
4
|
+
} from "./chunk-DIX4EUI4.js";
|
|
5
|
+
import "./chunk-KDLP27DS.js";
|
|
6
|
+
import "./chunk-J7255UQA.js";
|
|
7
|
+
|
|
8
|
+
// src/migration-worker.ts
|
|
9
|
+
import { parentPort, workerData } from "worker_threads";
|
|
10
|
+
import { migrateRepository, migrateUrl, renderMigrationFiles } from "@thallylabs/migrate";
|
|
11
|
+
async function execute(request) {
|
|
12
|
+
if (request.operation === "check") {
|
|
13
|
+
let diagnostics = [];
|
|
14
|
+
const code = await runCheck(request.args[0], {
|
|
15
|
+
fix: false,
|
|
16
|
+
ci: true,
|
|
17
|
+
silent: true,
|
|
18
|
+
onIssues: (issues) => {
|
|
19
|
+
diagnostics = issues;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return { code, diagnostics };
|
|
23
|
+
}
|
|
24
|
+
if (request.operation === "repository") {
|
|
25
|
+
return migrateRepository(...request.args);
|
|
26
|
+
}
|
|
27
|
+
if (request.operation === "url") {
|
|
28
|
+
return migrateUrl(...request.args);
|
|
29
|
+
}
|
|
30
|
+
return renderMigrationFiles(...request.args);
|
|
31
|
+
}
|
|
32
|
+
if (!parentPort) throw new Error("Migration worker requires a parent thread.");
|
|
33
|
+
try {
|
|
34
|
+
parentPort.postMessage({ result: await execute(workerData) });
|
|
35
|
+
} catch (error) {
|
|
36
|
+
parentPort.postMessage({ error: error instanceof Error ? error : new Error(String(error)) });
|
|
37
|
+
}
|
package/dist/scaffold.d.ts
CHANGED
|
@@ -27,6 +27,11 @@ interface StarterArchiveEntryMetadata {
|
|
|
27
27
|
*/
|
|
28
28
|
declare function validateStarterArchiveEntry(archivePath: string, entry: StarterArchiveEntryMetadata, archiveRoot?: string): void;
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Create a customer-owned project from the immutable starter release. Progress
|
|
32
|
+
* wraps each operation without changing the starter contents or owner fields.
|
|
33
|
+
*/
|
|
34
|
+
|
|
30
35
|
interface ScaffoldOptions {
|
|
31
36
|
projectDir: string;
|
|
32
37
|
projectName: string;
|
|
@@ -54,6 +59,7 @@ interface ScaffoldOptions {
|
|
|
54
59
|
interface ScaffoldResult {
|
|
55
60
|
projectDir: string;
|
|
56
61
|
}
|
|
62
|
+
/** Download, personalize, and optionally install a new documentation project. */
|
|
57
63
|
declare function scaffold(options: ScaffoldOptions): Promise<ScaffoldResult>;
|
|
58
64
|
|
|
59
65
|
export { STARTER_ARCHIVE_ROOT, STARTER_COMMIT_SHA, STARTER_REPOSITORY, type ScaffoldOptions, type ScaffoldResult, scaffold, validateStarterArchiveEntry };
|
package/dist/scaffold.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
scaffold
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KGKSB3PU.js";
|
|
5
5
|
import "./chunk-4VKRBJV2.js";
|
|
6
|
+
import "./chunk-J7255UQA.js";
|
|
6
7
|
import {
|
|
7
8
|
STARTER_ARCHIVE_ROOT,
|
|
8
9
|
STARTER_COMMIT_SHA,
|
|
9
10
|
STARTER_REPOSITORY,
|
|
10
11
|
validateStarterArchiveEntry
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WWIATVAD.js";
|
|
12
13
|
import "./chunk-RI56XMBI.js";
|
|
13
14
|
import {
|
|
14
15
|
STABLE_SCAFFOLD_RELEASE
|
|
15
16
|
} from "./chunk-BP2REWTO.js";
|
|
17
|
+
import "./chunk-L2YCVQBR.js";
|
|
16
18
|
export {
|
|
17
19
|
STABLE_SCAFFOLD_RELEASE,
|
|
18
20
|
STARTER_ARCHIVE_ROOT,
|
package/dist/starter-update.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
downloadStarter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WWIATVAD.js";
|
|
5
5
|
import {
|
|
6
6
|
applyStarterRuntimeSyncPlan,
|
|
7
7
|
mergeStarterOwnershipContracts,
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
STABLE_SCAFFOLD_RELEASE,
|
|
15
15
|
SUPPORTED_SCAFFOLD_RELEASES
|
|
16
16
|
} from "./chunk-BP2REWTO.js";
|
|
17
|
+
import "./chunk-L2YCVQBR.js";
|
|
17
18
|
|
|
18
19
|
// src/starter-update.ts
|
|
19
20
|
import {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/** Product-wide promise; command subtitles describe the immediate task. */
|
|
2
|
+
declare const PRODUCT_TAGLINE = "Product knowledge, kept in step with your code.";
|
|
3
|
+
/**
|
|
4
|
+
* Scope Clack's fixed cyan/magenta/green UI colors to our olive accent.
|
|
5
|
+
* Clack 0.11 has no theme option. Adapt only its color SGRs while a prompt or
|
|
6
|
+
* spinner owns stdout; preserve text, cursor controls, warnings, and errors.
|
|
7
|
+
* Release restores the original writer, including on cancellation or failure.
|
|
8
|
+
*/
|
|
9
|
+
declare function acquireTerminalAccent(): () => void;
|
|
10
|
+
interface TerminalOptions {
|
|
11
|
+
stdout?: Pick<NodeJS.WriteStream, 'write' | 'isTTY' | 'columns'>;
|
|
12
|
+
stderr?: Pick<NodeJS.WriteStream, 'write' | 'isTTY' | 'columns'>;
|
|
13
|
+
env?: NodeJS.ProcessEnv;
|
|
14
|
+
argv?: Array<string>;
|
|
15
|
+
}
|
|
16
|
+
/** Remove terminal escape sequences and non-printing controls from source text. */
|
|
17
|
+
declare function terminalText(value: string): string;
|
|
18
|
+
/** Create a terminal renderer; injected streams support deterministic transcripts. */
|
|
19
|
+
declare function createTerminal(options?: TerminalOptions): {
|
|
20
|
+
/** Whether interactive decoration is supported by the current output. */
|
|
21
|
+
readonly isRich: boolean;
|
|
22
|
+
/** Whether the caller requested detailed subprocess output. */
|
|
23
|
+
readonly isVerbose: boolean;
|
|
24
|
+
/** Introduce a command with the responsive wordmark and its immediate task. */
|
|
25
|
+
intro(command: string, version?: string, subtitle?: string): void;
|
|
26
|
+
/** Display a source, destination, or result with a consistent label. */
|
|
27
|
+
detail(label: string, value: string): void;
|
|
28
|
+
/** Display a neutral fact without implying success. */
|
|
29
|
+
info(message: string): void;
|
|
30
|
+
/** Record a completed operation in the retained transcript. */
|
|
31
|
+
success(message: string): void;
|
|
32
|
+
/** Keep warnings visible on stderr even when successful task logs are quiet. */
|
|
33
|
+
warn(message: string): void;
|
|
34
|
+
/** Keep errors visible on stderr and separate from machine-readable stdout. */
|
|
35
|
+
error(message: string): void;
|
|
36
|
+
/** Group next steps or results without a fixed-width box. */
|
|
37
|
+
section(title: string, lines: Array<string>): void;
|
|
38
|
+
/** Make the next action prominent while retaining one intact shell command. */
|
|
39
|
+
nextAction(title: string, command: string): void;
|
|
40
|
+
/** Finish a command without masking warnings or incomplete validation. */
|
|
41
|
+
outro(message: string): void;
|
|
42
|
+
/** Render progress, retain the outcome, and always release Clack's cursor hooks. */
|
|
43
|
+
step<T>(label: string, action: (update: (message: string) => void) => T | Promise<T>, completedLabel?: string): Promise<T>;
|
|
44
|
+
};
|
|
45
|
+
/** Process-local shared presentation; importing it never writes output. */
|
|
46
|
+
declare const terminal: {
|
|
47
|
+
/** Whether interactive decoration is supported by the current output. */
|
|
48
|
+
readonly isRich: boolean;
|
|
49
|
+
/** Whether the caller requested detailed subprocess output. */
|
|
50
|
+
readonly isVerbose: boolean;
|
|
51
|
+
/** Introduce a command with the responsive wordmark and its immediate task. */
|
|
52
|
+
intro(command: string, version?: string, subtitle?: string): void;
|
|
53
|
+
/** Display a source, destination, or result with a consistent label. */
|
|
54
|
+
detail(label: string, value: string): void;
|
|
55
|
+
/** Display a neutral fact without implying success. */
|
|
56
|
+
info(message: string): void;
|
|
57
|
+
/** Record a completed operation in the retained transcript. */
|
|
58
|
+
success(message: string): void;
|
|
59
|
+
/** Keep warnings visible on stderr even when successful task logs are quiet. */
|
|
60
|
+
warn(message: string): void;
|
|
61
|
+
/** Keep errors visible on stderr and separate from machine-readable stdout. */
|
|
62
|
+
error(message: string): void;
|
|
63
|
+
/** Group next steps or results without a fixed-width box. */
|
|
64
|
+
section(title: string, lines: Array<string>): void;
|
|
65
|
+
/** Make the next action prominent while retaining one intact shell command. */
|
|
66
|
+
nextAction(title: string, command: string): void;
|
|
67
|
+
/** Finish a command without masking warnings or incomplete validation. */
|
|
68
|
+
outro(message: string): void;
|
|
69
|
+
/** Render progress, retain the outcome, and always release Clack's cursor hooks. */
|
|
70
|
+
step<T>(label: string, action: (update: (message: string) => void) => T | Promise<T>, completedLabel?: string): Promise<T>;
|
|
71
|
+
};
|
|
72
|
+
/** Highlight help headings only on capable terminals; preserve plain help bytes otherwise. */
|
|
73
|
+
declare function formatHelp(text: string): string;
|
|
74
|
+
|
|
75
|
+
export { PRODUCT_TAGLINE, type TerminalOptions, acquireTerminalAccent, createTerminal, formatHelp, terminal, terminalText };
|
package/dist/terminal.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
PRODUCT_TAGLINE,
|
|
4
|
+
acquireTerminalAccent,
|
|
5
|
+
createTerminal,
|
|
6
|
+
formatHelp,
|
|
7
|
+
terminal,
|
|
8
|
+
terminalText
|
|
9
|
+
} from "./chunk-L2YCVQBR.js";
|
|
10
|
+
export {
|
|
11
|
+
PRODUCT_TAGLINE,
|
|
12
|
+
acquireTerminalAccent,
|
|
13
|
+
createTerminal,
|
|
14
|
+
formatHelp,
|
|
15
|
+
terminal,
|
|
16
|
+
terminalText
|
|
17
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-thally-docs",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.80",
|
|
4
4
|
"description": "Scaffold an open-source Thally docs site for people, search engines, and AI tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -29,7 +29,11 @@
|
|
|
29
29
|
"import": "./dist/starter-update.js"
|
|
30
30
|
},
|
|
31
31
|
"./migrate": "./dist/migrate/index.js",
|
|
32
|
-
"./package.json": "./package.json"
|
|
32
|
+
"./package.json": "./package.json",
|
|
33
|
+
"./terminal": {
|
|
34
|
+
"types": "./dist/terminal.d.ts",
|
|
35
|
+
"import": "./dist/terminal.js"
|
|
36
|
+
}
|
|
33
37
|
},
|
|
34
38
|
"files": [
|
|
35
39
|
"dist",
|
|
@@ -43,9 +47,10 @@
|
|
|
43
47
|
},
|
|
44
48
|
"dependencies": {
|
|
45
49
|
"@anthropic-ai/sdk": "^0.36.0",
|
|
50
|
+
"@clack/prompts": "^0.11.0",
|
|
46
51
|
"@inquirer/prompts": "^7.0.0",
|
|
47
52
|
"@thallylabs/core": "0.2.11",
|
|
48
|
-
"@thallylabs/migrate": "0.2.
|
|
53
|
+
"@thallylabs/migrate": "0.2.25",
|
|
49
54
|
"p-limit": "^6.1.0",
|
|
50
55
|
"remark-mdx": "^3.1.1",
|
|
51
56
|
"remark-parse": "^11.0.0",
|