Skip to content

[pull] next from storybookjs:next#864

Merged
pull[bot] merged 17 commits into
GesuBackups:nextfrom
storybookjs:next
Jun 12, 2026
Merged

[pull] next from storybookjs:next#864
pull[bot] merged 17 commits into
GesuBackups:nextfrom
storybookjs:next

Conversation

@pull

@pull pull Bot commented Jun 12, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

kasperpeulen and others added 17 commits June 11, 2026 13:09
…n once

A second copy of the telemetry module loading in the same process (an addon
resolving its own storybook package in a pnpm workspace, or dual CJS/ESM
loading) reset SB_TELEMETRY_STATE back to undefined, so every subsequent
telemetry() call was queued forever and silently dropped.

Guard-initialize the state, move the event queue to globalThis so a late
loading module instance flushes into the same queue, and apply the same
guard to PAYLOAD_ERROR_HANDLER which had the identical wipe-on-reload bug.
Engine-only open-service commands (_applyGraphSnapshot, _applyGraphUpdate,
_bumpGraphRevision, _setStatus, _waitForSettledEngine) are now marked
internal: true and prefixed with _ per open-service conventions.

Co-authored-by: Jeppe Reinhold <JReinhold@users.noreply.github.com>
…rybook/cli

The dispatcher only routed dev/build/index to the bundled core binary;
`storybook ai` was proxied to @storybook/cli, falling back to an npx
download on version mismatch. Since agent skills invoke
`npx storybook ai <tool>` repeatedly, that download sat on a hot path.

Move the whole ai command (MCP passthrough + setup) from
@storybook/cli into code/core/src/cli/ai, register it in bin/core.ts
next to dev/build, and add 'ai' to the dispatcher's bundled list.
getStorybookData is reimplemented on top of core's getStorybookInfo;
ProjectTypeService keeps the cross-package source import pattern.

Closes #35146
…rt, shared story-paths helper

- Extract detectLanguage/detectIncompatiblePackageVersions into core
  (storybook/internal/cli) and delegate from ProjectTypeService, so core
  no longer imports source from create-storybook (which depends on core).
- Move getStoriesPathsFromConfig into core-server as the single shared
  copy; cli-storybook re-exports it and the ai module imports it, instead
  of two verbatim duplicates.
… in detectLanguage

Addresses the codex thermo-nuclear review:
- getStorybookData moves to storybook/internal/cli as the one canonical
  project-metadata collector; automigrate/doctor/add delegate to it via a
  re-export instead of keeping a near-duplicate.
- detectLanguage takes an explicit workingDir for its js/tsconfig lookup
  (defaulting to process.cwd() for init), and ai setup passes the target
  Storybook's working dir instead of relying on the process cwd.
…-export

Second thermo-nuclear review pass: detectLanguage's workingDir scoping is
an intended fix (config files are found next to the target Storybook, not
the invoking cwd) — covered with memfs tests; the re-export in util.ts
moves below the import block.
`dirname(join(process.cwd(), configDir))` collapsed `--config-dir .` to the
project's parent directory, mispointing story-glob resolution and the
tsconfig/jsconfig lookup in detectLanguage. Taking dirname before resolving
keeps root-level config dirs anchored to the project root. Pre-existing on
next, surfaced by the move (CodeRabbit review on #35147).
…internal-ops-df57

Open Service: Mark module-graph engine commands as internal
CLI: Bundle the `ai` command in core so it never downloads `@storybook/cli`
…RROR_HANDLER global

The bare PayloadErrorHandler name in typings.d.ts never resolved (declaration
files are skipLibCheck'd), so the global was silently typed any. Export the
type and reference it the same way as the other telemetry globals.
…ate-guard

Telemetry: Preserve state machine when the module loads more than once
@pull pull Bot locked and limited conversation to collaborators Jun 12, 2026
@pull pull Bot added the ⤵️ pull label Jun 12, 2026
@pull pull Bot merged commit 35ea567 into GesuBackups:next Jun 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants