Skip to content
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

Open
wants to merge 2 commits into
base: release-2.8
Choose a base branch
from

Conversation

malinskibeniamin
Copy link
Contributor

@malinskibeniamin malinskibeniamin commented Mar 10, 2025

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
Screenshot 2025-03-10 at 19 29 29

@malinskibeniamin malinskibeniamin self-assigned this Mar 10, 2025
@malinskibeniamin malinskibeniamin changed the base branch from master to release-2.8 March 10, 2025 15:41
- 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
Copy link
Contributor Author

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 76 to 44
run: npm ci
run: bun install
Copy link
Contributor Author

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

Comment on lines -83 to +51
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8
Copy link
Contributor Author

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

Comment on lines -117 to +69
run: npm run install:browsers
run: bun run install:chromium
Copy link
Contributor Author

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

Comment on lines -153 to +105
retention-days: 1
retention-days: 2
Copy link
Contributor Author

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
Copy link
Contributor Author

@malinskibeniamin malinskibeniamin Mar 10, 2025

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

Comment on lines +3 to +4
saveTextLockfile = true
print = "yarn"
Copy link
Contributor Author

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.

Copy link
Contributor Author

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",
Copy link
Contributor Author

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`
Copy link
Contributor Author

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

@malinskibeniamin malinskibeniamin force-pushed the frontend-move-to-bun-package-manager branch from 3d2f019 to 39e0f63 Compare March 10, 2025 18:13
@malinskibeniamin malinskibeniamin force-pushed the frontend-move-to-bun-package-manager branch from dc08098 to 31c2ee4 Compare March 10, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant