Skip to content

Commit 5a86241

Browse files
committed
Let's give bun a try
Bun is a new JavaScript/TypeScript runtime with everything built in. It seems like it could be a lot easier than using a bunch of tools. It also is a bit faster and has some improvements to security. This replaces node, c8, esbuild, taze, maybe some other things.
1 parent d83736e commit 5a86241

24 files changed

+700
-709
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
node-version: ['18', '20', '22']
19+
bun-version: ['1.3']
2020

2121
steps:
22-
- uses: actions/checkout@v4
23-
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v4
22+
- uses: actions/checkout@v5
23+
- name: Use Bun ${{ matrix.bun-version }}
24+
uses: oven-sh/setup-bun@v2
2525
with:
26-
node-version: ${{ matrix.node-version }}
27-
- run: npm install
26+
bun-version: ${{ matrix.bun-version }}
27+
- run: bun install
2828
- run: |
2929
echo "::remove-matcher owner=eslint-compact::"
3030
echo "::remove-matcher owner=eslint-stylish::"
31-
- run: npm run test
31+
- run: bun run all

.gitignore

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
/coverage
2+
/dist
3+
/node_modules
4+
/scratch
5+
16
.DS_Store
2-
.cache
7+
.vscode
38
npm-debug.log
9+
lerna-debug.log
410
package-lock.json
5-
6-
.nyc_output/
7-
.scratch/
8-
coverage/
9-
node_modules/
11+
yarn.lock

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributing
2+
3+
This project uses **GitHub** to track issues and manage our source code.
4+
- Check out the [Git Guides](https://github.com/git-guides) to learn more.
5+
6+
This project uses the **JavaScript** programming language.
7+
- [MDN's JavaScript guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide) is a great resource for learning about JavaScript.
8+
9+
This project uses the **TypeScript** programming language.
10+
- Check out the [TypeScript Docs](https://www.typescriptlang.org/docs/) to learn more.
11+
- (It's a superset of JavaScript, so knowing that already will help you a lot).
12+
13+
This project uses **Bun** as our development environment.
14+
- Check out the [Bun Docs](https://bun.com/docs) to learn more.
15+
- (It's similar to other JavaScript tools like Node/Jest/Esbuild/Vite, so knowing any of those already will help you a lot).
16+
- Bun supports both JavaScript and TypeScript.
17+
18+
If you want to contribute to osm-auth, you'll probably need to:
19+
- [Install Bun](https://bun.com/docs/installation)
20+
- `git clone` osm-auth
21+
- `cd` into the project folder
22+
- `bun install` the dependencies
23+
24+
As you change things, you'll want to `bun run all` to ensure that things are working.
25+
(This command just runs `clean`, `lint`, `build`, and `test`.)
26+
27+
You can also test the code in a local server:
28+
- `bun start` - then open `http://127.0.0.1:8080/` in a browser.
29+
30+
It's also good to check on the dependencies sometimes with commands like:
31+
- `bun outdated` - what packages have updates available?
32+
- `bun update --interactive` - choose which updates to apply
33+
34+
Try to keep things simple!

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Try it out now at: https://osmlab.github.io/osm-auth/
2323
Or you can run the demo locally by cloning this project, then run:
2424

2525
```sh
26-
$ npm install
27-
$ npm run build
28-
$ npm start
26+
$ bun install
27+
$ bun run all
28+
$ bun start
2929
```
3030

3131
This will start a local server on port 8080. Then open `http://127.0.0.1:8080/` in a browser.
@@ -35,7 +35,7 @@ This will start a local server on port 8080. Then open `http://127.0.0.1:8080/`
3535

3636
### Use in Node
3737

38-
To install osm-auth as a dependency in your project:
38+
To install osm-auth as a dependency in your Node project:
3939
```bash
4040
$ npm install --save osm-auth
4141
```
@@ -148,6 +148,14 @@ if (window.location.search.slice(1).split('&').some(p => p.startsWith('code=')))
148148
}
149149
```
150150

151+
 
152+
153+
## Contributing
154+
155+
See the [CONTRIBUTING.md](CONTRIBUTING.md) file for more info.
156+
157+
 
158+
151159
# API
152160

153161
## `.osmAuth(options)`

bun.lock

Lines changed: 233 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bunfig.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[install]
2+
# Only install package versions published at least 3 days ago
3+
minimumReleaseAge = 259200 # seconds
4+
5+
[run]
6+
# equivalent to `bun --bun` for all `bun run` commands
7+
bun = true
8+
shell = "bun"

0 commit comments

Comments
 (0)