Skip to content

[HOTE-803] feat: Bun package manager#344

Draft
mikeeq wants to merge 12 commits intomainfrom
feature/hote-803/improve-lambdas-bun
Draft

[HOTE-803] feat: Bun package manager#344
mikeeq wants to merge 12 commits intomainfrom
feature/hote-803/improve-lambdas-bun

Conversation

@mikeeq
Copy link
Copy Markdown
Collaborator

@mikeeq mikeeq commented Apr 13, 2026

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

Copilot AI review requested due to automatic review settings April 13, 2026 10:25
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

Lambdas Coverage Report

Lines Statements Branches Functions
Coverage: 98%
98.49% (1441/1463) 92.27% (418/453) 96.61% (228/236)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

UI Coverage Report

Lines Statements Branches Functions
Coverage: 95%
95.66% (5732/5992) 87.58% (684/781) 87.86% (210/239)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to migrate the repo’s developer/CI tooling to use Bun, refresh lockfiles, and improve WireMock auth stubbing reliability for Playwright tests.

Changes:

  • Switched many scripts, docs, and CI steps from npm/npx to bun/bunx, and added Bun to mise.
  • Updated WireMock auth mappings to generate unique kid values per run and made the JWT issuer configurable.
  • Bumped Postgres images (local env + testcontainers) from 17.7 to 17.9.

Reviewed changes

Copilot reviewed 26 out of 31 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
ui/README.md Updates frontend dev/build/test instructions (now references pnpm).
ui/package.json Changes serve:static script to use pnpm/pnpm exec.
tests/utils/users/wiremockAuthMappings.ts Adds per-process kid nonce + issuer parameterization support.
tests/scripts/push-wiremock-mappings.ts Adds WIREMOCK_JWT_ISSUER, refactors OS Places mapping import, updates usage to Bun.
tests/README.md Updates Playwright setup/run commands to Bun.
tests/pnpm-lock.yaml Adds a pnpm lockfile for tests.
tests/global-setup.ts Passes configured WireMock JWT issuer into manifest + userinfo mappings.
tests/docs/guides/PullRequestGuidelines.md Updates examples/commands to Bun and reformats TypeScript snippets.
tests/configuration/EnvironmentVariables.ts Adds WIREMOCK_JWT_ISSUER env var.
tests/configuration/EnvironmentConfiguration.ts Adds wiremockJwtIssuer to config + env override logic.
scripts/tests/unit.sh Updates example command in comments to pnpm.
README.md Updates root developer commands from npm to Bun.
pnpm-lock.yaml Adds a pnpm lockfile at repo root.
package.json Replaces many npm-based scripts with Bun equivalents and uses bun install --frozen-lockfile.
mise.lock Adds Bun tool and updates various tool platform entries; adjusts Python version.
local-environment/wiremock/README.md Updates local WireMock usage command to pnpm.
local-environment/scripts/localstack/ensure-localstack-running.sh Updates guidance message to pnpm.
local-environment/scripts/database/Dockerfile Bumps Postgres base image to 17.9.
local-environment/docker-compose.yml Switches UI container command to pnpm install && pnpm run dev; bumps Postgres image to 17.9.
lambdas/src/lib/db/db-client.integration.test.ts Bumps testcontainers Postgres image and minor formatting.
lambdas/README.md Updates build/package/test commands to Bun.
lambdas/package.json Switches build/package/test scripts to pnpm commands.
.prettierignore Stops ignoring package-lock.json and ignores pnpm-lock.yaml instead.
.pre-commit-config.yaml Updates hooks to call Bun commands; excludes bun.lock from yamllint.
.mise.toml Adds Bun tool + settings changes; updates install task to Bun.
.github/workflows/playwright-e2e.yaml Updates Playwright install/test invocation to Bun.
.github/copilot-instructions.md Updates repo instructions to Bun.
.github/actions/run-npm-tests/action.yaml Updates custom action to run tests via Bun.
.github/actions/init-mise/action.yaml Changes cache to Bun cache path + uses bun lockfile hash for key.

"local:service:db:migrate": "npm run local:compose -- --profile backend up --build db-migrate",
"local:service:localstack:start": "npm run local:compose:up -- localstack",
"local:service:localstack:stop": "npm run local:compose:down -- localstack",
"postinstall": "cd ui && bun install --frozen-lockfile && cd ../lambdas && bun install --frozen-lockfile && cd ../tests && bun install --frozen-lockfile && cd ..",
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

bun install --frozen-lockfile will fail unless a Bun lockfile (e.g. bun.lock/bun.lockb) is present and committed; the repo currently still has package-lock.json/pnpm-lock.yaml but no Bun lockfile, so CI/local installs are likely to break. Commit the Bun lockfile(s) (and remove other lockfiles if migrating), or drop --frozen-lockfile until the lockfile strategy is consistent.

Copilot uses AI. Check for mistakes.
Comment on lines 11 to 13
"test:watch": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --watch",
"serve:static": "npm run build && npx http-server build -p 8085 -c-1 --proxy http://localhost:8085?",
"serve:static": "bun run build && bunx http-server build -p 8085 -c-1 --proxy http://localhost:8085?",
"check-typescript": "next typegen && tsc --noEmit"
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

This script uses pnpm exec http-server, but http-server is not listed in dependencies/devDependencies, so serve:static will fail on a clean install. Either add http-server as a devDependency or switch to a runner that can download/execute it (e.g. pnpm dlx/bunx/npx).

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +18
"test": "bun run test:unit && bun run test:integration",
"test:unit": "jest --testPathIgnorePatterns=\\.integration\\.test\\.ts$ --coverage",
"test:integration": "jest --testPathPatterns=\\.integration\\.test\\.ts$ --runInBand",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"build": "npx tsx scripts/build.ts",
"package": "npx tsx scripts/package.ts",
"local:deploy": "npm --prefix ../ run local:deploy",
"local:terraform:apply": "npm --prefix ../ run local:terraform:apply",
"build": "bunx tsx scripts/build.ts",
"package": "bunx tsx scripts/package.ts",
"local:deploy": "bun run --cwd ../ local:deploy",
"local:terraform:apply": "bun run --cwd ../ local:terraform:apply",
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

These scripts invoke pnpm, but the repo-level tooling and CI have been switched to Bun; unless pnpm is installed in the environment, test/build/package will fail. Align the lambdas scripts to use Bun (or plain tsx/node) consistently, or explicitly install/pin pnpm as part of the toolchain.

Copilot uses AI. Check for mistakes.
env_file:
- ../ui/.env.local
command: sh -c "npm install && npm run dev"
command: sh -c "pnpm install && pnpm run dev"
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

The ui service runs pnpm install, but the node:24 image doesn’t include pnpm by default (and there’s no corepack enable here), so docker compose is likely to fail. Use npm/bun consistently, or enable corepack and pin pnpm before running pnpm install.

Suggested change
command: sh -c "pnpm install && pnpm run dev"
command: sh -c "npm install && npm run dev"

Copilot uses AI. Check for mistakes.

if ! docker ps --format '{{.Names}}' | grep -qx 'localstack-main'; then
echo "LocalStack is not running. Start the backend first with 'npm run local:backend:start', or run 'npm run local:start'."
echo "LocalStack is not running. Start the backend first with 'pnpm run local:backend:start', or run 'pnpm run local:start'."
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

This error message tells users to run pnpm ..., but the root scripts in this PR have been switched to Bun; this will mislead anyone following the guidance. Update the message to reference the actual supported command (bun run local:backend:start / bun run local:start).

Suggested change
echo "LocalStack is not running. Start the backend first with 'pnpm run local:backend:start', or run 'pnpm run local:start'."
echo "LocalStack is not running. Start the backend first with 'bun run local:backend:start', or run 'bun run local:start'."

Copilot uses AI. Check for mistakes.

```shell
npm start
pnpm start
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

The README instructs pnpm start, but the root-level workflow/docs in this PR are moving to Bun; this is inconsistent and likely to confuse local setup. Update this to the correct root command (e.g. bun start) or explicitly document when pnpm is required.

Suggested change
pnpm start
bun start

Copilot uses AI. Check for mistakes.
Comment on lines 21 to 47
@@ -33,7 +33,7 @@ The application uses client-side routing with React Router. You can start editin
Build the static export:

```bash
npm run build
pnpm run build
```

This creates a `build/` directory with static HTML, CSS, and JavaScript files that can be deployed to any static hosting service.
@@ -43,7 +43,7 @@ This creates a `build/` directory with static HTML, CSS, and JavaScript files th
To test the production build locally:

```bash
npm run serve:static
pnpm run serve:static
```
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

This README now recommends pnpm commands, but the repo-level scripts/docs in this PR are switching to Bun, and pnpm may not be installed for contributors/CI. Update the instructions to match the chosen package manager (e.g. bun run dev/build/serve:static) or clearly document that the UI package requires pnpm.

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 4
# Dependency directories
node_modules/
package-lock.json
pnpm-lock.yaml

Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

.prettierignore no longer ignores package-lock.json, but the repo still contains multiple package-lock.json files (root/ui/lambdas/tests), so Prettier hooks may waste time or create unwanted churn on lockfiles. Add package-lock.json (and Bun lockfiles like bun.lock* if applicable) back to the ignore list, or remove the lockfiles as part of the migration.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link
Copy Markdown

@lewisbirks
Copy link
Copy Markdown
Contributor

I think Bun is a complete runtime whereas PNPM which still uses node so it might be better to go with #342 for better compatibility.

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