Skip to content

feat: add support for devcontainer - #1055

Open
LukeSeers wants to merge 2 commits into
SonicJs-Org:mainfrom
LukeSeers:support-devcontainers
Open

feat: add support for devcontainer#1055
LukeSeers wants to merge 2 commits into
SonicJs-Org:mainfrom
LukeSeers:support-devcontainers

Conversation

@LukeSeers

Copy link
Copy Markdown
Contributor

Description

Add support for a preconfigured Devcontainer so contributors get an identical, ready-to-run development environment without manual Node/Cloudflare setup. The devcontainer builds on Node LTS, pre-installs dependencies onto Docker volumes, and hardens the husky pre-commit hook so host-side commits degrade gracefully when npm/node_modules aren't available.

I've only tested this with JetBrains

Changes

  • Add .devcontainer/Dockerfile, devcontainer.json, and setup.sh bootstrap (Node LTS image, sudo for node user, forwards port 9115, mounts node_modules on Docker volumes, WebStorm backend configured)
  • Update .husky/pre-commit to resolve npm from container-typical paths and skip lint/type-check with a clear warning when running outside the container (CI still enforces on push)
  • Update README contributing section to document the Devcontainer workflow (npm install, npm run build:core, npm run db:reset, npm run devhttp://localhost:9115)

Testing

  • Setup is exercised locally via Docker devcontainer bring-up; postCreateCommand runs an idempotent npm install with retry logic for transient bind-mount EACCES/EPERM failures on Docker Desktop + WSL2
  • Pre-commit hook tested to skip cleanly from a host where npm/node_modules are not visible

Unit Tests

  • Added/updated unit tests
  • All unit tests passing (no runtime code changes; hook behavior is environment-based)

E2E Tests

  • Added/updated E2E tests
  • All E2E tests passing

Checklist

  • Code follows project conventions
  • Tests added/updated and passing
  • Type checking passes
  • No console errors or warnings
  • Documentation updated (if needed)

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