Skip to content

feat(lab): publish @astryxdesign/lab to the @canary dist-tag only#3235

Open
cixzhang wants to merge 2 commits into
mainfrom
navi/feat/lab-canary-only
Open

feat(lab): publish @astryxdesign/lab to the @canary dist-tag only#3235
cixzhang wants to merge 2 commits into
mainfrom
navi/feat/lab-canary-only

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Summary

Make @astryxdesign/lab installable for early testing without ever shipping a stable (latest) release. Today lab has no build and is private, so the only way to try a lab component is to fork/vendor the source. This change gives lab a real build and publishes it only under the @canary dist-tag:

npm install @astryxdesign/lab@canary @astryxdesign/core@canary

"Never a stable release" — three independent guarantees

  1. private: true stays in committed source — npm hard-refuses to publish a private package, and changesets ignores it (no "Version Packages" bump is ever generated for lab).
  2. Stable publish job additionally skips astryx.canaryOnly packages — so even an accidental private: false cannot leak lab onto latest.
  3. Canary job is the only place that treats lab as publishable, and it strips private only in the ephemeral CI checkout — never in git.

A new astryx.canaryOnly marker in package.json is the explicit opt-in; it's a reusable convention for any future experimental package.

What's in this change

  • Lab build: babel ESM compile + tsc declarations + StyleX CSS extraction (lab.css, 542 rules). scripts/build-css.mjs is generalized to take a --package target; core's output is byte-unchanged.
  • Lab package.json: adds exports, files, build scripts, and the astryx.canaryOnly marker. Keeps private: true.
  • themeProps through the public API: 7 lab files reached into core source (../../../core/src/utils/themeProps) — a path that does not exist in an installed package, which would break any published lab. They now import from @astryxdesign/core/utils, and themeProps (+ its types) is exported from core's utils barrel.
  • Root build: lab is added after core so CI builds it before publishing.

⚠️ One manual follow-up (workflow scope)

The matching change to .github/workflows/release.yml is not in this branch — the bot token used to push lacks workflow scope. The two gate edits (stable job: also skip canaryOnly; canary job: include canaryOnly and strip private in the ephemeral checkout) need to be applied to release.yml separately by a maintainer. The exact patch is provided by the PR author. Until that workflow edit lands, the canary job will not publish lab.

Verification

  • Full pnpm build passes with lab in the pipeline
  • Lab tests pass in isolation (7 files, 107 tests)
  • npm pack produces a complete tarball (dist/index.js, index.d.ts, lab.css, src)
  • check:sync, check:package-boundaries, sync-exports --check, verify-exports, check:changesets all green

Draft notes

Opening as draft for design sign-off on:

  • the astryx.canaryOnly manifest convention, and
  • the canary-only distribution policy for lab.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 29, 2026
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jun 29, 2026 11:32pm

Request Review

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

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

🧪 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

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.6KB 0B

Accessibility Audit

Status: No accessibility violations detected.


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

github-actions Bot added a commit that referenced this pull request Jun 29, 2026
cixzhang added 2 commits June 29, 2026 23:27
Make the experimental lab package installable for early testing without
ever shipping a stable (latest) release, so consumers can try lab
components via npm instead of forking or vendoring source.

- Give lab a real build: babel ESM compile, tsc declarations, and StyleX
  CSS extraction (lab.css). Generalize scripts/build-css.mjs to take a
  --package target; core output is unchanged.
- Add an exports map, files, and build scripts to lab's package.json, plus
  an astryx.canaryOnly marker. Lab keeps private: true.
- Release workflow: the stable job now also skips canaryOnly packages
  (redundant safeguard on top of private), and the canary job publishes
  canaryOnly packages, stripping private only in the ephemeral CI checkout.
- Route lab's themeProps import through @astryxdesign/core/utils instead of
  reaching into core source, and export themeProps from core's utils API.
- Add lab to the root build so CI builds it before publishing.

@cixzhang
@cixzhang cixzhang force-pushed the navi/feat/lab-canary-only branch from b381efc to 0c45e8f Compare June 29, 2026 23:28
github-actions Bot added a commit that referenced this pull request Jun 29, 2026
@cixzhang cixzhang marked this pull request as ready for review June 30, 2026 00:30
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