Skip to content

Commit 75d6bff

Browse files
committed
chore: migrate from pnpm back to bun and update dependencies
1 parent ebacb36 commit 75d6bff

12 files changed

Lines changed: 3627 additions & 15828 deletions

File tree

Dockerfile

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
# use the official Node image
2-
# see all versions at https://hub.docker.com/_/node/tags
3-
FROM node:24-slim AS build
4-
RUN corepack enable
1+
# use the official Bun image
2+
# see all versions at https://hub.docker.com/r/oven/bun/tags
3+
FROM oven/bun:1 AS build
54
WORKDIR /app
65

7-
# Copy package.json and your lockfile, here we add pnpm-lock.yaml for illustration
8-
COPY package.json pnpm-lock.yaml .npmrc ./
6+
COPY package.json bun.lock* ./
97

108
# use ignore-scripts to avoid running postinstall hooks
11-
RUN pnpm install --frozen-lockfile
9+
RUN bun install --frozen-lockfile --ignore-scripts
1210

1311
# Copy the entire project
1412
COPY . .
@@ -17,13 +15,13 @@ COPY . .
1715
ENV NITRO_PRESET=node_cluster
1816
ENV NODE_ENV=production
1917
ENV SKIP_MIGRATE=true
20-
RUN pnpm run build
18+
RUN bun --bun run build
2119

22-
# Bundle migrate script into .output/scripts directory using rolldown
23-
RUN pnpx rolldown --input ./scripts/migrate.ts --format esm --file ./.output/scripts/migrate.mjs --minify --platform node --inlineDynamicImports
20+
# Bundle migrate script into .output/scripts directory
21+
RUN bun build ./scripts/migrate.ts --outfile ./.output/scripts/migrate.mjs --target=bun --minify
2422

2523
# copy production dependencies and source code into final image
26-
FROM node:24-slim AS production
24+
FROM oven/bun:1-alpine AS production
2725
WORKDIR /app
2826

2927
# Copy .output directory (which now contains migrate.mjs)
@@ -36,4 +34,4 @@ ENV PORT=3000
3634

3735
# run the app
3836
EXPOSE 3000/tcp
39-
ENTRYPOINT ["sh", "-c", "node /app/scripts/migrate.mjs && node /app/server/index.mjs"]
37+
ENTRYPOINT ["sh", "-c", "bun /app/scripts/migrate.mjs && bun --bun run /app/server/index.mjs"]

app/utils/auth.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { createAuthClient } from "better-auth/vue";
2-
import {
3-
usernameClient,
4-
adminClient,
5-
apiKeyClient,
6-
organizationClient,
7-
} from "better-auth/client/plugins";
2+
import { usernameClient, adminClient, organizationClient } from "better-auth/client/plugins";
3+
import { apiKeyClient } from "@better-auth/api-key/client";
84
import { linkClient } from "~~/shared/utils/auth/link/client";
95
import { domainClient } from "~~/shared/utils/auth/domain/client";
106

basis.config.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
import { defineBasisConfig } from "@funish/basis";
1+
import { defineBasisConfig } from "@funish/basis/config";
22

33
export default defineBasisConfig({
44
lint: {
5-
staged: {
6-
"*": "pnpm lint",
7-
},
8-
project: {
9-
check: "oxlint --fix --fix-suggestions --type-aware",
10-
format: "oxfmt --write . --ignore-path .gitignore",
5+
config: ["--fix", "--fix-suggestions", "--type-aware", "--type-check"],
6+
},
7+
fmt: {
8+
config: ["--write", "."],
9+
},
10+
publish: {
11+
npm: {
12+
additionalTag: "edge",
1113
},
1214
},
1315
git: {
1416
hooks: {
15-
"pre-commit": "basis lint --staged",
16-
"commit-msg": "basis git --lint-commit",
17+
"pre-commit": "pnpm basis git staged",
18+
"commit-msg": "pnpm basis git lint-commit",
19+
},
20+
staged: {
21+
rules: {
22+
"**/*.{ts,tsx,js,jsx}": "basis lint",
23+
"**/*.{json,md,yml,yaml}": "basis fmt",
24+
},
1725
},
1826
},
1927
});

bun.lock

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

content.config.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ export default defineContentConfig({
44
collections: {
55
content_en: defineCollection({
66
type: "page",
7-
source: "en/*.md",
8-
prefix: "/",
7+
source: {
8+
include: "en/*.md",
9+
prefix: "/",
10+
},
911
}),
1012
content_zh_cn: defineCollection({
1113
type: "page",
12-
source: "zh_cn/*.md",
13-
prefix: "/",
14+
source: {
15+
include: "zh_cn/*.md",
16+
prefix: "/",
17+
},
1418
}),
1519
},
1620
});

nuxt.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
import { defineNuxtConfig } from "nuxt/config";
2-
import { isDevelopment, env } from "std-env";
2+
import { isProduction, env } from "std-env";
33

44
export default defineNuxtConfig({
5-
app: {
6-
keepalive: true,
7-
},
8-
95
future: {
106
compatibilityVersion: 5,
117
},
128

139
compatibilityDate: "2026-02-16",
1410

1511
typescript: {
16-
typeCheck: isDevelopment ? true : false,
12+
typeCheck: !isProduction,
1713
},
1814

1915
routeRules: {
@@ -42,6 +38,10 @@ export default defineNuxtConfig({
4238
deployConfig: true,
4339
nodeCompat: true,
4440
},
41+
...(isProduction && {
42+
serveStatic: "inline",
43+
noExternals: true,
44+
}),
4545
},
4646

4747
modules: ["@nuxt/ui", "@vueuse/nuxt", "@nuxtjs/i18n", "@nuxt/content"],

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,39 @@
2222
"dev": "nuxt dev",
2323
"generate": "nuxt generate",
2424
"preview": "nuxt preview",
25-
"lint": "basis lint --all",
25+
"lint": "basis lint",
2626
"db": "bun scripts/migrate.ts",
27-
"postinstall": "nuxt prepare && basis git setup"
27+
"postinstall": "basis git setup"
2828
},
2929
"devDependencies": {
30-
"@better-auth/cli": "1.5.0-beta.13",
31-
"@clickhouse/client-web": "1.17.0",
32-
"@funish/basis": "0.1.3",
30+
"@better-auth/api-key": "1.5.3",
31+
"@clickhouse/client-web": "1.18.1",
32+
"@funish/basis": "0.2.9",
3333
"@hypequery/clickhouse": "1.5.0",
34-
"@iconify-json/lucide": "1.2.93",
35-
"@iconify-json/simple-icons": "1.2.71",
36-
"@nuxt/content": "3.11.2",
37-
"@nuxt/ui": "4.4.0",
34+
"@iconify-json/lucide": "1.2.95",
35+
"@iconify-json/simple-icons": "1.2.72",
36+
"@nuxt/content": "3.12.0",
37+
"@nuxt/ui": "4.5.1",
3838
"@nuxtjs/i18n": "10.2.3",
39-
"@types/node": "25.3.0",
40-
"@types/pg": "8.16.0",
39+
"@types/node": "25.3.3",
40+
"@types/pg": "8.18.0",
4141
"@types/ua-parser-js": "0.7.39",
4242
"@unovis/vue": "1.6.4",
4343
"@vueuse/nuxt": "14.2.1",
44-
"better-auth": "1.5.0-beta.13",
44+
"better-auth": "1.5.3",
4545
"date-fns": "4.1.0",
4646
"geoip0": "0.0.12",
47-
"ioredis": "5.9.3",
47+
"ioredis": "5.10.0",
4848
"ipdo": "0.0.6",
4949
"isbot": "5.1.35",
5050
"kysely": "0.28.11",
5151
"nuxt": "4.3.1",
5252
"openapi-renderer": "0.1.1",
53-
"oxfmt": "0.35.0",
54-
"oxlint": "1.50.0",
55-
"oxlint-tsgolint": "0.14.2",
56-
"pg": "8.18.0",
57-
"resend": "6.9.2",
53+
"oxfmt": "0.36.0",
54+
"oxlint": "1.51.0",
55+
"oxlint-tsgolint": "0.16.0",
56+
"pg": "8.20.0",
57+
"resend": "6.9.3",
5858
"reserved-usernames": "1.1.6",
5959
"tailwindcss": "4.2.1",
6060
"ua-parser-js": "2.0.9",

0 commit comments

Comments
 (0)