Skip to content

Commit

Permalink
bun
Browse files Browse the repository at this point in the history
  • Loading branch information
dromzeh committed Apr 1, 2024
1 parent 54c4f8b commit f8f09d2
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 8,017 deletions.
44 changes: 23 additions & 21 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,20 @@ jobs:
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.9.0

- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Install bun
uses: oven-sh/setup-bun@v1
with:
version: latest
run_install: false
bun-version: latest

- name: Install dependencies
run: pnpm install
run: bun i

- name: Prettier check
run: pnpm run prettier:check
run: bun run prettier:check

lint:
name: ESLint
Expand All @@ -42,21 +41,25 @@ jobs:
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.9.0

- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install bun
uses: oven-sh/setup-bun@v1
with:
version: latest
run_install: false
bun-version: latest

- name: Install dependencies
run: pnpm install
run: bun i

- name: Lint
run: pnpm run lint
run: bun run lint

typecheck:
name: TypeScript types
Expand All @@ -66,18 +69,17 @@ jobs:
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.9.0

- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Install bun
uses: oven-sh/setup-bun@v1
with:
version: latest
run_install: false
bun-version: latest

- name: Install dependencies
run: pnpm install
run: bun i

- name: Lint
run: pnpm run typecheck
run: bun run typecheck
11 changes: 5 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ jobs:
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.9.0

- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Install bun
uses: oven-sh/setup-bun@v1
with:
version: latest
run_install: false
bun-version: latest

- name: Install dependencies
run: pnpm install
run: bun i

- name: Deploy to Cloudflare Workers using Wrangler
uses: cloudflare/wrangler-action@2.0.0
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,22 @@ jobs:
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.9.0

- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Install bun
uses: oven-sh/setup-bun@v1
with:
version: latest
run_install: false
bun-version: latest

- name: Install dependencies
run: pnpm install
run: bun i

- name: Create .dev.vars file
run: |
echo ENVIRONMENT=$ENVIRONMENT >> .dev.vars
echo TURSO_DEV_DATABASE_URL=$TURSO_DEV_DATABASE_URL >> .dev.vars
- name: Initialize Drizzle
run: pnpm drizzle:dev:init
run: bun run drizzle:dev:init
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)

Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run typecheck && pnpm run lint && pnpm run prettier:check
bun run typecheck && bun run lint && bun run prettier:check
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To install `sqld` for dev db `wget https://github.com/libsql/sqld/releases/downl

The API will connect to the local database if the environment is set to `DEV` in `.dev.vars`, else - it will connect to your production database.

To generate seed data, generate and migrate, you can run `pnpm drizzle:init:dev`.
To generate seed data, generate and migrate, you can run `bun run drizzle:init:dev`.

### Wrangler

Expand Down
Binary file added bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"drizzle-kit": "^0.20.14",
"eslint": "^8.57.0",
"husky": "^9.0.11",
"openapi-generator": "link:@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator",
"tsx": "^4.7.1",
"typescript": "^5.4.2",
"wrangler": "3.34.2"
Expand Down
Loading

0 comments on commit f8f09d2

Please sign in to comment.