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: Prebundle get-npm-tarball-url and @ndelangen/get-tarball #28481

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Jul 8, 2024

Related: #28226
Related: #28479
Related: #26884

What I did

I chatted with @valentinpalkovic, and we discovered that this sometimes happens:

Error: Cannot find @storybook/react/package.json, Error: Cannot find module '@storybook/react/package.json'
Require stack:
- /-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs
- /-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/bin/index.cjs
    at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
    at Function.resolve (node:internal/modules/helpers:188:19)
    at getRendererDir (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:60:11624)
    at templatePath (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:62:2146)
    at copyTemplateFiles (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:62:3340)
    ....

TypeError: (0 , import_get_npm_tarball_url.default) is not a function
    at resolveUsingBranchInstall (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:60:11070)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getRendererDir (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:60:11763)
    at async templatePath (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:62:2140)
    at async copyTemplateFiles (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:62:3334)
    at async baseGenerator (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:108:782)
    at async generator3 (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:117:4909)
    at async installStorybook (/-/.npm/_npx/30b66e50c619b15f/node_modules/storybook/dist/generate.cjs:145:4887)

I have yet to find out when exactly this happens, but prebundling should solve that type of problem.

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

More information
Published version 0.0.0-pr-28481-sha-85821163
Triggered by @ghengeveld
Repository storybookjs/storybook
Branch norbert/prebundle-cli-more
Commit 85821163
Datetime Mon Jul 8 10:11:52 UTC 2024 (1720433512)
Workflow run 9837676618

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=28481

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

  • Moved get-npm-tarball-url from dependencies to devDependencies in /code/lib/cli/package.json
  • Prebundling to prevent runtime errors during Storybook CLI execution

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

@ndelangen ndelangen changed the title prebundle get-npm-tarball-url Bug: Prebundle get-npm-tarball-url Jul 8, 2024
@ndelangen ndelangen self-assigned this Jul 8, 2024
Copy link

nx-cloud bot commented Jul 8, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 8582116. 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 merged commit d44f9af into next Jul 8, 2024
51 of 54 checks passed
@valentinpalkovic valentinpalkovic deleted the norbert/prebundle-cli-more branch July 8, 2024 10:41
@valentinpalkovic valentinpalkovic changed the title Bug: Prebundle get-npm-tarball-url CLI: Prebundle get-npm-tarball-url Jul 8, 2024
@valentinpalkovic valentinpalkovic changed the title CLI: Prebundle get-npm-tarball-url CLI: Prebundle get-npm-tarball-url and @ndelangen/get-tarball Jul 8, 2024
@github-actions github-actions bot mentioned this pull request Jul 8, 2024
4 tasks
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.

None yet

2 participants