Skip to content

Commit ce00207

Browse files
committed
Use bun
1 parent a6e9bb6 commit ce00207

File tree

8 files changed

+5268
-60
lines changed

8 files changed

+5268
-60
lines changed

.github/workflows/deploy-to-firebase.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,16 @@ jobs:
1515
- name: Checkout to repository
1616
uses: actions/[email protected]
1717

18-
- name: Setup Node
19-
uses: actions/setup-[email protected]
18+
- name: Setup Bun
19+
uses: oven-sh/setup-bun@v2
2020
with:
21-
node-version: 20.8.1
22-
23-
- name: Install Yarn
24-
run: sudo npm i -g yarn
21+
bun-version: latest
2522

2623
- name: Install dependencies
27-
run: yarn
24+
run: bun install --frozen-lockfile
2825

2926
- name: Build
30-
run: REACT_APP_CONFIG=preview PUBLIC_URL=/ yarn build
27+
run: REACT_APP_CONFIG=preview PUBLIC_URL=/ bun run build
3128

3229
- name: Deploy
3330
uses: FirebaseExtended/action-hosting-deploy@v0

.github/workflows/deploy-to-github-pages.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,17 @@ jobs:
1414
- name: Checkout to repository
1515
uses: actions/[email protected]
1616

17-
- name: Setup Node
18-
uses: actions/setup-[email protected]
17+
- name: Setup Bun
18+
uses: oven-sh/setup-bun@v2
1919
with:
20-
node-version: 20.8.1
21-
22-
- name: Install Yarn
23-
run: sudo npm i -g yarn
20+
bun-version: latest
2421

2522
- name: Install dependencies
26-
run: yarn
23+
run: bun install --frozen-lockfile
2724

2825
- name: Build and deploy to GitHub Pages
2926
run: |
3027
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
31-
yarn deploy -- -u "github-actions-bot <[email protected]>"
28+
bun run deploy -- -u "github-actions-bot <[email protected]>"
3229
env:
3330
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ jobs:
1616
ref: master
1717
persist-credentials: false
1818

19-
- name: Setup Node
20-
uses: actions/setup-[email protected]
19+
- name: Setup Bun
20+
uses: oven-sh/setup-bun@v2
2121
with:
22-
node-version: 20.8.1
22+
bun-version: latest
2323

2424
- name: Install dependencies
25-
run: yarn
25+
run: bun install --frozen-lockfile
2626

2727
- name: Build
28-
run: yarn build
28+
run: bun run build
2929

3030
- name: Zip build
3131
run: zip -r build.zip build
@@ -37,4 +37,4 @@ jobs:
3737
GIT_AUTHOR_EMAIL: ${{ vars.RELEASE_GIT_AUTHOR_EMAIL }}
3838
GIT_COMMITTER_NAME: ${{ vars.RELEASE_GIT_COMMITTER_NAME }}
3939
GIT_COMMITTER_EMAIL: ${{ vars.RELEASE_GIT_COMMITTER_EMAIL }}
40-
run: npx semantic-release --branches master
40+
run: bunx semantic-release --branches master

.github/workflows/unit-tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ jobs:
1414
- name: Checkout to repository
1515
uses: actions/[email protected]
1616

17-
- name: Setup Node
18-
uses: actions/setup-[email protected]
17+
- name: Setup Bun
18+
uses: oven-sh/setup-bun@v2
1919
with:
20-
node-version: 20.8.1
20+
bun-version: latest
2121

2222
- name: Install dependencies
23-
run: yarn
23+
run: bun install --frozen-lockfile
2424

2525
- name: Build
26-
run: yarn build
26+
run: bun run build
2727

2828
- name: Lint
29-
run: yarn lint
29+
run: bun run lint
3030

3131
- name: Test
32-
run: yarn test
32+
run: bun run test

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ The app is built using [craco](https://github.com/gsoft-inc/craco) (with the [cr
3131

3232
Tests are written and run using the [jest](https://jestjs.io/) framework.
3333

34-
The [yarn](https://yarnpkg.com/) package manager is used to manage dependencies and run scripts specified in `package.json` (`build`, `lint`, `test`, etc.).
34+
The [Bun](https://bun.sh/) runtime and package manager is used to manage dependencies and run scripts specified in `package.json` (`build`, `lint`, `test`, etc.).
3535

3636
## Coding style
3737

3838
Source code is linted using [ts-standard](https://github.com/standard/ts-standard) (based on [eslint](https://eslint.org/)) and TypeScript is used with [strict type checking compiler options](https://www.typescriptlang.org/tsconfig#Strict_Type_Checking_Options_6173) enabled.
3939

4040
Use the following command to identify potential coding style and type annotation violations:
4141

42-
$ yarn lint
42+
$ bun run lint
4343

4444

4545
### Documentation

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ When enabled, the memory footer appears at the bottom of all pages and monitors
236236
Download the latest release from [github.com/imagingdatacommons/slim/releases](https://github.com/imagingdatacommons/slim/releases) and then run the following commands to install build dependencies and build the app:
237237

238238
```none
239-
yarn install
240-
PUBLIC_URL=/ yarn build
239+
bun install
240+
PUBLIC_URL=/ bun run build
241241
```
242242

243243
Once the app has been built, the content of the `build` folder can be directly served by a static web server at the location specified by `PUBLIC_URL` (in this case at `/`).
@@ -374,57 +374,57 @@ For the time being, the legacy implicit grand type has to be used.
374374
To install requirements and run the app for local development, run the following commands:
375375

376376
```none
377-
yarn install
378-
yarn start
377+
bun install
378+
bun run start
379379
```
380380

381381
This will serve the app via a development server at [http://localhost:3000](http://localhost:3000) using the default `local` configuration.
382382

383383
The configuration can be specified using the `REACT_APP_CONFIG` environment variable, which can be set either in the `.env` file or directly in the command line:
384384

385385
```none
386-
REACT_APP_CONFIG=local yarn start
386+
REACT_APP_CONFIG=local bun run start
387387
```
388388

389389
## Linking Slim to a Local dicom-microscopy-viewer Library
390390

391-
If you are developing features or fixing bugs that require changes in both Slim and the underlying [`dicom-microscopy-viewer`](https://github.com/ImagingDataCommons/dicom-microscopy-viewer) library, you can use `yarn link` to connect your local Slim project to a local clone of `dicom-microscopy-viewer`. This allows Slim to immediately use the latest local changes from the library without publishing to npm.
391+
If you are developing features or fixing bugs that require changes in both Slim and the underlying [`dicom-microscopy-viewer`](https://github.com/ImagingDataCommons/dicom-microscopy-viewer) library, you can use `bun link` to connect your local Slim project to a local clone of `dicom-microscopy-viewer`. This allows Slim to immediately use the latest local changes from the library without publishing to npm.
392392

393393
### Steps
394394

395395
1. **Clone dicom-microscopy-viewer**
396396
If you haven't already, clone the `dicom-microscopy-viewer` repository to your machine.
397397

398-
2. **Set up yarn link in dicom-microscopy-viewer**
398+
2. **Set up bun link in dicom-microscopy-viewer**
399399
In the root directory of your local `dicom-microscopy-viewer` repository, run:
400400
```sh
401-
yarn link
401+
bun link
402402
```
403403

404404
3. **Link dicom-microscopy-viewer in Slim**
405405
In the root directory of your Slim project, run:
406406
```sh
407-
yarn link dicom-microscopy-viewer
407+
bun link dicom-microscopy-viewer
408408
```
409409

410410
4. **Enable live rebuilding in dicom-microscopy-viewer**
411411
To automatically rebuild `dicom-microscopy-viewer` when you make changes, run the following command in the `dicom-microscopy-viewer` directory:
412412
```sh
413-
yarn webpack:dynamic-import:watch
413+
bun run webpack:dynamic-import:watch
414414
```
415415
This will watch for file changes and rebuild the library, so Slim can immediately use the updated code.
416416

417417
5. **Run Slim as usual**
418418
In the Slim directory, start the development server:
419419
```sh
420-
yarn start
420+
bun run start
421421
```
422422
Slim will now use your locally linked version of `dicom-microscopy-viewer`.
423423

424424
### Notes
425425

426-
- If you want to unlink and return to the npm-published version, run `yarn unlink dicom-microscopy-viewer` and `yarn install --force` in the Slim directory.
427-
- Make sure both projects use compatible Node and Yarn versions to avoid dependency issues.
426+
- If you want to unlink and return to the npm-published version, run `bun unlink dicom-microscopy-viewer` and `bun install` in the Slim directory.
427+
- Make sure both projects use compatible Bun versions to avoid dependency issues.
428428

429429
## Citation
430430

0 commit comments

Comments
 (0)