Skip to content

Commit

Permalink
Merge pull request #13 from ayungavis/with-trpc
Browse files Browse the repository at this point in the history
With trpc
  • Loading branch information
ayungavis authored Jan 23, 2024
2 parents 278f68c + ed93b00 commit e8b6b18
Show file tree
Hide file tree
Showing 177 changed files with 16,020 additions and 5,833 deletions.
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: 32 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
{
"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\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]
}
2 changes: 1 addition & 1 deletion LICENSE
100644 → 100755
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

0 comments on commit e8b6b18

Please sign in to comment.