Skip to content

Commit 8420e6f

Browse files
Merge pull request #156 from ImagingDataCommons/chore/update-to-slim-0-45-2
chore: update to slim 0.45.2
2 parents 545a072 + 66a5740 commit 8420e6f

File tree

110 files changed

+11746
-19076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+11746
-19076
lines changed

.eslintrc.strict.cjs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* ESLint config that approximates DeepSource + SonarQube rules.
3+
* Run with: bun run lint:strict (or: bunx eslint --config .eslintrc.strict.cjs src/)
4+
*
5+
* DeepSource's JavaScript analyzer uses ESLint under the hood and supports
6+
* style_guide (e.g. "standard"). SonarQube rules are available via eslint-plugin-sonarjs.
7+
* This config enables rules that catch the kinds of issues both report.
8+
*/
9+
module.exports = {
10+
root: true,
11+
extends: [
12+
'react-app',
13+
'react-app/jest',
14+
'plugin:sonarjs/recommended',
15+
],
16+
plugins: ['sonarjs'],
17+
overrides: [
18+
{
19+
files: ['src/**/*.{ts,tsx,js,jsx}'],
20+
rules: {
21+
// DeepSource JS-0050: use === and !==
22+
eqeqeq: ['error', 'always'],
23+
// Avoid console in browser code (DeepSource JS-0002)
24+
'no-console': ['warn', { allow: ['warn', 'error'] }],
25+
// Object shorthand (DeepSource JS-0240)
26+
'object-shorthand': ['warn', 'always'],
27+
// Empty callbacks (DeepSource JS-0321)
28+
'no-empty-function': ['warn', { allow: ['arrowFunctions'] }],
29+
// Prefer named exports when re-exporting (DeepSource JS-P1003)
30+
'sonarjs/prefer-single-boolean-return': 'warn',
31+
},
32+
},
33+
],
34+
ignorePatterns: [
35+
'build/',
36+
'node_modules/',
37+
'coverage/',
38+
'*.config.js',
39+
'*.config.cjs',
40+
],
41+
};

.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/checkout@v4.2.2
1717

18-
- name: Setup Node
19-
uses: actions/setup-node@v4.4.0
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/checkout@v4.2.2
1616

17-
- name: Setup Node
18-
uses: actions/setup-node@v4.4.0
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 <support+actions@github.com>"
28+
bun run deploy -- -u "github-actions-bot <support+actions@github.com>"
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-node@v4.4.0
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/checkout@v4.2.2
1616

17-
- name: Setup Node
18-
uses: actions/setup-node@v4.4.0
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

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
/coverage
1313
.env
1414

15+
.cursorrules
16+
1517
# production
1618
/build
1719

@@ -28,7 +30,7 @@ public/config/*
2830
.env.production.local
2931

3032
npm-debug.log*
31-
yarn-debug.log*
32-
yarn-error.log*
33+
bun-debug.log*
34+
bun-error.log*
3335

3436
/.github

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env sh
2+
# Block commit if typecheck or lint fails
3+
bun run typecheck && bun run lint

CONTRIBUTING.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ 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

38-
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.
38+
Source code is linted and formatted using [Biome](https://biomejs.dev/). TypeScript is used with [strict type checking compiler options](https://www.typescriptlang.org/tsconfig#Strict_Type_Checking_Options_6173) enabled. Semicolons are not used at the end of statements (Biome uses `asNeeded`).
3939

40-
Use the following command to identify potential coding style and type annotation violations:
40+
Use the following commands to check and fix style:
4141

42-
$ yarn lint
42+
$ bun run lint # check for issues
43+
$ bun run lint:fix # auto-fix issues
44+
$ bun run fmt # format code
4345

4446

4547
### Documentation

Dockerfile

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,27 @@ RUN apt-get update && \
1010
curl \
1111
dumb-init \
1212
gnupg \
13-
nginx && \
13+
nginx \
14+
unzip && \
1415
apt-get clean
1516

1617
RUN curl -fsSL https://deb.nodesource.com/setup_21.x | bash - && \
17-
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
18-
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
19-
curl -sS https://deb.nodesource.com/setup_21.x | bash - && \
2018
apt-get update && \
2119
apt-get install -y --no-install-suggests --no-install-recommends \
22-
nodejs \
23-
yarn && \
20+
nodejs && \
2421
apt-get clean
2522

23+
# Install Bun (matches packageManager in package.json)
24+
ENV BUN_INSTALL=/usr/local
25+
RUN curl -fsSL https://bun.sh/install | bash -
26+
2627
WORKDIR /usr/local/share/mghcomputationalpathology/slim
2728

2829
# Install dependencies first and then include code for efficient caching
2930
COPY package.json .
30-
COPY yarn.lock .
31+
COPY bun.lock .
3132

32-
# There are sometimes weird network errors. Increasing the network timeout
33-
# seems to help (see https://github.com/yarnpkg/yarn/issues/5259)
34-
RUN yarn install --frozen-lockfile --network-timeout 100000
33+
RUN bun install --frozen-lockfile
3534

3635
COPY craco.config.js .
3736
COPY tsconfig.json .
@@ -57,7 +56,7 @@ RUN addgroup --system --gid 101 nginx && \
5756
--shell /bin/false \
5857
nginx
5958

60-
RUN NODE_OPTIONS=--max_old_space_size=8192 yarn run build && \
59+
RUN NODE_OPTIONS=--max_old_space_size=8192 bun run build && \
6160
mkdir -p /var/www/html && \
6261
cp -R build/* /var/www/html/
6362

@@ -82,4 +81,4 @@ RUN useradd -m -s /bin/bash tester && \
8281

8382
USER tester
8483

85-
ENTRYPOINT ["/usr/bin/dumb-init", "--", "yarn", "test"]
84+
ENTRYPOINT ["/usr/bin/dumb-init", "--", "bun", "run", "test"]

0 commit comments

Comments
 (0)