create-thally-docs 0.10.117 → 0.10.119

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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  migrateDocs
4
- } from "./chunk-XDSBT5EE.js";
4
+ } from "./chunk-VCVHOOB5.js";
5
5
  import {
6
6
  parseFrontmatter,
7
7
  runCheck
@@ -13,22 +13,23 @@ import {
13
13
  scaffold,
14
14
  slugify,
15
15
  success
16
- } from "./chunk-SVB25WSN.js";
16
+ } from "./chunk-6MT76XGS.js";
17
17
  import "./chunk-UG3OXVLE.js";
18
18
  import "./chunk-J7255UQA.js";
19
- import "./chunk-JKC4FXSW.js";
19
+ import "./chunk-7BAJKUBN.js";
20
+ import "./chunk-44WRU5LD.js";
20
21
  import {
21
22
  acquireTerminalAccent,
22
23
  formatHelp,
23
24
  terminal
24
25
  } from "./chunk-L2YCVQBR.js";
25
- import "./chunk-QPHUUFSH.js";
26
+ import "./chunk-C4DPGWFM.js";
26
27
  import "./chunk-FMVUFWZP.js";
27
28
 
28
29
  // src/index.ts
29
30
  import { existsSync as existsSync2, readdirSync } from "fs";
30
31
  import { createRequire } from "module";
31
- import { resolve as resolve2 } from "path";
32
+ import { basename as basename2, resolve as resolve2 } from "path";
32
33
 
33
34
  // src/interactive-prompts.ts
34
35
  import * as clack from "@clack/prompts";
@@ -676,13 +677,15 @@ var valueFlags = /* @__PURE__ */ new Set([
676
677
  "--into",
677
678
  "--locale",
678
679
  "--max-pages",
680
+ "--openapi",
679
681
  "--model",
680
682
  "--pages",
683
+ "--package-manager",
681
684
  "--platform",
682
685
  "--source-ref"
683
686
  ]);
684
687
  var commandFlags = {
685
- scaffold: /* @__PURE__ */ new Set(["--help", "-h", "--yes", "-y", "--install", "--no-install", "--verbose"]),
688
+ scaffold: /* @__PURE__ */ new Set(["--package-manager", "--help", "-h", "--yes", "-y", "--install", "--no-install", "--verbose"]),
686
689
  migrate: /* @__PURE__ */ new Set([
687
690
  "--help",
688
691
  "-h",
@@ -691,6 +694,7 @@ var commandFlags = {
691
694
  "--docs-dir",
692
695
  "--into",
693
696
  "--max-pages",
697
+ "--openapi",
694
698
  "--platform",
695
699
  "--skip-validation",
696
700
  "--source-ref",
@@ -725,6 +729,7 @@ Scaffold options:
725
729
  -y, --yes Accept defaults and skip interactive prompts
726
730
  --install Install project dependencies (the default)
727
731
  --no-install Skip dependency installation
732
+ --package-manager <npm|pnpm|yarn> Select the dependency installer
728
733
  --verbose Show detailed installation and Git output
729
734
  -h, --help Show this help
730
735
  -v, -V, --version Show the installed version
@@ -734,12 +739,13 @@ Run create-thally-docs <command> --help for command-specific options.
734
739
  var commandHelp = {
735
740
  migrate: `
736
741
  Usage:
737
- create-thally-docs migrate <github-or-docs-url> [output-dir] [options]
742
+ create-thally-docs migrate <github-or-docs-url-or-directory> [output-dir] [options]
738
743
 
739
744
  Options:
740
745
  --into <dir> Migrate into an existing Thally project
741
746
  --branch <name> Override the detected Git branch
742
747
  --docs-dir <path> Override the detected documentation directory
748
+ --openapi <https-url> Import an explicit OpenAPI spec for a docs website
743
749
  --max-pages <count> Limit a public URL crawl to 1-10000 pages (default: 1000)
744
750
  --platform <name> Use mintlify, docusaurus, fern, or auto
745
751
  --source-ref <owner/repo>=<path>
@@ -810,16 +816,21 @@ function validateFlags(command) {
810
816
  async function runMigrateCommand() {
811
817
  let sourceUrl = positional[1];
812
818
  if (!sourceUrl) {
813
- console.error("\n \u274C Source URL is required.");
814
- console.error(" Usage: create-thally-docs migrate <github-or-docs-url> [output-dir] [options]");
819
+ console.error("\n \u274C A source URL or local directory is required.");
820
+ console.error(" Usage: create-thally-docs migrate <github-or-docs-url-or-directory> [output-dir] [options]");
815
821
  console.error(" Example: create-thally-docs migrate https://docs.example.com my-docs");
816
822
  process.exit(1);
817
823
  }
818
824
  let source;
825
+ const sourceDirectory = !/^[a-z][a-z0-9+.-]*:/i.test(sourceUrl) || /^[a-z]:[\\/]/i.test(sourceUrl) ? resolve2(sourceUrl) : void 0;
819
826
  try {
820
- source = new URL(sourceUrl);
821
- if (!["http:", "https:"].includes(source.protocol)) throw new Error("Only HTTP and HTTPS sources are supported.");
822
- if (source.hostname.toLowerCase() === "github.com") parseGitHubRepositoryUrl2(sourceUrl);
827
+ if (sourceDirectory) {
828
+ if (!existsSync2(sourceDirectory)) throw new Error(`Local source directory does not exist: ${sourceDirectory}`);
829
+ } else {
830
+ source = new URL(sourceUrl);
831
+ if (!["http:", "https:"].includes(source.protocol)) throw new Error("Only HTTP and HTTPS sources are supported.");
832
+ if (source.hostname.toLowerCase() === "github.com") parseGitHubRepositoryUrl2(sourceUrl);
833
+ }
823
834
  } catch (err) {
824
835
  console.error(`
825
836
  \u274C ${err instanceof Error ? err.message : err}`);
@@ -831,7 +842,7 @@ async function runMigrateCommand() {
831
842
  terminal.intro("migrate", packageMetadata.version, "Bring your docs to Thally. Built for people and AI tools.");
832
843
  const platformFlag = getFlagValue("--platform");
833
844
  const platform = await gatherMigrationPlatform(platformFlag, yes);
834
- if (platform === void 0) {
845
+ if (platform === void 0 && !sourceDirectory) {
835
846
  const shouldPromptForSource = platformFlag === void 0 && !yes && Boolean(process.stdin.isTTY);
836
847
  sourceUrl = await resolveAutoDetectedMigrationSource(sourceUrl, shouldPromptForSource);
837
848
  source = new URL(sourceUrl);
@@ -845,7 +856,7 @@ async function runMigrateCommand() {
845
856
  } else if (positional[2]) {
846
857
  projectDir = resolve2(positional[2]);
847
858
  } else {
848
- const sourceName = source.hostname.toLowerCase() === "github.com" ? parseGitHubRepositoryUrl2(sourceUrl).repo : source.pathname.split("/").filter(Boolean).at(-1) ?? source.hostname.split(".")[0];
859
+ const sourceName = sourceDirectory ? basename2(sourceDirectory) : source.hostname.toLowerCase() === "github.com" ? parseGitHubRepositoryUrl2(sourceUrl).repo : source.pathname.split("/").filter(Boolean).at(-1) ?? source.hostname.split(".")[0];
849
860
  projectDir = resolve2(`${slugify(sourceName)}-docs`);
850
861
  }
851
862
  const maxPagesValue = getFlagValue("--max-pages");
@@ -854,7 +865,7 @@ async function runMigrateCommand() {
854
865
  console.error("\n \u274C --max-pages must be an integer between 1 and 10000.");
855
866
  process.exit(1);
856
867
  }
857
- terminal.detail("Source", `${source.origin}${source.pathname}`);
868
+ terminal.detail("Source", sourceDirectory ?? `${source.origin}${source.pathname}`);
858
869
  terminal.detail("Output", projectDir);
859
870
  if (branch) terminal.detail("Branch", branch);
860
871
  if (docsDir) terminal.detail("Docs dir", docsDir);
@@ -875,12 +886,14 @@ async function runMigrateCommand() {
875
886
  }
876
887
  const result = await migrateDocs({
877
888
  sourceUrl,
889
+ sourceDirectory,
878
890
  projectDir,
879
891
  into: isInto,
880
892
  apiKey,
881
893
  branch,
882
894
  docsDir,
883
895
  maxPages,
896
+ openapiUrl: getFlagValue("--openapi"),
884
897
  platform,
885
898
  yes,
886
899
  skipValidation: flags.includes("--skip-validation"),
@@ -901,6 +914,8 @@ async function runMigrateCommand() {
901
914
  async function runScaffoldCommand() {
902
915
  const useDefaults = flags.includes("--yes") || flags.includes("-y") || !process.stdin.isTTY;
903
916
  const installPreference = flags.includes("--install") ? true : flags.includes("--no-install") ? false : void 0;
917
+ const packageManager = getFlagValue("--package-manager");
918
+ if (packageManager !== void 0 && !["npm", "pnpm", "yarn"].includes(packageManager)) throw new Error("--package-manager must be npm, pnpm, or yarn.");
904
919
  const dirArg = positional[0];
905
920
  if (dirArg) {
906
921
  const resolved = resolve2(dirArg);
@@ -918,11 +933,12 @@ async function runScaffoldCommand() {
918
933
  brandPreset: answers.brandPreset,
919
934
  repoUrl: answers.repoUrl,
920
935
  doInstall: answers.doInstall,
936
+ packageManager,
921
937
  continueOnInstallFailure: true,
922
938
  i18nLocales: answers.i18nLocales,
923
939
  trackRepos: answers.trackRepos
924
940
  });
925
- success(result.projectDir, answers.projectName, result.dependenciesInstalled);
941
+ success(result.projectDir, answers.projectName, result.dependenciesInstalled, packageManager);
926
942
  if (answers.doInstall && !result.dependenciesInstalled) process.exitCode = 1;
927
943
  }
928
944
  async function runCheckCommand() {
@@ -28,6 +28,8 @@ interface MigrationValidation {
28
28
 
29
29
  interface MigrateOptions {
30
30
  sourceUrl: string;
31
+ /** Explicit trusted local CLI capability; never inferred by remote adapters. */
32
+ sourceDirectory?: string;
31
33
  projectDir: string;
32
34
  into: boolean;
33
35
  /** Retained for CLI compatibility; Markdown/MDX imports do not require a key. */
@@ -37,6 +39,8 @@ interface MigrateOptions {
37
39
  projectName?: string;
38
40
  yes: boolean;
39
41
  maxPages?: number;
42
+ /** Explicit HTTPS specification for a URL-only documentation source. */
43
+ openapiUrl?: string;
40
44
  /** Explicit source platform selected by an interactive or automated caller. */
41
45
  platform?: MigrationPlatform;
42
46
  /** Optional host fetch boundary; used by Thally Cloud adapters and tests. */
@@ -57,7 +61,7 @@ interface MigrateResult {
57
61
  validation: MigrationValidation;
58
62
  reportPath: string;
59
63
  }
60
- /** Import a GitHub docs repository or public docs URL into a Thally project. */
64
+ /** Import a repository, public docs URL, or explicitly trusted local checkout. */
61
65
  declare function migrateDocs(options: MigrateOptions): Promise<MigrateResult>;
62
66
 
63
67
  export { type MigrateOptions, type MigrateResult, migrateDocs };
@@ -1,14 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  migrateDocs
4
- } from "../chunk-XDSBT5EE.js";
4
+ } from "../chunk-VCVHOOB5.js";
5
5
  import "../chunk-KDLP27DS.js";
6
- import "../chunk-SVB25WSN.js";
6
+ import "../chunk-6MT76XGS.js";
7
7
  import "../chunk-UG3OXVLE.js";
8
8
  import "../chunk-J7255UQA.js";
9
- import "../chunk-JKC4FXSW.js";
9
+ import "../chunk-7BAJKUBN.js";
10
+ import "../chunk-44WRU5LD.js";
10
11
  import "../chunk-L2YCVQBR.js";
11
- import "../chunk-QPHUUFSH.js";
12
+ import "../chunk-C4DPGWFM.js";
12
13
  import "../chunk-FMVUFWZP.js";
13
14
  export {
14
15
  migrateDocs
@@ -1,5 +1,7 @@
1
1
  export { STABLE_SCAFFOLD_RELEASE } from './release.js';
2
2
 
3
+ type PackageManager = 'npm' | 'pnpm' | 'yarn';
4
+
3
5
  /**
4
6
  * Immutable starter archive download and extraction.
5
7
  *
@@ -39,6 +41,8 @@ interface ScaffoldOptions {
39
41
  brandPreset: string;
40
42
  repoUrl: string;
41
43
  doInstall: boolean;
44
+ /** Explicitly select npm, pnpm, or Yarn; otherwise infer the invoking manager. */
45
+ packageManager?: PackageManager;
42
46
  /**
43
47
  * Report a failed install and still finish the project (Git setup included)
44
48
  * instead of throwing. Interactive creation opts in; library callers keep
package/dist/scaffold.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  scaffold
4
- } from "./chunk-SVB25WSN.js";
4
+ } from "./chunk-6MT76XGS.js";
5
5
  import "./chunk-UG3OXVLE.js";
6
6
  import "./chunk-J7255UQA.js";
7
7
  import {
@@ -9,9 +9,9 @@ import {
9
9
  STARTER_COMMIT_SHA,
10
10
  STARTER_REPOSITORY,
11
11
  validateStarterArchiveEntry
12
- } from "./chunk-JKC4FXSW.js";
12
+ } from "./chunk-44WRU5LD.js";
13
13
  import "./chunk-L2YCVQBR.js";
14
- import "./chunk-QPHUUFSH.js";
14
+ import "./chunk-C4DPGWFM.js";
15
15
  import {
16
16
  STABLE_SCAFFOLD_RELEASE
17
17
  } from "./chunk-FMVUFWZP.js";
@@ -9,7 +9,7 @@ import {
9
9
  planStarterRuntimeSync,
10
10
  readStarterReleaseManifest,
11
11
  starterManifestSha256
12
- } from "./chunk-QPHUUFSH.js";
12
+ } from "./chunk-C4DPGWFM.js";
13
13
  import "./chunk-FMVUFWZP.js";
14
14
  export {
15
15
  applyStarterRuntimeSyncPlan,
@@ -6,10 +6,10 @@ import {
6
6
  resolveStarterUpdateBase,
7
7
  starterReleaseProviderError,
8
8
  updateStarterProject
9
- } from "./chunk-7UPLZRN4.js";
10
- import "./chunk-JKC4FXSW.js";
9
+ } from "./chunk-7BAJKUBN.js";
10
+ import "./chunk-44WRU5LD.js";
11
11
  import "./chunk-L2YCVQBR.js";
12
- import "./chunk-QPHUUFSH.js";
12
+ import "./chunk-C4DPGWFM.js";
13
13
  import "./chunk-FMVUFWZP.js";
14
14
  export {
15
15
  fetchStarterReleaseHint,
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  updateStarterProject
4
- } from "./chunk-7UPLZRN4.js";
4
+ } from "./chunk-7BAJKUBN.js";
5
5
  import {
6
6
  downloadStarter
7
- } from "./chunk-JKC4FXSW.js";
7
+ } from "./chunk-44WRU5LD.js";
8
8
  import "./chunk-L2YCVQBR.js";
9
9
  import {
10
10
  classifyStarterPath,
11
11
  mergeStarterOwnershipContracts,
12
12
  readStarterReleaseManifest
13
- } from "./chunk-QPHUUFSH.js";
13
+ } from "./chunk-C4DPGWFM.js";
14
14
  import {
15
15
  STABLE_SCAFFOLD_RELEASE,
16
16
  SUPPORTED_SCAFFOLD_RELEASES
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-thally-docs",
3
- "version": "0.10.117",
3
+ "version": "0.10.119",
4
4
  "description": "Scaffold an open-source Thally docs site for people, search engines, and AI tools.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -54,18 +54,20 @@
54
54
  "@clack/prompts": "^0.11.0",
55
55
  "@inquirer/prompts": "^7.0.0",
56
56
  "@thallylabs/core": "0.2.17",
57
- "@thallylabs/migrate": "0.2.41",
57
+ "@thallylabs/migrate": "0.2.43",
58
58
  "p-limit": "^6.1.0",
59
59
  "remark-mdx": "^3.1.1",
60
60
  "remark-parse": "^11.0.0",
61
61
  "tar": "^7.5.22",
62
62
  "unified": "^11.0.5",
63
- "yaml": "^2.6.0"
63
+ "yaml": "^2.6.0",
64
+ "semver": "^7.8.5"
64
65
  },
65
66
  "devDependencies": {
66
67
  "@types/node": "^22.0.0",
67
68
  "tsup": "^8.0.0",
68
- "typescript": "^5.0.0"
69
+ "typescript": "^5.0.0",
70
+ "@types/semver": "^7.8.0"
69
71
  },
70
72
  "license": "MIT",
71
73
  "keywords": [