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

Automigrations: GFM fails with complex addon object #21286

Closed
2 tasks
shilman opened this issue Feb 28, 2023 · 2 comments · Fixed by #21731
Closed
2 tasks

Automigrations: GFM fails with complex addon object #21286

shilman opened this issue Feb 28, 2023 · 2 comments · Fixed by #21731

Comments

@shilman
Copy link
Member

shilman commented Feb 28, 2023

Describe the bug

The GFM automigration fails on a main.js that contains a complex addons config, such as the following:

const postcssConfig = require('../postcss.config');

module.exports = {
    addons: [
        {
            name: '@storybook/addon-postcss',
            options: {
                postcssLoaderOptions: {
                    ...postcssConfig,
                    implementation: require('postcss')
                }
            }
        },

It tries to parse the addons field into an array, append an addon string to the array, and then set it again in the ConfigFile object.

  • it should not parse addons and should append the string to the addons array in the AST to work around this issue.
  • if the automigration fails anyway, it should produce a better error message stating the failure and the manual workaround

To Reproduce

https://github.com/inkline/inkline/blob/85c694daebf4eb18462988876d89ab95e4a0ab78/.storybook/main.js#L10-L18

System

No response

Additional context

No response

@tmeasday
Copy link
Member

tmeasday commented Mar 1, 2023

I'll also note it claimed to work:

Image

@shilman shilman moved this to Required for GA in Core Team Projects Mar 3, 2023
@shilman shilman self-assigned this Mar 21, 2023
@shilman shilman moved this from Required for GA to Nice to have in Core Team Projects Mar 21, 2023
@shilman shilman moved this from Nice to have to Stabilization in Core Team Projects Mar 21, 2023
@shilman shilman moved this from Stabilization to In Progress in Core Team Projects Mar 22, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Core Team Projects Mar 22, 2023
@shilman
Copy link
Member Author

shilman commented Mar 22, 2023

Shiver me timbers!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-rc.6 containing PR #21731 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb@next upgrade --prerelease

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants