Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This was referenced Sep 26, 2026
web-pkg, design-system and web-test-helpers formed a cycle: the mount
helpers have to install the design system (its components are registered
globally) and web-pkg's mocked pinia stores, so web-test-helpers was
imported by both packages that imported it back.
Resolved by layering the helpers onto the packages that already need
them, instead of adding another one:
design-system/testing mount/shallowMount, prop types, design system +
gettext + router-link stub plugins
web-pkg/src/testing the above, extended with casl abilities, mocked
pinia stores and component mocks
web-test-helpers re-export of web-pkg/src/testing
design-system sits at the bottom of the workspace graph, so it cannot
depend on a package that installs it - hence the generic half lives
there. web-pkg composes those plugins rather than duplicating them, so
every helper is still defined exactly once, and no package depends on
one above it.
The public API of `@ownclouders/web-test-helpers` is unchanged, so
external extensions are unaffected.
Also:
- pin `typescript` via `pnpm.overrides` - without it, a second peer-
resolved typescript version forks `vue`, which forks `vue3-gettext`
into two module instances, breaking `inject(GetTextSymbol)` for any
component mounted through these helpers.
- keep `@ownclouders/design-system/testing` external in web-pkg's lib
build. rollup matches `external` strings exactly, so the subpath was
inlined, shipping a second copy of the design system and of
@vue/test-utils into the published bundle - components and wrappers
were then not identity-equal to the consumer's own, and gettext
injection broke.
- name the web-test-helpers umd output `.cjs`. The package is ESM, so the
`.js` file that publishConfig.exports pointed `require` at could not be
required.
Verified: `pnpm install --frozen-lockfile` clean, zero cyclic-workspace
warnings; `pnpm test:unit` 380 files / 3129 tests pass; `pnpm check:types`
0 errors; `pnpm lint`/`check:format` 0 errors; `pnpm build` succeeds;
published artifacts checked by mounting through the built `dist/` bundles
the way an external extension resolves them via publishConfig.exports.
mzner
added this pull request to stack #13012
September 26, 2026 11:02
mzner
force-pushed
the
fix/web-pkg-dependency-cycle
branch
from
September 26, 2026 11:09
4f8a422 to
ee8c29a
Compare
This branch has not been deployed
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.
Description
web-pkg,design-systemandweb-test-helpershad a dependency cycle: the mount helpers needto install the design system (its components are registered globally) and web-pkg's mocked
pinia stores, so
web-test-helpersended up imported by both packages that imported it.Fixed by layering the helpers instead of adding another package for them:
design-system/testing—mount/shallowMount, prop types, design system + gettext pluginsweb-pkg/src/testing— the above plus casl abilities, mocked pinia, component mocksweb-test-helpers— just re-exportsweb-pkg/src/testingdesign-systemsits at the bottom of the graph, so it can't depend on anything that installsit — that's why the generic bits live there. web-pkg builds on top of it instead of duplicating
it, so nothing depends on something above it anymore. Public API of
web-test-helpersisunchanged, so extensions aren't affected.
Two smaller things included here:
typescriptinpnpm.overrides— a second resolved typescript version was forkingvue3-gettextinto two instances, breaking$gettextin mounted componentsdesign-system/testingexternal in web-pkg's build config — it was getting bundled in byaccident, shipping a duplicate copy of the design system to consumers
Related Issue
Motivation and Context
Needed before we can turn on Nx (see #13011) — Nx errors out on a circular task graph, and this
was one.
How Has This Been Tested?
pnpm install— no more cyclic-workspace warningpnpm test:unit— 380 files / 3129 tests passpnpm check:types,pnpm lint,pnpm check:format,pnpm build— all cleanextensions still get the real design system and
@vue/test-utilsinstances, not duplicatesweb-app-skeleton) installed like an npm consumer would —build, typecheck and a component test using
@ownclouders/web-test-helpersall passTypes of changes
Checklist: