From 484095157d23c575d0900575bc92ecadbc1cdfb1 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Mon, 12 May 2025 13:36:05 +0530 Subject: [PATCH] fix ts references when backend is none or convex --- .changeset/eleven-heads-open.md | 5 +++++ .../native/nativewind/{tsconfig.json => tsconfig.json.hbs} | 2 ++ .../native/unistyles/{tsconfig.json => tsconfig.json.hbs} | 2 ++ .../frontend/nuxt/{tsconfig.json => tsconfig.json.hbs} | 2 ++ .../frontend/react/next/{tsconfig.json => tsconfig.json.hbs} | 2 ++ .../react/react-router/{tsconfig.json => tsconfig.json.hbs} | 2 ++ .../tanstack-router/{tsconfig.json => tsconfig.json.hbs} | 2 ++ .../tanstack-start/{tsconfig.json => tsconfig.json.hbs} | 2 ++ .../frontend/solid/{tsconfig.json => tsconfig.json.hbs} | 2 ++ .../frontend/svelte/{tsconfig.json => tsconfig.json.hbs} | 4 +++- 10 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .changeset/eleven-heads-open.md rename apps/cli/templates/frontend/native/nativewind/{tsconfig.json => tsconfig.json.hbs} (80%) rename apps/cli/templates/frontend/native/unistyles/{tsconfig.json => tsconfig.json.hbs} (79%) rename apps/cli/templates/frontend/nuxt/{tsconfig.json => tsconfig.json.hbs} (65%) rename apps/cli/templates/frontend/react/next/{tsconfig.json => tsconfig.json.hbs} (90%) rename apps/cli/templates/frontend/react/react-router/{tsconfig.json => tsconfig.json.hbs} (89%) rename apps/cli/templates/frontend/react/tanstack-router/{tsconfig.json => tsconfig.json.hbs} (84%) rename apps/cli/templates/frontend/react/tanstack-start/{tsconfig.json => tsconfig.json.hbs} (90%) rename apps/cli/templates/frontend/solid/{tsconfig.json => tsconfig.json.hbs} (90%) rename apps/cli/templates/frontend/svelte/{tsconfig.json => tsconfig.json.hbs} (87%) diff --git a/.changeset/eleven-heads-open.md b/.changeset/eleven-heads-open.md new file mode 100644 index 0000000..58a8242 --- /dev/null +++ b/.changeset/eleven-heads-open.md @@ -0,0 +1,5 @@ +--- +"create-better-t-stack": patch +--- + +remove references from tsconfig when backend is none or convex diff --git a/apps/cli/templates/frontend/native/nativewind/tsconfig.json b/apps/cli/templates/frontend/native/nativewind/tsconfig.json.hbs similarity index 80% rename from apps/cli/templates/frontend/native/nativewind/tsconfig.json rename to apps/cli/templates/frontend/native/nativewind/tsconfig.json.hbs index 487386a..69aeec2 100644 --- a/apps/cli/templates/frontend/native/nativewind/tsconfig.json +++ b/apps/cli/templates/frontend/native/nativewind/tsconfig.json.hbs @@ -15,7 +15,9 @@ "expo-env.d.ts", "nativewind-env.d.ts" ], + {{#unless (or (eq backend "convex") (eq backend "none"))}} "references": [{ "path": "../server" }] + {{/unless}} } diff --git a/apps/cli/templates/frontend/native/unistyles/tsconfig.json b/apps/cli/templates/frontend/native/unistyles/tsconfig.json.hbs similarity index 79% rename from apps/cli/templates/frontend/native/unistyles/tsconfig.json rename to apps/cli/templates/frontend/native/unistyles/tsconfig.json.hbs index d2c4916..ede463c 100644 --- a/apps/cli/templates/frontend/native/unistyles/tsconfig.json +++ b/apps/cli/templates/frontend/native/unistyles/tsconfig.json.hbs @@ -9,7 +9,9 @@ } }, "include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"], + {{#unless (or (eq backend "convex") (eq backend "none"))}} "references": [{ "path": "../server" }] + {{/unless}} } diff --git a/apps/cli/templates/frontend/nuxt/tsconfig.json b/apps/cli/templates/frontend/nuxt/tsconfig.json.hbs similarity index 65% rename from apps/cli/templates/frontend/nuxt/tsconfig.json rename to apps/cli/templates/frontend/nuxt/tsconfig.json.hbs index d322c58..1b295aa 100644 --- a/apps/cli/templates/frontend/nuxt/tsconfig.json +++ b/apps/cli/templates/frontend/nuxt/tsconfig.json.hbs @@ -1,7 +1,9 @@ { // https://nuxt.com/docs/guide/concepts/typescript "extends": "./.nuxt/tsconfig.json", + {{#unless (or (eq backend "convex") (eq backend "none"))}} "references": [{ "path": "../server" }] + {{/unless}} } diff --git a/apps/cli/templates/frontend/react/next/tsconfig.json b/apps/cli/templates/frontend/react/next/tsconfig.json.hbs similarity index 90% rename from apps/cli/templates/frontend/react/next/tsconfig.json rename to apps/cli/templates/frontend/react/next/tsconfig.json.hbs index 34c5485..16f1684 100644 --- a/apps/cli/templates/frontend/react/next/tsconfig.json +++ b/apps/cli/templates/frontend/react/next/tsconfig.json.hbs @@ -25,7 +25,9 @@ }, "include": ["./next-env.d.ts", "./**/*.ts", "./**/*.tsx", "./.next/types/**/*.ts"], "exclude": ["./node_modules"], + {{#unless (or (eq backend "convex") (eq backend "none"))}} "references": [{ "path": "../server" }] + {{/unless}} } diff --git a/apps/cli/templates/frontend/react/react-router/tsconfig.json b/apps/cli/templates/frontend/react/react-router/tsconfig.json.hbs similarity index 89% rename from apps/cli/templates/frontend/react/react-router/tsconfig.json rename to apps/cli/templates/frontend/react/react-router/tsconfig.json.hbs index 030bdbe..b2d4c22 100644 --- a/apps/cli/templates/frontend/react/react-router/tsconfig.json +++ b/apps/cli/templates/frontend/react/react-router/tsconfig.json.hbs @@ -24,7 +24,9 @@ "skipLibCheck": true, "strict": true }, + {{#unless (or (eq backend "convex") (eq backend "none"))}} "references": [{ "path": "../server" }] + {{/unless}} } diff --git a/apps/cli/templates/frontend/react/tanstack-router/tsconfig.json b/apps/cli/templates/frontend/react/tanstack-router/tsconfig.json.hbs similarity index 84% rename from apps/cli/templates/frontend/react/tanstack-router/tsconfig.json rename to apps/cli/templates/frontend/react/tanstack-router/tsconfig.json.hbs index 2845b4d..cb03647 100644 --- a/apps/cli/templates/frontend/react/tanstack-router/tsconfig.json +++ b/apps/cli/templates/frontend/react/tanstack-router/tsconfig.json.hbs @@ -15,7 +15,9 @@ "@/*": ["./src/*"] } }, + {{#unless (or (eq backend "convex") (eq backend "none"))}} "references": [{ "path": "../server" }] + {{/unless}} } diff --git a/apps/cli/templates/frontend/react/tanstack-start/tsconfig.json b/apps/cli/templates/frontend/react/tanstack-start/tsconfig.json.hbs similarity index 90% rename from apps/cli/templates/frontend/react/tanstack-start/tsconfig.json rename to apps/cli/templates/frontend/react/tanstack-start/tsconfig.json.hbs index 04ac163..1ff0ad7 100644 --- a/apps/cli/templates/frontend/react/tanstack-start/tsconfig.json +++ b/apps/cli/templates/frontend/react/tanstack-start/tsconfig.json.hbs @@ -25,7 +25,9 @@ "@/*": ["./src/*"] } }, + {{#unless (or (eq backend "convex") (eq backend "none"))}} "references": [{ "path": "../server" }] + {{/unless}} } diff --git a/apps/cli/templates/frontend/solid/tsconfig.json b/apps/cli/templates/frontend/solid/tsconfig.json.hbs similarity index 90% rename from apps/cli/templates/frontend/solid/tsconfig.json rename to apps/cli/templates/frontend/solid/tsconfig.json.hbs index b733483..cdfc2d4 100644 --- a/apps/cli/templates/frontend/solid/tsconfig.json +++ b/apps/cli/templates/frontend/solid/tsconfig.json.hbs @@ -26,7 +26,9 @@ "@/*": ["./src/*"] } }, + {{#unless (or (eq backend "convex") (eq backend "none"))}} "references": [{ "path": "../server" }] + {{/unless}} } diff --git a/apps/cli/templates/frontend/svelte/tsconfig.json b/apps/cli/templates/frontend/svelte/tsconfig.json.hbs similarity index 87% rename from apps/cli/templates/frontend/svelte/tsconfig.json rename to apps/cli/templates/frontend/svelte/tsconfig.json.hbs index 6a5b9fe..eaad01f 100644 --- a/apps/cli/templates/frontend/svelte/tsconfig.json +++ b/apps/cli/templates/frontend/svelte/tsconfig.json.hbs @@ -11,9 +11,11 @@ "strict": true, "moduleResolution": "bundler" }, - "references": [{ + {{#unless (or (eq backend "convex") (eq backend "none"))}} + "references": [{ "path": "../server" }] + {{/unless}} // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files //