Skip to content

Revert "Cleanup: Remove duplicated entrypoints in core"#32575

Closed
ndelangen wants to merge 1 commit into
nextfrom
revert-32507-norbert/cleanup-entrypoints-core
Closed

Revert "Cleanup: Remove duplicated entrypoints in core"#32575
ndelangen wants to merge 1 commit into
nextfrom
revert-32507-norbert/cleanup-entrypoints-core

Conversation

@ndelangen
Copy link
Copy Markdown
Member

@ndelangen ndelangen commented Sep 29, 2025

Reverts #32507

Seems there may have been some unintentional UI changes due to this, checking if reverting this PR fixes it, if not something else was the cause.

Summary by CodeRabbit

  • Refactor
    • Standardized use of internal APIs across stories and components for consistency.
    • Simplified globals handling and reduced duplication.
    • Minor cleanup in example stories, including removal of obsolete mocked data.
  • Chores
    • Expanded internal export surface to improve package ergonomics.
    • Updated build and bundling configuration to recognize additional internal entries.
    • Streamlined migration tooling to rely on consolidated import mappings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 29, 2025

Walkthrough

This PR redirects multiple imports from public Storybook packages to their internal counterparts (e.g., theming, manager-api, preview-api). It exposes new internal export paths in core/package.json and augments core build-config to include ./internal/* export entries. The Vite builder adds storybook/internal/preview-api to INCLUDE_CANDIDATES. Globals are adjusted: a new runtime mapping for storybook/internal/preview-api is added, and a duplicative globals-module-info path expansion is removed. Some stories/templates update hook/context imports accordingly, and a manager story removes mocked Manager API data. The CLI automigration consolidates import rewrites by relying solely on consolidatedPackages.

Possibly related PRs

Suggested labels

maintenance, core, cleanup

Suggested reviewers

  • yannbf
  • kasperpeulen
  • JReinhold
  • vanessayuenn

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and succinctly indicates that the pull request reverts the prior cleanup which removed duplicated entrypoints in core, matching the primary change in the diff without extraneous detail or vague phrasing.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-32507-norbert/cleanup-entrypoints-core

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df23220 and 2ce57f9.

📒 Files selected for processing (17)
  • code/addons/docs/src/blocks/components/TableOfContents.stories.tsx (1 hunks)
  • code/addons/pseudo-states/src/manager/PseudoStateTool.tsx (1 hunks)
  • code/addons/pseudo-states/src/stories/CSSAtRules.stories.tsx (1 hunks)
  • code/addons/vitest/src/components/SidebarContextMenu.tsx (1 hunks)
  • code/builders/builder-vite/src/constants.ts (1 hunks)
  • code/core/build-config.ts (2 hunks)
  • code/core/package.json (3 hunks)
  • code/core/src/components/components/Button/Button.stories.tsx (1 hunks)
  • code/core/src/components/components/Form/Checkbox.tsx (1 hunks)
  • code/core/src/components/components/Form/Radio.tsx (1 hunks)
  • code/core/src/highlight/useHighlights.stories.tsx (1 hunks)
  • code/core/src/manager/components/layout/Layout.stories.tsx (1 hunks)
  • code/core/src/manager/globals/globals-module-info.ts (0 hunks)
  • code/core/src/preview/globals/globals.ts (1 hunks)
  • code/core/src/preview/globals/runtime.ts (1 hunks)
  • code/lib/cli-storybook/src/automigrate/fixes/consolidated-imports.ts (1 hunks)
  • code/renderers/react/template/stories/decorators.stories.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • code/core/src/manager/globals/globals-module-info.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Adhere to ESLint and Prettier rules across all JS/TS source files

Files:

  • code/core/src/manager/components/layout/Layout.stories.tsx
  • code/lib/cli-storybook/src/automigrate/fixes/consolidated-imports.ts
  • code/core/src/preview/globals/runtime.ts
  • code/addons/pseudo-states/src/manager/PseudoStateTool.tsx
  • code/addons/vitest/src/components/SidebarContextMenu.tsx
  • code/core/src/components/components/Form/Checkbox.tsx
  • code/core/src/highlight/useHighlights.stories.tsx
  • code/core/src/components/components/Form/Radio.tsx
  • code/core/src/preview/globals/globals.ts
  • code/addons/pseudo-states/src/stories/CSSAtRules.stories.tsx
  • code/addons/docs/src/blocks/components/TableOfContents.stories.tsx
  • code/builders/builder-vite/src/constants.ts
  • code/core/build-config.ts
  • code/renderers/react/template/stories/decorators.stories.tsx
  • code/core/src/components/components/Button/Button.stories.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Fix type errors and prefer precise typings instead of using any or suppressions, consistent with strict mode

Files:

  • code/core/src/manager/components/layout/Layout.stories.tsx
  • code/lib/cli-storybook/src/automigrate/fixes/consolidated-imports.ts
  • code/core/src/preview/globals/runtime.ts
  • code/addons/pseudo-states/src/manager/PseudoStateTool.tsx
  • code/addons/vitest/src/components/SidebarContextMenu.tsx
  • code/core/src/components/components/Form/Checkbox.tsx
  • code/core/src/highlight/useHighlights.stories.tsx
  • code/core/src/components/components/Form/Radio.tsx
  • code/core/src/preview/globals/globals.ts
  • code/addons/pseudo-states/src/stories/CSSAtRules.stories.tsx
  • code/addons/docs/src/blocks/components/TableOfContents.stories.tsx
  • code/builders/builder-vite/src/constants.ts
  • code/core/build-config.ts
  • code/renderers/react/template/stories/decorators.stories.tsx
  • code/core/src/components/components/Button/Button.stories.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: ndelangen
PR: storybookjs/storybook#32507
File: code/core/src/manager/globals/globals-module-info.ts:25-33
Timestamp: 2025-09-24T09:39:39.209Z
Learning: In Storybook, storybook/actions/decorator is a preview-only entrypoint and should not be included in manager globals configuration. The duplicatedKeys array in code/core/src/manager/globals/globals-module-info.ts is specifically for manager-side externalization, not preview entrypoints.
📚 Learning: 2025-09-24T09:39:39.209Z
Learnt from: ndelangen
PR: storybookjs/storybook#32507
File: code/core/src/manager/globals/globals-module-info.ts:25-33
Timestamp: 2025-09-24T09:39:39.209Z
Learning: In Storybook, storybook/actions/decorator is a preview-only entrypoint and should not be included in manager globals configuration. The duplicatedKeys array in code/core/src/manager/globals/globals-module-info.ts is specifically for manager-side externalization, not preview entrypoints.

Applied to files:

  • code/core/src/manager/components/layout/Layout.stories.tsx
  • code/core/src/preview/globals/runtime.ts
  • code/core/src/preview/globals/globals.ts
  • code/addons/pseudo-states/src/stories/CSSAtRules.stories.tsx
  • code/builders/builder-vite/src/constants.ts
  • code/core/build-config.ts
  • code/renderers/react/template/stories/decorators.stories.tsx
📚 Learning: 2025-09-17T08:11:47.197Z
Learnt from: CR
PR: storybookjs/storybook#0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-09-17T08:11:47.197Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Document complex mock behaviors

Applied to files:

  • code/core/src/manager/components/layout/Layout.stories.tsx
📚 Learning: 2025-09-17T08:11:47.197Z
Learnt from: CR
PR: storybookjs/storybook#0
File: .cursor/rules/spy-mocking.mdc:0-0
Timestamp: 2025-09-17T08:11:47.197Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Group related mocks together

Applied to files:

  • code/core/build-config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: normal
  • GitHub Check: Danger JS
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (11)
code/builders/builder-vite/src/constants.ts (1)

108-109: Restore preview-api prebundle coverage.

Re-adding storybook/internal/preview-api keeps the Vite prebundle list aligned with the configuration before #32507, preventing the dependency scan churn we saw without it.

code/core/src/preview/globals/globals.ts (1)

16-17: Comment matches the restored roadmap.

Tweaking the TODO back to “Remove in 9.1” keeps this revert faithful to the previous deprecation note, no further action needed.

code/addons/pseudo-states/src/manager/PseudoStateTool.tsx (1)

4-4: Align theming import with internal entrypoint.

Pointing back to storybook/internal/theming restores the manager-facing styling helpers that the cleanup removed; the addon once again consumes the intended internal surface.

code/addons/vitest/src/components/SidebarContextMenu.tsx (1)

4-5: Restore manager API import path.

Using storybook/internal/manager-api again keeps this component on the internal manager surface that existed before the cleanup—exactly what this revert is aiming for.

code/core/src/components/components/Button/Button.stories.tsx (1)

3-6: Revert story imports to their internal variants.

Going back to storybook/internal/theming and @storybook/icons returns this story to the configuration that worked prior to #32507, so the revert stays complete.

code/core/src/components/components/Form/Radio.tsx (1)

3-3: Consistent theming import restored.

Switching back to storybook/internal/theming keeps the core UI module aligned with the duplicated internal entrypoints exposed in this revert. Looks good to me.

code/core/src/preview/globals/runtime.ts (1)

28-30: Internal preview-api path covered.

Adding 'storybook/internal/preview-api' here keeps the global singleton wired up for callers that resolve the reintroduced internal entrypoint. Looks solid.

code/renderers/react/template/stories/decorators.stories.tsx (1)

4-6: Confirm template should reference the internal preview API.

This template is emitted into user projects, so pointing folks back at storybook/internal/preview-api effectively blesses the internal alias again. Please double-check that’s intentional for this revert (and that downstream starters will keep working with that path).

code/lib/cli-storybook/src/automigrate/fixes/consolidated-imports.ts (1)

150-152: Double-check consolidatedPackages covers the reverted aliases.

Relying solely on consolidatedPackages means every internal ↔ public rewrite (e.g., preview-api, theming, manager-api) must live in that helper. Please sanity-check its contents so we don’t miss any of the reintroduced duplicates during automigration.

code/core/package.json (1)

61-185: Internal export aliases reinstated.

The duplicated export surface (./internal/*) lines back up with the rest of the revert and matches the dist targets, so no concerns here.

code/core/build-config.ts (1)

100-161: Reinstating the internal aliases looks consistent.

Lines 100-161 now mirror the package.json export surface (public + internal paths), so the build artifacts will again emit both aliases. This lines up with the revert’s intent, and I don’t see any mismatches that would break bundling.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

@ndelangen ndelangen added core build Internal-facing build tooling & test updates ci:normal labels Sep 29, 2025
@ndelangen ndelangen self-assigned this Sep 29, 2025
@ndelangen ndelangen requested a review from shilman September 29, 2025 06:38
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Sep 29, 2025

View your CI Pipeline Execution ↗ for commit 2ce57f9

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 46s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-29 07:00:28 UTC

@ndelangen ndelangen closed this Sep 29, 2025
@kasperpeulen kasperpeulen deleted the revert-32507-norbert/cleanup-entrypoints-core branch April 4, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:normal core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant