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

Addon-onboarding: Move onboarding to monorepo #26176

Merged
merged 391 commits into from
Feb 27, 2024
Merged

Addon-onboarding: Move onboarding to monorepo #26176

merged 391 commits into from
Feb 27, 2024

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Feb 23, 2024

Closes #26096

What I did

Merge this repo (https://github.com/storybookjs/addon-onboarding) into monorepo, with history.

  • Fixes for typescript
  • Fixes for compile
  • Add to workspace
  • Bump version installed by CLI
  • Fix verdaccio config
  • Sync versions
  • Remove unused dependencies

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

I was able to manually test this to some degree, via:

  • comment out these lines:
    const hasButtonStories =
    !!api.getData('example-button--primary') ||
    !!document.getElementById('example-button--primary');
    if (!hasButtonStories) {
    console.warn(
    `[@storybook/addon-onboarding] It seems like you have finished the onboarding experience in Storybook! Therefore this addon is not necessary anymore and will not be loaded. You are free to remove it from your project. More info: https://github.com/storybookjs/addon-onboarding#uninstalling`
    );
    return;
    }
    if (!isOnboarding || window.innerWidth < 730) {
    return;
    }
  • add '@storybook/addon-onboarding', to code/ui/.storybook/main.ts's addon field
  • compile packages
  • run yarn storybook:ui --initial-path=/onboarding
  • expect to see the onboarding UI

The second was to test would be to generate a sandbox that would normally show the onboarding addon.

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

More information
Published version 0.0.0-pr-26176-sha-e072ee44
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch monorepo-migration
Commit e072ee44
Datetime Tue Feb 27 13:47:55 UTC 2024 (1709041675)
Workflow run 8065797916

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

@storybookjs/core and others added 30 commits June 8, 2023 09:25
Use the correct event to detect args change
@ndelangen
Copy link
Member Author

@SocketSecurity ignore npm/readline-sync@1.4.10
@SocketSecurity ignore npm/ms@2.1.2
@SocketSecurity ignore npm/estraverse@4.3.0
@SocketSecurity ignore npm/istanbul-lib-report@3.0.1
@SocketSecurity ignore npm/istanbul-lib-source-maps@4.0.1
@SocketSecurity ignore npm/update-browserslist-db@1.0.13
@SocketSecurity ignore npm/cross-spawn@7.0.3
@SocketSecurity ignore npm/merge-stream@2.0.0
@SocketSecurity ignore npm/ajv@8.12.0
@SocketSecurity ignore npm/react-is@18.2.0
@SocketSecurity ignore npm/address@1.2.2
@SocketSecurity ignore npm/depd@2.0.0
@SocketSecurity ignore npm/ejs@3.1.9
@SocketSecurity ignore npm/pretty-format@27.5.1
@SocketSecurity ignore npm/react@18.2.0
@SocketSecurity ignore npm/react-dom@18.2.0
@SocketSecurity ignore npm/foreground-child@3.1.1
@SocketSecurity ignore npm/jake@10.8.7
@SocketSecurity ignore npm/ejs@3.1.8
@SocketSecurity ignore npm/syntax-error@1.4.0
@SocketSecurity ignore npm/jsonwebtoken@9.0.2
@SocketSecurity ignore npm/tsup@6.7.0
@SocketSecurity ignore npm/esbuild-register@3.5.0
@SocketSecurity ignore npm/window-size@1.1.1
@SocketSecurity ignore npm/playwright-core@1.36.0
@SocketSecurity ignore npm/nx@17.0.2
@SocketSecurity ignore npm/trash@7.2.0
@SocketSecurity ignore npm/node-gyp@9.4.1
@SocketSecurity ignore npm/playwright@1.36.0
@SocketSecurity ignore npm/json-parse-even-better-errors@3.0.1
@SocketSecurity ignore npm/simple-git@3.22.0

@ndelangen ndelangen marked this pull request as ready for review February 24, 2024 12:08
@shilman shilman changed the title Maintenance: Add addon-onboarding into monorepo Addon-onboarding: Move onboarding into monorepo Feb 25, 2024
@shilman shilman changed the title Addon-onboarding: Move onboarding into monorepo Addon-onboarding: Move onboarding to monorepo Feb 25, 2024
@@ -0,0 +1,8 @@
function managerEntries(entry = []) {
Copy link
Member

@shilman shilman Feb 25, 2024

Choose a reason for hiding this comment

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

I know this PR is just porting over the existing code, but any idea why this is needed? If there is a good reason we should add a comment here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have no idea.

We'd have to ask the authors @yannbf or @valentinpalkovic ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@shilman Could you please be a bit more precise about what exactly you are referring to? Are you saying that the managerEntries should just be exported in the src/preset.ts file like described here: https://storybook.js.org/docs/addons/writing-presets#root-level-presets? I don't understand the intention of your question.

ndelangen and others added 2 commits February 27, 2024 14:28
@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Feb 27, 2024

@ndelangen

Tested it in a Vite and Webpack project. In Webpack everything seems to be fine. In Vite, though, I can't continue on this step:

image

Somehow I don't get notified about the new Warning Story.

How to reproduce:

  1. Checkout https://github.com/storybookjs/sandboxes/tree/next/react-vite/default-ts/before-storybook
  2. npx storybook@0.0.0-pr-26176-sha-e072ee44 init
  3. Go through the onboarding

Note: I also checked out the latest released version of addon-onboarding (2.0.0-next.2) and there it works for both, Webpack5 and Vite React-based projects.

@yannbf
Copy link
Member

yannbf commented Feb 27, 2024

@ndelangen

Tested it in a Vite and Webpack project. In Webpack everything seems to be fine. In Vite, though, I can't continue on this step...

I just tested this in different projects, including the one mentioned in the repro, and had no issues:
image

Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

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

LGTM

@ndelangen ndelangen merged commit 02dbecf into next Feb 27, 2024
55 of 58 checks passed
@ndelangen ndelangen deleted the monorepo-migration branch February 27, 2024 17:44
@github-actions github-actions bot mentioned this pull request Feb 27, 2024
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move @storybook/addon-onboarding to monorepo
7 participants