Skip to content

Conversation

@MiltonTulli
Copy link
Contributor

@MiltonTulli MiltonTulli commented Jan 14, 2026

Description

Migrate the project tooling from Node.js/npm + Webpack to Bun + Vite for faster builds, better developer experience, and modern tooling.

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

Core Migration

  • Replace npm with Bun as package manager and runtime
  • Replace Webpack with Vite as bundler
  • Update all scripts to use Bun commands
  • Change dev server port from 3030 to 3000
  • Replace jsdom with happy-dom for Vitest (ESM compatibility)

Files Changed

File Change
package.json Add packageManager, update scripts, remove eslintConfig, restore build:development
bunfig.toml New Bun configuration
vite.config.ts New Vite configuration (replaces webpack.config.js)
index.html Moved from public/ to root (Vite requirement), fixed opensearch link
vitest.config.ts Changed environment to happy-dom
playwright.config.ts Updated port and commands
scripts/*.sh Updated to use Bun commands
.github/workflows/*.yml Migrated from setup-node to setup-bun
README.md, CLAUDE.md, CONTRIBUTING.md Updated documentation

Removed

  • .nvmrc - No longer needed
  • package-lock.json - Replaced by bun.lock
  • webpack.config.js - Replaced by Vite
  • eslintConfig in package.json - Using Biome

Screenshots (if applicable)

N/A - Tooling change, no UI changes

Checklist

  • I have run bun run format:fix and bun run lint:fix
  • I have run bun run typecheck with no errors
  • I have run tests with bun run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

Test Results

  • bun install - Installs dependencies correctly
  • bun start - Dev server runs on port 3000
  • bun run build - Production build succeeds
  • bun run test:run - All tests pass
  • bun run typecheck - No TypeScript errors
  • bun run format && bun run lint - No issues

CI Status Note

The build-and-deploy (PR Preview) check is expected to fail until this PR is merged. This is because deploy-pr-preview.yml uses pull_request_target, which executes the workflow from the base branch (main), not the PR branch. Once merged, future PRs will use the correct Bun configuration.

Node.js Usage

The only remaining Node.js usage is in .github/workflows/hash-deploy-build.yml for the custom Pinata deploy action, which requires Node.js runtime for GitHub Actions.

@AugustoL
Copy link
Collaborator

@MiltonTulli Thanks a lot for the PR, im in for a change on stack, but what would be the pros of changing to bun & vite?
Since this decision will impact the entire codebase of the explorer, we will also need the approval of @MatiasOS as well.

- Change dev server port back to 3030 (vite.config.ts, playwright.config.ts)
- Add overrides for @noble/hashes and @noble/curves to fix version conflict
- Update package.json scripts to call tools directly (no bun run prefix)
- Update all docs to use npm run/start commands while keeping bun install
- Update shell scripts to use npm run and correct port 3030
@MatiasOS
Copy link
Member

MatiasOS commented Jan 20, 2026

I'm testing this branch, and it seems to be working quite well. I'm in for this change too

There are still some references to npm. I don't know what you, @AugustoL, discussed with @MiltonTulli, but if my comments are fix we should merge so I can continue with #146 and #118

```bash
# Run with npm script
# Run with bun script
npm run dev
Copy link
Member

Choose a reason for hiding this comment

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

Here are some references to npm still.
Should some commands still run with npm?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, i specifically left the commands to be run with npm, I think it is better since we use it as an alias command and later on the package.json we can define the entire command to be run, and in case it changes we change it only on one place

"build": "vite build",
"build:production": "bash ./scripts/build-production.sh",
"build:staging": "bash ./scripts/build-staging.sh",
"build:development": "webpack --config webpack.config.js --mode development",
Copy link
Member

Choose a reason for hiding this comment

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

Why is this command removed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Mistake, going to add it back

Copy link
Collaborator

Choose a reason for hiding this comment

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

commited here 4bd5164

// These are injected into localStorage by the test fixture (e2e/fixtures/test.ts)
webServer: {
command: "npm start",
command: "npm run start",
Copy link
Member

Choose a reason for hiding this comment

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

If tests e2e still use npm, should we keep the .nvmrc file?

- name: Setup Node.js for deploy action
uses: actions/setup-node@v4
with:
node-version: '20'
Copy link
Member

Choose a reason for hiding this comment

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

We should keep using Node LTS if possible

Copy link
Collaborator

Choose a reason for hiding this comment

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

We use this version cause is what the deploy to ipfs needs to run, it wont affect or require to have nodejs installed locally. This is the only place where nodejs is used, we can leave it as it is.

3. Install dependencies:
```bash
npm install
bun install
Copy link
Member

Choose a reason for hiding this comment

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

Should we update all this section to use bun instead of npm?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It uses bun for install, which is compatible with npm install. And te rest of the contirbuting file doesnt mention nodejs.

Copy link
Member

@MatiasOS MatiasOS left a comment

Choose a reason for hiding this comment

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

:shipit:

@AugustoL AugustoL merged commit 3c631cd into openscan-explorer:dev Jan 20, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants