Skip to content

Commit

Permalink
🆙 repo Upgrade repo & rename packages (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
steeeee0223 committed Sep 27, 2024
1 parent 7e23723 commit 1f5e5d8
Show file tree
Hide file tree
Showing 262 changed files with 2,851 additions and 2,229 deletions.
21 changes: 21 additions & 0 deletions .github/DISCUSSION_TEMPLATE/ideas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to file a feature request. Please fill out this form as completely as possible.
- type: textarea
attributes:
label: Describe the feature you'd like to request
description: Please describe the feature as clear and concise as possible. Remember to add context as to why you believe this feature is needed.
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like to see
description: Please describe the solution you would like to see. Adding example usage is a good way to provide context.
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Add any other information related to the feature here. If your feature request is related to any issues or discussions, link them here.
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": ["config:base"],
"packageRules": [
{
"matchPackagePatterns": ["^@acme/"],
"matchPackagePatterns": ["^@swy/"],
"enabled": false
}
],
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ out/

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

# production
build
Expand All @@ -43,6 +44,8 @@ yarn-error.log*
.vercel

# typescript
dist/
.cache
*.tsbuildinfo

# turbo
Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# The symbolic links of pnpm break the rules of Expo monorepos.
# @link https://docs.expo.dev/guides/monorepos/#common-issues
node-linker=hoisted
strict-peer-dependencies=false
link-workspace-packages=true

# storybook
auto-install-peers=true
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.10
20.16
34 changes: 22 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"eslint.runtime": "node",
"eslint.workingDirectories": [
{
"mode": "auto"
}
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" },
{ "pattern": "tooling/*/" }
],
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.format.enable": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
"prettier.ignorePath": ".gitignore",
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
"tailwindCSS.experimental.configFile": "./tooling/tailwind/web.ts",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.autoImportFileExcludePatterns": [
"next/router.d.ts",
"next/dist/client/router.d.ts"
],
"typescript.tsdk": "node_modules/typescript/lib"
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Version `1.2.0`

### 🆕 Core Updates

- Migrate repo to commit [`create-t3-turbo:86c5f8`](https://github.com/t3-oss/create-t3-turbo/commit/86c5f8898ec67de0c1af6a893f64f1476fb40bb9)
- Upgrade `nodejs` from `20.10` to `20.16`
- Upgrade `pnpm` from `9.1.x` to `9.7`
- Rename `@acme/*` to `@swy/*`
- Add more lint rules & fix

## Version `1.1.0`

### 🆕 Core Updates
Expand Down
16 changes: 13 additions & 3 deletions apps/auth-proxy/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
# Auth Proxy

This is a simple proxy server that enables OAuth authentication for preview environments.
This is a simple proxy server that enables OAuth authentication for preview environments and Expo apps.

## Setup

Deploy it somewhere (Vercel is a one-click, zero-config option) and set the following environment variables:

- `AUTH_DISCORD_ID` - The Discord OAuth client ID
- `AUTH_DISCORD_SECRET` - The Discord OAuth client secret
- `AUTH_REDIRECT_PROXY_URL` - The URL of this proxy server
- `AUTH_REDIRECT_PROXY_URL` - The URL of this proxy server (e.g. )
- `AUTH_SECRET` - Your secret

Make sure the `AUTH_SECRET` and `AUTH_REDIRECT_PROXY_URL` match the values set for the main application's deployment for preview environments, and that you're using the same OAuth credentials for the proxy and the application's preview environment. The lines below shows what values should match eachother in both deployments.
Make sure the `AUTH_SECRET` and `AUTH_REDIRECT_PROXY_URL` match the values set for the main application's deployment for preview environments, and that you're using the same OAuth credentials for the proxy and the application's preview environment.
`AUTH_REDIRECT_PROXY_URL` should only be set for the main application's preview environment. Do not set it for the production environment.
The lines below shows what values should match eachother in both deployments.

> [!NOTE]
>
> For using the proxy for local development set the `AUTH_REDIRECT_PROXY_URL` in the `.env` file as well.
![Environment variables setup](https://github.com/t3-oss/create-t3-turbo/assets/51714798/5fadd3f5-f705-459a-82ab-559a3df881d0)

For providers that require an origin and a redirect URL, set them to `{AUTH_REDIRECT_PROXY_URL}` and `{AUTH_REDIRECT_PROXY_URL}/r/callback/{provider}` accordingly.

![Google credentials setup](https://github.com/ahkhanjani/create-t3-turbo/assets/72540492/eaa88685-6fc2-4c23-b7ac-737eb172fa0e)
9 changes: 9 additions & 0 deletions apps/auth-proxy/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import baseConfig from "@swy/eslint-config/base";

/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: [".nitro/**", ".output/**"],
},
...baseConfig,
];
34 changes: 15 additions & 19 deletions apps/auth-proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
{
"name": "@acme/auth-proxy",
"name": "@swy/auth-proxy",
"private": true,
"type": "module",
"scripts": {
"build": "nitro build",
"clean": "rm -rf .turbo node_modules",
"dev": "nitro dev --port 3001",
"lint": "eslint .",
"clean": "git clean -xdf .cache .nitro .output .turbo .vercel node_modules",
"lint": "eslint",
"format": "prettier --check . --ignore-path ../../.gitignore",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@auth/core": "^0.19.0"
"@auth/core": "0.34.2"
},
"devDependencies": {
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"eslint": "^8.56.0",
"nitropack": "^2.8.1",
"prettier": "^3.2.5",
"typescript": "^5.5.4"
"@swy/eslint-config": "workspace:*",
"@swy/prettier-config": "workspace:*",
"@swy/tailwind-config": "workspace:*",
"@swy/tsconfig": "workspace:*",
"@types/node": "catalog:node20",
"eslint": "catalog:",
"h3": "^1.12.0",
"nitropack": "^2.9.7",
"prettier": "catalog:",
"typescript": "catalog:"
},
"eslintConfig": {
"root": true,
"extends": [
"@acme/eslint-config/base"
]
},
"prettier": "@acme/prettier-config"
"prettier": "@swy/prettier-config"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { eventHandler, toWebRequest } from "h3";

export default eventHandler(async (event) =>
Auth(toWebRequest(event), {
basePath: "/r",
secret: process.env.AUTH_SECRET,
trustHost: !!process.env.VERCEL,
redirectProxyUrl: process.env.AUTH_REDIRECT_PROXY_URL,
Expand Down
2 changes: 1 addition & 1 deletion apps/auth-proxy/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@acme/tsconfig/base.json",
"extends": "@swy/tsconfig/base.json",
"include": ["routes"]
}
13 changes: 13 additions & 0 deletions apps/auth-proxy/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": [".nitro/**", ".output/**", ".vercel/**"]
},
"dev": {
"persistent": true
}
}
}
15 changes: 15 additions & 0 deletions apps/storybook/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import baseConfig from "@swy/eslint-config/base";
import nextjsConfig from "@swy/eslint-config/nextjs";
import reactConfig from "@swy/eslint-config/react";
import storybookConfig from "@swy/eslint-config/storybook";

/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: [".next/**", "next-env.d.ts"],
},
...baseConfig,
...reactConfig,
...nextjsConfig,
...storybookConfig,
];
2 changes: 1 addition & 1 deletion apps/storybook/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const config = {
reactStrictMode: true,

/** Enables hot reloading for local packages without a build step */
transpilePackages: ["@acme/ui"],
transpilePackages: ["@swy/ui"],

/** We already do linting and typechecking as separate tasks in CI */
eslint: { ignoreDuringBuilds: true },
Expand Down
60 changes: 25 additions & 35 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
{
"name": "@acme/storybook",
"version": "1.1.0",
"name": "@swy/storybook",
"version": "1.2.0",
"private": true,
"type": "module",
"scripts": {
"build": "storybook build",
"clean": "git clean -xdf .next .turbo node_modules",
"dev": "storybook dev -p 6006",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint .",
"start": "serve storybook-static",
"lint": "eslint",
"start": "pnpx http-server storybook-static",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@acme/ui": "workspace:*",
"lucide-react": "^0.408.0",
"next": "^14.2.3",
"next-themes": "^0.3.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"@swy/ui": "workspace:*",
"lucide-react": "catalog:ui",
"next": "catalog:next14",
"next-themes": "catalog:ui",
"react": "catalog:react18",
"react-dom": "catalog:react18",
"swr": "^2.2.5",
"usehooks-ts": "^2.9.1",
"uuid": "^10.0.0"
"uuid": "catalog:uuid"
},
"devDependencies": {
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@storybook/addon-essentials": "^8.0.10",
"@storybook/addon-interactions": "^8.0.10",
"@storybook/addon-links": "^8.0.10",
Expand All @@ -36,26 +32,20 @@
"@storybook/nextjs": "^8.0.10",
"@storybook/react": "^8.0.10",
"@storybook/test": "^8.0.10",
"@types/node": "^20.10.6",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/uuid": "^10.0.0",
"eslint": "^8.56.0",
"eslint-plugin-storybook": "^0.6.15",
"prettier": "^3.2.5",
"sonner": "^1.3.1",
"@swy/eslint-config": "workspace:*",
"@swy/prettier-config": "workspace:*",
"@swy/tailwind-config": "workspace:*",
"@swy/tsconfig": "workspace:*",
"@types/node": "catalog:node20",
"@types/react": "catalog:react18",
"@types/react-dom": "catalog:react18",
"@types/uuid": "catalog:uuid",
"eslint": "catalog:",
"prettier": "catalog:",
"sonner": "catalog:ui",
"storybook": "^8.0.10",
"tailwindcss": "^3.4.3",
"typescript": "^5.5.4"
"tailwindcss": "catalog:",
"typescript": "catalog:"
},
"eslintConfig": {
"root": true,
"extends": [
"plugin:storybook/recommended",
"@acme/eslint-config/base",
"@acme/eslint-config/nextjs",
"@acme/eslint-config/react"
]
},
"prettier": "@acme/prettier-config"
"prettier": "@swy/prettier-config"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";

import { ActivityItem } from "@acme/ui/custom";
import { ActivityItem } from "@swy/ui/custom";

const meta = {
title: "custom/Activity Item",
Expand Down
4 changes: 2 additions & 2 deletions apps/storybook/src/stories/custom/cover-picker.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Meta, StoryObj } from "@storybook/react";
import { ImageIcon } from "lucide-react";

import { CoverPicker } from "@acme/ui/custom";
import { Button } from "@acme/ui/shadcn";
import { CoverPicker } from "@swy/ui/custom";
import { Button } from "@swy/ui/shadcn";

const meta = {
title: "custom/Cover Picker",
Expand Down
4 changes: 2 additions & 2 deletions apps/storybook/src/stories/custom/cover.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";

import { Cover } from "@acme/ui/custom";
import { Cover } from "@swy/ui/custom";

import image from "@/stories/assets/addon-library.png";

Expand All @@ -15,7 +15,7 @@ type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
url: image.src,
url: image,
unsplashAPIKey: "UNSPLASH_ACCESS_KEY",
onUrlChange: (url) => console.log(`Uploading url: ${url}`),
onUploadChange: (file) => console.log(`Uploading file: ${file.name}`),
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/stories/custom/crud-item.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react";

import { CRUDItem } from "@acme/ui/custom";
import { CRUDItem } from "@swy/ui/custom";

const meta = {
title: "custom/Crud Item",
Expand Down
Loading

0 comments on commit 1f5e5d8

Please sign in to comment.