Skip to content

Commit

Permalink
update to the latest t3-turbo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
noxify committed May 16, 2024
1 parent ba52bfd commit 0c1b40b
Show file tree
Hide file tree
Showing 137 changed files with 7,291 additions and 6,860 deletions.
23 changes: 9 additions & 14 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# Since .env is gitignored, you can use .env.example to build a new `.env` file when you clone the repo.
# Keep this file up-to-date when you add new variables to \`.env\`.

# This file will be committed to version control, so make sure not to have any secrets in it.
# If you are cloning this repo, create a copy of this file named `.env` and populate it with your secrets.

# The database URL is used to connect to your mysql database.
# The database URL is used to connect to your database.
DB_HOST='localhost'
DB_NAME='YOUR_DB_NAME'
DB_USERNAME=''
DB_PASSWORD='pscale_pw_'
DB_PORT=5432
DB_NAME='turbo_stack'
DB_USERNAME='turbo_stack'
DB_PASSWORD='turbo_stack'

# OAUTH Configuration
AUTH_GITHUB_ID='<github oauth app id>'
AUTH_GITHUB_SECRET='<github oauth app secret>'
AUTH_GITHUB_ID=''
AUTH_GITHUB_SECRET=''

AUTH_DISCORD_ID='<discord oauth app id>'
AUTH_DISCORD_SECRET='<discord oauth app secret>'
AUTH_DISCORD_ID=''
AUTH_DISCORD_SECRET=''
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This template is heavily inspired by the Next.js's template:
# See here: https://github.com/vercel/next.js/tree/canary/.github/ISSUE_TEMPLATE

name: 🛠 Feature Request
description: Create a feature request for the core packages
title: "feat: "
labels: ["✨ enhancement"]
body:
- type: markdown
attributes:
Expand Down
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
contact_links:
- name: Ask a question
url: https://github.com/t3-oss/create-t3-turbo/discussions
about: Ask questions and discuss with other community members
- name: Feature request
url: https://github.com/t3-oss/create-t3-turbo/discussions/new?category=ideas
about: Feature requests should be opened as discussions
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

# You can leverage Vercel Remote Caching with Turbo to speed up your builds
# @link https://turborepo.org/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ next-env.d.ts

# expo
.expo/
dist/
expo-env.d.ts
apps/expo/.gitignore

Expand All @@ -45,6 +44,7 @@ yarn-error.log*

# typescript
*.tsbuildinfo
dist/

# turbo
.turbo
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.10
20.12
12 changes: 8 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" },
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"eslint.useFlatConfig": true,
"eslint.workingDirectories": [
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" },
Expand All @@ -12,7 +15,7 @@
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
"tailwindCSS.experimental.configFile": "./tooling/tailwind/index.ts",
"tailwindCSS.experimental.configFile": "./tooling/tailwind/web.ts",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.autoImportFileExcludePatterns": [
"next/router.d.ts",
Expand All @@ -22,7 +25,8 @@
"i18n-ally.localesPaths": ["packages/locales/src/lang"],
"i18n-ally.editor.preferEditor": true,
"i18n-ally.pathMatcher": "{locale}.json",
"i18n-ally.enabledFrameworks": ["next-international"],
"i18n-ally.keystyle": "nested",
"i18n-ally.extract.autoDetect": true
"i18n-ally.enabledFrameworks": ["next-international"],
"i18n-ally.extract.autoDetect": true,
"i18n-ally.fullReloadOnChanged": true
}
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
## Features

* Monorepo via turborepo
* NextJS 14.1
* TRPC ( with RSC support )
* Lucia Auth with multi provider support
* i18n support ( with support for i18n-ally )
* tailwind with shadcn-ui
- Monorepo via turborepo
- NextJS 14
- TRPC ( with RSC support )
- Lucia Auth with multi provider support
- i18n support ( with support for i18n-ally )
- tailwind with shadcn-ui

## Installation

Expand Down Expand Up @@ -38,14 +38,14 @@ packages
├─ auth
| └─ Authentication using lucia-auth@v3
├─ db
| └─ Typesafe db calls using Drizzle & mysql
| └─ Typesafe db calls using Drizzle & postgres
├─ locales
| └─ type-safe internationalization
├─ validators
| └─ shared zod schemas for trpc and forms
└─ ui
└─ Start of a UI package for the webapp using shadcn-ui
tooling
├─ eslint
Expand All @@ -64,7 +64,7 @@ tooling

To get it running, follow the steps below.

The db is currently configured for `mysql`.
The db is currently configured for `postgres`.

Feel free to change it.

Expand All @@ -85,7 +85,7 @@ pnpm db:push
pnpm dev
```

## i18n
## i18n

This packages uses [next-international](https://github.com/quiiBz/next-international) for type-safe translations.

Expand All @@ -94,6 +94,8 @@ We're using `json` files and generating the `ts` files from them.

Why? Using json files allows us to use the vsc extension [`i18n ally`](https://github.com/lokalise/i18n-ally), which makes it a lot easier to manage the translations.

> Note: If you don't need / use the i18n-ally extension, you could simply import the typescript files directly ( without using the json files).
> Unfortunately the i18n-ally doesn't support writing `.ts` files.
**Example:**

Expand All @@ -109,10 +111,11 @@ Visit their [wiki](https://github.com/lokalise/i18n-ally/wiki) to learn more abo

## Credits / Special thanks

* https://github.com/shadcn-ui
* https://github.com/juliusmarminge
* https://github.com/t3-oss
* https://github.com/QuiiBz
* https://github.com/lucia-auth
- https://github.com/shadcn-ui
- https://github.com/juliusmarminge
- https://github.com/dBianchii
- https://github.com/t3-oss
- https://github.com/QuiiBz
- https://github.com/lucia-auth

If you like what you see, feel free to support one or all of them via their sponsoring options ( if available ).
14 changes: 14 additions & 0 deletions apps/nextjs/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import baseConfig, { restrictEnvAccess } from "@acme/eslint-config/base"
import nextjsConfig from "@acme/eslint-config/nextjs"
import reactConfig from "@acme/eslint-config/react"

/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: [".next/**"],
},
...baseConfig,
...reactConfig,
...nextjsConfig,
...restrictEnvAccess,
]
13 changes: 6 additions & 7 deletions apps/nextjs/next.config.mjs → apps/nextjs/next.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
// Importing env files here to validate on build
import "./src/env.mjs"
import "@acme/auth/env"
import { fileURLToPath } from "url"
import createJiti from "jiti"

// Import env files to validate at build time. Use jiti so we can load .ts files in here.
createJiti(fileURLToPath(import.meta.url))("./src/env")

/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,
experimental: {
serverComponentsExternalPackages: ["@icons-pack/react-simple-icons"],
},

/** Enables hot reloading for local packages without a build step */
transpilePackages: [
"@acme/api",
"@acme/auth",
"@acme/db",
"@acme/ui",
"@acme/validators",
"@acme/locales",
],

Expand Down
48 changes: 19 additions & 29 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "git clean -xdf .next .turbo node_modules",
"dev": "pnpm with-env next dev",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "dotenv -v SKIP_ENV_VALIDATION=1 next lint",
"lint": "eslint",
"start": "pnpm with-env next start",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env --"
Expand All @@ -19,42 +19,32 @@
"@acme/db": "workspace:*",
"@acme/locales": "workspace:*",
"@acme/ui": "workspace:*",
"@acme/validators": "workspace:*",
"@icons-pack/react-simple-icons": "9.3.0",
"@t3-oss/env-nextjs": "0.9.2",
"@tanstack/react-query": "5.24.1",
"@tanstack/react-query-devtools": "5.24.1",
"@trpc/client": "11.0.0-next-beta.294",
"@trpc/react-query": "11.0.0-next-beta.294",
"@trpc/server": "11.0.0-next-beta.294",
"lucide-react": "0.341.0",
"next": "14.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"@t3-oss/env-nextjs": "0.10.1",
"@tanstack/react-query": "5.36.2",
"@trpc/client": "11.0.0-rc.364",
"@trpc/react-query": "11.0.0-rc.364",
"@trpc/server": "11.0.0-rc.364",
"geist": "1.3.0",
"next": "14.2.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"superjson": "2.2.1",
"zod": "3.22.4"
"zod": "3.23.8"
},
"devDependencies": {
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@types/node": "20.11.20",
"@types/react": "18.2.58",
"@types/react-dom": "18.2.19",
"dotenv-cli": "7.3.0",
"eslint": "8.57.0",
"@types/node": "20.12.12",
"@types/react": "18.3.2",
"@types/react-dom": "18.3.0",
"dotenv-cli": "7.4.2",
"eslint": "9.2.0",
"jiti": "1.21.0",
"prettier": "3.2.5",
"tailwindcss": "3.4.1",
"typescript": "5.3.3"
},
"eslintConfig": {
"root": true,
"extends": [
"@acme/eslint-config/base",
"@acme/eslint-config/nextjs",
"@acme/eslint-config/react"
]
"tailwindcss": "3.4.3",
"typescript": "5.4.5"
},
"prettier": "@acme/prettier-config"
}
1 change: 0 additions & 1 deletion apps/nextjs/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
2 changes: 1 addition & 1 deletion apps/nextjs/src/actions/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function logoutAction(): Promise<ActionResult> {
sessionCookie.value,
sessionCookie.attributes,
)
return redirect("/auth")
return redirect("/")
}

interface ActionResult {
Expand Down
24 changes: 0 additions & 24 deletions apps/nextjs/src/app/[locale]/(authorized)/layout.tsx

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0c1b40b

Please sign in to comment.