Skip to content

feat(website): Add compose.bundle.yml for local bundled server testing#1067

Merged
yamadashy merged 9 commits intomainfrom
feat/website-bundle-compose
Jan 3, 2026
Merged

feat(website): Add compose.bundle.yml for local bundled server testing#1067
yamadashy merged 9 commits intomainfrom
feat/website-bundle-compose

Conversation

@yamadashy
Copy link
Owner

Add Docker Compose configuration to run the server in bundled mode locally.

Summary

  • Add website/compose.bundle.yml for production-like bundled server testing
  • Add npm run website-bundle script

This enables testing of:

  • esbuild bundling
  • Node.js compile cache
  • Startup performance

without deploying to Cloud Run.

Usage

npm run website-bundle

Then access http://localhost:8080/api/pack

Checklist

  • Run npm run test
  • Run npm run lint

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Added a new npm script "website-bundle" to package.json that executes a Docker Compose configuration for building and running a bundled production-like server environment. Created a corresponding Docker Compose file that defines the bundled server service with no volume mounts.

Changes

Cohort / File(s) Summary
Bundled server workflow
package.json, website/compose.bundle.yml
Added npm script "website-bundle" that invokes Docker Compose with the new compose.bundle.yml file. New Docker Compose configuration defines a single "server" service built from ./server/Dockerfile, exposes port 8080 in production mode without volume mounts, and is intended for testing esbuild bundling, compile cache, and startup performance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding compose.bundle.yml for local testing of bundled server configurations.
Description check ✅ Passed The description includes all required sections from the template (Summary, Checklist) with comprehensive context about changes, usage instructions, and testing evidence.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yamadashy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new development workflow for the website by adding a Docker Compose configuration (compose.bundle.yml) and an npm script (website-bundle). This enables developers to locally test the server in a production-like bundled environment, specifically focusing on esbuild bundling, Node.js compile cache efficiency, and startup performance, without requiring a full deployment to Cloud Run.

Highlights

  • New Docker Compose Configuration: Added website/compose.bundle.yml to run the server in a production-like bundled mode locally, mimicking the Cloud Run environment.
  • New npm Script: Introduced npm run website-bundle to easily start the bundled server using the new Docker Compose file.
  • Enhanced Local Testing: This setup enables local testing of esbuild bundling, Node.js compile cache, and startup performance without requiring deployment to Cloud Run.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.19%. Comparing base (32bf806) to head (4b9d84d).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1067   +/-   ##
=======================================
  Coverage   87.19%   87.19%           
=======================================
  Files         116      116           
  Lines        4350     4350           
  Branches     1011     1011           
=======================================
  Hits         3793     3793           
  Misses        557      557           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new Docker Compose configuration and an npm script to facilitate local testing of the production-like bundled server. The changes are clear and achieve the stated goal. I have one suggestion to improve the developer experience by ensuring automatic cleanup of Docker containers after testing, which will make the new script more convenient to use.

"memory-check": "node --run repomix -- --verbose | grep Memory",
"memory-check-one-file": "node --run repomix -- --verbose --include 'package.json' | grep Memory",
"website": "docker compose -f website/compose.yml up --build",
"website-bundle": "docker compose -f website/compose.bundle.yml up --build",
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For a better local testing experience, consider using docker compose run instead of up. The run command with the --rm flag will automatically clean up the container when you stop it (e.g., with Ctrl+C), preventing dangling containers. The --service-ports flag is needed to publish the container's ports to the host.

This approach is particularly well-suited for the testing scenario described in the PR, as it ensures a clean state for each run without requiring a manual docker compose down.

If you apply this change, you might also want to update the example command in the website/compose.bundle.yml file's header comment for consistency.

Suggested change
"website-bundle": "docker compose -f website/compose.bundle.yml up --build",
"website-bundle": "docker compose -f website/compose.bundle.yml run --build --rm --service-ports server",

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 3, 2026

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4b9d84d
Status: ✅  Deploy successful!
Preview URL: https://0e74b705.repomix.pages.dev
Branch Preview URL: https://feat-website-bundle-compose.repomix.pages.dev

View logs

@claude
Copy link
Contributor

claude bot commented Jan 3, 2026

Code Review

Overall Assessment: ✅ Approved

This is a clean, focused PR that adds a simple Docker Compose configuration for local bundled server testing. The changes are minimal (17 additions, 0 deletions) and well-documented.

Code Quality

  • Well-structured: The compose.bundle.yml follows the same patterns as the existing compose.yml
  • Good documentation: Clear comments explaining the purpose and usage
  • Consistent naming: website-bundle script name follows the existing website script pattern
  • No redundancy: The compose file is intentionally minimal, relying on the Dockerfile's production defaults

Security Considerations

No security concerns - The configuration:

  • Uses the existing, reviewed Dockerfile
  • Exposes only port 8080 (same as development)
  • No sensitive environment variables are hardcoded
  • No volume mounts (intentionally, for production-like isolation)

Potential Edge Cases / Premortem Analysis

Details
Scenario Risk Mitigation
Docker build cache invalidation Low Standard Docker behavior, not a regression
Port 8080 conflict with website script Low User would need to stop one before running the other - expected behavior
Missing client service By design This is intentional - only tests the bundled server, not the full development environment

Minor Observation (Not Required)

Details

The compose file only includes the server service, which is appropriate for testing the bundled server. However, if full end-to-end testing is needed (including the client), users would need to either:

  1. Run the client separately
  2. Access the API endpoints directly at http://localhost:8080/api/pack

This is documented in the PR description, so no changes needed.

Test Coverage

This is a configuration-only change that doesn't require unit tests. The functionality can be verified by running npm run website-bundle locally.

Recommendations

None - this PR is ready to merge. 👍


🤖 Generated with Claude Code

@claude
Copy link
Contributor

claude bot commented Jan 3, 2026

Updated Code Review

Overall Assessment: ✅ Approved

This is a follow-up review after the second commit (ee9e156) was added.

Summary of Changes

File Changes
package.json Added website-bundle npm script
website/compose.bundle.yml New Docker Compose for bundled server testing

Second Commit Review (ee9e156)

The fix to set NODE_ENV=development is appropriate:

environment:
  # Use development mode to avoid Google Cloud Logging authentication errors
  - NODE_ENV=development
Why this is correct
  • The Dockerfile sets NODE_ENV=production by default (line 48)
  • The compose file overrides this to development to avoid GCP authentication errors locally
  • This is the expected behavior for local testing without GCP credentials
  • The bundled server code path is still tested (esbuild bundling, compile cache) regardless of NODE_ENV
  • NODE_ENV primarily affects logging behavior, not the bundling mechanism being tested

Code Quality ✅

  • Well-documented with clear comments
  • Follows existing patterns from compose.yml
  • Consistent naming convention (website-bundle matches website)

Security ✅

  • No sensitive data exposed
  • Uses existing, reviewed Dockerfile
  • Port 8080 is standard for this project

Potential Edge Cases

Details
Scenario Risk Status
Port conflict with npm run website Low User must stop one before running the other
GCP Logging errors in local mode Fixed Resolved by second commit
Missing client service By Design Intentional - tests server bundling only

Gemini's Suggestion (--rm flag)

Gemini suggested adding automatic cleanup. This is a valid enhancement but not required for this PR - the current behavior matches npm run website and is consistent with the existing developer workflow.

Recommendation: Ready to merge 👍


🤖 Generated with Claude Code

@claude
Copy link
Contributor

claude bot commented Jan 3, 2026

Code Review

Overall Assessment: ✅ Approved

This is a well-structured PR that adds Docker Compose configuration for local bundled server testing. The final version (with all 3 commits) provides a complete solution including both client and server services.

Summary of Changes

File Changes
package.json Added website-bundle npm script
website/compose.bundle.yml New Docker Compose with client + bundled server

Code Quality ✅

  • Consistent patterns: Follows existing compose.yml structure closely
  • Well-documented: Clear header comments explaining the purpose
  • Appropriate naming: website-bundle aligns with existing website script

Review of Key Design Decisions

  1. NODE_ENV=development for server - Correct choice to avoid GCP Cloud Logging auth errors locally while still testing the bundled code path
  2. No volume mounts for server - Intentional and correct for testing the actual bundled Docker image
  3. Client with volume mounts - Appropriate for development convenience while testing API integration

Security ✅

No security concerns:

  • Uses existing, reviewed Dockerfiles
  • Standard port exposure (5173, 8080)
  • No secrets or credentials

Premortem Analysis

Potential Failure Scenarios
Scenario Risk Mitigation
Port conflict with npm run website Low Expected - user stops one before running the other
Docker build fails on first run Low Standard behavior, rebuild with --no-cache if needed
Client cannot connect to server Low Both services are in same compose network, well-tested pattern
Large Docker image size N/A Uses same Dockerfile as production - not a regression

Minor Observations (Not Blocking)

Details
  1. Client npm i on every start: The command sh -c "npm i && npm run docs:dev..." runs npm install on each container start. This matches compose.yml behavior, so it is consistent.

  2. Dockerfile for client uses multi-stage but compose overrides command: The client Dockerfile has a deps stage, but the compose file overrides the command to re-run npm i. This is intentional for volume-mounted development.

Test Coverage

Configuration-only change - no unit tests required. Can be verified by running npm run website-bundle locally.

Recommendation: Ready to merge 👍


🤖 Generated with Claude Code

@claude
Copy link
Contributor

claude bot commented Jan 3, 2026

Code Review

Overall Assessment: ✅ Approved

This PR adds Docker Compose configuration for local bundled server testing, plus refactors the bundling process. The latest commit (4th) extracts bundle commands from the Dockerfile to npm scripts, which is a nice improvement.

Summary of Changes (4 commits)

Commit Description
54568ab Initial compose.bundle.yml for bundled server testing
ee9e156 Fix NODE_ENV=development to avoid GCP Cloud Logging auth errors
225691e Add client service to compose.bundle.yml
26709ab Refactor: Extract bundle scripts from Dockerfile to package.json

Code Quality ✅

  • Well-structured: Both files follow existing patterns
  • Good refactoring: Moving esbuild commands to package.json improves:
    • Local testing without Docker (npm run bundle && npm run start:bundle)
    • Maintainability (scripts easier to read/modify than Dockerfile RUN commands)
    • Reusability across different contexts
  • Clear documentation: Header comments explain purpose

Review of 4th Commit (26709ab)

Details on the refactoring

The bundling logic was extracted from the Dockerfile into npm scripts:

Before (Dockerfile):

RUN npm run build
RUN npx esbuild dist/index.js --bundle ...
RUN mkdir -p dist-bundled/wasm && find node_modules ...

After (package.json):

"bundle": "npm run build && npm run bundle:esbuild && npm run bundle:wasm",
"bundle:esbuild": "esbuild dist/index.js --bundle ...",
"bundle:wasm": "mkdir -p dist-bundled/wasm && find node_modules ..."

This is a good change:

  • esbuild is now a devDependency (was using npx before)
  • Commands can be run locally without Docker
  • Dockerfile is simpler: just RUN npm run bundle

Security ✅

No security concerns:

  • Uses existing, reviewed patterns
  • Standard port exposure (5173, 8080)
  • No secrets or credentials

Premortem Analysis

Potential Failure Scenarios
Scenario Risk Mitigation
Port conflict with npm run website Low Expected - user stops one before running the other
find command fails on non-Unix systems N/A Only runs in Docker (Alpine Linux)
Large Docker image size N/A Uses same multi-stage build pattern
WASM files missing after bundling Low find command is specific enough to catch tree-sitter WASM files

Minor Observations

Details (Not Blocking)
  1. bundle:wasm uses find with -exec cp: This is fine for the use case, though xargs could be slightly faster for many files. Not worth changing.

  2. esbuild added to devDependencies: Good practice - no longer using npx which has cold-start overhead.

  3. clean script now removes dist-bundled: Correct update to match the new bundle output directory.

Test Coverage

Configuration-only changes plus script additions - no unit tests required. Can be verified by running npm run website-bundle locally.

Recommendation: Ready to merge 👍


🤖 Generated with Claude Code

@claude
Copy link
Contributor

claude bot commented Jan 3, 2026

Code Review

Overall Assessment: ✅ Approved

This PR adds a well-designed Docker Compose configuration for local bundled server testing, along with a clean refactoring of the bundling process into a dedicated script.

Summary of Changes

File Description
package.json Added website-bundle npm script
website/compose.bundle.yml New Docker Compose config with client + bundled server
website/server/Dockerfile Simplified to use npm run bundle
website/server/package.json Added bundle scripts and esbuild dependency
website/server/scripts/bundle.mjs New JS bundling script

Code Quality ✅

  • Excellent refactoring: Moving bundling logic from shell commands in Dockerfile to a proper JavaScript file (bundle.mjs) improves:
    • Maintainability and readability
    • Local testing capability without Docker
    • Consistent behavior across environments
  • Follows existing patterns: compose.bundle.yml structure mirrors compose.yml
  • Well-documented: Clear header comments and JSDoc in bundle script

Security ✅

No security concerns identified:

  • Uses existing, reviewed Dockerfiles
  • Standard port exposure (5173, 8080)
  • No secrets or credentials hardcoded
  • NODE_ENV=development override prevents GCP auth errors without compromising security

Premortem Analysis

Potential Failure Scenarios
Scenario Risk Mitigation
Port conflict with npm run website Low Expected behavior - stop one before starting the other
Missing WASM files after bundling Low Script logs warning if tree-sitter-wasms not found
esbuild version mismatch Low Pinned to ^0.25.5 in devDependencies
Bundle script fails silently Addressed Error handling with process.exit(1) on failure

Notable Design Decisions

Details
  1. NODE_ENV=development for server: Correct choice to avoid GCP Cloud Logging auth errors locally while still testing bundled code paths

  2. No volume mounts for server: Intentional - tests the actual bundled Docker image as it would run in production

  3. Client with volume mounts: Appropriate for development convenience while testing API integration

  4. esbuild as devDependency: Good choice vs using npx - faster and more reliable

  5. External packages (tinypool, tiktoken): Correctly kept external due to WASM file loading requirements from __dirname

Minor Observations (Not Blocking)

Details
  1. Bundle script error handling: The collectWasmFiles() function logs a warning if WASM files aren't found but doesn't fail. This is probably intentional for flexibility, but consider whether a hard failure would be safer for CI.

  2. No --rm flag in compose command: As Gemini noted, adding --rm could help with cleanup. However, the current behavior is consistent with npm run website and allows inspecting containers after shutdown.

Test Coverage

Configuration and build script changes - no unit tests required. The functionality is verified by running npm run website-bundle locally.

Recommendation: Ready to merge 👍


🤖 Generated with Claude Code

@claude
Copy link
Contributor

claude bot commented Jan 3, 2026

Code Review

Overall Assessment: ✅ Approved

This PR adds Docker Compose configuration for local bundled server testing with a well-designed refactoring of the bundling process into a dedicated JavaScript script.

Summary of Changes (8 commits)

File Changes
package.json Added website-bundle npm script
website/compose.bundle.yml New Docker Compose config (client + bundled server)
website/server/Dockerfile Simplified to use npm run bundle
website/server/package.json Added bundle script, esbuild ^0.27.2
website/server/scripts/bundle.mjs New JS bundling script with esbuild
website/server/package-lock.json Updated dependencies

Code Quality ✅

  • Excellent refactoring: Moving bundling logic from shell commands in Dockerfile to a proper JavaScript file (bundle.mjs) improves maintainability, local testing capability, and cross-environment consistency
  • Follows existing patterns: compose.bundle.yml structure mirrors compose.yml
  • Well-documented: Clear header comments and organized script functions

Review Highlights

Design Decisions (All Correct)
  1. NODE_ENV=development for server - Prevents GCP Cloud Logging auth errors locally while still testing bundled code paths
  2. No volume mounts for server - Intentional to test the actual bundled Docker image
  3. esbuild as devDependency - Good practice vs npx (faster, more reliable)
  4. target: 'node24' - Matches the Docker base image (node:24-alpine)
  5. External packages (tinypool, tiktoken) - Correctly kept external due to WASM file loading from __dirname

Security ✅

No security concerns:

  • Uses existing, reviewed Dockerfiles
  • Standard port exposure (5173, 8080)
  • No secrets or credentials hardcoded

Premortem Analysis

Potential Failure Scenarios
Scenario Risk Mitigation
Port conflict with npm run website Low Expected - user stops one before starting the other
Missing WASM files Low Script logs warning if tree-sitter-wasms not found
Bundle script fails silently Addressed Error handling with process.exit(1) on failure

Minor Observation (Not Blocking)

Details

The collectWasmFiles() function logs a warning if WASM files aren't found but doesn't fail the build. This allows flexibility but could mask issues in CI. Consider whether a hard failure would be preferable for production builds.

Test Coverage

Configuration and build script changes - no unit tests required. Functionality verified by running npm run website-bundle locally.

Recommendation: Ready to merge 👍


🤖 Generated with Claude Code

@claude
Copy link
Contributor

claude bot commented Jan 3, 2026

Code Review - Final Assessment

Overall Assessment: ✅ Approved

This PR adds a well-designed Docker Compose configuration for local bundled server testing, with a clean JavaScript bundling script.

Summary of All Changes (8 commits)

Area Changes
Root Added website-bundle npm script
compose.bundle.yml New Docker Compose with client + bundled server services
Dockerfile Simplified to use npm run bundle
package.json Added bundle/start:bundle scripts, esbuild devDep
bundle.mjs New JavaScript bundling script

Code Quality ✅

  • Clean architecture: Bundling logic extracted from Dockerfile shell commands to a proper JS module
  • Consistent patterns: compose.bundle.yml mirrors existing compose.yml structure
  • Well-documented: Clear header comments and JSDoc documentation
  • Maintainable: Scripts can run locally without Docker for debugging

Key Design Decisions (All Correct)

Click to expand
Decision Rationale
NODE_ENV=development for server Avoids GCP Cloud Logging auth errors locally
No volume mounts for server Tests the actual bundled Docker image
Client with volume mounts Development convenience for testing API
esbuild as devDependency Faster than npx, more reliable
External packages (tinypool, tiktoken) Required for WASM file loading from __dirname
target: node24 Matches Dockerfile's node:24-alpine base image

Security ✅

No security concerns:

  • Uses existing, reviewed Dockerfiles
  • Standard port exposure (5173, 8080)
  • No secrets or credentials hardcoded
  • Multi-stage Docker build minimizes image size

Premortem Analysis

Potential Failure Scenarios
Scenario Risk Status
Port conflict with npm run website Low Expected - user stops one before the other
Missing WASM files Low Script logs warning if not found
GCP Logging errors locally Fixed Resolved by NODE_ENV=development
Docker build cache issues Low Standard behavior, use --no-cache if needed

Test Coverage

Configuration and build script changes - no unit tests required. The functionality is verified by running npm run website-bundle locally.

Regarding Gemini's --rm Suggestion

The suggestion to add automatic container cleanup with --rm is valid but optional. The current behavior is consistent with npm run website and allows inspecting containers after shutdown for debugging.

Recommendation: Ready to merge 👍


🤖 Generated with Claude Code

@claude
Copy link
Contributor

claude bot commented Jan 3, 2026

Final Code Review Summary

Overall Assessment: ✅ Approved

This PR has been reviewed across all 6 commits and is ready to merge. Previous reviews have tracked the evolution from initial compose configuration through the final refactoring.

Final State Summary

File Description
package.json Added website-bundle npm script
website/compose.bundle.yml Docker Compose with client + bundled server
website/server/Dockerfile Simplified to use npm run bundle
website/server/package.json Added bundle scripts, esbuild dependency
website/server/scripts/bundle.mjs New JS bundling script

Key Strengths

  • Excellent refactoring: The bundling logic was extracted from shell commands in Dockerfile to a proper JavaScript file, improving maintainability and enabling local testing without Docker
  • Consistent patterns: Follows existing codebase conventions
  • Well-documented: Clear header comments and JSDoc

Security ✅

No security concerns - uses existing Dockerfiles, standard ports, no credentials.

Premortem Analysis

Potential Failure Scenarios
Scenario Risk Status
Port conflict with npm run website Low Expected - user stops one before running other
Missing WASM files Low Script logs warning if not found
esbuild version mismatch Low Pinned version in package.json

AI Bot Comment Evaluation

Note: Unable to access inline review comments API due to permission restrictions. The Gemini review mentioned a suggestion about --rm flag for automatic container cleanup - this is a valid enhancement but not required for this PR, as the current behavior is consistent with npm run website.

Recommendation: Ready to merge 👍


🤖 Generated with Claude Code

Add Docker Compose configuration to run the server in bundled mode locally,
similar to the production Cloud Run environment. This enables testing of
esbuild bundling, compile cache, and startup performance without deploying.

Usage: npm run website-bundle
Avoid Google Cloud Logging authentication errors when running
the bundled server locally. Cloud Logging requires GCP credentials
which are not available in local development.
Include VitePress client alongside the bundled server for full
local testing with the production-like server configuration.
Move esbuild bundling and WASM collection from Dockerfile to package.json
for easier local testing and maintenance.

Added scripts:
- bundle: Full bundle (build + esbuild + wasm)
- bundle:esbuild: Run esbuild bundling
- bundle:wasm: Copy tree-sitter WASM files
- start:bundle: Run bundled server locally
Replace inline npm scripts with a dedicated bundle.mjs script for better
readability and maintainability.

The script handles:
- TypeScript compilation
- esbuild bundling with ESM banner
- Tree-sitter WASM file collection
Add bundled output directory to .gitignore to prevent
committing generated files from esbuild bundling.
@yamadashy yamadashy force-pushed the feat/website-bundle-compose branch from e1c4479 to 4b9d84d Compare January 3, 2026 12:33
@claude
Copy link
Contributor

claude bot commented Jan 3, 2026

Final Code Review

Overall Assessment: ✅ Approved

This is a well-executed PR that adds Docker Compose configuration for local bundled server testing, along with a clean refactoring of the bundling process into a dedicated JavaScript script.

Summary of All Changes (9 commits)

File Purpose
package.json Added website-bundle npm script
website/compose.bundle.yml Docker Compose with client + bundled server
website/server/Dockerfile Simplified to use npm run bundle
website/server/package.json Added bundle scripts, esbuild dependency
website/server/scripts/bundle.mjs JavaScript bundling script
website/server/.gitignore Added dist-bundled directory

Code Quality ✅

  • Excellent refactoring: The bundling logic was moved from inline shell commands in Dockerfile to a proper JavaScript script (bundle.mjs), improving:
    • Maintainability and readability
    • Local testing capability without Docker
    • Consistent behavior across environments
  • Follows existing patterns: compose.bundle.yml structure mirrors the existing compose.yml
  • Well-documented: Clear header comments and JSDoc in bundle script

Security ✅

No security concerns:

  • Uses existing, reviewed Dockerfiles
  • Standard port exposure (5173, 8080)
  • No secrets or credentials
  • NODE_ENV=development override prevents GCP auth errors locally

Design Decisions (All Correct)

Click to expand
Decision Rationale
NODE_ENV=development for server Avoids GCP Cloud Logging auth errors locally while still testing bundled code paths
No volume mounts for server Intentional - tests the actual bundled Docker image as it would run in production
Client with volume mounts Appropriate for development convenience
esbuild as devDependency Good choice vs using npx - faster and more reliable
External packages (tinypool, tiktoken) Correctly kept external due to WASM file loading requirements
Target node24 Matches Dockerfile base image

Premortem Analysis

Potential Failure Scenarios
Scenario Risk Mitigation
Port conflict with npm run website Low Expected - user stops one before running the other
Missing WASM files after bundling Low Script logs warning if tree-sitter-wasms not found
Bundle script fails silently Addressed Error handling with process.exit(1) on failure
esbuild version mismatch Low Pinned to ^0.27.2 in devDependencies

Minor Observations (Non-blocking)

Details
  1. collectWasmFiles() warning vs failure: The function logs a warning if WASM files aren't found but doesn't fail. This is probably intentional for flexibility, but consider whether a hard failure would be safer for CI builds.

  2. Gemini's --rm suggestion: Adding --rm to the compose command could help with cleanup. However, the current behavior is consistent with npm run website and allows inspecting containers after shutdown if needed.

Test Coverage

Configuration and build script changes - no unit tests required. The functionality is verified by running npm run website-bundle locally.


Recommendation: Ready to merge 👍


🤖 Generated with Claude Code

@yamadashy yamadashy merged commit 4a39afa into main Jan 3, 2026
52 checks passed
@yamadashy yamadashy deleted the feat/website-bundle-compose branch January 3, 2026 12:36
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.

1 participant