Skip to content

Commit

Permalink
feat: split API into separate service (#698)
Browse files Browse the repository at this point in the history
* feat: split API into separate service

* fix: fix compilation errors

* docs: remove commented code

* ci: make format script work in CI

* build(yarn): set Node linker to node-modules
  • Loading branch information
jonahsnider authored Mar 29, 2024
1 parent 26a74a0 commit 8414b8e
Show file tree
Hide file tree
Showing 212 changed files with 14,609 additions and 2,054 deletions.
88 changes: 17 additions & 71 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,89 +7,35 @@ env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

jobs:
build:
name: Build
build-and-test:
name: Build and test

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout Git repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies with Bun
run: bun install --frozen-lockfile
- name: Pull environment variables
run: bun vercel env pull --environment development .env --token ${{ secrets.VERCEL_TOKEN }}
- name: Cache Next.js
uses: actions/cache@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
path: |
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-
- name: Build
run: bun run build
lint:
name: Lint

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout Git repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies with Bun
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint
lint-openapi:
name: Lint OpenAPI

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout Git repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies with Bun
run: bun install --frozen-lockfile
node-version: 'lts/*'
cache: 'yarn'
- name: Install dependencies with Yarn
run: yarn install --immutable
- name: Pull environment variables
run: bun vercel env pull --environment development .env --token ${{ secrets.VERCEL_TOKEN }}
run: yarn vercel env pull --environment development .env --token ${{ secrets.VERCEL_TOKEN }}
- name: Cache Next.js
uses: actions/cache@v3
uses: actions/cache@v4
with:
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: |
${{ github.workspace }}/.next/cache
~/.npm
${{ github.workspace }}/apps/web/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-
- name: Start local server and download OpenAPI schema
run: bun run openapi:download
- name: Lint
run: bun run openapi:lint
lint-exports:
name: Lint exports and dependencies

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout Git repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies with Bun
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint:exports
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
- name: Build and test
run: yarn run test
67 changes: 0 additions & 67 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

23 changes: 15 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Node ###
# Logs
logs
Expand Down Expand Up @@ -204,8 +208,6 @@ dist
.history
.ionide

# Support for Project snippet scope

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Expand Down Expand Up @@ -234,12 +236,17 @@ $RECYCLE.BIN/

# End of https://www.toptal.com/developers/gitignore/api/node,linux,macos,windows,visualstudiocode

# Dotenv files
*.env
!*example.env

# Vercel
.vercel

# Downloaded OpenAPI spec for linting
./openapi.json
# Turbo
.turbo

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
Loading

0 comments on commit 8414b8e

Please sign in to comment.