Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 13 additions & 14 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,50 +19,49 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 22
cache: npm
bun-version: 1.3.6

- name: Install dependencies
run: npm ci
run: bun ci
Comment thread
mattiacerutti marked this conversation as resolved.

- name: Lint
run: npm run lint
run: bun run lint

- name: Prettier
run: npm run prettier
run: bun run prettier

- name: Build
env:
NEXT_TELEMETRY_DISABLED: "1"
run: npm run build
run: bun run build

migrate:
needs: test
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 22
bun-version: 1.3.6

- name: Install dependencies
run: npm ci
run: bun ci
Comment thread
mattiacerutti marked this conversation as resolved.

- name: Run migrations
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: npx prisma migrate deploy
run: bunx prisma migrate deploy

- name: Seed database
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
GITHUB_API_TOKEN: ${{ secrets.GH_API_TOKEN }}
run: npx prisma db seed
run: bunx prisma db seed

build-and-push:
needs:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: 20
cache: "npm"
- run: npm ci
- run: npm run lint
- run: npm run prettier
- run: npm run build
bun-version: 1.3.6
- run: bun ci
Comment thread
mattiacerutti marked this conversation as resolved.
- run: bun run lint
- run: bun run prettier
- run: bun run build

commitlint:
runs-on: ubuntu-latest
Expand Down
13 changes: 6 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ Thanks for wanting to help make Code Typer better. This is a small project, so e

## Requirements

- **Node 22**
- **npm**. Yarn/pnpm are great, but please stick to npm so lockfiles stay in sync.
- **Bun 1.3.6**
- **GitHub API token** to run the snippet seeding scripts
- **Docker** (optional)

## Setup

1. Fork the repo and clone your fork.
2. Install dependencies: `npm install`.
2. Install dependencies: `bun install`.
3. Copy `.env.example` to `.env`

```bash
Expand All @@ -26,18 +25,18 @@ Thanks for wanting to help make Code Typer better. This is a small project, so e
- **Local install:** make sure the credentials (either `DATABASE_URL` or `POSTGRES_*`) match your running server.
5. Sync Prisma with the database:
```bash
npx prisma db push # creates tables
npx prisma db seed # seeds languages, files and snippets
bunx prisma db push # creates tables
bunx prisma db seed # seeds languages, files and snippets
```
Note that this process is expected to take a while (~10 minutes).
6. Run the dev server using `npm run dev`.
6. Run the dev server using `bun run dev`.

## Pull request checklist

- Create a branch off `main` with a descriptive name (`feature/auto-closing-tweak`, `fix/language-picker`, etc.).
- Keep changes scoped. Smaller PRs get reviewed faster.
- Update docs when behavior changes (README, this file, inline comments).
- Run `npm run lint`, `npm run prettier`, and `npm run build` locally.
- Run `bun run lint`, `bun run prettier`, and `bun run build` locally.
- Include screenshots or screen recordings if you touch UI/UX. A quick Loom/GIF helps reviewers verify the behavior without pulling the branch immediately.
- Push your branch and open a PR against `main`. Describe the problem, your solution, and any follow-up work you’re leaving for later.

Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM node:22-bullseye
FROM oven/bun:1.3.6

WORKDIR /app

COPY package*.json ./
COPY package.json bun.lock ./
COPY prisma ./prisma/

RUN npm ci
RUN bun install --frozen-lockfile

# Copy the rest of the source code
COPY . .

RUN npm run build
RUN bun run build

EXPOSE 3000

CMD ["npm", "run", "start"]
CMD ["bun", "run", "start"]
Loading