Skip to content

Jason/extract local dev package#270

Open
jasonmorais wants to merge 55 commits into
mainfrom
jason/extract-local-dev-package
Open

Jason/extract local dev package#270
jasonmorais wants to merge 55 commits into
mainfrom
jason/extract-local-dev-package

Conversation

@jasonmorais

@jasonmorais jasonmorais commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Introduce shared local-development helper packages and update apps to use them for worktree-aware dev workflows.

New Features:

  • Add @cellix/local-dev package providing generic workspace discovery, dotenv/JSON utilities, worktree-aware URL and port helpers, and dev runners for Vite, Docusaurus, Azure Functions, Node, and Azurite.
  • Add @ocom/local-dev-config package encapsulating OCOM-specific local URL and hostname policy plus API local-settings configuration.

Enhancements:

  • Refactor API, UI, docs, mock OAuth2, and MongoDB mock apps to use new TypeScript-based local-dev entrypoints instead of .mjs scripts and TSX, centralising worktree logic.
  • Update e2e test environment to derive Azure Functions local settings via shared helpers and ensure portless proxy is cleanly restarted with stricter host matching.
  • Expose additional types from service-queue-storage and tidy various import orders and formatting across the codebase.
  • Tighten pnpm overrides, Sonar coverage exclusions, and Azure Storage SDK version pinning to align with catalog settings.

Tests:

  • Add comprehensive unit tests for @cellix/local-dev and @ocom/local-dev-config packages, covering workspace resolution, dotenv parsing, URL/port helpers, Azurite runner behaviour, worktree transforms, and OCOM URL derivation.

jasonmorais and others added 22 commits May 19, 2026 15:36
…variable and building them into the url for our various portless hosted services
… settings modes, for e2e, so we have alternate between settings files
…ss-worktrees

# Conflicts:
#	.snyk
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
…sdom to happydom, and overall some code cleanliness changes
…eeded, and allowed more flexability for passing in of servers, gives user control of what they need. ensured api doesnt break across worktrees

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @jasonmorais, your pull request is larger than the review limit of 150000 diff characters

@jasonmorais jasonmorais changed the base branch from main to jason/serenity-framework-refactor June 4, 2026 15:16
…igh finalize, and standaridzed server configs and made them object focused
…r' into jason/extract-local-dev-package

# Conflicts:
#	packages/cellix/serenity-framework/src/servers/process-test-server.test.ts
#	packages/ocom-verification/e2e-tests/src/infrastructure.ts
#	packages/ocom-verification/e2e-tests/src/test-server-factories.ts
jasonmorais and others added 2 commits June 23, 2026 14:20
…al-dev-package

Resolves conflicts from upstream's later API/blob-storage work and its own
ProcessTestServer simplification (dropped isReusableExit/probe/extraEnv in
favor of url:string + automatic worktree env injection from the local-dev
runner, which supersedes the manual extraEnv wiring this branch had). Kept
this branch's local-dev package extraction (CELLIX_WORKTREE toggle, .ts
wrapper scripts) and picked up upstream's build/script and dependency
updates (tsgo --noEmit step, turbo 2.9.18, grpc-js/snyk override cleanup).
Regenerated pnpm-lock.yaml from the merged manifests rather than hand
resolving its conflicts, and removed two pnpm catalog entries (tsx,
@azure/storage-blob) that the merged dependency set left unused. Removed
the now-dead scripts/local-dev/worktree-ports.mjs conflict since this
branch already moved that logic into @cellix/local-dev and
verification-shared.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e2e detection

forwardChildExit unconditionally overwrote process.exitCode, masking an
earlier non-zero failure when a wrapper script owns more than one child
process. Extracted the azurite runner's setProcessExitCode guard into
process/index.ts as a shared helper and reused it from both forwardChildExit
and the azurite runner.

isE2E was duplicated verbatim in vite/index.ts, azure-functions-local-settings.ts,
and @ocom/local-dev-config's api-settings builder. Centralized it in a new
env/index.ts module exported from @cellix/local-dev.

Also documented WorktreeSettings' value-content URL scanning (vs. the
key-based convertSettingsForWorktree) so consumers aren't surprised by a
setting value that happens to contain an http(s)/mongodb URL getting rewritten.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jasonmorais

Copy link
Copy Markdown
Contributor Author

@sourcery-ai review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • There are now two distinct worktree transformation paths (WorktreeSettings scanning all settings vs convertSettingsForWorktree acting only on named keys); consider tightening the naming and documentation and adding guidance on when each should be used to avoid future misuse and unexpected rewrites of free‑text values.
  • Magic numbers for port derivation and hashing (e.g. base ports 50000/10000 and the 49‑bucket/100‑step logic in getWorktreePortOffset and related helpers) are currently embedded in the implementation; it may be worth centralizing these into clearly named constants so future adjustments are safer and easier to reason about.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- There are now two distinct worktree transformation paths (`WorktreeSettings` scanning all settings vs `convertSettingsForWorktree` acting only on named keys); consider tightening the naming and documentation and adding guidance on when each should be used to avoid future misuse and unexpected rewrites of free‑text values.
- Magic numbers for port derivation and hashing (e.g. base ports 50000/10000 and the 49‑bucket/100‑step logic in `getWorktreePortOffset` and related helpers) are currently embedded in the implementation; it may be worth centralizing these into clearly named constants so future adjustments are safer and easier to reason about.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Base automatically changed from jason/serenity-framework-refactor to main June 24, 2026 14:05
@jasonmorais jasonmorais requested a review from a team June 24, 2026 14:05
Comment thread packages/cellix/local-dev/src/urls/index.ts Fixed
Comment thread packages/cellix/local-dev/src/urls/index.ts Fixed
nnoce14
nnoce14 previously approved these changes Jun 30, 2026
@jasonmorais

Copy link
Copy Markdown
Contributor Author

@sourcery-ai review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Fixed security issues:

  • @opentelemetry/exporter-prometheus (link)
  • @vitest/browser (link)
  • axios (link)
  • react-router (link)
  • shell-quote (link)

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jasonmorais

Copy link
Copy Markdown
Contributor Author

@sourcery-ai review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

Fixed security issues:

  • @opentelemetry/exporter-prometheus (link)

  • @vitest/browser (link)

  • axios (link)

  • react-router (link)

  • shell-quote (link)

  • In @cellix/local-dev/package.json, the exports list does not include the ./vite and ./process subpaths that are documented in the README, which will break those import examples; consider adding those subpath exports or adjusting the README.

  • WorktreeSettings.transformRecord currently rewrites any http(s):// or mongodb:// substring found in string values (including nested objects/arrays), which could unintentionally alter non-config text; you may want to constrain this to specific keys or make the behavior opt-in per-setting.

Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In @cellix/local-dev/package.json, the exports list does not include the `./vite` and `./process` subpaths that are documented in the README, which will break those import examples; consider adding those subpath exports or adjusting the README.
- WorktreeSettings.transformRecord currently rewrites any `http(s)://` or `mongodb://` substring found in string values (including nested objects/arrays), which could unintentionally alter non-config text; you may want to constrain this to specific keys or make the behavior opt-in per-setting.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jasonmorais

Copy link
Copy Markdown
Contributor Author

@sourcery-ai

@jasonmorais

Copy link
Copy Markdown
Contributor Author

@sourcery-ai review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Fixed security issues:

  • @opentelemetry/exporter-prometheus (link)
  • @vitest/browser (link)
  • axios (link)
  • react-router (link)
  • shell-quote (link)

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gidich

gidich commented Jul 1, 2026

Copy link
Copy Markdown
Member

@soucery-ai summarize

@jasonmorais

Copy link
Copy Markdown
Contributor Author

@sourcery-ai summarize this prs changes

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.

Local Dev - Extract out test runner logic and general worktree logic into reusable package

4 participants