Skip to content

Commit 6a8c374

Browse files
authored
Merge pull request #9 from appwrite/bun-ts
2 parents e2a3f38 + ff74615 commit 6a8c374

21 files changed

+1227
-2499
lines changed

.dockerignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Git
2+
.git/
3+
.gitignore
4+
5+
# IDE
6+
.idea/
7+
.vscode/
8+
9+
# Documentation
10+
*.md
11+
README.md
12+
CHANGELOG.md
13+
LICENSE
14+
15+
# Test artifacts
16+
test-screenshots/
17+
comparison/
18+
19+
# Build output
20+
dist/
21+
22+
# Logs
23+
*.log
24+
logs/
25+
26+
# macOS
27+
.DS_Store
28+
29+
# CI/CD
30+
.github/

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,13 @@ dist
134134
.yarn/build-state.yml
135135
.yarn/install-state.gz
136136
.pnp.*
137+
138+
# macOS
139+
.DS_Store
140+
141+
# IDE
142+
.idea/
143+
144+
# Test artifacts
145+
test-screenshots/
146+
comparison/

Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
FROM node:22.13.1-alpine3.20 AS base
1+
FROM oven/bun:1.3.2-alpine AS base
22

33
WORKDIR /app
44

5-
COPY package.json pnpm-lock.yaml ./
5+
COPY package.json bun.lock ./
66

7-
RUN npm install -g pnpm@10.20.0
7+
RUN bun install --frozen-lockfile --production && \
8+
rm -rf ~/.bun/install/cache /tmp/*
89

9-
RUN pnpm install --prod --frozen-lockfile && \
10-
rm -rf ~/.pnpm ~/.npm /tmp/* /var/cache/apk/*
11-
12-
FROM node:22.13.1-alpine3.20 AS final
10+
FROM oven/bun:1.3.2-alpine AS final
1311

1412
RUN apk upgrade --no-cache --available && \
1513
apk add --no-cache \
@@ -40,4 +38,4 @@ COPY --from=base /app/node_modules ./node_modules
4038
COPY src/ ./src/
4139

4240
ENTRYPOINT ["tini", "--"]
43-
CMD ["node", "src/index.js"]
41+
CMD ["bun", "run", "src/server.ts"]

bun.lock

Lines changed: 672 additions & 0 deletions
Large diffs are not rendered by default.

eslint.config.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
import globals from "globals";
22
import pluginJs from "@eslint/js";
3-
3+
import tseslint from "typescript-eslint";
44

55
/** @type {import('eslint').Linter.Config[]} */
66
export default [
7-
{languageOptions: { globals: globals.node }},
7+
{
8+
files: ["**/*.{js,mjs,cjs,ts}"],
9+
languageOptions: {
10+
globals: {
11+
...globals.node,
12+
Bun: "readonly",
13+
}
14+
}
15+
},
816
pluginJs.configs.recommended,
17+
...tseslint.configs.recommended,
18+
{
19+
rules: {
20+
"@typescript-eslint/no-unused-vars": [
21+
"error",
22+
{
23+
argsIgnorePattern: "^_",
24+
varsIgnorePattern: "^_",
25+
}
26+
]
27+
}
28+
}
929
];

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
"name": "appwrite-browser",
33
"version": "0.1.0",
44
"description": "",
5-
"main": "src/index.js",
5+
"main": "src/server.ts",
66
"type": "module",
77
"scripts": {
8-
"start": "node src/index.js",
8+
"start": "bun run src/server.ts",
9+
"dev": "bun --watch src/server.ts",
10+
"build": "tsc",
11+
"type-check": "tsc --noEmit",
912
"format": "biome check --write ./src",
1013
"lint": "biome check ./src",
1114
"check": "eslint ./src",
@@ -16,7 +19,6 @@
1619
"license": "ISC",
1720
"packageManager": "pnpm@10.20.0",
1821
"dependencies": {
19-
"h3": "^1.13.0",
2022
"lighthouse": "^12.2.1",
2123
"playwright-core": "^1.52.0",
2224
"playwright-lighthouse": "^4.0.0",
@@ -25,7 +27,10 @@
2527
"devDependencies": {
2628
"@biomejs/biome": "^1.9.4",
2729
"@eslint/js": "^9.20.0",
30+
"@types/bun": "^1.3.2",
2831
"eslint": "^9.20.1",
29-
"globals": "^15.15.0"
32+
"globals": "^15.15.0",
33+
"typescript": "^5.9.3",
34+
"typescript-eslint": "^8.46.3"
3035
}
3136
}

0 commit comments

Comments
 (0)