-
-
Notifications
You must be signed in to change notification settings - Fork 171
feat: add T3 Env support (needs testing) #544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7fa8718
a089360
3759be6
53263eb
f978479
4de6454
b5da47f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,8 @@ | |
"shadcn", | ||
"pwa", | ||
"tauri", | ||
"biome" | ||
"biome", | ||
"t3env" | ||
], | ||
"repository": { | ||
"type": "git", | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,6 +9,7 @@ import { getPackageExecutionCommand } from "../../utils/package-runner"; | |||||||||||||||||||
import { setupFumadocs } from "./fumadocs-setup"; | ||||||||||||||||||||
import { setupVibeRules } from "./ruler-setup"; | ||||||||||||||||||||
import { setupStarlight } from "./starlight-setup"; | ||||||||||||||||||||
import { setupT3Env } from "./t3env-setup"; | ||||||||||||||||||||
import { setupTauri } from "./tauri-setup"; | ||||||||||||||||||||
import { setupUltracite } from "./ultracite-setup"; | ||||||||||||||||||||
import { addPwaToViteConfig } from "./vite-pwa-setup"; | ||||||||||||||||||||
|
@@ -58,6 +59,11 @@ ${pc.cyan("Docs:")} ${pc.underline("https://turborepo.com/docs")} | |||||||||||||||||||
) { | ||||||||||||||||||||
await setupTauri(config); | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
if (addons.includes("t3env")) { | ||||||||||||||||||||
await setupT3Env(config); | ||||||||||||||||||||
} | ||||||||||||||||||||
Comment on lines
+63
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainEnsure zod is installed for Next.js web when adding T3 Env The Apply this diff in - if (hasNext) {
- await addPackageDependency({
- dependencies: ["@t3-oss/env-nextjs"],
- projectDir: webDir,
- });
- } else if (hasNuxt) {
+ if (hasNext) {
+ await addPackageDependency({
+ dependencies: ["@t3-oss/env-nextjs", "zod"],
+ projectDir: webDir,
+ });
+ } else if (hasNuxt) {
// For Nuxt, we'll use the core package
await addPackageDependency({
dependencies: ["@t3-oss/env-nuxt", "zod"],
projectDir: webDir,
});
} else {
// For other frameworks, use the core package
await addPackageDependency({
dependencies: ["@t3-oss/env-core", "zod"],
projectDir: webDir,
});
} Also confirm 🏁 Script executed: #!/bin/bash
# Inspect Next.js branch in t3env-setup.ts to verify if "zod" is included
rg -n "addPackageDependency" -C3 --glob "apps/cli/src/helpers/addons/t3env-setup.ts"
# Locate dependencyVersionMap to ensure pinned versions for required packages
rg -n "dependencyVersionMap" -C3 Length of output: 5018 🏁 Script executed: #!/bin/bash
# Display the section of dependencyVersionMap around @t3-oss/env-core, @t3-oss/env-nextjs, and zod
sed -n '120,160p' apps/cli/src/constants.ts Length of output: 1224 Ensure The Next.js path in • File: - if (hasNext) {
- await addPackageDependency({
- dependencies: ["@t3-oss/env-nextjs"],
- projectDir: webDir,
- });
- } else if (hasNuxt) {
+ if (hasNext) {
+ await addPackageDependency({
+ dependencies: ["@t3-oss/env-nextjs", "zod"],
+ projectDir: webDir,
+ });
+ } else if (hasNuxt) { • I’ve confirmed in 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||
|
||||||||||||||||||||
const hasUltracite = addons.includes("ultracite"); | ||||||||||||||||||||
const hasBiome = addons.includes("biome"); | ||||||||||||||||||||
const hasHusky = addons.includes("husky"); | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,64 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import path from "node:path"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { spinner } from "@clack/prompts"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { consola } from "consola"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import fs from "fs-extra"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import pc from "picocolors"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import type { ProjectConfig } from "../../types"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { addPackageDependency } from "../../utils/add-package-deps"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export async function setupT3Env(config: ProjectConfig) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { frontend, backend, projectDir } = config; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const s = spinner(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// T3 Env requires a backend to be present | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (backend === "none") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
s.stop(pc.yellow("T3 Env requires a backend to be configured")); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+13
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect early return and spinner misuse block web-only setups.
Refactor to always process the web app and only skip the server section when no backend/server app exists. - // T3 Env requires a backend to be present
- if (backend === "none") {
- s.stop(pc.yellow("T3 Env requires a backend to be configured"));
- return;
- }
+ // Proceed regardless of backend; we'll conditionally configure server/web below. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
s.start("Setting up T3 Env for type-safe environment variables..."); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Add dependencies to server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const serverDir = path.join(projectDir, "apps/server"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (await fs.pathExists(serverDir)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await addPackageDependency({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dependencies: ["@t3-oss/env-core", "zod"], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
projectDir: serverDir, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+19
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Start the spinner before any conditional exits; improve messaging. Begin the spinner first, then handle per-app setup. This avoids calling stop before start and provides clearer UX. - try {
- s.start("Setting up T3 Env for type-safe environment variables...");
+ try {
+ s.start("Setting up T3 Env for type-safe environment variables..."); Optionally, after computing presence, add a note if neither app exists: + const serverDir = path.join(projectDir, "apps/server");
+ const webDir = path.join(projectDir, "apps/web");
+ const hasServer = await fs.pathExists(serverDir);
+ const hasWeb = await fs.pathExists(webDir);
+ if (!hasServer && !hasWeb) {
+ s.stop(pc.yellow("No apps/server or apps/web found; skipping T3 Env setup."));
+ return;
+ } 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Add framework-specific dependencies to web app | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const webDir = path.join(projectDir, "apps/web"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (await fs.pathExists(webDir)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const hasNext = frontend.includes("next"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const hasNuxt = frontend.includes("nuxt"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (hasNext) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await addPackageDependency({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dependencies: ["@t3-oss/env-nextjs"], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
projectDir: webDir, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else if (hasNuxt) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+37
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Next.js branch should also add zod. Templates typically import zod schemas; - if (hasNext) {
+ if (hasNext) {
await addPackageDependency({
- dependencies: ["@t3-oss/env-nextjs"],
+ dependencies: ["@t3-oss/env-nextjs", "zod"],
projectDir: webDir,
}); 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// For Nuxt, we'll use the core package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await addPackageDependency({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dependencies: ["@t3-oss/env-nuxt", "zod"], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
projectDir: webDir, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// For other frameworks, use the core package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
await addPackageDependency({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dependencies: ["@t3-oss/env-core", "zod"], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
projectDir: webDir, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
s.stop("T3 Env configured successfully!"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} catch (error) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
s.stop(pc.red("Failed to set up T3 Env")); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (error instanceof Error) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
consola.error(pc.red(error.message)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1 @@ | ||||||
import "@/env/server"; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainSame alias-resolution pitfall: switch to a relative import in server Next config Using "@/env/server" in -import "@/env/server";
+// If next.config.ts is at the app root:
+import "./src/env/server";
+// If placed under src/:
+// import "./env/server"; Double-check the final file location produced by the generator and align the relative path accordingly. 🏁 Script executed: #!/bin/bash
set -e
# Print current working directory
pwd
# List files under the Next.js config directory
find apps/cli/templates/addons/t3env/apps/server/next -maxdepth 2 -type f -print
# Find environment schema files in the template
find apps/cli/templates/addons/t3env -type f \( -name "server.ts" -o -name "env.ts" \) -print Length of output: 274 🏁 Script executed: #!/bin/bash
set -e
echo "Listing all files under apps/cli/templates/addons/t3env:"
find apps/cli/templates/addons/t3env -type f Length of output: 518 🏁 Script executed: #!/bin/bash
# Display the beginning of the Next.js server template config to inspect import paths
sed -n '1,100p' apps/cli/templates/addons/t3env/apps/server/next/next.config.ts Length of output: 102 Switch to a relative import in Importing via the • File needing update: • Change the import to point at -import "@/env/server";
+import "./src/env/server"; Verify this path matches your final project structure (e.g., if 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { createEnv } from "@t3-oss/env-nextjs"; | ||
import { z } from "zod"; | ||
|
||
export const env = createEnv({ | ||
server: { | ||
DATABASE_URL: z.string().url(), | ||
BETTER_AUTH_SECRET: z.string().min(1), | ||
BETTER_AUTH_URL: z.string().url(), | ||
CORS_ORIGIN: z.string().url(), | ||
{{#if (includes examples 'ai')}} | ||
GOOGLE_GENERATIVE_AI_API_KEY: z.string().min(1), | ||
{{/if}} | ||
}, | ||
experimental__runtimeEnv: process.env, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { createEnv } from "@t3-oss/env-nextjs"; | ||
import { z } from "zod"; | ||
|
||
export const env = createEnv({ | ||
client: { | ||
NEXT_PUBLIC_SERVER_URL: z.string().url(), | ||
{{#if (eq backend 'convex')}} | ||
NEXT_PUBLIC_CONVEX_URL: z.string().url(), | ||
{{/if}} | ||
}, | ||
Comment on lines
+5
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainKeep client keys and runtimeEnv in lockstep. Given the conditional Convex block, any future additions to Run this quick repo check to ensure the Next template importing this file resolves path aliases and that the dependency is declared: Also applies to: 11-16 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Verify next.config imports the client env (fail fast validation at build time)
rg -n --color=always $'from\\s+[\'"]@/env/client[\'"]' apps/cli/templates/addons/t3env/apps/web/next/src/next.config.ts.hbs || {
echo "Missing import of '@/env/client' in next.config.ts.hbs" >&2; exit 1; }
# 2) Ensure '@' path alias exists in the Next web template tsconfig
tsconfigs=$(fd -t f --full-path 'apps/cli/templates/addons/t3env/apps/web/next/.*tsconfig.*' || true)
if [ -n "$tsconfigs" ]; then
echo "$tsconfigs" | xargs -I{} rg -n -C2 --color=always '"paths"\s*:\s*\{\s*"@/\*"\s*:\s*\["\./src/\*"\]' {} || {
echo "Missing '@/ -> ./src/*' path alias in Next web tsconfig" >&2; exit 1; }
else
echo "No tsconfig found for Next web template; please verify alias setup." >&2; exit 1
fi
# 3) Confirm the dependency is declared somewhere in templates
rg -n --color=always '@t3-oss/env-nextjs' || {
echo "Dependency '@t3-oss/env-nextjs' not found in template manifests" >&2; exit 1; } Length of output: 281 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 2) Verify tsconfig path alias for '@/*'
echo "Checking tsconfig path aliases..."
tsconfigs=$(fd -t f --full-path 'apps/cli/templates/addons/t3env/apps/web/next/.*tsconfig.*' || true)
if [ -n "$tsconfigs" ]; then
echo "$tsconfigs" | while read -r f; do
echo "-- Inspecting $f --"
rg -n -C2 '"paths"\s*:\s*\{[^}]*"@/\*"\s*:\s*\["\.\/src\/\*"\]' "$f" \
|| echo "Missing '@/*' path alias in $f"
done
else
echo "No tsconfig found for Next web template"
fi
# 3) Confirm the dependency '@t3-oss/env-nextjs'
echo
echo "Checking for '@t3-oss/env-nextjs' dependency..."
rg -n '@t3-oss/env-nextjs' || echo "Dependency '@t3-oss/env-nextjs' not found in template manifests" Length of output: 836 Action required: Add missing client env import & verify path alias The repo check indicates two critical gaps in the Next web template:
The dependency Please address the following: • In + import { createEnv } from '@/env/client'; • Locate (or create) the Next web template’s TypeScript config ( {
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
}
} 🤖 Prompt for AI Agents
|
||
runtimeEnv: { | ||
NEXT_PUBLIC_SERVER_URL: process.env.NEXT_PUBLIC_SERVER_URL, | ||
{{#if (eq backend 'convex')}} | ||
NEXT_PUBLIC_CONVEX_URL: process.env.NEXT_PUBLIC_CONVEX_URL, | ||
{{/if}} | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "@/env/client"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainAvoid path alias in next.config; use a relative import
Apply: -import "@/env/client";
+import "./env/client"; If this file is generated at the project root instead of import "./src/env/client"; Also consider switching to the server env import if present (often recommended): To verify the recommendation: 🏁 Script executed: #!/bin/bash
# 1. Show the import in the template
sed -n '1,50p' apps/cli/templates/addons/t3env/apps/web/next/src/next.config.ts.hbs
# 2. Confirm any tsconfig path aliases
rg -n '"paths"' -g 'tsconfig.json' -C3
rg -n '"@/\*"' -g 'tsconfig.json' -C3 Length of output: 876 🌐 Web query:
💡 Result: Short summary and practical guidance.
Sources
Use a relative import in next.config.ts.hbs -import "@/env/client";
+import "./env/client"; If your config is at the project root instead of import "./src/env/client"; 🤖 Prompt for AI Agents
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createEnv } from "@t3-oss/env-nuxt"; | ||
import { z } from "zod"; | ||
|
||
export const env = createEnv({ | ||
client: { | ||
NUXT_PUBLIC_SERVER_URL: z.string().url(), | ||
{{#if (eq backend 'convex')}} | ||
NUXT_PUBLIC_CONVEX_URL: z.string().url(), | ||
{{/if}} | ||
} | ||
}); |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,3 +1,5 @@ | ||||||||||
import "./env"; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainImport path and unconditional import will break non-t3env scaffolds
Gate the import behind the addon flag and point to the correct file. Apply: - import "./env";
+ {{#if (includes addons "t3env")}}import "~/env/client";{{/if}} If the To confirm helper availability across templates: 🏁 Script executed: #!/usr/bin/env bash
# Look for existing array-membership helpers in templates
rg -n -C2 "{{#if \(includes " apps/cli/templates || true
rg -n -C2 "{{#if \(some " apps/cli/templates || true Length of output: 293 🏁 Script executed: #!/usr/bin/env bash
# Search for includes helper usage in Handlebars templates
rg -nF '{{#if (includes' -g '*.hbs' apps/cli/templates || true
# Search for 'some' helper usage in Handlebars templates
rg -nF '{{#if (some' -g '*.hbs' apps/cli/templates || true
# Search for includes helper registration in TypeScript code
rg -nP 'registerHelper\(\s*["'\'']?includes["'\'']?,' -g '*.ts' apps/cli || true
# Search for any helper registrations to locate available helpers
rg -n 'registerHelper' -g '*.ts' apps/cli || true Length of output: 4376 🏁 Script executed: #!/usr/bin/env bash
# Display the beginning of the helper registration file to verify available helpers
sed -n '1,200p' apps/cli/src/utils/template-processor.ts Length of output: 1334 Fix conditional Nuxt env import for t3env addon The Nuxt scaffold currently unconditionally imports • File to update: - import "./env";
+ {{#if (includes addons "t3env")}}import "~/env/client";{{/if}} This ensures that only projects with the 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||
|
||||||||||
// https://nuxt.com/docs/api/configuration/nuxt-config | ||||||||||
export default defineNuxtConfig({ | ||||||||||
compatibilityDate: 'latest', | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ const NpmPackage = () => { | |
); | ||
}; | ||
|
||
export default NpmPackage; | ||
export default NpmPackage; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -369,13 +369,17 @@ export const addonsConfig = { | |||||||||||||||||||||||||||||
label: "Starlight", | ||||||||||||||||||||||||||||||
color: "hsl(var(--chart-5))", | ||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||
t3env: { | ||||||||||||||||||||||||||||||
label: "T3 Env", | ||||||||||||||||||||||||||||||
color: "hsl(var(--chart-6))", | ||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||
turborepo: { | ||||||||||||||||||||||||||||||
label: "Turborepo", | ||||||||||||||||||||||||||||||
color: "hsl(var(--chart-6))", | ||||||||||||||||||||||||||||||
color: "hsl(var(--chart-7))", | ||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||
none: { | ||||||||||||||||||||||||||||||
label: "No Addons", | ||||||||||||||||||||||||||||||
color: "hsl(var(--chart-7))", | ||||||||||||||||||||||||||||||
color: "hsl(var(--chart-8))", | ||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||
Comment on lines
+378
to
383
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify availability of CSS token --chart-8 before using it. You bumped turborepo to 🏁 Script executed: #!/bin/bash
# Verify that --chart-8 is defined somewhere in CSS/vars.
rg -nP --type css --type scss --type tsx --type ts -C2 'var\(--chart-8\)' || true
rg -nP --type css --type scss --type tsx --type ts -C2 '--chart-8:' || true Length of output: 599 🏁 Script executed: #!/bin/bash
# Search for any definitions or usages of --chart-7 and --chart-8 across the codebase
# Find where --chart-7 is defined to locate the CSS variable declarations
rg -n -- '--chart-7' -C2
# Find any occurrences of --chart-8 (definition or usage)
rg -n -- '--chart-8' -C2 Length of output: 137 🏁 Script executed: #!/bin/bash
# Correctly search for CSS variable definitions and usages of --chart-7 and --chart-8
# 1. Definitions in CSS/SCSS files
rg -n -C2 '\-\-chart-(7|8)\s*:' -g '*.css' -g '*.scss'
# 2. Usages via var(...) in CSS/SCSS/TS/TSX
rg -n -C2 'var\(--chart-(7|8)\)' -g '*.css' -g '*.scss' -g '*.ts' -g '*.tsx' Length of output: 10659 Add missing CSS variable The lookup shows that Please add a matching entry for • File: apps/web/src/app/global.css diff --git a/apps/web/src/app/global.css b/apps/web/src/app/global.css
index abcdef0..1234567 100644
--- a/apps/web/src/app/global.css
+++ b/apps/web/src/app/global.css
@@ -191,6 +191,7 @@
--chart-5: 27 87% 67%;
--chart-6: 210 80% 55%;
--chart-7: 330 75% 60%;
+ --chart-8: 90 70% 50%; /* <-- define this to match your theme palette */
--sidebar: oklch(0.93 0.01 264.52);
--sidebar-foreground: oklch(0.44 0.04 279.33); Adjust the HSL values ( 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||
} satisfies ChartConfig; | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Pin checks: ensure versions exist and are compatible (Zod v4 + @t3-oss/env).*
Zod v4 is specified. Some ecosystems still assume v3; ensure templates and @t3-oss/env* peer ranges are compatible with v4 to avoid runtime/TS errors.
🏁 Script executed:
Length of output: 1642
Ensure zod version matches @t3-oss/env peer dependency*
The published v0.13.8 of @t3-oss/env-core, env-nextjs, and env-nuxt peer-depend on
which does not include the stable v4.0.14 you’ve pinned. Installing zod@^4.0.14 will trigger a peer-dependency conflict.
You have two remediation paths:
• Pin to a prerelease zod that satisfies the peer range:
– In apps/cli/src/constants.ts (lines 147–150), change
This will align with the existing peer-dependency and avoid install-time errors.
• Upgrade to a future @t3-oss/env-* release that adds stable zod v4 support (once published).
🤖 Prompt for AI Agents
💡 Verification agent
🧩 Analysis chain
Consider gating/removing dotenv when T3 Env is present.
Since T3 Env is now default and the guidelines discourage dotenv with Bun, ensure scaffolding doesn’t include both, to avoid duplicated/conflicting env loading.
🏁 Script executed:
Length of output: 14762
Remove direct dotenv usage from CLI scaffolding now that T3 Env is the default
T3 Env packages (
@t3-oss/env-core
,env-nextjs
,env-nuxt
, etc.) now handle.env
loading across runtimes, and Bun auto-loads.env
files out of the box. Keepingdotenv
imports/dependencies leads to duplicated or conflicting environment loading. Please remove or gate all directdotenv
usage in your scaffolding and helper code:• In
apps/cli/src/constants.ts
– Remove the
"dotenv": "^17.2.1",
entry.• In all Prisma templates (
apps/cli/templates/db/prisma/*/prisma.config.ts.hbs
)– Drop the top-level
import "dotenv/config";
.• In backend server templates (
apps/cli/templates/backend/server/**/src/index.ts.hbs
)– Remove any
import "dotenv/config";
(Hono, Elysia, Fastify, Express). If you still need to support plain Node projects without Bun, you can instead wrap this import under a{{#if (eq runtime "node")}}…{{/if}}
check.• In package-template JSON files
–
apps/cli/templates/backend/server/server-base/package.json.hbs
and…/next/package.json.hbs
: drop the"dotenv": "^17.2.1"
dependency.• In deployment scripts and helpers
–
apps/cli/templates/deploy/alchemy/alchemy.run.ts.hbs
: remove theimport { config } from "dotenv";
and allconfig({ path: … })
calls.– All Alchemy setup helpers (
alchemy-*.ts
undersrc/helpers/deployment/alchemy/
): remove"dotenv"
from thedevDependencies
arrays passed toaddPackageDependency
.• In database-provider setup code
–
apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts
: stop injectingimport "dotenv/config";
into the generated Prisma config.By eliminating these, you’ll avoid double-loading environment variables and fully rely on T3 Env’s loading across both Bun and Node runtimes.
🤖 Prompt for AI Agents