Skip to content

Commit 9a99885

Browse files
authored
feat!: Upgrade bun and refactor routing (#6)
1 parent 1ee6329 commit 9a99885

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+714
-418
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1+
# See https://git-scm.com/docs/gitattributes#_pattern_format for more about `.gitattributes`.
2+
3+
# Normalize EOL for all files that Git considers text files
4+
* text=auto eol=lf
5+
6+
# Mark lock files as generated to avoid diffing
7+
bun.lock linguist-generated
8+
9+
# Mark other generated files as generated
110
src/crawlers/__tests__/fixtures/chrome-web-store/*.html linguist-generated=true

.github/actions/setup/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ description: Install Bun and dependencies
33
runs:
44
using: composite
55
steps:
6-
- uses: oven-sh/setup-bun@v1
6+
- uses: oven-sh/setup-bun@v2
7+
with:
8+
bun-version-file: package.json
79
- run: bun install
810
shell: bash

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- uses: ./.github/actions/setup
15-
- run: bun generate:types
15+
- run: bun gen:types
1616
- run: bun check
1717
tests:
1818
runs-on: ubuntu-22.04

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@jsr:registry=https://npm.jsr.io

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ COPY package.json package.json
44
COPY bun.lockb bun.lockb
55
RUN bun install --production --ignore-scripts
66
COPY . .
7-
ENTRYPOINT ["bun", "src/index.ts"]
7+
ENTRYPOINT ["bun", "src/main.ts"]

bun.lock

Lines changed: 235 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bun.lockb

-30.7 KB
Binary file not shown.

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "wxt-queue",
2+
"name": "@wxt-dev/queue",
33
"version": "0.3.20",
4-
"module": "src/index.ts",
54
"type": "module",
6-
"packageManager": "bun@1.1.31",
5+
"packageManager": "bun@1.2.18",
76
"scripts": {
8-
"dev": "bun --hot run src/dev.ts",
9-
"generate:types": "bun run src/generate-types.ts",
7+
"dev": "bun run --watch scripts/dev.ts",
8+
"gen": "bun run gen:types",
9+
"gen:types": "bun run scripts/generate-types.ts",
1010
"docker:build": "docker build . -t aklinker1/store-api",
1111
"docker:run": "docker run -it aklinker1/store-api",
1212
"docker:build:amd": "bun docker:build --platform linux/amd64",
@@ -15,21 +15,24 @@
1515
"check": "check"
1616
},
1717
"dependencies": {
18+
"@aklinker1/zero-ioc": "^1.3.2",
19+
"@aklinker1/zeta": "npm:@jsr/[email protected]",
1820
"consola": "^3.2.3",
1921
"dataloader": "^2.2.2",
2022
"graphql": "^16.8.0",
2123
"linkedom": "^0.15.3",
2224
"picocolors": "^1.0.0",
23-
"radix3": "^1.1.2"
25+
"zod": "^3.25.75"
2426
},
2527
"devDependencies": {
26-
"@aklinker1/check": "^1.2.0",
27-
"bun-types": "latest",
28+
"@aklinker1/check": "^2.1.0",
29+
"@types/bun": "latest",
2830
"code-block-writer": "^12.0.0",
2931
"lint-staged": "^15.2.2",
32+
"oxlint": "^1.6.0",
3033
"prettier": "^3.2.5",
3134
"simple-git-hooks": "^2.9.0",
32-
"typescript": "^5.3.3"
35+
"typescript": "^5.8.3"
3336
},
3437
"simple-git-hooks": {
3538
"pre-commit": "bun lint-staged"

scripts/dev.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bun
2+
import consola, { LogLevels } from "consola";
3+
import app from "../src/server";
4+
import { generateGqlTypes } from "./generate-gql-types";
5+
import pc from "picocolors";
6+
import { version } from "../package.json";
7+
8+
const fetch = app.build();
9+
await generateGqlTypes(fetch);
10+
11+
consola.level = LogLevels.debug;
12+
const port = Number(process.env.PORT ?? "3000");
13+
Bun.serve({ port, fetch });
14+
15+
consola.success(
16+
`${pc.cyan("@wxt-dev/queue v" + version)} ${pc.dim("server started")}`,
17+
);
18+
consola.log(` ${pc.bold(pc.green("➜"))} http://localhost:${port}`);
19+
console.log();

scripts/gen.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)