mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
feat(cli): add nuxt + convex support (#458)
This commit is contained in:
@@ -101,11 +101,17 @@ export const dependencyVersionMap = {
|
||||
"@trpc/server": "^11.4.2",
|
||||
"@trpc/client": "^11.4.2",
|
||||
|
||||
convex: "^1.25.0",
|
||||
convex: "^1.25.4",
|
||||
"@convex-dev/react-query": "^0.0.0-alpha.8",
|
||||
"convex-svelte": "^0.0.11",
|
||||
"convex-nuxt": "0.1.5",
|
||||
"convex-vue": "^0.1.5",
|
||||
|
||||
"@tanstack/svelte-query": "^5.74.4",
|
||||
|
||||
"@tanstack/vue-query-devtools": "^5.83.0",
|
||||
"@tanstack/vue-query": "^5.83.0",
|
||||
|
||||
"@tanstack/react-query-devtools": "^5.80.5",
|
||||
"@tanstack/react-query": "^5.80.5",
|
||||
|
||||
|
||||
@@ -345,5 +345,5 @@ function getBunWebNativeWarning(): string {
|
||||
}
|
||||
|
||||
function getWorkersDeployInstructions(runCmd?: string): string {
|
||||
return `\n${pc.bold("Deploy frontend to Cloudflare Workers:")}\n${pc.cyan("•")} Deploy: ${`cd apps/web && ${runCmd || "bun run"} deploy`}`;
|
||||
return `\n${pc.bold("Deploy frontend to Cloudflare Workers:")}\n${pc.cyan("•")} Deploy: ${`cd apps/web && ${runCmd} run deploy`}`;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,8 @@ export async function setupApi(config: ProjectConfig) {
|
||||
if (api === "orpc") {
|
||||
await addPackageDependency({
|
||||
dependencies: [
|
||||
"@tanstack/vue-query",
|
||||
"@tanstack/vue-query-devtools",
|
||||
"@orpc/tanstack-query",
|
||||
"@orpc/client",
|
||||
"@orpc/server",
|
||||
@@ -219,7 +221,10 @@ export async function setupApi(config: ProjectConfig) {
|
||||
if (hasSvelteWeb) {
|
||||
webDepsToAdd.push("convex-svelte");
|
||||
}
|
||||
|
||||
if (hasNuxtWeb) {
|
||||
webDepsToAdd.push("convex-nuxt");
|
||||
webDepsToAdd.push("convex-vue");
|
||||
}
|
||||
await addPackageDependency({
|
||||
dependencies: webDepsToAdd,
|
||||
projectDir: webDir,
|
||||
|
||||
@@ -9,9 +9,7 @@ export async function getBackendFrameworkChoice(
|
||||
): Promise<Backend> {
|
||||
if (backendFramework !== undefined) return backendFramework;
|
||||
|
||||
const hasIncompatibleFrontend = frontends?.some(
|
||||
(f) => f === "nuxt" || f === "solid",
|
||||
);
|
||||
const hasIncompatibleFrontend = frontends?.some((f) => f === "solid");
|
||||
|
||||
const backendOptions: Array<{
|
||||
value: Backend;
|
||||
@@ -59,15 +57,10 @@ export async function getBackendFrameworkChoice(
|
||||
hint: "No backend server",
|
||||
});
|
||||
|
||||
let initialValue = DEFAULT_CONFIG.backend;
|
||||
if (hasIncompatibleFrontend && initialValue === "convex") {
|
||||
initialValue = "hono";
|
||||
}
|
||||
|
||||
const response = await select<Backend>({
|
||||
message: "Select backend",
|
||||
options: backendOptions,
|
||||
initialValue,
|
||||
initialValue: DEFAULT_CONFIG.backend,
|
||||
});
|
||||
|
||||
if (isCancel(response)) {
|
||||
|
||||
@@ -75,7 +75,7 @@ export async function getFrontendChoice(
|
||||
|
||||
const webOptions = allWebOptions.filter((option) => {
|
||||
if (backend === "convex") {
|
||||
return option.value !== "nuxt" && option.value !== "solid";
|
||||
return option.value !== "solid";
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
@@ -205,7 +205,7 @@ export function processAndValidateFlags(
|
||||
|
||||
if (providedFlags.has("frontend") && options.frontend) {
|
||||
const incompatibleFrontends = options.frontend.filter(
|
||||
(f) => f === "nuxt" || f === "solid",
|
||||
(f) => f === "solid",
|
||||
);
|
||||
if (incompatibleFrontends.length > 0) {
|
||||
consola.fatal(
|
||||
|
||||
Reference in New Issue
Block a user