Skip to content

Commit f49bfd1

Browse files
committed
Let's give bun a try
Bun is a new JavaScript 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. This commit also upgrades our eslint config to work with v9.
1 parent 39c04c0 commit f49bfd1

24 files changed

+543
-190
lines changed

.eslintrc

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +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
28-
- run: npm run all
26+
bun-version: ${{ matrix.bun-version }}
27+
- run: bun install
28+
- run: |
29+
echo "::remove-matcher owner=eslint-compact::"
30+
echo "::remove-matcher owner=eslint-stylish::"
31+
- run: bun run all

.gitignore

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1+
/coverage
2+
/dist
3+
/node_modules
4+
15
.DS_Store
2-
.esm-cache
36
.vscode
4-
.coverage
5-
6-
.nyc_output/
7-
built/
8-
coverage/
9-
dist/
10-
node_modules/
11-
127
npm-debug.log
138
lerna-debug.log
149
package-lock.json

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 node-diff3, you'll probably need to:
19+
- [Install Bun](https://bun.com/docs/installation)
20+
- `git clone` node-diff3
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+
It's also good to check on the dependencies sometimes with commands like:
28+
- `bun outdated` - what packages have updates available?
29+
- `bun update --interactive` - choose which updates to apply
30+
31+
Try to keep things simple!

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You can also use **node-diff3** directly in a web browser. A good way to do thi
3939
When you load this file in a `<script>` tag, you'll get a `Diff3` global to use elsewhere in your scripts:
4040
```html
4141
<head>
42-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.iife.min.js"></script>
42+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/diff3.iife.min.js"></script>
4343
</head>
4444
4545
<script>
@@ -54,6 +54,12 @@ When you load this file in a `<script>` tag, you'll get a `Diff3` global to use
5454

5555
&nbsp;
5656

57+
## Contributing
58+
59+
See the [CONTRIBUTING.md](CONTRIBUTING.md) file for more info.
60+
61+
&nbsp;
62+
5763
## API Reference
5864

5965
* [3-way diff and merging](#3-way-diff-and-merging)

RELEASE.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
## Release Checklist
22

33
#### Update version, tag, and publish
4+
45
```bash
5-
$ git checkout main
6-
$ npm install
7-
$ npm run test
8-
$ Update CHANGELOG
9-
$ Update version number in `package.json`
10-
$ git add .
11-
$ git commit -m 'vA.B.C'
12-
$ git tag vA.B.C
13-
$ git push origin main vA.B.C
14-
$ npm publish
6+
# Make sure your main branch is up to date and all tests pass
7+
git checkout main
8+
git pull origin
9+
bun install
10+
bun run all
11+
12+
# Pick a version, see https://semver.org/ - for example: 'A.B.C' or 'A.B.C-pre.D'
13+
# Update version number in `package.json`
14+
# Update CHANGELOG.md
1515

16+
export VERSION=vA.B.C-pre.D
17+
git add . && git commit -m "$VERSION"
18+
git tag "$VERSION"
19+
git push origin main "$VERSION"
20+
bun publish
1621
```
17-
* Open https://github.com/bhousel/node-diff3/tags
18-
* Click "Add Release Notes" and link to the CHANGELOG#version
22+
23+
Set as latest release on GitHub:
24+
- Open https://github.com/bhousel/node-diff3/blob/main/CHANGELOG.md and copy the URL to the new release
25+
- Open https://github.com/bhousel/node-diff3/tags and pick the new tag you just pushed
26+
- There should be a link like "create a release from the tag", click that, and paste in the link to the changelog.

0 commit comments

Comments
 (0)