Skip to content

Commit c2395b2

Browse files
authored
chore: use Bun as a package manager (#224)
* chore: use Bun as a package manager * remove `yarn.lock` * fix `hono` version * update dependencies and fix the tests
1 parent 6a79ca8 commit c2395b2

File tree

6 files changed

+1720
-5464
lines changed

6 files changed

+1720
-5464
lines changed

.github/workflows/ci.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: ${{ matrix.node-version }}
26-
- run: yarn install --frozen-lockfile
27-
- run: yarn format
28-
- run: yarn lint
29-
- run: yarn build
30-
- run: yarn test
26+
- uses: oven-sh/setup-bun@v2
27+
- run: bun install
28+
- run: bun run format
29+
- run: bun run lint
30+
- run: bun run build
31+
- run: bun run test

bun.lock

+1,711
Large diffs are not rendered by default.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"build": "tsup --external hono",
5959
"watch": "tsup --watch",
6060
"postbuild": "publint",
61-
"prerelease": "yarn build && yarn test",
61+
"prerelease": "bun run build && bun run test",
6262
"release": "np",
6363
"lint": "eslint src test",
6464
"lint:fix": "eslint src test --fix",
@@ -99,4 +99,4 @@
9999
"peerDependencies": {
100100
"hono": "^4"
101101
}
102-
}
102+
}

test/serve-static.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('Serve Static Middleware', () => {
7474
name: 'Foo Bar',
7575
flag: true,
7676
})
77-
expect(res.headers['content-type']).toBe('application/json; charset=utf-8')
77+
expect(res.headers['content-type']).toBe('application/json')
7878
})
7979

8080
it('Should return correct headers and data for text', async () => {

test/server.test.ts

-3
Original file line numberDiff line numberDiff line change
@@ -625,15 +625,13 @@ describe('HTTP2', () => {
625625
})
626626

627627
it('Should return 200 response - GET /', async () => {
628-
// @ts-expect-error: @types/supertest is not updated yet
629628
const res = await request(server, { http2: true }).get('/').trustLocalhost()
630629
expect(res.status).toBe(200)
631630
expect(res.headers['content-type']).toMatch('text/plain')
632631
expect(res.text).toBe('Hello! Node!')
633632
})
634633

635634
it('Should return 200 response - GET /headers', async () => {
636-
// @ts-expect-error: @types/supertest is not updated yet
637635
const res = await request(server, { http2: true }).get('/headers').trustLocalhost()
638636
expect(res.status).toBe(200)
639637
expect(res.headers['content-type']).toMatch('text/plain')
@@ -642,7 +640,6 @@ describe('HTTP2', () => {
642640

643641
// Use :authority as the host for the url.
644642
it('Should return 200 response - GET /url', async () => {
645-
// @ts-expect-error: @types/supertest is not updated yet
646643
const res = await request(server, { http2: true }).get('/url').trustLocalhost()
647644
expect(res.status).toBe(200)
648645
expect(res.headers['content-type']).toMatch('text/plain')

0 commit comments

Comments
 (0)