Skip to content

Commit

Permalink
Add: bun setup
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianKoerner committed Oct 7, 2023
1 parent 0980d06 commit 2115c25
Show file tree
Hide file tree
Showing 96 changed files with 334 additions and 8,822 deletions.
1 change: 0 additions & 1 deletion .buildpacks

This file was deleted.

2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

18 changes: 6 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,19 @@ name: Test
on:
push:
branches:
- 'main'
- '2.x'
pull_request:
branches:
- 'main'
- '2.x'

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: oven-sh/setup-bun@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
bun-version: 1
- run: bun install
- run: bun test
177 changes: 176 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,176 @@
node_modules
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
\*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
\*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

\*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

\*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.cache
.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

.cache/

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp
.cache

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.\*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store

3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"singleQuote": true
"singleQuote": true,
"printWidth": 120
}
2 changes: 0 additions & 2 deletions CHECKS

This file was deleted.

11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM --platform=linux/amd64 node:18-slim
FROM --platform=linux/amd64 oven/bun:1

EXPOSE 3000

WORKDIR /dicebear-api
COPY package.json ./
COPY bun.lockb ./
COPY src ./

COPY . .
RUN npm install

CMD ["npm", "start"]
RUN bun install
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Florian Körner
Copyright (c) 2023 Florian Körner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1><img src="https://dicebear.com/logo-readme.svg" width="28" /> DiceBear API</h1>

This is the source code for the [DiceBear API](https://dicebear.com/how-to-use/http-api). It's built on [Fastify](https://fastify.io/).
This is the source code for the [DiceBear API](https://dicebear.com/how-to-use/http-api). It's built on [Bun](https://bun.sh/) and [ElysiaJS](https://elysiajs.com/).
Learn how to set up your own instance of the API in the [documentation](https://dicebear.com/guides/host-the-http-api-yourself).

[Playground](https://dicebear.com/playground) |
Expand Down
51 changes: 0 additions & 51 deletions app/config.ts

This file was deleted.

1 change: 0 additions & 1 deletion app/loadr.mjs

This file was deleted.

40 changes: 0 additions & 40 deletions app/package.json

This file was deleted.

Loading

0 comments on commit 2115c25

Please sign in to comment.