Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch to bun and elysia #99

Merged
merged 18 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
node_modules/
node_modules
.github
.gitignore
Dockerfile
README.md
renovate.json
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: '@terrestris/eslint-config-typescript'
};
20 changes: 0 additions & 20 deletions .eslintrc.js

This file was deleted.

13 changes: 0 additions & 13 deletions .github/dependabot.yml

This file was deleted.

26 changes: 6 additions & 20 deletions .github/workflows/on-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,18 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use bun
uses: oven-sh/setup-bun@v1

- name: Cache Node.js modules 💾
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies ⏬
run: npm install
run: bun install

- name: Lint code 💄
run: npm run lint
run: bun run lint

- name: Test code ✅
run: npm run test
run: bun test
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM node:lts-alpine
LABEL maintainer="[email protected]"
FROM oven/bun

COPY . .
RUN npm install

CMD [ "npm", "start" ]
RUN bun install

ENTRYPOINT ["bun"]

CMD ["src/index.ts"]
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ git clone https://github.com/geostyler/geostyler-rest.git

cd geostyler-rest

npm install
bun install

npm run start-dev
bun run dev

Open http://localhost:8888/geostyler-rest/api-docs/ in a browser
Open http://localhost:8888/api-docs/ in a browser
```

### Run unit tests

```
cd /path/to/this/checkout

npm run test
bun test
```

## Production setup
Expand All @@ -33,11 +33,11 @@ npm run test
```
cd /path/to/this/checkout

npm install
bun install

npm start
bun run src/index.ts

Open http://localhost:8888/geostyler-rest/api-docs/ in a browser
Open http://localhost:8888/api-docs/ in a browser
```

### Run with Docker
Expand All @@ -49,7 +49,7 @@ docker build -t geostyler_rest_server .

docker run -e NODE_API_PORT=9999 -p 9999:9999 geostyler_rest_server

Open http://localhost:9999/geostyler-rest/api-docs/ in a browser
Open http://localhost:9999/api-docs/ in a browser
```

## <a name="funding"></a>Funding & financial sponsorship
Expand All @@ -58,4 +58,3 @@ Maintenance and further development of this code can be funded through the
[GeoStyler Open Collective](https://opencollective.com/geostyler). All contributions and
expenses can transparently be reviewed by anyone; you see what we use the donated money for.
Thank you for any financial support you give the GeoStyler project 💞

Binary file added bun.lockb
Binary file not shown.
89 changes: 0 additions & 89 deletions index.js

This file was deleted.

Loading