Repository navigation
fix(build): own packed consumer dependencies - #6605
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression25 of 420 shot(s) changed. View the report A change here is a question, not a failure: check whether the after is the
and 5 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
This change looks ready to approve. It fixes a real published-package bug: @astryxdesign/build loaded PostCSS, Autoprefixer, Browserslist, and Lightning CSS without owning all of those resolution paths, so a packed consumer under isolated dependency resolution could fail to load the PostCSS helper, and the Vite compatibility pass could silently skip and drop generated prefixes.
The fix owns each load site — the three packages are now declared dependencies, the PostCSS helper resolves its bundled Autoprefixer by absolute path, and the PostCSS plugin lets the host instance parse the generated CSS instead of requiring a second copy. No public API, export, or peer range changes, and the patch [fix] Changeset matches that nonbreaking, contract-restoring classification.
The new packed-consumer test is the right regression guard: it packs the real tarball, rebuilds dependency visibility from its manifest, checks that those packages do not leak into the consumer root, exercises the public PostCSS helper, and verifies the Vite build emits the -webkit-user-select prefix — and it runs in the Build package CI job, which is passing along with the other checks. One limitation worth knowing: the test reconstructs isolation with symlinks to workspace copies rather than a fresh registry install, so it proves visibility and behaviour while lockfile consistency rests on the dependency checks.
[Automated review]
…DE_PATH After meta#5327 made node_modules strict, packages/build/src/next.test.mjs kept resolving enhanced-resolve (meta#5932) without a declaration: it arrives only transitively through next, and pnpm's vitest shim puts node_modules/.pnpm/node_modules on NODE_PATH, which require folds in. Run without it, the test fails with MODULE_NOT_FOUND. Declare it as a build dev dependency at the version the lockfile already carries, so the lockfile gains an importer entry and no new package versions. The other two requires this commit first declared are covered elsewhere: meta#6605 has ./postcss let the host's postcss parse its CSS, and meta#6627 removed the sandbox's next.config.mjs.
postProcessCss catches any failure and returns the CSS unprocessed, so the test guarding that pass has to see something only the pass produces. It looked for any -webkit- prefix, which the -webkit-box-orient authored in source always satisfies: with the pass forced to skip, it stays green. Check for -webkit-user-select, which only the pass adds and which fails when it is skipped. This commit first also had ./postcss and ./vite resolve only what build can reach itself. meta#6605 covers that, along with a packed-consumer test of the same pass; this keeps the in-repo build test honest too.









User impact
Consumers of the published
@astryxdesign/buildpackage can use its PostCSS helper and Vite plugin under isolated dependency resolution. They no longer need workspace hoisting or undeclared root packages to keep CSS compilation and compatibility processing working.Root cause
The shipped package loaded
postcss,autoprefixer,browserslist, andlightningcsswithout owning all four resolution paths. Monorepo tooling hid those gaps. A clean packed consumer failed to load the complete PostCSS config, while Vite could silently skip compatibility processing.Fix
-webkit-user-selectprefix.This is the consumer-facing package correction identified while reviewing #6372. That PR can rebase and drop its overlapping package changes.
Test plan
pnpm vitest run packages/build/src --project node --maxWorkers=1— 64 passedorigin/main— expected failures: package-localpostcssresolution and missing Vite compatibility prefixpnpm -F @astryxdesign/build buildpnpm check:changesetspnpm check:package-boundariespnpm check:portable-scriptspnpm check:repo