Skip to content

Auto-resolve workspace deps in e2e fixtures#52

Merged
gtbuchanan merged 2 commits intomainfrom
fix/e2e-workspace-deps
Apr 21, 2026
Merged

Auto-resolve workspace deps in e2e fixtures#52
gtbuchanan merged 2 commits intomainfrom
fix/e2e-workspace-deps

Conversation

@gtbuchanan
Copy link
Copy Markdown
Owner

Summary

  • createIsolatedFixture / createProjectFixture now walk the primary package's dependencies for workspace: specs and install those tarballs automatically, replacing the manual workspaceDeps option
  • Shared findWorkspaceRoot() + module-scope memoization of workspace root, tarball listing, and parsed package.json index — each additional fixture in a worker is O(1)
  • Parsed package.json is validated via valibot (matches the existing pinned() pattern) instead of a type assertion; resolved tarball list is deduped

Test plan

  • pnpm -C packages/test-utils typecheck:ts passes
  • pnpm -C packages/test-utils lint:eslint passes (zero warnings)
  • pnpm -C packages/test-utils test:vitest:fast — 13/13 tests pass
  • pnpm -C packages/eslint-config typecheck:ts / lint:eslint pass
  • pnpm -C packages/eslint-config test:vitest:e2e — 17/17 tests pass (auto-resolver picks up @gtbuchanan/eslint-plugin-markdownlint from the primary package's dependencies)
  • pnpm build:ci passes locally

🤖 Generated with Claude Code

Walks the primary package's `dependencies` for `workspace:` specs and
installs those tarballs alongside it, replacing the manual `workspaceDeps`
option on `createIsolatedFixture` / `createProjectFixture`. Callers can
no longer forget to list a newly added transitive workspace dep.

- Extract `findWorkspaceRoot()` shared by `collectTarballs` and the new
  `buildWorkspaceIndex`; both remain coupled to the `packages/*` layout
  documented in AGENTS.md.
- Validate parsed workspace `package.json` via valibot (matches `pinned()`
  pattern) instead of a type assertion.
- Memoize workspace root, tarball listing, and workspace index at module
  scope — each additional fixture in the same worker is O(1).
- Dedupe the resolved tarball list when a dep appears via multiple paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gtbuchanan gtbuchanan force-pushed the fix/e2e-workspace-deps branch from 7d6cbba to 0f1d25e Compare April 21, 2026 20:27
Unify `pinned()`'s version-only schema and `buildWorkspaceIndex`'s
name/dependencies schema into a single `PackageJson` schema. Workspace
packages always declare a version, so the stricter field is safe for
both callers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gtbuchanan gtbuchanan marked this pull request as ready for review April 21, 2026 21:21
@gtbuchanan gtbuchanan merged commit 1cb9240 into main Apr 21, 2026
7 of 8 checks passed
@gtbuchanan gtbuchanan deleted the fix/e2e-workspace-deps branch April 21, 2026 21:38
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