Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPC: Fix missing exports for addon-kit #28691

Merged
merged 3 commits into from
Jul 23, 2024
Merged

CPC: Fix missing exports for addon-kit #28691

merged 3 commits into from
Jul 23, 2024

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Jul 23, 2024

Closes #28673

What I did

the ./globals export was there, however due to a combination of modernized tools, the legacy method of adding an file export (just adding a file) was not enough.

After some experimentation I found the only way to make it work was by making the module type=module and have a full set in the export map.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 76.4 MB 76.4 MB 0 B -2.78 0%
initSize 198 MB 198 MB -51 B -2.81 0%
diffSize 121 MB 121 MB -51 B 0.68 0%
buildSize 7.6 MB 7.6 MB 0 B 0.5 0%
buildSbAddonsSize 1.63 MB 1.63 MB 0 B 0.41 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.3 MB 2.3 MB 0 B 0.5 0%
buildSbPreviewSize 349 kB 349 kB 0 B 0.33 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.47 MB 4.47 MB 0 B 0.5 0%
buildPreviewSize 3.12 MB 3.12 MB 0 B 0.23 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 7.8s 8.9s 1s -0.69 11.7%
generateTime 33.4s 24.9s -8s -561ms 0.75 -34.4%
initTime 23.9s 24s 85ms 0.52 0.4%
buildTime 14.8s 14s -753ms -0.63 -5.3%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 9.3s 8.1s -1s -169ms -0.68 -14.3%
devManagerResponsive 6.2s 5.5s -662ms -0.6 -11.9%
devManagerHeaderVisible 864ms 777ms -87ms -0.57 -11.2%
devManagerIndexVisible 897ms 813ms -84ms -0.53 -10.3%
devStoryVisibleUncached 1.3s 1.4s 116ms 0.04 8.2%
devStoryVisible 917ms 833ms -84ms -0.56 -10.1%
devAutodocsVisible 777ms 716ms -61ms -0.69 -8.5%
devMDXVisible 778ms 709ms -69ms -0.77 -9.7%
buildManagerHeaderVisible 833ms 775ms -58ms -0.6 -7.5%
buildManagerIndexVisible 838ms 777ms -61ms -0.62 -7.9%
buildStoryVisible 891ms 828ms -63ms -0.59 -7.6%
buildAutodocsVisible 759ms 708ms -51ms -0.74 -7.2%
buildMDXVisible 689ms 652ms -37ms -0.79 -5.7%

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request addresses missing exports for the addon-kit by modernizing the module system and ensuring compatibility with both ES and CommonJS modules.

  • Added code/deprecated/manager/globals.cjs to re-export using CommonJS syntax.
  • Updated code/deprecated/manager/package.json to set type=module and define an export map.
  • Modified code/deprecated/manager/globals.js to use ES module syntax.
  • Added code/deprecated/preview/globals.cjs for CommonJS re-exports.
  • Updated code/deprecated/preview/package.json to set type=module and define an export map.

8 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

nx-cloud bot commented Jul 23, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1f30459. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@ndelangen ndelangen added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jul 23, 2024
code/deprecated/manager/package.json Outdated Show resolved Hide resolved
code/deprecated/preview/package.json Outdated Show resolved Hide resolved
@ndelangen ndelangen merged commit 2f7072b into next Jul 23, 2024
52 of 53 checks passed
@ndelangen ndelangen deleted the norbert/fix-28673 branch July 23, 2024 15:51
storybook-bot pushed a commit that referenced this pull request Jul 23, 2024
CPC: Fix missing exports for addon-kit
(cherry picked from commit 2f7072b)
@github-actions github-actions bot mentioned this pull request Jul 23, 2024
3 tasks
storybook-bot pushed a commit that referenced this pull request Jul 24, 2024
CPC: Fix missing exports for addon-kit
(cherry picked from commit 2f7072b)
storybook-bot pushed a commit that referenced this pull request Jul 24, 2024
CPC: Fix missing exports for addon-kit
(cherry picked from commit 2f7072b)
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ci:normal core patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Addon build fails due to missing @storybook/manager/globals on 8.2.5
2 participants