Skip to content

Commit

Permalink
use bun and remove some deps
Browse files Browse the repository at this point in the history
  • Loading branch information
cupcakearmy committed Feb 27, 2024
1 parent 500d7b2 commit 3ca15c5
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 367 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
*
!src
!tsconfig.json
!package.json
!pnpm-lock.yaml
!bun.lockb
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.env
ip.log
dist
node_modules
.vscode
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.4.0] - 2024-02-27

### Changed

- Moved to bun.
- Removed some dependencies.

## [1.3.4] - 2024-02-27

### Security
Expand Down
25 changes: 6 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
FROM node:20-alpine as base
# PNPM
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
# Setup
ENV CI=true
WORKDIR /app
ADD ./package.json ./pnpm-lock.yaml ./

FROM oven/bun:1 as base

FROM base as builder
RUN pnpm install
ADD . .
RUN pnpm run build
WORKDIR /app
COPY package.json bun.lockb /app/
RUN bun install --production --frozen-lockfile

FROM base
RUN pnpm install --prod
COPY --from=builder /app/dist/ /app/dist/
COPY . .

STOPSIGNAL SIGTERM

CMD ["pnpm", "start"]
CMD ["bun", "."]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ docker-compose up -d
| `ZONE` | | Cloudflare zone where your domain is. |
| `DNS_RECORD` | | The actual DNS record that should be updated. |
| `PROXIED` | `true` | Whether the record is proxied by CloudFlare or not. |
| `CRON` | `*/5 * * * *` | Frequency of updates. |
| `CRON` | `*/5 * * * *` | Frequency of updates. The [following syntax](https://croner.56k.guru/usage/pattern/) is supported |
| `RESOLVER` | `https://api.ipify.org/` | The endpoint used to determine your public ip. |
| `LOG_LEVEL` | `info` | Log level to run at. See [winston](https://github.com/winstonjs/winston#logging-levels) for possible values |

Expand Down
Binary file added bun.lockb
Binary file not shown.
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
{
"version": "1.3.4",
"version": "1.4.0",
"license": "MIT",
"type": "module",
"main": "dist",
"main": "./src/index.ts",
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"start": "node ."
"check": "tsc --noEmit",
"dev": "bun --watch ./src/index.ts",
"start": "bun ./src/index.ts"
},
"dependencies": {
"axios": "^1.6.7",
"dotenv": "^16.4.5",
"node-cron": "^3.0.3",
"croner": "^8.0.1",
"winston": "^3.11.0"
},
"devDependencies": {
"@types/node": "^20.11.20",
"@types/node-cron": "^3.0.11",
"@types/bun": "^1.0.7",
"typescript": "^5.3.3"
},
"packageManager": "[email protected]"
}
}
Loading

0 comments on commit 3ca15c5

Please sign in to comment.