@better-t-stack/template-generator 3.23.0 → 3.23.1
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.mjs +30 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -434,7 +434,22 @@ function updateRootPackageJson(vfs, config) {
|
|
|
434
434
|
else if (pkgJson.workspaces && typeof pkgJson.workspaces === "object" && pkgJson.workspaces.packages) workspaces = pkgJson.workspaces.packages;
|
|
435
435
|
pkgJson.workspaces = workspaces;
|
|
436
436
|
const scripts = pkgJson.scripts;
|
|
437
|
-
const { projectName, packageManager, backend, database, orm, dbSetup, addons } = config;
|
|
437
|
+
const { projectName, packageManager, backend, database, orm, dbSetup, addons, frontend } = config;
|
|
438
|
+
const hasWebApp = frontend.some((item) => [
|
|
439
|
+
"tanstack-router",
|
|
440
|
+
"react-router",
|
|
441
|
+
"tanstack-start",
|
|
442
|
+
"next",
|
|
443
|
+
"nuxt",
|
|
444
|
+
"svelte",
|
|
445
|
+
"solid",
|
|
446
|
+
"astro"
|
|
447
|
+
].includes(item));
|
|
448
|
+
const hasNativeApp = frontend.some((item) => [
|
|
449
|
+
"native-bare",
|
|
450
|
+
"native-uniwind",
|
|
451
|
+
"native-unistyles"
|
|
452
|
+
].includes(item));
|
|
438
453
|
const backendPackageName = backend === "convex" ? `@${projectName}/backend` : "server";
|
|
439
454
|
const dbPackageName = `@${projectName}/db`;
|
|
440
455
|
const hasTurborepo = addons.includes("turborepo");
|
|
@@ -449,8 +464,8 @@ function updateRootPackageJson(vfs, config) {
|
|
|
449
464
|
scripts.dev = pmConfig.dev;
|
|
450
465
|
scripts.build = pmConfig.build;
|
|
451
466
|
scripts["check-types"] = pmConfig.checkTypes;
|
|
452
|
-
scripts["dev:native"] = pmConfig.filter("native", "dev");
|
|
453
|
-
scripts["dev:web"] = pmConfig.filter("web", "dev");
|
|
467
|
+
if (hasNativeApp) scripts["dev:native"] = pmConfig.filter("native", "dev");
|
|
468
|
+
if (hasWebApp) scripts["dev:web"] = pmConfig.filter("web", "dev");
|
|
454
469
|
if (addons.includes("opentui")) scripts["dev:tui"] = pmConfig.filter("tui", "dev");
|
|
455
470
|
if (backend !== "self" && backend !== "none") scripts["dev:server"] = pmConfig.filter(backendPackageName, "dev");
|
|
456
471
|
if (backend === "convex") scripts["dev:setup"] = pmConfig.filter(backendPackageName, "dev:setup");
|
|
@@ -2679,13 +2694,23 @@ ${packageManagerRunCmd} db:push
|
|
|
2679
2694
|
return setup;
|
|
2680
2695
|
}
|
|
2681
2696
|
function generateScriptsList(packageManagerRunCmd, config, hasNative) {
|
|
2682
|
-
const { database, addons, backend, dbSetup } = config;
|
|
2697
|
+
const { database, addons, backend, dbSetup, frontend } = config;
|
|
2683
2698
|
const isConvex = backend === "convex";
|
|
2684
2699
|
const isBackendSelf = backend === "self";
|
|
2700
|
+
const hasWeb = frontend.some((f) => [
|
|
2701
|
+
"tanstack-router",
|
|
2702
|
+
"react-router",
|
|
2703
|
+
"tanstack-start",
|
|
2704
|
+
"next",
|
|
2705
|
+
"nuxt",
|
|
2706
|
+
"svelte",
|
|
2707
|
+
"solid",
|
|
2708
|
+
"astro"
|
|
2709
|
+
].includes(f));
|
|
2685
2710
|
const dbSupport = getDbScriptSupport(config);
|
|
2686
2711
|
let scripts = `- \`${packageManagerRunCmd} dev\`: Start all applications in development mode
|
|
2687
2712
|
- \`${packageManagerRunCmd} build\`: Build all applications`;
|
|
2688
|
-
if (
|
|
2713
|
+
if (hasWeb) scripts += `\n- \`${packageManagerRunCmd} dev:web\`: Start only the web application`;
|
|
2689
2714
|
if (isConvex) scripts += `\n- \`${packageManagerRunCmd} dev:setup\`: Setup and configure your Convex project`;
|
|
2690
2715
|
else if (backend !== "none" && !isBackendSelf) scripts += `\n- \`${packageManagerRunCmd} dev:server\`: Start only the server`;
|
|
2691
2716
|
scripts += `\n- \`${packageManagerRunCmd} check-types\`: Check TypeScript types across all apps`;
|