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

CLI: Fix the initialization of Storybook in workspaces #28699

Merged

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Jul 24, 2024

Closes #20726

What I did

I have fixed a bug related to npm and workspaces where calling npm config get ... in a workspace was throwing an error.

Additionally, I have removed the setRegistryURL method from the JSPackageManager class since it was exclusively used by our scripts.

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

Manually tested with the following package managers:

  • yarn berry pnp
  • pnpm
  • npm

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

  1. git clone https://github.com/kinetics-dev/kinetics.git
  2. cd ./packages/kinetics-core
  3. npx storybook@ init

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 pull request has been released as version 0.0.0-pr-28699-sha-3cca421e. Try it out in a new sandbox by running npx storybook@0.0.0-pr-28699-sha-3cca421e sandbox or in an existing project with npx storybook@0.0.0-pr-28699-sha-3cca421e upgrade.

More information
Published version 0.0.0-pr-28699-sha-3cca421e
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/fix-installing-storybook-in-workspaces
Commit 3cca421e
Datetime Wed Jul 24 08:39:37 UTC 2024 (1721810377)
Workflow run 10073385361

To request a new release of this pull request, mention the @storybookjs/core team.

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 76.4 MB 76.4 MB 0 B -1.48 0%
initSize 198 MB 198 MB 875 B -1.45 0%
diffSize 121 MB 121 MB 875 B 1.98 0%
buildSize 7.6 MB 7.6 MB 0 B 0.33 0%
buildSbAddonsSize 1.63 MB 1.63 MB 0 B 0.33 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.3 MB 2.3 MB 0 B - 0%
buildSbPreviewSize 349 kB 349 kB 0 B - 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.47 MB 4.47 MB 0 B 0.33 0%
buildPreviewSize 3.12 MB 3.12 MB 0 B - 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 23.6s 7.5s -16s -43ms -0.91 -211.4%
generateTime 20.7s 21.2s 447ms -0.47 2.1%
initTime 21.9s 20.7s -1s -174ms -1.26 🔰-5.6%
buildTime 14.8s 13s -1s -842ms -1.56 🔰-14.1%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 8.2s 9.7s 1.5s 0.43 15.5%
devManagerResponsive 5.6s 6s 410ms 0.21 6.7%
devManagerHeaderVisible 802ms 914ms 112ms -0.01 12.3%
devManagerIndexVisible 843ms 959ms 116ms 0.06 12.1%
devStoryVisibleUncached 1.1s 1.6s 431ms 0.51 26.8%
devStoryVisible 864ms 971ms 107ms -0.01 11%
devAutodocsVisible 723ms 899ms 176ms 0.78 19.6%
devMDXVisible 718ms 748ms 30ms -0.34 4%
buildManagerHeaderVisible 819ms 973ms 154ms 0.86 15.8%
buildManagerIndexVisible 825ms 983ms 158ms 0.89 16.1%
buildStoryVisible 870ms 1s 156ms 0.79 15.2%
buildAutodocsVisible 721ms 815ms 94ms 0.25 11.5%
buildMDXVisible 650ms 897ms 247ms 1.26 🔺27.5%

@valentinpalkovic valentinpalkovic self-assigned this Jul 24, 2024
@valentinpalkovic valentinpalkovic changed the title Valentin/fix installing storybook in workspaces CLI: Fix the initialization of Storybook in workspaces Jul 24, 2024
Copy link

nx-cloud bot commented Jul 24, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit dd2f9b4. 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.

@valentinpalkovic valentinpalkovic marked this pull request as ready for review July 24, 2024 09:52
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 a bug in initializing Storybook within npm workspaces and removes the setRegistryURL method from the JSPackageManager class.

  • code/core/src/common/js-package-manager/JsPackageManager.ts: Removed setRegistryURL method; added abstract getRegistryURL method.
  • code/core/src/common/js-package-manager/NPMProxy.ts: Added getRegistryURL method to handle npm registry URL retrieval, removed setRegistryURL.
  • code/core/src/common/js-package-manager/PNPMProxy.ts: Added getRegistryURL method for pnpm registry URL retrieval.
  • code/core/src/common/js-package-manager/Yarn1Proxy.ts: Added getRegistryURL method for Yarn registry URL retrieval.
  • code/core/src/common/js-package-manager/Yarn2Proxy.ts: Added getRegistryURL method for Yarn 2 registry URL retrieval.

10 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

scripts/sandbox/generate.ts Outdated Show resolved Hide resolved
Copy link
Member

@ndelangen ndelangen left a comment

Choose a reason for hiding this comment

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

I did not manually test this, but the code looks good to me.

@valentinpalkovic valentinpalkovic merged commit e432880 into next Jul 25, 2024
52 of 53 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/fix-installing-storybook-in-workspaces branch July 25, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Error installing storybook in monorepo
2 participants