Skip to content

Commit 3ca15c5

Browse files
committed
use bun and remove some deps
1 parent 500d7b2 commit 3ca15c5

13 files changed

+61
-367
lines changed

.dockerignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
*
22
!src
3-
!tsconfig.json
43
!package.json
5-
!pnpm-lock.yaml
4+
!bun.lockb

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.env
22
ip.log
3-
dist
43
node_modules
54
.vscode

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.4.0] - 2024-02-27
9+
10+
### Changed
11+
12+
- Moved to bun.
13+
- Removed some dependencies.
14+
815
## [1.3.4] - 2024-02-27
916

1017
### Security

Dockerfile

+6-19
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
1-
FROM node:20-alpine as base
2-
# PNPM
3-
ENV PNPM_HOME="/pnpm"
4-
ENV PATH="$PNPM_HOME:$PATH"
5-
RUN corepack enable
6-
# Setup
7-
ENV CI=true
8-
WORKDIR /app
9-
ADD ./package.json ./pnpm-lock.yaml ./
10-
1+
FROM oven/bun:1 as base
112

12-
FROM base as builder
13-
RUN pnpm install
14-
ADD . .
15-
RUN pnpm run build
3+
WORKDIR /app
4+
COPY package.json bun.lockb /app/
5+
RUN bun install --production --frozen-lockfile
166

17-
FROM base
18-
RUN pnpm install --prod
19-
COPY --from=builder /app/dist/ /app/dist/
7+
COPY . .
208

219
STOPSIGNAL SIGTERM
22-
23-
CMD ["pnpm", "start"]
10+
CMD ["bun", "."]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ docker-compose up -d
5151
| `ZONE` | | Cloudflare zone where your domain is. |
5252
| `DNS_RECORD` | | The actual DNS record that should be updated. |
5353
| `PROXIED` | `true` | Whether the record is proxied by CloudFlare or not. |
54-
| `CRON` | `*/5 * * * *` | Frequency of updates. |
54+
| `CRON` | `*/5 * * * *` | Frequency of updates. The [following syntax](https://croner.56k.guru/usage/pattern/) is supported |
5555
| `RESOLVER` | `https://api.ipify.org/` | The endpoint used to determine your public ip. |
5656
| `LOG_LEVEL` | `info` | Log level to run at. See [winston](https://github.com/winstonjs/winston#logging-levels) for possible values |
5757

bun.lockb

17.1 KB
Binary file not shown.

package.json

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
{
2-
"version": "1.3.4",
2+
"version": "1.4.0",
33
"license": "MIT",
44
"type": "module",
5-
"main": "dist",
5+
"main": "./src/index.ts",
66
"scripts": {
7-
"build": "tsc",
8-
"dev": "tsc -w",
9-
"start": "node ."
7+
"check": "tsc --noEmit",
8+
"dev": "bun --watch ./src/index.ts",
9+
"start": "bun ./src/index.ts"
1010
},
1111
"dependencies": {
1212
"axios": "^1.6.7",
13-
"dotenv": "^16.4.5",
14-
"node-cron": "^3.0.3",
13+
"croner": "^8.0.1",
1514
"winston": "^3.11.0"
1615
},
1716
"devDependencies": {
18-
"@types/node": "^20.11.20",
19-
"@types/node-cron": "^3.0.11",
17+
"@types/bun": "^1.0.7",
2018
"typescript": "^5.3.3"
21-
},
22-
"packageManager": "[email protected]"
19+
}
2320
}

0 commit comments

Comments
 (0)