Skip to content

fix(build): own packed consumer dependencies - #6605

Merged
cixzhang merged 2 commits into
mainfrom
fix/build-packed-contract
Sep 24, 2026
Merged

cixzhang merged 2 commits into
mainfrom
fix/build-packed-contract

Conversation

@cixzhang

@cixzhang cixzhang commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Consumers of the published @astryxdesign/build package 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, and lightningcss without 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

  • Let the host PostCSS instance parse generated replacement CSS.
  • Resolve package-owned Autoprefixer by absolute path.
  • Declare Autoprefixer, Browserslist, and Lightning CSS as package dependencies.
  • Pack the real tarball, reconstruct strict dependency visibility solely from its manifest, exercise the public PostCSS helper, and verify Vite emits a generated -webkit-user-select prefix.
  • Run that tarball contract in the Build package CI owner.

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 passed
  • Regression oracle on origin/main — expected failures: package-local postcss resolution and missing Vite compatibility prefix
  • pnpm -F @astryxdesign/build build
  • pnpm check:changesets
  • pnpm check:package-boundaries
  • pnpm check:portable-scripts
  • commit hook: full pnpm check:repo

@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 24, 2026 5:41pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 24, 2026
@astracat-bot

astracat-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Sep 24, 2026, 6:32 PM UTC

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

25 of 420 shot(s) changed. View the report

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Chat Full AI Chat probe light 42,708
Chat Empty State probe light 42,708
Chat Full AI Chat probe dark 41,786
Chat Empty State probe dark 41,786
Slider Default probe light 15,617
Slider Default probe dark 15,615
Chat With Attachments probe light 12,964
Chat With Attachments probe dark 12,114
InputGroup With Typeahead probe light 11,012
InputGroup With Typeahead probe dark 9,189
ComplexSelector Tree list with search probe light 6,245
TextArea Vertical Form Alignment probe light 5,634
ComplexSelector Tree list with search probe dark 5,602
TextArea Vertical Form Alignment probe dark 5,047
ComplexSelector Fruit ripeness selector neutral light 4,007
ComplexSelector Fruit ripeness selector neutral dark 3,825
ToggleButton Group Single probe dark 1,538
ToggleButton Group Single probe light 1,538
MediaTheme On Dark neutral dark 838
Banner Collapsible Content (Expanded) probe dark 92

and 5 more.

Chat — Full AI Chat — probe light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
Chat — Empty State — probe light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
Chat — Full AI Chat — probe dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@cixzhang
cixzhang merged commit 09846f0 into main Sep 24, 2026
45 checks passed
@github-actions
github-actions Bot deleted the fix/build-packed-contract branch September 25, 2026 06:24
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Sep 25, 2026
…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.
sangwook-dev added a commit to sangwook-dev/astryx that referenced this pull request Sep 25, 2026
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.

This branch was successfully deployed

1 active deployment
Preview — 100a5013 Deployed Sep 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant