Skip to content

Commit

Permalink
add latest changes from create-t3-turbo
Browse files Browse the repository at this point in the history
  • Loading branch information
noxify committed Jun 13, 2024
1 parent 892ba0b commit 320f8d2
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 35 deletions.
5 changes: 4 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
],
"updateInternalDeps": true,
"rangeStrategy": "bump",
"automerge": true
"automerge": true,
"npm": {
"fileMatch": ["(^|/)package\\.json$", "(^|/)package\\.json\\.hbs$"]
}
}
4 changes: 1 addition & 3 deletions apps/nextjs/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@ export const env = createEnv({
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
},
skipValidation:
!!process.env.CI ||
!!process.env.SKIP_ENV_VALIDATION ||
process.env.npm_lifecycle_event === "lint",
!!process.env.CI || process.env.npm_lifecycle_event === "lint",
})
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,29 @@
"engines": {
"node": ">=20.12.0"
},
"packageManager": "pnpm@9.1.4",
"packageManager": "pnpm@9.3.0",
"scripts": {
"build": "turbo build",
"build": "turbo run build",
"dev": "turbo watch dev",
"dev:next": "turbo watch dev -F @acme/nextjs...",
"clean": "git clean -xdf node_modules",
"clean:workspaces": "turbo clean",
"clean:workspaces": "turbo run clean",
"db:generate": "pnpm -F db generate",
"db:migrate": "pnpm -F db migrate",
"db:push": "pnpm -F db push",
"db:studio": "pnpm -F db studio",
"dev": "turbo dev --parallel",
"format": "turbo format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
"format:fix": "turbo format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
"lint": "turbo lint --continue -- --cache --cache-location node_modules/.cache/.eslintcache",
"lint:fix": "turbo lint --continue -- --fix --cache --cache-location node_modules/.cache/.eslintcache",
"db:push": "turbo -F @acme/db push",
"db:studio": "turbo -F @acme/db studio",
"typecheck": "turbo run typecheck",
"format": "turbo run format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
"format:fix": "turbo run format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
"lint": "turbo run lint --continue -- --cache --cache-location node_modules/.cache/.eslintcache",
"lint:fix": "turbo run lint --continue -- --fix --cache --cache-location node_modules/.cache/.eslintcache",
"lint:ws": "sherif",
"lint:ws:fix": "sherif --fix",
"postinstall": "pnpm lint:ws",
"typecheck": "turbo typecheck",
"ui-add": "pnpm -F ui ui-add",
"ui-add": "turbo run ui-add",
"deps:check": "pnpm outdated -r",
"deps:update": "pnpm update -i -L -r",
"lang:gen": "pnpm -F locales generate"
"lang:gen": "pnpm -F locales generate",
"postinstall": "pnpm lint:ws"
},
"devDependencies": {
"@acme/prettier-config": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/auth/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ export const env = createEnv({
experimental__runtimeEnv: {
NODE_ENV: process.env.NODE_ENV,
},
skipValidation: !!process.env.CI || !!process.env.SKIP_ENV_VALIDATION,
skipValidation:
!!process.env.CI || process.env.npm_lifecycle_event === "lint",
})
1 change: 0 additions & 1 deletion packages/db/drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ export default {
password: env.DB_PASSWORD,
database: env.DB_NAME,
},
tablesFilter: ["t3turbo_*"],
} satisfies Config
3 changes: 2 additions & 1 deletion packages/db/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export const env = createEnv({
DB_NAME: z.string().min(1),
},
runtimeEnv: process.env,
skipValidation: !!process.env.CI || !!process.env.SKIP_ENV_VALIDATION,
skipValidation:
!!process.env.CI || process.env.npm_lifecycle_event === "lint",
})
1 change: 0 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
},
"license": "MIT",
"scripts": {
"add": "shadcn-ui add",
"clean": "rm -rf .turbo node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
Expand Down
4 changes: 4 additions & 0 deletions tooling/eslint/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import eslint from "@eslint/js"
import importPlugin from "eslint-plugin-import"
import turboPlugin from "eslint-plugin-turbo"
import tseslint from "typescript-eslint"

/**
Expand Down Expand Up @@ -40,6 +41,7 @@ export default tseslint.config(
files: ["**/*.js", "**/*.ts", "**/*.tsx"],
plugins: {
import: importPlugin,
turbo: turboPlugin,
},
extends: [
eslint.configs.recommended,
Expand All @@ -48,6 +50,8 @@ export default tseslint.config(
...tseslint.configs.stylisticTypeChecked,
],
rules: {
...turboPlugin.configs.recommended.rules,

"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
Expand Down
9 changes: 9 additions & 0 deletions tooling/eslint/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,12 @@ declare module "@next/eslint-plugin-next" {
}
export const rules: Record<string, Rule.RuleModule>
}

declare module "eslint-plugin-turbo" {
import type { Linter, Rule } from "eslint"

export const configs: {
recommended: { rules: Linter.RulesRecord }
}
export const rules: Record<string, Rule.RuleModule>
}
14 changes: 14 additions & 0 deletions tooling/prettier/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ const config = {
importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
importOrderTypeScriptVersion: "4.4.0",
semi: false,
overrides: [
{
files: "*.json.hbs",
options: {
parser: "json",
},
},
{
files: "*.js.hbs",
options: {
parser: "babel",
},
},
],
}

export default config
30 changes: 25 additions & 5 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"$schema": "https://turborepo.org/schema.json",
"experimentalUI": false,
"globalDependencies": ["**/.env"],
"pipeline": {
"ui": "tui",
"tasks": {
"topo": {
"dependsOn": ["^topo"]
},
Expand All @@ -23,7 +22,7 @@
},
"format": {
"outputs": ["node_modules/.cache/.prettiercache"],
"outputMode": "new-only"
"outputLogs": "new-only"
},
"lint": {
"dependsOn": ["^topo"],
Expand All @@ -38,13 +37,34 @@
},
"//#clean": {
"cache": false
},
"push": {
"cache": false,
"interactive": true
},
"studio": {
"cache": false,
"persistent": true
},
"ui-add": {
"cache": false,
"interactive": true
}
},
"globalEnv": [
"DATABASE_URL",
"AUTH_DISCORD_ID",
"AUTH_DISCORD_SECRET",
"AUTH_REDIRECT_PROXY_URL",
"AUTH_SECRET"
"AUTH_SECRET",
"PORT"
],
"globalPassThroughEnv": [
"NODE_ENV",
"CI",
"VERCEL",
"VERCEL_ENV",
"VERCEL_URL",
"npm_lifecycle_event"
]
}
6 changes: 3 additions & 3 deletions turbo/generators/templates/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"eslint": "^9.0.0",
"prettier": "^3.2.5",
"typescript": "^5.4.3"
"eslint": "9.4.0",
"prettier": "3.3.2",
"typescript": "5.4.5"
},
"prettier": "@acme/prettier-config"
}
5 changes: 0 additions & 5 deletions vercel.json

This file was deleted.

0 comments on commit 320f8d2

Please sign in to comment.