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

chore(storybook): update v1 syntax to use Storybook v6 #568

Merged

Commits on Aug 22, 2024

  1. chore(storybook): update v1 syntax to use Storybook v6

    - while the deps used Storybook v6, the configuration and stories themselves were still on a legacy v5 format
      - v6 had backward compat for v5, but v7 does not, so this needs upgrading/migrating
        - or well, v7 has some legacy mode for it that can be enabled with some config, but it is entirely gone in v8
      - migrate `storiesOf` to CSF per https://storybook.js.org/docs/7/migration-guide#storiesof-to-csf
        - then had to do a bunch of manual changes to get back mostly the same previous indentation (with some minor differences where there were mistakes or inconsistencies)
          - tried to keep the diff as small as possible
        - CSF is still valid through to latest v8
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    329a56f View commit details
    Browse the repository at this point in the history
  2. chore(storybook): convert v1 config to use Storybook v6

    - modified version of v2's config
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    d49e4a9 View commit details
    Browse the repository at this point in the history
  3. fixup config a bit -- take more from prev webpack config

    - `ts-loader` is necessary to handle the `import type` syntax
      - custom `tsconfig.json` doesn't seem necessary though
    - use same SASS config
    - plain CSS config not needed though bc PostCSS already runs by default
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    704c2c2 View commit details
    Browse the repository at this point in the history
  4. rename to .stories.tsx and remove index

    - the conventional format
      - also had some problems finding stories without this change
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    3def63d View commit details
    Browse the repository at this point in the history
  5. fix deprecation warning re: storyName

    - per https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations
      - migrate `.story.name` -> `.storyName`
        - not sure why the automigration didn't do this and instead used the deprecated name 😕
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    73faf46 View commit details
    Browse the repository at this point in the history
  6. also fix history deprecation warning

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    5132972 View commit details
    Browse the repository at this point in the history
  7. attempt to load CSS properly but still fail

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    a9cc062 View commit details
    Browse the repository at this point in the history
  8. improve perf with built in loader for TS

    - remove `ts-loader` as not necessary
    - plus some settings for Storybook's TS loader preset
    
    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    8db46bd View commit details
    Browse the repository at this point in the history
  9. diff reduction

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    e6e2da1 View commit details
    Browse the repository at this point in the history
  10. more diff reduction

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    166bc0a View commit details
    Browse the repository at this point in the history
  11. more diff reduction

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    c93f6d0 View commit details
    Browse the repository at this point in the history
  12. attempt to reduce diff a bit more hackily

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    c758f0c View commit details
    Browse the repository at this point in the history
  13. one more diff reduction with one hackishness

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    62abbf8 View commit details
    Browse the repository at this point in the history
  14. diff reduction with older wacky syntax

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    460c1b3 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    ae3a40f View commit details
    Browse the repository at this point in the history
  16. last diff reduction/indentation change

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    51b30ec View commit details
    Browse the repository at this point in the history
  17. missing trailing comma

    Signed-off-by: Anton Gilgur <[email protected]>
    agilgur5 committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    80f3ce9 View commit details
    Browse the repository at this point in the history