Skip to content

Build: Preapprove Storybook packages for yarn npmMinimalAgeGate in sandboxes#34842

Closed
valentinpalkovic wants to merge 2 commits into
storybookjs:nextfrom
valentinpalkovic:valentin/yarn-npm-minimal-age-gate
Closed

Build: Preapprove Storybook packages for yarn npmMinimalAgeGate in sandboxes#34842
valentinpalkovic wants to merge 2 commits into
storybookjs:nextfrom
valentinpalkovic:valentin/yarn-npm-minimal-age-gate

Conversation

@valentinpalkovic
Copy link
Copy Markdown
Contributor

@valentinpalkovic valentinpalkovic commented May 20, 2026

Summary

Yarn 4.15.0 enables npmMinimalAgeGate: 1d by default (yarnpkg/berry#7135), which quarantines freshly-published packages from the local Verdaccio registry and breaks sandbox creation:

SB_CLI_0002 (MinimumReleaseAgeHandledError): yarn blocked package installation
because your project uses npmMinimalAgeGate.

Failed package: create-storybook@10.5.0-alpha.0

This PR configures the sandbox yarn install (scripts/utils/yarn.ts → installYarn2) to:

  • Tighten the gate to 7 days (10080 minutes) — stricter than yarn's new 1d default for unknown third-party packages.
  • Preapprove every Storybook monorepo package (derived dynamically from code/core/src/common/versions.ts) plus the known satellite @chromatic-com/storybook, so freshly-released sandbox packages aren't blocked.

The package list stays in sync as packages are added to or removed from versions.ts.

Test plan

  • CI sandbox creation succeeds (lit-vite/default-ts and others that were failing on next)
  • Locally: yarn task sandbox --template react-vite/default-ts --start-from auto completes without YN0016
  • The generated .yarnrc.yml in the sandbox contains npmMinimalAgeGate: 10080 and npmPreapprovedPackages with the Storybook package list

Summary by CodeRabbit

  • Chores
    • Enforced a 7‑day package age gate for sandbox Yarn installs to improve stability.
    • Preapproved an allowlist of Storybook-related packages (including the new vite-plugin-storybook-nextjs) to speed and stabilize sandbox setup, improving reliability of local development and testing.

Review Change Stack

…ndboxes

Yarn 4.15.0 enables `npmMinimalAgeGate: 1d` by default, which quarantines
freshly-published packages from the local Verdaccio registry and breaks
sandbox creation (e.g. `create-storybook@10.5.0-alpha.0`).

Tighten the gate to 7 days for unknown third-party packages but preapprove
every Storybook monorepo package (derived from `versions.ts`) plus the
known satellite `@chromatic-com/storybook`.
Reuse `code/core/src/common/satellite-addons.ts` for the sandbox yarn
`npmPreapprovedPackages` list and add `vite-plugin-storybook-nextjs` to it
so all known Storybook-maintained satellites are covered by both the CLI
satellite-addons list and the sandbox preapproval logic.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1850c45c-b041-4db8-82ad-b706fb6d1818

📥 Commits

Reviewing files that changed from the base of the PR and between 1c785c8 and 8dc993d.

📒 Files selected for processing (2)
  • code/core/src/common/satellite-addons.ts
  • scripts/utils/yarn.ts
✅ Files skipped from review due to trivial changes (1)
  • code/core/src/common/satellite-addons.ts

📝 Walkthrough

Walkthrough

Adds Yarn 2 sandbox settings: a 7-day npm age gate and a JSON-stringified preapproved package allowlist built from Storybook package keys plus satellite addons; also appends these settings to the install command sequence and adds 'vite-plugin-storybook-nextjs' to the satellite addons list.

Changes

Yarn sandbox package age gate configuration

Layer / File(s) Summary
Yarn config: import, constants, and command updates
scripts/utils/yarn.ts
Adds satelliteAddons import; defines npmMinimalAgeGate (7 days in minutes) and preapprovedNpmPackages (union of storybookVersions keys and satelliteAddons); appends yarn config set npmMinimalAgeGate and yarn config set npmPreapprovedPackages --json '<stringified-list>' to installYarn2's command array.
Add new satellite addon to maintained list
code/core/src/common/satellite-addons.ts
Adds 'vite-plugin-storybook-nextjs' to the default exported array of maintained Storybook satellite addons.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs


Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-scan:human ci:normal maintenance User-facing maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant