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: Add yarn1 package manager fallback for init in empty directory #26500

Merged
merged 1 commit into from Mar 17, 2024

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Mar 14, 2024

Closes #26480

What I did

I have introduced a package manager fallback from yarn1 to npm in cases where Storybook is initialized into an empty directory. Due to hoisting issues in yarn1, the framework's initialization already fails, and the init process exited with an error.

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

  1. mkdir empty-directory && cd ./empty-directory
  2. touch yarn.lock
  3. mkdir nested && cd ./nested
  4. npx storybook@0.0.0-pr-26500-sha-4eef9b4c init
  5. Storybook starts and is initialized with npm instead of yarn.

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-26500-sha-4eef9b4c. Try it out in a new sandbox by running npx storybook@0.0.0-pr-26500-sha-4eef9b4c sandbox or in an existing project with npx storybook@0.0.0-pr-26500-sha-4eef9b4c upgrade.

More information
Published version 0.0.0-pr-26500-sha-4eef9b4c
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/use-npm-over-yarn1-while-init
Commit 4eef9b4c
Datetime Thu Mar 14 14:37:16 UTC 2024 (1710427036)
Workflow run 8282580419

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

@valentinpalkovic valentinpalkovic self-assigned this Mar 14, 2024
@valentinpalkovic valentinpalkovic changed the title Introduce package manager fallback for initializing Storybook in an empty directory with yarn1 CLI: Introduce package manager fallback for initializing Storybook in an empty directory with yarn1 Mar 14, 2024
@valentinpalkovic valentinpalkovic added bug ci:daily Run the CI jobs that normally run in the daily job. labels Mar 14, 2024
Copy link

nx-cloud bot commented Mar 14, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 4eef9b4. 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 2 targets

Sent with 💌 from NxCloud.

@valentinpalkovic valentinpalkovic marked this pull request as ready for review March 14, 2024 15:00
@valentinpalkovic valentinpalkovic merged commit c0fdb3e into next Mar 17, 2024
109 of 124 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/use-npm-over-yarn1-while-init branch March 17, 2024 11:52
@shilman shilman added the cli label Mar 17, 2024
@shilman
Copy link
Member

shilman commented Mar 17, 2024

@valentinpalkovic why did you run ci: daily on this PR? Seems like overkill to me.

@github-actions github-actions bot mentioned this pull request Mar 17, 2024
15 tasks
@valentinpalkovic
Copy link
Contributor Author

valentinpalkovic commented Mar 17, 2024

Because the test-empty-init-* jobs are only executed during ci:daily and are not part of ci:normal and ci:merged:
https://app.circleci.com/pipelines/github/storybookjs/storybook/73178/workflows/ec20434f-2fa9-4c36-bc83-67f890199a3a

@shilman
Copy link
Member

shilman commented Mar 17, 2024

Aha! Thanks for clarifying 🤦‍♂️

@valentinpalkovic valentinpalkovic added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Mar 19, 2024
storybook-bot pushed a commit that referenced this pull request Mar 19, 2024
…1-while-init

CLI: Introduce package manager fallback for initializing Storybook in an empty directory with yarn1
(cherry picked from commit c0fdb3e)
@github-actions github-actions bot mentioned this pull request Mar 19, 2024
11 tasks
@shilman shilman changed the title CLI: Introduce package manager fallback for initializing Storybook in an empty directory with yarn1 CLI: Add package manager fallback for initializing in empty directory with yarn1 Mar 19, 2024
@shilman shilman changed the title CLI: Add package manager fallback for initializing in empty directory with yarn1 CLI: Add yarn1 package manager fallback for init in empty directory Mar 19, 2024
storybook-bot pushed a commit that referenced this pull request Mar 19, 2024
…1-while-init

CLI: Introduce package manager fallback for initializing Storybook in an empty directory with yarn1
(cherry picked from commit c0fdb3e)
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ci:daily Run the CI jobs that normally run in the daily job. cli 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.

Better yarn handling
2 participants