Skip to content

refactor(data): split @adobe/data-testing into its own package - #167

Merged
krisnye merged 2 commits into
mainfrom
split-data-testing-package
Aug 11, 2026
Merged

refactor(data): split @adobe/data-testing into its own package#167
krisnye merged 2 commits into
mainfrom
split-data-testing-package

Conversation

@dwabyick

Copy link
Copy Markdown
Member

Summary

  • @adobe/data's peerDependencies field applied to the whole package, not just the /testing subpath — so any project depending on @adobe/data picked up a vitest peer requirement even if it never touches conformance-testing helpers. Under strict peer-dependency resolution this could surface as a vitest version conflict for a consumer that has nothing to do with testing.
  • The vitest dependency is real, not accidental: src/testing/conformance/*.ts calls describe/it from vitest at module scope, and those calls must resolve to the same vitest instance running the consumer's own test suite (module-identity requirement for test registration) — a plain dependency would risk a duplicate/mismatched vitest instance, and a devDependency wouldn't install at all for downstream consumers.
  • Fix: moved src/testing/** (the Match and Conformance namespaces) out of @adobe/data into a new workspace package, @adobe/data-testing, which now carries the vitest peer dependency itself. @adobe/data no longer mentions vitest outside its own devDependencies.
  • Updated the 7 sample packages that actually author conformance tests (data-lit-todo, data-lit-tictactoe, data-lit-space-rock-game, data-gpu-hopper, data-p2p-tictactoe, data-react-pixie, data-solid-dashboard) to import from @adobe/data-testing and depend on it directly.
  • Updated the @adobe/data-ai AI-guidance rule docs (state.md, conformance.md, computed.md) that referenced the old @adobe/data/testing import path.

Note on the lockfile diff

pnpm-lock.yaml's format bump (lockfileVersion 6.09.0) is a side effect of running pnpm install with the CI-pinned pnpm major version (9) against a lockfile last written by pnpm 8 — any real (non-frozen) install with pnpm 9 upgrades the format on first write. It's unrelated to this change in substance but unavoidable once the lockfile needs updating for the new package.

Test plan

  • pnpm -r run typecheck — all 18 packages pass, including the new @adobe/data-testing
  • pnpm -r run build — all packages build clean
  • pnpm -r run test — all packages pass (245 tests in @adobe/data, 10 in @adobe/data-testing, and the full suite in every consumer sample app)
  • pnpm run check:workspace — workspace conventions OK
  • pnpm -r run lint — clean

🤖 Generated with Claude Code

dwabyick and others added 2 commits August 11, 2026 13:32
Installing @adobe/data pulled in a vitest peer dependency for everyone, even
consumers who never use the conformance-testing helpers — the peerDependencies
field applies to the whole package, not just the /testing subpath, so a
downstream project with strict peer-dependency resolution could hit a vitest
version conflict just from depending on @adobe/data.

Move src/testing/** (the Match + Conformance namespaces) into a new
@adobe/data-testing package that carries the vitest peer dependency itself.
@adobe/data now has zero vitest footprint outside its own devDependency; only
the 7 sample packages that actually author conformance tests add
@adobe/data-testing + vitest as devDependencies.

Note: pnpm-lock.yaml's format bump (v6 -> v9) is a side effect of running
`pnpm install` with the CI-pinned pnpm 9 against a lockfile last written by
pnpm 8 — unrelated to this change but unavoidable once the lockfile is
touched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Includes the new @adobe/data-testing package in the version bump.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@krisnye
krisnye merged commit 27611aa into main Aug 11, 2026
3 checks passed
@krisnye
krisnye deleted the split-data-testing-package branch August 11, 2026 22:00
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.

2 participants