create-thally-docs 0.10.30 → 0.10.32

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.
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  migrateDocs
4
- } from "../chunk-UYGDCVX3.js";
5
- import "../chunk-4RPHM4NA.js";
4
+ } from "../chunk-E5URHAYU.js";
5
+ import "../chunk-74SGZLEY.js";
6
6
  import "../chunk-ORUAMPNF.js";
7
- import "../chunk-XAUCGJ6B.js";
8
- import "../chunk-PMAJ4BVM.js";
9
- import "../chunk-SSKXNB6D.js";
7
+ import "../chunk-FLSOVTVO.js";
8
+ import "../chunk-HYGEXPZG.js";
9
+ import "../chunk-ZFCZE7M7.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-SSKXNB6D.js";
6
+ } from "./chunk-ZFCZE7M7.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-4RPHM4NA.js";
4
+ } from "./chunk-74SGZLEY.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-XAUCGJ6B.js";
12
- import "./chunk-PMAJ4BVM.js";
11
+ } from "./chunk-FLSOVTVO.js";
12
+ import "./chunk-HYGEXPZG.js";
13
13
  import {
14
14
  STABLE_SCAFFOLD_RELEASE
15
- } from "./chunk-SSKXNB6D.js";
15
+ } from "./chunk-ZFCZE7M7.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-PMAJ4BVM.js";
12
- import "./chunk-SSKXNB6D.js";
11
+ } from "./chunk-HYGEXPZG.js";
12
+ import "./chunk-ZFCZE7M7.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-XAUCGJ6B.js";
4
+ } from "./chunk-FLSOVTVO.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-PMAJ4BVM.js";
12
+ } from "./chunk-HYGEXPZG.js";
13
13
  import {
14
14
  STABLE_SCAFFOLD_RELEASE,
15
15
  SUPPORTED_SCAFFOLD_RELEASES
16
- } from "./chunk-SSKXNB6D.js";
16
+ } from "./chunk-ZFCZE7M7.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.30",
3
+ "version": "0.10.32",
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,7 +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.4",
47
+ "@thallylabs/migrate": "0.2.5",
48
48
  "p-limit": "^6.1.0",
49
49
  "tar": "^7.5.22",
50
50
  "yaml": "^2.6.0"
@@ -1,113 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- initGit,
4
- installDeps,
5
- scaffold
6
- } from "./chunk-4RPHM4NA.js";
7
-
8
- // src/migrate/index.ts
9
- import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "fs";
10
- import { tmpdir } from "os";
11
- import { dirname, isAbsolute, join, relative, resolve, sep } from "path";
12
- import {
13
- cloneGitHubRepository,
14
- migrateRepository,
15
- migrateUrl,
16
- parseGitHubRepositoryUrl,
17
- renderMigrationFiles
18
- } from "@thallylabs/migrate";
19
- function projectPath(projectDir, candidate) {
20
- const target = resolve(projectDir, candidate);
21
- const fromRoot = relative(resolve(projectDir), target);
22
- if (isAbsolute(fromRoot) || fromRoot === ".." || fromRoot.startsWith(`..${sep}`)) {
23
- throw new Error(`Generated migration path escapes the project: ${candidate}`);
24
- }
25
- return target;
26
- }
27
- function readExistingConfig(projectDir) {
28
- const configPath = projectPath(projectDir, "docs.json");
29
- if (!existsSync(configPath)) return void 0;
30
- return JSON.parse(readFileSync(configPath, "utf8"));
31
- }
32
- function resetFreshMigrationContent(projectDir) {
33
- const contentDirectory = projectPath(projectDir, "src/content");
34
- rmSync(contentDirectory, { recursive: true, force: true });
35
- mkdirSync(contentDirectory, { recursive: true });
36
- for (const sampleSpec of ["openapi.yaml", "openapi.json"]) {
37
- rmSync(projectPath(projectDir, sampleSpec), { force: true });
38
- }
39
- }
40
- async function discoverMigration(options) {
41
- const url = new URL(options.sourceUrl);
42
- if (url.hostname.toLowerCase() !== "github.com") {
43
- console.log(` \u{1F310} Discovering public docs at ${url.origin}${url.pathname}...`);
44
- return migrateUrl({
45
- sourceUrl: options.sourceUrl,
46
- platform: options.platform,
47
- maxPages: options.maxPages,
48
- fetcher: options.fetcher
49
- });
50
- }
51
- const source = parseGitHubRepositoryUrl(options.sourceUrl);
52
- if (options.branch) source.branch = options.branch;
53
- const temporaryRoot = mkdtempSync(join(tmpdir(), "thally-migrate-"));
54
- const cloneDir = join(temporaryRoot, "repository");
55
- console.log(` \u{1F4E6} Cloning ${source.owner}/${source.repo}...`);
56
- try {
57
- await cloneGitHubRepository(source, cloneDir);
58
- return migrateRepository({
59
- repositoryDir: cloneDir,
60
- sourceUrl: options.sourceUrl,
61
- docsDir: options.docsDir ?? (source.docsDir || void 0),
62
- platform: options.platform
63
- });
64
- } finally {
65
- rmSync(temporaryRoot, { recursive: true, force: true });
66
- }
67
- }
68
- async function migrateDocs(options) {
69
- const projectDir = resolve(options.projectDir);
70
- const bundle = await discoverMigration(options);
71
- if (!options.into) {
72
- console.log(`
73
- \u{1F3D7} Scaffolding new project at ${projectDir}...`);
74
- await scaffold({
75
- projectDir,
76
- projectName: options.projectName ?? bundle.site?.name ?? "My Docs",
77
- description: bundle.site?.description ?? `Documentation migrated from ${new URL(options.sourceUrl).hostname}`,
78
- brandPreset: "primary",
79
- repoUrl: bundle.sourceKind === "repository" ? options.sourceUrl : "",
80
- doInstall: false
81
- });
82
- resetFreshMigrationContent(projectDir);
83
- } else if (!existsSync(projectDir)) {
84
- throw new Error(`Project directory "${projectDir}" does not exist. Use without --into to scaffold a new one.`);
85
- }
86
- const rendered = renderMigrationFiles(bundle, {
87
- existingConfig: options.into ? readExistingConfig(projectDir) : void 0
88
- });
89
- for (const file of rendered) {
90
- const destination = projectPath(projectDir, file.path);
91
- mkdirSync(dirname(destination), { recursive: true });
92
- writeFileSync(destination, file.content);
93
- }
94
- for (const warning of bundle.warnings) {
95
- console.warn(` \u26A0 ${warning.message}${warning.source ? ` (${warning.source})` : ""}`);
96
- }
97
- console.log(` \u2713 Imported ${bundle.pages.length} pages and ${bundle.assets.length} assets from ${bundle.platform}.`);
98
- if (!options.into) {
99
- installDeps(projectDir);
100
- initGit(projectDir);
101
- }
102
- return {
103
- pagesWritten: bundle.pages.length,
104
- assetsWritten: bundle.assets.length,
105
- projectDir,
106
- platform: bundle.platform,
107
- warnings: bundle.warnings
108
- };
109
- }
110
-
111
- export {
112
- migrateDocs
113
- };