create-better-fullstack 1.1.8 → 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-CiDXRNuh.mjs → src-B07FiCRd.mjs} +32 -8
- 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;
|
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",
|