-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
frontend: move to bun package manager #1641
base: release-2.8
Are you sure you want to change the base?
frontend: move to bun package manager #1641
Conversation
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('frontend/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- uses: oven-sh/setup-bun@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bun does not need caching dependencies, caching is slower than a clean install.
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- uses: oven-sh/setup-bun@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run: npm ci | ||
run: bun install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no ci
command for bun
, it's just a clean install
runs-on: ubuntu-latest | ||
runs-on: ubuntu-latest-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bumping the machine type to a larger one to match our other UIs and make playwright tests fast
run: npm run install:browsers | ||
run: bun run install:chromium |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need chrome, firefox/safari/webkit are taking up CI time but we don't care right now
retention-days: 1 | ||
retention-days: 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 2 days is reasonable because we can check what may have failed over weekend
v20 | ||
v22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use fnm
or nvm
then it will automatically load the correct node version for you, we want to update to ensure all latest packages can be used
saveTextLockfile = true | ||
print = "yarn" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will always use text lockfile instead of binary, and we will use yarn lock to ensure compatibility with snyk security scan.
frontend/package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted intentionally, because we should use bun.lock
and yarn.lock
}, | ||
"scripts": { | ||
"start": "rsbuild dev", | ||
"start2": "REACT_APP_ENABLED_FEATURES=SINGLE_SIGN_ON,REASSIGN_PARTITIONS rsbuild dev", | ||
"preview": "rsbuild preview", | ||
"build": "NODE_OPTIONS=--max_old_space_size=16384 rsbuild build", | ||
"build-local-test": "REACT_APP_BUSINESS=true REACT_APP_CONSOLE_GIT_SHA=abc123 REACT_APP_CONSOLE_GIT_REF=local REACT_APP_BUILD_TIMESTAMP=32503680000 REACT_APP_DEV_HINT=true NODE_OPTIONS=--max_old_space_size=16384 rsbuild build", | ||
"install:browsers": "npx playwright install --with-deps", | ||
"install:chromium": "bunx playwright install chromium", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npx
= bunx
* `npx license-checker --csv --production > ../licenses/third_party_js.csv` | ||
* `bunx license-checker --csv --production > ../licenses/third_party_js.csv` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reran license checker to ensure we have up-to-date report
3d2f019
to
39e0f63
Compare
dc08098
to
31c2ee4
Compare
We want to unify the set up and lay down the ground work for bun workspaces to have a possible microfrontend setup.
Tested e2e by serving frontend with locally built Docker image, thank you @sago2k8
