Auto-resolve workspace deps in e2e fixtures#52
Merged
gtbuchanan merged 2 commits intomainfrom Apr 21, 2026
Merged
Conversation
3 tasks
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>
7d6cbba to
0f1d25e
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createIsolatedFixture/createProjectFixturenow walk the primary package'sdependenciesforworkspace:specs and install those tarballs automatically, replacing the manualworkspaceDepsoptionfindWorkspaceRoot()+ module-scope memoization of workspace root, tarball listing, and parsedpackage.jsonindex — each additional fixture in a worker is O(1)package.jsonis validated via valibot (matches the existingpinned()pattern) instead of a type assertion; resolved tarball list is dedupedTest plan
pnpm -C packages/test-utils typecheck:tspassespnpm -C packages/test-utils lint:eslintpasses (zero warnings)pnpm -C packages/test-utils test:vitest:fast— 13/13 tests passpnpm -C packages/eslint-config typecheck:ts/lint:eslintpasspnpm -C packages/eslint-config test:vitest:e2e— 17/17 tests pass (auto-resolver picks up@gtbuchanan/eslint-plugin-markdownlintfrom the primary package'sdependencies)pnpm build:cipasses locally🤖 Generated with Claude Code