create-thally-docs 0.7.3 → 0.7.5
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.
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
initGit,
|
|
4
4
|
installDeps,
|
|
5
5
|
scaffold
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YKA5APVS.js";
|
|
7
7
|
|
|
8
8
|
// src/migrate/index.ts
|
|
9
9
|
import { mkdirSync as mkdirSync2, copyFileSync as copyFileSync2, readFileSync as readFileSync3, writeFileSync, existsSync as existsSync3, mkdtempSync, rmSync } from "fs";
|
|
@@ -520,6 +520,42 @@ anywhere Next.js is supported, or connect the repository to
|
|
|
520
520
|
`;
|
|
521
521
|
writeFileSync2(join2(targetDir, "README.md"), readme, "utf8");
|
|
522
522
|
}
|
|
523
|
+
function writeCloudflareRuntimeConfig(targetDir, slug) {
|
|
524
|
+
writeFileSync2(
|
|
525
|
+
join2(targetDir, "open-next.config.ts"),
|
|
526
|
+
`/** OpenNext adapter configuration for the Cloudflare Workers runtime. */
|
|
527
|
+
import { defineCloudflareConfig } from '@opennextjs/cloudflare/config'
|
|
528
|
+
|
|
529
|
+
export default defineCloudflareConfig()
|
|
530
|
+
`,
|
|
531
|
+
"utf8"
|
|
532
|
+
);
|
|
533
|
+
writeFileSync2(
|
|
534
|
+
join2(targetDir, "wrangler.jsonc"),
|
|
535
|
+
`${JSON.stringify(
|
|
536
|
+
{
|
|
537
|
+
$schema: "node_modules/wrangler/config-schema.json",
|
|
538
|
+
name: slug,
|
|
539
|
+
main: ".open-next/worker.js",
|
|
540
|
+
compatibility_date: "2026-07-15",
|
|
541
|
+
compatibility_flags: ["nodejs_compat", "global_fetch_strictly_public"],
|
|
542
|
+
observability: {
|
|
543
|
+
enabled: true,
|
|
544
|
+
logs: { head_sampling_rate: 1 },
|
|
545
|
+
traces: { enabled: true, head_sampling_rate: 0.01 }
|
|
546
|
+
},
|
|
547
|
+
assets: {
|
|
548
|
+
directory: ".open-next/assets",
|
|
549
|
+
binding: "ASSETS"
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
null,
|
|
553
|
+
2
|
|
554
|
+
)}
|
|
555
|
+
`,
|
|
556
|
+
"utf8"
|
|
557
|
+
);
|
|
558
|
+
}
|
|
523
559
|
function updateSiteConfig(targetDir, projectName, description, brandPreset, repoUrl) {
|
|
524
560
|
const siteFile = join2(targetDir, "src", "data", "site.ts");
|
|
525
561
|
if (!existsSync(siteFile)) {
|
|
@@ -629,15 +665,34 @@ function patchPackageJson(targetDir, slug) {
|
|
|
629
665
|
if (!existsSync(pkgPath)) return;
|
|
630
666
|
const pkg = JSON.parse(readFileSync2(pkgPath, "utf8"));
|
|
631
667
|
const hadWorkspaces = Array.isArray(pkg.workspaces) && pkg.workspaces.length > 0;
|
|
668
|
+
const hasRuntimeSourceCompiler = existsSync(
|
|
669
|
+
join2(targetDir, "scripts", "build-runtime-sources.mts")
|
|
670
|
+
);
|
|
632
671
|
pkg.name = slug;
|
|
633
672
|
delete pkg.workspaces;
|
|
634
673
|
if (pkg.scripts) {
|
|
635
|
-
if (
|
|
674
|
+
if (hasRuntimeSourceCompiler) {
|
|
675
|
+
pkg.scripts["runtime-sources:build"] ??= "tsx scripts/build-runtime-sources.mts";
|
|
676
|
+
pkg.scripts["predev"] = "npm run runtime-sources:build";
|
|
677
|
+
pkg.scripts["postinstall"] = "npm run runtime-sources:build";
|
|
678
|
+
pkg.scripts["prebuild"] = "npm run runtime-sources:build && npm run embeddings:build";
|
|
679
|
+
} else {
|
|
680
|
+
pkg.scripts["prebuild"] = "npm run embeddings:build";
|
|
681
|
+
}
|
|
636
682
|
delete pkg.scripts["pretest"];
|
|
637
683
|
delete pkg.scripts["packages:build"];
|
|
684
|
+
pkg.scripts["build:cloudflare"] = "opennextjs-cloudflare build";
|
|
685
|
+
pkg.scripts["preview:cloudflare"] = "npm run build:cloudflare && opennextjs-cloudflare preview";
|
|
686
|
+
pkg.scripts["deploy:cloudflare"] = "npm run build:cloudflare && opennextjs-cloudflare deploy";
|
|
687
|
+
pkg.scripts["upload:cloudflare"] = "npm run build:cloudflare && opennextjs-cloudflare upload";
|
|
638
688
|
}
|
|
689
|
+
pkg.devDependencies ??= {};
|
|
690
|
+
pkg.devDependencies["@thallylabs/cli"] = "0.5.2";
|
|
691
|
+
pkg.devDependencies["@opennextjs/cloudflare"] ??= "1.15.0";
|
|
692
|
+
pkg.devDependencies.vite ??= "7.2.6";
|
|
693
|
+
pkg.devDependencies.wrangler ??= "4.111.0";
|
|
639
694
|
if (pkg.dependencies?.["@thallylabs/mcp"] === "*") {
|
|
640
|
-
pkg.dependencies["@thallylabs/mcp"] = "0.7.
|
|
695
|
+
pkg.dependencies["@thallylabs/mcp"] = "0.7.1";
|
|
641
696
|
}
|
|
642
697
|
writeFileSync2(pkgPath, `${JSON.stringify(pkg, null, 2)}
|
|
643
698
|
`, "utf8");
|
|
@@ -768,6 +823,7 @@ async function scaffold(options) {
|
|
|
768
823
|
patchTopBarNavigation(targetDir);
|
|
769
824
|
patchOpenApiFetch(targetDir);
|
|
770
825
|
patchPackageJson(targetDir, slug);
|
|
826
|
+
writeCloudflareRuntimeConfig(targetDir, slug);
|
|
771
827
|
patchGitignore(targetDir);
|
|
772
828
|
updateEnvExample(targetDir);
|
|
773
829
|
if (doInstall) {
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
migrateDocs,
|
|
4
4
|
parseGitHubUrl
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RTC4LS6J.js";
|
|
6
6
|
import {
|
|
7
7
|
logo,
|
|
8
8
|
readDocsJson,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
slugify,
|
|
11
11
|
success,
|
|
12
12
|
writeDocsJson
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YKA5APVS.js";
|
|
14
14
|
|
|
15
15
|
// src/index.ts
|
|
16
16
|
import { existsSync as existsSync3, readdirSync as readdirSync2 } from "fs";
|
package/dist/migrate/index.js
CHANGED
package/dist/scaffold.js
CHANGED