-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
304 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { BuildConfig } from 'bun' | ||
import dts from 'bun-plugin-dts' | ||
|
||
const defaultBuildConfig: BuildConfig = { | ||
entrypoints: ['./src/index.ts'], | ||
outdir: './dist' | ||
} | ||
|
||
await Promise.all([ | ||
Bun.build({ | ||
...defaultBuildConfig, | ||
plugins: [dts()], | ||
format: 'esm', | ||
naming: "[dir]/[name].js", | ||
}), | ||
Bun.build({ | ||
...defaultBuildConfig, | ||
format: 'cjs', | ||
naming: "[dir]/[name].cjs", | ||
}) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: auto-update | ||
run-name: Update npm dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: '30 12 4,18 * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
update-deps: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Bun.js | ||
uses: oven-sh/setup-bun@v2 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Update bun dependencies | ||
run: | | ||
bun bump | ||
bun update | ||
bun run build | ||
bun test --if-present | ||
- name: Commit and push changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: 'package*.json' | ||
message: 'Bot: bun deps update' | ||
|
||
- name: Store build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: | | ||
dist | ||
package*.json | ||
publish-npm: | ||
needs: update-deps | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Bun.js | ||
uses: oven-sh/setup-bun@v2 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: dist | ||
|
||
- name: Publish to npmjs.com | ||
run: bun publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: first-interaction-greetings | ||
run-name: First interaction greetings | ||
|
||
on: [pull_request_target, issues] | ||
|
||
jobs: | ||
greeting: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- name: First interaction greetings | ||
uses: actions/first-interaction@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-message: | | ||
👋 Hii! | ||
Welcome to the repository, and thank you for opening an issue. 🎉 | ||
We're excited to have you contribute! | ||
Please make sure to include all the relevant details to help us understand your report or suggestion. | ||
If you’re new here, take a moment to review our [contribution guidelines](../blob/main/CONTRIBUTING.md). | ||
These document will help you collaborate effectively and ensure a positive experience for everyone. | ||
We appreciate your effort and look forward to collaborating with you! 🚀 | ||
When chatting, please don't forget that we are human beings and that we do this with our own dedication and out of joy. | ||
Cheers ❤️ | ||
pr-message: | | ||
👋 Hii! | ||
Welcome, and thank you for opening your first pull request with us! 🎉 We're thrilled to see your contribution. | ||
Before we review, please ensure that: | ||
- You've followed the [contribution guidelines](../blob/main/CONTRIBUTING.md). | ||
- Your changes are thoroughly tested and documented (if applicable). | ||
- The PR description includes all changes and necessary details for the reviewers. | ||
Our team will review your submission as soon as possible. | ||
In the meantime, feel free to ask any questions or provide additional context to help with the review process. | ||
We appreciate your effort and look forward to collaborating with you! 🚀 | ||
When chatting, please don't forget that we are human beings and that we do this with our own dedication and out of joy. | ||
Cheers ❤️ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: npm-publish | ||
run-name: NPM build, test and publish | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "main" ] | ||
paths: | ||
- 'package.json' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Bun.js | ||
uses: oven-sh/setup-bun@v2 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Update bun dependencies | ||
run: | | ||
bun i | ||
bun run build | ||
bun run test --if-present | ||
- name: Commit and push changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: 'package*.json' | ||
message: 'Bot: bun deps update' | ||
|
||
- name: Store build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: | | ||
dist | ||
package*.json | ||
publish-npmjs-com: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Bun.js | ||
uses: oven-sh/setup-bun@v2 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: dist | ||
|
||
- name: Publish to npmjs.com | ||
run: bun publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,44 @@ | ||
{ | ||
"name": "bunrouter", | ||
"version": "1.0.1", | ||
"module": "src/index.ts", | ||
"name": "bun-route", | ||
"version": "1.0.14", | ||
"type": "module", | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"description": "A fast, Express-like router for the high-performance bun.serve() HTTP server.", | ||
"exports": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"scripts": { | ||
"test": "bun test" | ||
"bump": "bun --print \"const pkg = await Bun.file('package.json').json(); pkg.version = pkg.version.split('.').map((v, i) => i===2?+v+1:v).join('.'); await Bun.write('package.json', JSON.stringify(pkg, null, 2)); export default pkg.version\"", | ||
"test": "bun test", | ||
"build": "bun run .github/build.ts" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"keywords": [ | ||
"bun" | ||
], | ||
"license": "MIT", | ||
"homepage": "https://github.com/NobleMajo/bun-route", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/NobleMajo/bun-route.git" | ||
}, | ||
"bugs": "https://github.com/NobleMajo/bun-route/issues", | ||
"author": { | ||
"name": "NobleMajo", | ||
"email": "[email protected]", | ||
"url": "https://noblemajo.de/en/" | ||
}, | ||
"devDependencies": { | ||
"@types/bun": "latest" | ||
"bun-plugin-dts": "^0.3.0", | ||
"@types/bun": "^1.1.10" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.6.2" | ||
} | ||
} | ||
} |
Oops, something went wrong.