Skip to content
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

[CHORE] Update new architecture of the monorepo #12

Merged
merged 24 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
acf5f8d
feat(create-turbo): apply pnpm-eslint transform
turbobot-temp Dec 25, 2023
2fc09a8
feat(create-turbo): install dependencies
turbobot-temp Dec 25, 2023
c4d7cf9
feat(create-turbo): apply pnpm-eslint transform
turbobot-temp Dec 25, 2023
400d888
feat(create-turbo): install dependencies
turbobot-temp Dec 25, 2023
d0c7ee6
feat(create-turbo): apply official-starter transform
turbobot-temp Jan 8, 2024
6c0dcb1
feat(create-turbo): apply pnpm-eslint transform
turbobot-temp Jan 8, 2024
48ecf0c
feat(create-turbo): install dependencies
turbobot-temp Jan 8, 2024
c7f1e1d
🔧 chore: update vscode launch file
ayungavis Jan 16, 2024
5788089
♻️ refactor: remove unused files
ayungavis Jan 16, 2024
c286bb7
🔧 chore: rename `tooling` to `configs
ayungavis Jan 16, 2024
36799e6
♻️ refactor: remove unused config root file
ayungavis Jan 16, 2024
d110345
🔧 chore: update turbo generator script file
ayungavis Jan 16, 2024
963cffd
🔧 chore: update env example variables
ayungavis Jan 16, 2024
1b521cf
🔧 chore: update `.gitignore`, `.npmrc`, `.nvmrc`, and `LICENSE`
ayungavis Jan 16, 2024
c5c2737
🔧 chore: update root `package.json` and dependencies
ayungavis Jan 16, 2024
a2a39b4
🔧 chore: update apps
ayungavis Jan 16, 2024
a1a8415
🔧 chore: update packages
ayungavis Jan 16, 2024
f1ad698
feat(create-turbo): apply pnpm-eslint transform
turbobot-temp Jan 17, 2024
dd82876
feat(create-turbo): install dependencies
turbobot-temp Jan 17, 2024
e93b702
🔧 chore: update github actions workflow, PR template, and issue template
ayungavis Jan 16, 2024
4ca3ed9
🔧 chore: update pnpm workspaces and turborepo config file
ayungavis Jan 17, 2024
e0b4edd
📝 docs: update `README.md`
ayungavis Jan 16, 2024
3a5bb77
🐛 fix: format error and ci setup
ayungavis Jan 17, 2024
50d5cde
🐛 fix: linter error
ayungavis Jan 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
# 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.

# We use dotenv to load Prisma from Next.js' .env file
# @see https://www.prisma.io/docs/reference/database-reference/connection-urls
DATABASE_URL=file:./db.sqlite
# The database URL is used to connect to your PlanetScale database.
DB_HOST='aws.connect.psdb.cloud'
DB_NAME='YOUR_DB_NAME'
DB_USERNAME=''
DB_PASSWORD='pscale_pw_'

# @see https://next-auth.js.org/configuration/options#nextauth_url
NEXTAUTH_URL=http://localhost:3000
AUTH_URL='http://localhost:3000'
AUTH_REDIRECT_PROXY_URL="http://localhost:3001/api"

# You can generate the secret via 'openssl rand -base64 32' on Unix
# @see https://next-auth.js.org/configuration/options#secret
NEXTAUTH_SECRET=supersecret
AUTH_SECRET='supersecret'

# Preconfigured Discord OAuth provider, works out-of-the-box
# @see https://next-auth.js.org/providers/discord
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
AUTH_DISCORD_ID=''
AUTH_DISCORD_SECRET=''
22 changes: 0 additions & 22 deletions .eslintrc.js

This file was deleted.

7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# This template is heavily inspired by the Next.js's template:
# See here: https://github.com/vercel/next.js/blob/canary/.github/ISSUE_TEMPLATE/3.feature_request.yml
# 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']
title: "feat: "
labels: ["✨ enhancement"]
body:
- type: markdown
attributes:
Expand All @@ -26,4 +26,3 @@ body:
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.

11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Description

<!-- One-liner description (or quick point form) of what was done -->

## Screenshots / Videos

<!-- Add screenshots or videos of the changes -->

## How to test?

<!--Add a URL where reviewers can go to see changes -->
6 changes: 4 additions & 2 deletions renovate.json → .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"extends": ["config:base"],
"packageRules": [
{
"matchPackagePatterns": ["^@myapp/", "@myapp/eslint-config"],
"matchPackagePatterns": ["^@acme/"],
"enabled": false
}
],
"updateInternalDeps": true
"updateInternalDeps": true,
"rangeStrategy": "bump",
"automerge": true
}
73 changes: 32 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,51 @@ on:
branches: ["main"]
merge_group:

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

# 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
env:
FORCE_COLOR: 3
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
build-lint:
env:
DATABASE_URL: file:./db.sqlite
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Setup
uses: ./configs/github/setup

- name: Get pnpm store directory
id: pnpm-cache
- name: Copy env
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
run: cp .env.example .env

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Lint
run: pnpm lint && pnpm lint:ws

- name: Install deps (with cache)
run: pnpm install
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Normally, this would be done as part of the turbo pipeline - however since the Expo app doesn't depend on `@myapp/db` it doesn't care.
# TODO: Free for all to find a better solution here.
- name: Generate Prisma Client
run: pnpm turbo db:generate
- name: Setup
uses: ./configs/github/setup

- name: Format
run: pnpm format

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build, lint and type-check
run: pnpm with-env turbo build lint type-check
env:
SKIP_ENV_VALIDATION: true
- name: Setup
uses: ./configs/github/setup

- name: Check workspaces
run: pnpm manypkg check
- name: Typecheck
run: pnpm typecheck
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ node_modules
# testing
coverage

# database
prisma/db.sqlite
prisma/db.sqlite-journal

# next.js
.next/
out/
next-env.d.ts

# nitro
.nitro/
.output/

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

# production
build
Expand All @@ -46,3 +48,7 @@ yarn-error.log*

# turbo
.turbo

# vscode
.idea
./**/.idea
7 changes: 0 additions & 7 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,4 @@
# The symbolic links of pnpm break the rules of Expo monorepos.
# @link https://docs.expo.dev/guides/monorepos/#common-issues
node-linker=hoisted

# In order to cache Prisma correctly
public-hoist-pattern[]=*prisma*

# FIXME: @prisma/client is required by the @myapp/auth,
# but we don't want it installed there since it's already
# installed in the @myapp/db package
strict-peer-dependencies=false
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20.10
7 changes: 4 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"bradlc.vscode-tailwindcss",
"Prisma.prisma"
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"expo.vscode-expo-tools",
"yoavbls.pretty-ts-errors"
]
}
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"version": "0.2.0",
"configurations": [
{
"name": "Next.js",
"name": "Web App",
"type": "node-terminal",
"request": "launch",
"command": "pnpm dev",
"cwd": "${workspaceFolder}/apps/app/",
"command": "pnpm dev:web",
"cwd": "${workspaceFolder}",
"skipFiles": ["<node_internals>/**"]
}
]
Expand Down
37 changes: 31 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
{
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"eslint.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
// prettier extension setting
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.rulers": [80],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "always",
"source.fixAll": "always"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": [],
"tailwindCSS.experimental.classRegex": [
["cn\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["tv\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
["tv\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Wahyu Adi Kurniawan
Copyright (c) 2023 Wahyu Kurniawan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading