create-better-fullstack 1.1.7 → 1.1.9
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/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-bp7xdTNG.mjs → src-B07FiCRd.mjs} +80 -10
- package/package.json +9 -8
package/dist/cli.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as create, c as docs, d as sponsors, i as builder, l as generateVirtualProject, n as TEMPLATE_COUNT, o as createBtsCli, r as VirtualFileSystem, s as createVirtual, t as EMBEDDED_TEMPLATES, u as router } from "./src-
|
|
2
|
+
import { a as create, c as docs, d as sponsors, i as builder, l as generateVirtualProject, n as TEMPLATE_COUNT, o as createBtsCli, r as VirtualFileSystem, s as createVirtual, t as EMBEDDED_TEMPLATES, u as router } from "./src-B07FiCRd.mjs";
|
|
3
3
|
|
|
4
4
|
export { EMBEDDED_TEMPLATES, TEMPLATE_COUNT, VirtualFileSystem, builder, create, createBtsCli, createVirtual, docs, generateVirtualProject, router, sponsors };
|
|
@@ -802,12 +802,24 @@ function validateExamplesCompatibility(examples, backend, database, frontend, ap
|
|
|
802
802
|
/**
|
|
803
803
|
* Validates that a UI library is compatible with the selected frontend(s)
|
|
804
804
|
*/
|
|
805
|
-
function validateUILibraryFrontendCompatibility(uiLibrary, frontends = []) {
|
|
805
|
+
function validateUILibraryFrontendCompatibility(uiLibrary, frontends = [], astroIntegration) {
|
|
806
806
|
if (!uiLibrary || uiLibrary === "none") return;
|
|
807
807
|
const { web } = splitFrontends(frontends);
|
|
808
808
|
if (web.length === 0) return;
|
|
809
809
|
const compatibility = UI_LIBRARY_COMPATIBILITY[uiLibrary];
|
|
810
810
|
const webFrontend = web[0];
|
|
811
|
+
if (webFrontend === "astro") {
|
|
812
|
+
if (astroIntegration === "react") {
|
|
813
|
+
if (compatibility.frontends.some((f) => [
|
|
814
|
+
"tanstack-router",
|
|
815
|
+
"react-router",
|
|
816
|
+
"tanstack-start",
|
|
817
|
+
"next"
|
|
818
|
+
].includes(f))) return;
|
|
819
|
+
}
|
|
820
|
+
if (!compatibility.frontends.includes("astro")) exitWithError(`UI library '${uiLibrary}' requires React. Astro is configured with '${astroIntegration || "none"}' integration. Please use --astro-integration react or choose a different UI library (e.g., daisyui, ark-ui).`);
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
811
823
|
if (!compatibility.frontends.includes(webFrontend)) exitWithError(`UI library '${uiLibrary}' is not compatible with '${webFrontend}' frontend. Supported frontends: ${compatibility.frontends.join(", ")}`);
|
|
812
824
|
}
|
|
813
825
|
/**
|
|
@@ -822,12 +834,24 @@ function validateUILibraryCSSFrameworkCompatibility(uiLibrary, cssFramework) {
|
|
|
822
834
|
/**
|
|
823
835
|
* Gets list of UI libraries compatible with the selected frontend(s)
|
|
824
836
|
*/
|
|
825
|
-
function getCompatibleUILibraries(frontends = []) {
|
|
837
|
+
function getCompatibleUILibraries(frontends = [], astroIntegration) {
|
|
826
838
|
const { web } = splitFrontends(frontends);
|
|
827
839
|
if (web.length === 0) return ["none"];
|
|
828
840
|
const webFrontend = web[0];
|
|
829
841
|
return Object.keys(UI_LIBRARY_COMPATIBILITY).filter((lib) => {
|
|
830
|
-
|
|
842
|
+
if (lib === "none") return true;
|
|
843
|
+
const compatibility = UI_LIBRARY_COMPATIBILITY[lib];
|
|
844
|
+
if (webFrontend === "astro") {
|
|
845
|
+
if (astroIntegration === "react") return compatibility.frontends.some((f) => [
|
|
846
|
+
"tanstack-router",
|
|
847
|
+
"react-router",
|
|
848
|
+
"tanstack-start",
|
|
849
|
+
"next",
|
|
850
|
+
"astro"
|
|
851
|
+
].includes(f));
|
|
852
|
+
return compatibility.frontends.includes("astro");
|
|
853
|
+
}
|
|
854
|
+
return compatibility.frontends.includes(webFrontend);
|
|
831
855
|
});
|
|
832
856
|
}
|
|
833
857
|
/**
|
|
@@ -2895,10 +2919,10 @@ const UI_LIBRARY_OPTIONS = {
|
|
|
2895
2919
|
hint: "No UI component library"
|
|
2896
2920
|
}
|
|
2897
2921
|
};
|
|
2898
|
-
async function getUILibraryChoice(uiLibrary, frontends) {
|
|
2922
|
+
async function getUILibraryChoice(uiLibrary, frontends, astroIntegration) {
|
|
2899
2923
|
const { web } = splitFrontends(frontends);
|
|
2900
2924
|
if (web.length === 0) return "none";
|
|
2901
|
-
const compatibleLibraries = getCompatibleUILibraries(frontends);
|
|
2925
|
+
const compatibleLibraries = getCompatibleUILibraries(frontends, astroIntegration);
|
|
2902
2926
|
if (uiLibrary !== void 0) return compatibleLibraries.includes(uiLibrary) ? uiLibrary : compatibleLibraries[0];
|
|
2903
2927
|
const options = compatibleLibraries.map((lib) => ({
|
|
2904
2928
|
value: lib,
|
|
@@ -3019,7 +3043,7 @@ async function gatherConfig(flags, projectName, projectDir, relativePath) {
|
|
|
3019
3043
|
},
|
|
3020
3044
|
uiLibrary: ({ results }) => {
|
|
3021
3045
|
if (results.ecosystem === "rust") return Promise.resolve("none");
|
|
3022
|
-
if (hasWebStyling(results.frontend)) return getUILibraryChoice(flags.uiLibrary, results.frontend);
|
|
3046
|
+
if (hasWebStyling(results.frontend)) return getUILibraryChoice(flags.uiLibrary, results.frontend, results.astroIntegration);
|
|
3023
3047
|
return Promise.resolve("none");
|
|
3024
3048
|
},
|
|
3025
3049
|
cssFramework: ({ results }) => {
|
|
@@ -3825,7 +3849,7 @@ function validateFullConfig(config, providedFlags, options) {
|
|
|
3825
3849
|
validateExamplesCompatibility(config.examples ?? [], config.backend, config.database, config.frontend ?? [], config.api);
|
|
3826
3850
|
validatePaymentsCompatibility(config.payments, config.auth, config.backend, config.frontend ?? []);
|
|
3827
3851
|
validateNextAuthCompatibility(config.auth, config.backend, config.frontend ?? []);
|
|
3828
|
-
validateUILibraryFrontendCompatibility(config.uiLibrary, config.frontend ?? []);
|
|
3852
|
+
validateUILibraryFrontendCompatibility(config.uiLibrary, config.frontend ?? [], config.astroIntegration);
|
|
3829
3853
|
validateUILibraryCSSFrameworkCompatibility(config.uiLibrary, config.cssFramework);
|
|
3830
3854
|
}
|
|
3831
3855
|
function validateConfigForProgrammaticUse(config) {
|
|
@@ -3837,7 +3861,7 @@ function validateConfigForProgrammaticUse(config) {
|
|
|
3837
3861
|
validateNextAuthCompatibility(config.auth, config.backend, config.frontend ?? []);
|
|
3838
3862
|
if (config.addons && config.addons.length > 0) validateAddonsAgainstFrontends(config.addons, config.frontend, config.auth);
|
|
3839
3863
|
validateExamplesCompatibility(config.examples ?? [], config.backend, config.database, config.frontend ?? [], config.api);
|
|
3840
|
-
validateUILibraryFrontendCompatibility(config.uiLibrary, config.frontend ?? []);
|
|
3864
|
+
validateUILibraryFrontendCompatibility(config.uiLibrary, config.frontend ?? [], config.astroIntegration);
|
|
3841
3865
|
validateUILibraryCSSFrameworkCompatibility(config.uiLibrary, config.cssFramework);
|
|
3842
3866
|
} catch (error) {
|
|
3843
3867
|
if (error instanceof Error) throw error;
|
|
@@ -5799,7 +5823,11 @@ async function getDockerStatus(database) {
|
|
|
5799
5823
|
//#endregion
|
|
5800
5824
|
//#region src/helpers/core/post-installation.ts
|
|
5801
5825
|
async function displayPostInstallInstructions(config) {
|
|
5802
|
-
const { api, database, relativePath, packageManager, depsInstalled, orm, addons, runtime, frontend, backend, dbSetup, webDeploy, serverDeploy } = config;
|
|
5826
|
+
const { api, database, relativePath, packageManager, depsInstalled, orm, addons, runtime, frontend, backend, dbSetup, webDeploy, serverDeploy, ecosystem } = config;
|
|
5827
|
+
if (ecosystem === "rust") {
|
|
5828
|
+
displayRustInstructions(config);
|
|
5829
|
+
return;
|
|
5830
|
+
}
|
|
5803
5831
|
const isConvex = backend === "convex";
|
|
5804
5832
|
const isBackendSelf = backend === "self";
|
|
5805
5833
|
const runCmd = packageManager === "npm" ? "npm run" : packageManager === "pnpm" ? "pnpm run" : "bun run";
|
|
@@ -5967,6 +5995,48 @@ function getAlchemyDeployInstructions(runCmd, webDeploy, serverDeploy, backend)
|
|
|
5967
5995
|
else if (webDeploy === "cloudflare" && (serverDeploy === "cloudflare" || isBackendSelf)) instructions.push(`${pc.bold("Deploy with Alchemy:")}\n${pc.cyan("•")} Dev: ${`${runCmd} dev`}\n${pc.cyan("•")} Deploy: ${`${runCmd} deploy`}\n${pc.cyan("•")} Destroy: ${`${runCmd} destroy`}`);
|
|
5968
5996
|
return instructions.length ? `\n${instructions.join("\n")}` : "";
|
|
5969
5997
|
}
|
|
5998
|
+
function displayRustInstructions(config) {
|
|
5999
|
+
const { relativePath, rustWebFramework, rustFrontend, rustOrm, rustApi, rustCli } = config;
|
|
6000
|
+
const cdCmd = `cd ${relativePath}`;
|
|
6001
|
+
let output = `${pc.bold("Next steps")}\n${pc.cyan("1.")} ${cdCmd}\n`;
|
|
6002
|
+
let stepCounter = 2;
|
|
6003
|
+
output += `${pc.cyan(`${stepCounter++}.`)} cargo build\n`;
|
|
6004
|
+
output += `${pc.cyan(`${stepCounter++}.`)} cargo run\n`;
|
|
6005
|
+
output += `\n${pc.bold("Your Rust project includes:")}\n`;
|
|
6006
|
+
if (rustWebFramework && rustWebFramework !== "none") output += `${pc.cyan("•")} Web Framework: ${{
|
|
6007
|
+
actix: "Actix Web",
|
|
6008
|
+
axum: "Axum",
|
|
6009
|
+
rocket: "Rocket"
|
|
6010
|
+
}[rustWebFramework] || rustWebFramework}\n`;
|
|
6011
|
+
if (rustFrontend && rustFrontend !== "none") output += `${pc.cyan("•")} Frontend: ${{
|
|
6012
|
+
leptos: "Leptos",
|
|
6013
|
+
dioxus: "Dioxus",
|
|
6014
|
+
yew: "Yew"
|
|
6015
|
+
}[rustFrontend] || rustFrontend}\n`;
|
|
6016
|
+
if (rustOrm && rustOrm !== "none") output += `${pc.cyan("•")} Database: ${{
|
|
6017
|
+
diesel: "Diesel",
|
|
6018
|
+
sqlx: "SQLx",
|
|
6019
|
+
"sea-orm": "SeaORM"
|
|
6020
|
+
}[rustOrm] || rustOrm}\n`;
|
|
6021
|
+
if (rustApi && rustApi !== "none") output += `${pc.cyan("•")} API: ${{
|
|
6022
|
+
"async-graphql": "async-graphql",
|
|
6023
|
+
juniper: "Juniper"
|
|
6024
|
+
}[rustApi] || rustApi}\n`;
|
|
6025
|
+
if (rustCli && rustCli !== "none") output += `${pc.cyan("•")} CLI: ${{
|
|
6026
|
+
clap: "Clap",
|
|
6027
|
+
ratatui: "Ratatui"
|
|
6028
|
+
}[rustCli] || rustCli}\n`;
|
|
6029
|
+
output += `\n${pc.bold("Common Cargo commands:")}\n`;
|
|
6030
|
+
output += `${pc.cyan("•")} Build: cargo build\n`;
|
|
6031
|
+
output += `${pc.cyan("•")} Run: cargo run\n`;
|
|
6032
|
+
output += `${pc.cyan("•")} Test: cargo test\n`;
|
|
6033
|
+
output += `${pc.cyan("•")} Check: cargo check\n`;
|
|
6034
|
+
output += `${pc.cyan("•")} Format: cargo fmt\n`;
|
|
6035
|
+
output += `${pc.cyan("•")} Lint: cargo clippy\n`;
|
|
6036
|
+
output += `\n${pc.bold("Like Better Fullstack?")} Please consider giving us a star\n on GitHub:\n`;
|
|
6037
|
+
output += pc.cyan("https://github.com/Marve10s/Better-Fullstack");
|
|
6038
|
+
consola$1.box(output);
|
|
6039
|
+
}
|
|
5970
6040
|
|
|
5971
6041
|
//#endregion
|
|
5972
6042
|
//#region src/helpers/core/create-project.ts
|
|
@@ -5987,7 +6057,7 @@ async function createProject(options, cliInput = {}) {
|
|
|
5987
6057
|
await writeBtsConfig(options);
|
|
5988
6058
|
await formatProject(projectDir);
|
|
5989
6059
|
if (!isSilent()) log.success("Project template successfully scaffolded!");
|
|
5990
|
-
if (options.install) await installDependencies({
|
|
6060
|
+
if (options.install && options.ecosystem !== "rust") await installDependencies({
|
|
5991
6061
|
projectDir,
|
|
5992
6062
|
packageManager: options.packageManager
|
|
5993
6063
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-fullstack",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "A CLI-first toolkit for building Full Stack applications. Skip the configuration. Ship the code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"better-auth",
|
|
@@ -64,16 +64,17 @@
|
|
|
64
64
|
"dev": "tsdown --watch",
|
|
65
65
|
"lint": "oxlint . && tsc --noEmit && bun test test/cli-builder-sync.test.ts",
|
|
66
66
|
"check-types": "tsc --noEmit",
|
|
67
|
-
"test": "bun
|
|
68
|
-
"test:watch": "bun
|
|
69
|
-
"test:coverage": "bun
|
|
70
|
-
"test:ci": "
|
|
71
|
-
"test:
|
|
67
|
+
"test": "bun test",
|
|
68
|
+
"test:watch": "bun test --watch",
|
|
69
|
+
"test:coverage": "bun test --coverage",
|
|
70
|
+
"test:ci": "CI=1 bun test --bail=5",
|
|
71
|
+
"test:e2e": "E2E=1 bun test test/e2e/e2e.e2e.ts",
|
|
72
|
+
"test:astro-combos": "bun run scripts/test-astro-combinations.ts",
|
|
72
73
|
"prepublishOnly": "npm run build"
|
|
73
74
|
},
|
|
74
75
|
"dependencies": {
|
|
75
|
-
"@better-fullstack/template-generator": "^1.1.
|
|
76
|
-
"@better-fullstack/types": "^1.1.
|
|
76
|
+
"@better-fullstack/template-generator": "^1.1.9",
|
|
77
|
+
"@better-fullstack/types": "^1.1.9",
|
|
77
78
|
"@clack/core": "^0.5.0",
|
|
78
79
|
"@clack/prompts": "^1.0.0-alpha.8",
|
|
79
80
|
"@orpc/server": "^1.13.0",
|