mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add tauri option for nextjs
This commit is contained in:
5
.changeset/chubby-coins-greet.md
Normal file
5
.changeset/chubby-coins-greet.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"create-better-t-stack": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
add tauri option for nextjs
|
||||||
@@ -14,6 +14,7 @@ export async function setupAddons(config: ProjectConfig) {
|
|||||||
const hasNuxtFrontend = frontend.includes("nuxt");
|
const hasNuxtFrontend = frontend.includes("nuxt");
|
||||||
const hasSvelteFrontend = frontend.includes("svelte");
|
const hasSvelteFrontend = frontend.includes("svelte");
|
||||||
const hasSolidFrontend = frontend.includes("solid");
|
const hasSolidFrontend = frontend.includes("solid");
|
||||||
|
const hasNextFrontend = frontend.includes("next");
|
||||||
|
|
||||||
if (addons.includes("turborepo")) {
|
if (addons.includes("turborepo")) {
|
||||||
await addPackageDependency({
|
await addPackageDependency({
|
||||||
@@ -30,7 +31,8 @@ export async function setupAddons(config: ProjectConfig) {
|
|||||||
(hasReactWebFrontend ||
|
(hasReactWebFrontend ||
|
||||||
hasNuxtFrontend ||
|
hasNuxtFrontend ||
|
||||||
hasSvelteFrontend ||
|
hasSvelteFrontend ||
|
||||||
hasSolidFrontend)
|
hasSolidFrontend ||
|
||||||
|
hasNextFrontend)
|
||||||
) {
|
) {
|
||||||
await setupTauri(config);
|
await setupTauri(config);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,17 +45,22 @@ export async function setupTauri(config: ProjectConfig): Promise<void> {
|
|||||||
const hasNuxt = frontend.includes("nuxt");
|
const hasNuxt = frontend.includes("nuxt");
|
||||||
const hasSvelte = frontend.includes("svelte");
|
const hasSvelte = frontend.includes("svelte");
|
||||||
const hasSolid = frontend.includes("solid");
|
const hasSolid = frontend.includes("solid");
|
||||||
|
const hasNext = frontend.includes("next");
|
||||||
|
|
||||||
const devUrl =
|
const devUrl =
|
||||||
hasReactRouter || hasSvelte
|
hasReactRouter || hasSvelte
|
||||||
? "http://localhost:5173"
|
? "http://localhost:5173"
|
||||||
: "http://localhost:3001";
|
: hasNext
|
||||||
|
? "http://localhost:3001"
|
||||||
|
: "http://localhost:3001";
|
||||||
|
|
||||||
const frontendDist = hasNuxt
|
const frontendDist = hasNuxt
|
||||||
? "../.output/public"
|
? "../.output/public"
|
||||||
: hasSvelte
|
: hasSvelte
|
||||||
? "../build"
|
? "../build"
|
||||||
: "../dist";
|
: hasNext
|
||||||
|
? "../.next"
|
||||||
|
: "../dist";
|
||||||
|
|
||||||
const tauriArgs = [
|
const tauriArgs = [
|
||||||
"init",
|
"init",
|
||||||
|
|||||||
@@ -795,7 +795,8 @@ function processAndValidateFlags(
|
|||||||
f === "react-router" ||
|
f === "react-router" ||
|
||||||
f === "nuxt" ||
|
f === "nuxt" ||
|
||||||
f === "svelte" ||
|
f === "svelte" ||
|
||||||
f === "solid";
|
f === "solid" ||
|
||||||
|
f === "next";
|
||||||
|
|
||||||
if (
|
if (
|
||||||
config.addons?.includes("pwa") &&
|
config.addons?.includes("pwa") &&
|
||||||
@@ -820,7 +821,7 @@ function processAndValidateFlags(
|
|||||||
}
|
}
|
||||||
if (config.addons.includes("tauri")) {
|
if (config.addons.includes("tauri")) {
|
||||||
incompatibleReason =
|
incompatibleReason =
|
||||||
"Tauri requires tanstack-router, react-router, nuxt, svelte, or solid.";
|
"Tauri requires tanstack-router, react-router, nuxt, svelte, solid, or next.";
|
||||||
}
|
}
|
||||||
consola.fatal(
|
consola.fatal(
|
||||||
`Incompatible addon/frontend combination: ${incompatibleReason}`,
|
`Incompatible addon/frontend combination: ${incompatibleReason}`,
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ export async function getAddonsChoice(
|
|||||||
frontends?.includes("tanstack-router") ||
|
frontends?.includes("tanstack-router") ||
|
||||||
frontends?.includes("nuxt") ||
|
frontends?.includes("nuxt") ||
|
||||||
frontends?.includes("svelte") ||
|
frontends?.includes("svelte") ||
|
||||||
frontends?.includes("solid");
|
frontends?.includes("solid") ||
|
||||||
|
frontends?.includes("next");
|
||||||
|
|
||||||
const allPossibleOptions: AddonOption[] = [
|
const allPossibleOptions: AddonOption[] = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -105,7 +105,14 @@ const hasPWACompatibleFrontend = (frontend: string[]) =>
|
|||||||
|
|
||||||
const hasTauriCompatibleFrontend = (frontend: string[]) =>
|
const hasTauriCompatibleFrontend = (frontend: string[]) =>
|
||||||
frontend.some((f) =>
|
frontend.some((f) =>
|
||||||
["tanstack-router", "react-router", "nuxt", "svelte", "solid"].includes(f),
|
[
|
||||||
|
"tanstack-router",
|
||||||
|
"react-router",
|
||||||
|
"nuxt",
|
||||||
|
"svelte",
|
||||||
|
"solid",
|
||||||
|
"next",
|
||||||
|
].includes(f),
|
||||||
);
|
);
|
||||||
|
|
||||||
const getBadgeColors = (category: string): string => {
|
const getBadgeColors = (category: string): string => {
|
||||||
@@ -545,10 +552,10 @@ const analyzeStackCompatibility = (stack: StackState): CompatibilityResult => {
|
|||||||
if (!isTauriCompat && nextStack.addons.includes("tauri")) {
|
if (!isTauriCompat && nextStack.addons.includes("tauri")) {
|
||||||
incompatibleAddons.push("tauri");
|
incompatibleAddons.push("tauri");
|
||||||
notes.frontend.notes.push(
|
notes.frontend.notes.push(
|
||||||
"Tauri addon requires TanStack/React Router, Nuxt, Svelte or Solid. Addon will be removed.",
|
"Tauri addon requires TanStack/React Router, Nuxt, Svelte, Solid, or Next.js. Addon will be removed.",
|
||||||
);
|
);
|
||||||
notes.addons.notes.push(
|
notes.addons.notes.push(
|
||||||
"Tauri requires TanStack/React Router/Nuxt/Svelte/Solid. It will be removed.",
|
"Tauri requires TanStack/React Router/Nuxt/Svelte/Solid/Next.js. It will be removed.",
|
||||||
);
|
);
|
||||||
notes.frontend.hasIssue = true;
|
notes.frontend.hasIssue = true;
|
||||||
notes.addons.hasIssue = true;
|
notes.addons.hasIssue = true;
|
||||||
@@ -1213,7 +1220,7 @@ const StackArchitect = () => {
|
|||||||
addRule(
|
addRule(
|
||||||
category,
|
category,
|
||||||
techId,
|
techId,
|
||||||
"Disabled: Tauri addon requires a compatible frontend (e.g., TanStack Router, Nuxt, Svelte, Solid).",
|
"Disabled: Tauri addon requires a compatible frontend (e.g., TanStack Router, Nuxt, Svelte, Solid, Next.js).",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
64
bun.lock
64
bun.lock
@@ -14,7 +14,7 @@
|
|||||||
},
|
},
|
||||||
"apps/cli": {
|
"apps/cli": {
|
||||||
"name": "create-better-t-stack",
|
"name": "create-better-t-stack",
|
||||||
"version": "2.9.3",
|
"version": "2.9.5",
|
||||||
"bin": {
|
"bin": {
|
||||||
"create-better-t-stack": "dist/index.js",
|
"create-better-t-stack": "dist/index.js",
|
||||||
},
|
},
|
||||||
@@ -42,39 +42,39 @@
|
|||||||
"name": "web",
|
"name": "web",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@radix-ui/react-dialog": "latest",
|
"@radix-ui/react-dialog": "^1.1.13",
|
||||||
"@radix-ui/react-scroll-area": "latest",
|
"@radix-ui/react-scroll-area": "^1.2.8",
|
||||||
"@radix-ui/react-switch": "latest",
|
"@radix-ui/react-switch": "^1.2.4",
|
||||||
"@radix-ui/react-tooltip": "latest",
|
"@radix-ui/react-tooltip": "^1.2.6",
|
||||||
"babel-plugin-react-compiler": "latest",
|
"babel-plugin-react-compiler": "^19.1.0-rc.1",
|
||||||
"class-variance-authority": "latest",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "latest",
|
"clsx": "^2.1.1",
|
||||||
"fumadocs-core": "latest",
|
"fumadocs-core": "15.3.0",
|
||||||
"fumadocs-mdx": "latest",
|
"fumadocs-mdx": "11.6.3",
|
||||||
"fumadocs-ui": "latest",
|
"fumadocs-ui": "15.3.0",
|
||||||
"lucide-react": "latest",
|
"lucide-react": "^0.509.0",
|
||||||
"motion": "latest",
|
"motion": "^12.10.5",
|
||||||
"next": "latest",
|
"next": "15.3.2",
|
||||||
"next-themes": "latest",
|
"next-themes": "^0.4.6",
|
||||||
"nuqs": "latest",
|
"nuqs": "^2.4.3",
|
||||||
"react": "latest",
|
"react": "^19.1.0",
|
||||||
"react-dom": "latest",
|
"react-dom": "^19.1.0",
|
||||||
"react-tweet": "latest",
|
"react-tweet": "^3.2.2",
|
||||||
"sonner": "latest",
|
"sonner": "^2.0.3",
|
||||||
"tailwind-merge": "latest",
|
"tailwind-merge": "^3.2.0",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/postcss": "latest",
|
"@tailwindcss/postcss": "^4.1.6",
|
||||||
"@types/mdx": "latest",
|
"@types/mdx": "^2.0.13",
|
||||||
"@types/node": "latest",
|
"@types/node": "22.15.17",
|
||||||
"@types/react": "latest",
|
"@types/react": "^19.1.3",
|
||||||
"@types/react-dom": "latest",
|
"@types/react-dom": "^19.1.3",
|
||||||
"eslint": "latest",
|
"eslint": "^9.26.0",
|
||||||
"eslint-config-next": "latest",
|
"eslint-config-next": "15.3.2",
|
||||||
"postcss": "latest",
|
"postcss": "^8.5.3",
|
||||||
"tailwindcss": "latest",
|
"tailwindcss": "^4.1.6",
|
||||||
"tw-animate-css": "latest",
|
"tw-animate-css": "^1.2.9",
|
||||||
"typescript": "latest",
|
"typescript": "^5.8.3",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user