create-thally-docs 0.10.78 → 0.10.79
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-IZQHRVPV.js +324 -0
- 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-W5WQ2V7P.js → chunk-WWIATVAD.js} +14 -4
- package/dist/index.js +112 -47
- 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 +7 -2
- package/dist/chunk-QLMRRNLL.js +0 -162
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-IZQHRVPV.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.79",
|
|
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,6 +47,7 @@
|
|
|
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
53
|
"@thallylabs/migrate": "0.2.24",
|
package/dist/chunk-QLMRRNLL.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
personalizeStarter,
|
|
4
|
-
updateEnvExample
|
|
5
|
-
} from "./chunk-4VKRBJV2.js";
|
|
6
|
-
import {
|
|
7
|
-
downloadStarter
|
|
8
|
-
} from "./chunk-W5WQ2V7P.js";
|
|
9
|
-
|
|
10
|
-
// src/scaffold.ts
|
|
11
|
-
import { existsSync, mkdirSync, readdirSync } from "fs";
|
|
12
|
-
import { resolve } from "path";
|
|
13
|
-
|
|
14
|
-
// src/docs-json.ts
|
|
15
|
-
import { readFileSync, writeFileSync } from "fs";
|
|
16
|
-
import { join } from "path";
|
|
17
|
-
function readDocsJson(projectDir) {
|
|
18
|
-
const docsPath = join(projectDir, "docs.json");
|
|
19
|
-
const raw = readFileSync(docsPath, "utf8");
|
|
20
|
-
return JSON.parse(raw);
|
|
21
|
-
}
|
|
22
|
-
function writeDocsJson(projectDir, config) {
|
|
23
|
-
const docsPath = join(projectDir, "docs.json");
|
|
24
|
-
writeFileSync(docsPath, JSON.stringify(config, null, 2) + "\n", "utf8");
|
|
25
|
-
}
|
|
26
|
-
function resetTrackingConfig(projectDir) {
|
|
27
|
-
const config = readDocsJson(projectDir);
|
|
28
|
-
if (config.tracking) {
|
|
29
|
-
delete config.tracking;
|
|
30
|
-
writeDocsJson(projectDir, config);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function writeTrackingConfig(projectDir, repos) {
|
|
34
|
-
if (repos.length === 0) return;
|
|
35
|
-
const config = readDocsJson(projectDir);
|
|
36
|
-
config.tracking = { repos: repos.map((r) => ({ owner: r.owner, repo: r.repo, branch: "main" })) };
|
|
37
|
-
writeDocsJson(projectDir, config);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// src/utils.ts
|
|
41
|
-
import { execSync } from "child_process";
|
|
42
|
-
import { basename } from "path";
|
|
43
|
-
function slugify(name) {
|
|
44
|
-
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
45
|
-
}
|
|
46
|
-
function run(cmd, cwd) {
|
|
47
|
-
execSync(cmd, { cwd, stdio: "inherit" });
|
|
48
|
-
}
|
|
49
|
-
function initGit(targetDir) {
|
|
50
|
-
try {
|
|
51
|
-
run("git init", targetDir);
|
|
52
|
-
run("git add -A", targetDir);
|
|
53
|
-
run('git commit -m "Initial commit from create-thally-docs"', targetDir);
|
|
54
|
-
} catch {
|
|
55
|
-
console.log(" \u26A0\uFE0F Could not initialize git (you can do this manually).");
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function installDeps(targetDir) {
|
|
59
|
-
console.log("");
|
|
60
|
-
console.log(" \u{1F4E6} Installing dependencies...");
|
|
61
|
-
console.log("");
|
|
62
|
-
run("npm install --prefer-offline --no-audit --no-fund --progress=false", targetDir);
|
|
63
|
-
}
|
|
64
|
-
function logo() {
|
|
65
|
-
console.log("");
|
|
66
|
-
console.log(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557");
|
|
67
|
-
console.log(" \u2551 \u2551");
|
|
68
|
-
console.log(" \u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557 \u2551");
|
|
69
|
-
console.log(" \u2551 \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2557 \u2588\u2588\u2554\u255D \u2551");
|
|
70
|
-
console.log(" \u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2554\u255D \u2551");
|
|
71
|
-
console.log(" \u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2554\u255D \u2551");
|
|
72
|
-
console.log(" \u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2551");
|
|
73
|
-
console.log(" \u2551 \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u2551");
|
|
74
|
-
console.log(" \u2551 \u2551");
|
|
75
|
-
console.log(" \u2551Give your product and docs first-class agent visibility.\u2551");
|
|
76
|
-
console.log(" \u2551 \u2551");
|
|
77
|
-
console.log(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
|
|
78
|
-
console.log("");
|
|
79
|
-
}
|
|
80
|
-
function success(projectDir, projectName, dependenciesInstalled) {
|
|
81
|
-
console.log("");
|
|
82
|
-
console.log(" \u2705 Your Thally project is ready!");
|
|
83
|
-
console.log("");
|
|
84
|
-
console.log(` \u{1F4C2} ${projectDir}`);
|
|
85
|
-
console.log("");
|
|
86
|
-
console.log(" Next steps:");
|
|
87
|
-
console.log("");
|
|
88
|
-
console.log(` cd ${basename(projectDir)}`);
|
|
89
|
-
if (!dependenciesInstalled) {
|
|
90
|
-
console.log(" npm install");
|
|
91
|
-
}
|
|
92
|
-
console.log(" npm run dev");
|
|
93
|
-
console.log("");
|
|
94
|
-
console.log(` Your terminal will print the local URL for your ${projectName} docs.`);
|
|
95
|
-
console.log("");
|
|
96
|
-
console.log(" \u{1F4DD} Key files to edit:");
|
|
97
|
-
console.log(" \u2022 src/data/site.ts \u2014 name, links, branding");
|
|
98
|
-
console.log(" \u2022 docs.json \u2014 navigation structure");
|
|
99
|
-
console.log(" \u2022 src/content/*.mdx \u2014 your documentation");
|
|
100
|
-
console.log(" \u2022 openapi.yaml \u2014 API spec (optional)");
|
|
101
|
-
console.log("");
|
|
102
|
-
console.log(" Happy documenting! \u{1F680}");
|
|
103
|
-
console.log("");
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// src/scaffold.ts
|
|
107
|
-
async function scaffold(options) {
|
|
108
|
-
const {
|
|
109
|
-
projectDir,
|
|
110
|
-
projectName,
|
|
111
|
-
description,
|
|
112
|
-
brandPreset,
|
|
113
|
-
repoUrl,
|
|
114
|
-
doInstall,
|
|
115
|
-
enableAiChat = true,
|
|
116
|
-
i18nLocales,
|
|
117
|
-
trackRepos,
|
|
118
|
-
colors
|
|
119
|
-
} = options;
|
|
120
|
-
const targetDir = resolve(projectDir);
|
|
121
|
-
if (existsSync(targetDir) && readdirSync(targetDir).length > 0) {
|
|
122
|
-
throw new Error(`Directory "${targetDir}" already exists and is not empty.`);
|
|
123
|
-
}
|
|
124
|
-
mkdirSync(targetDir, { recursive: true });
|
|
125
|
-
const slug = slugify(projectName);
|
|
126
|
-
await downloadStarter(targetDir, projectName);
|
|
127
|
-
personalizeStarter(targetDir, {
|
|
128
|
-
projectName,
|
|
129
|
-
packageName: slug,
|
|
130
|
-
description,
|
|
131
|
-
brandPreset,
|
|
132
|
-
repoUrl,
|
|
133
|
-
enableAiChat,
|
|
134
|
-
i18nLocales,
|
|
135
|
-
colors
|
|
136
|
-
});
|
|
137
|
-
resetTrackingConfig(targetDir);
|
|
138
|
-
if (trackRepos?.length) {
|
|
139
|
-
writeTrackingConfig(targetDir, trackRepos);
|
|
140
|
-
const list = trackRepos.map((r) => `${r.owner}/${r.repo}`).join(", ");
|
|
141
|
-
console.log(` \u2713 Thally Track enabled \u2014 watching ${list} (branch main, all files; refine in docs.json).`);
|
|
142
|
-
console.log(" To finish wiring it: `thally track setup` (pick a trigger) + `thally agent init`,");
|
|
143
|
-
console.log(" then add your ANTHROPIC_API_KEY. See /guides/thally-track.");
|
|
144
|
-
}
|
|
145
|
-
updateEnvExample(targetDir);
|
|
146
|
-
if (doInstall) {
|
|
147
|
-
installDeps(targetDir);
|
|
148
|
-
}
|
|
149
|
-
initGit(targetDir);
|
|
150
|
-
return { projectDir: targetDir };
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export {
|
|
154
|
-
slugify,
|
|
155
|
-
initGit,
|
|
156
|
-
installDeps,
|
|
157
|
-
logo,
|
|
158
|
-
success,
|
|
159
|
-
readDocsJson,
|
|
160
|
-
writeDocsJson,
|
|
161
|
-
scaffold
|
|
162
|
-
};
|