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

Updating fork-ts-checker-webpack-plugin to v5.x #12701

Closed
maneetgoyal opened this issue Oct 8, 2020 · 8 comments
Closed

Updating fork-ts-checker-webpack-plugin to v5.x #12701

maneetgoyal opened this issue Oct 8, 2020 · 8 comments

Comments

@maneetgoyal
Copy link

Is your feature request related to a problem? Please describe

Will be great the fork-ts-checker-webpack-plugin can be updated to v5 in the future. It allows a concise way of overriding include field in tsconfig.json via configOverwrite to allow easier type-checking of story files (*.stories.ts).

Describe the solution you'd like

I was hoping to do something like:

// .storybook/main.js
module.exports = {
  ...
  typescript: {
    check: true, // Enabling fork-ts-checker-webpack-plugin for unlocking type-checking
    checkOptions: {
       typescript: {
         configOverwrite: { include: ["./src/**/*.stories.tsx"] }
       }
    }
  },
}

Describe alternatives you've considered

Other solutions that I tried seemed a little lengthy. I'd prefer not to modify the default Storybook Webpack config whenever possible.

Another (working) solution I tried is:

// .storybook/main.js
module.exports = {
  ...
  typescript: {
    check: true, // Enabling fork-ts-checker-webpack-plugin for unlocking type-checking
    checkOptions: {
        checkOptions: {
        tsconfig: "./tsconfig.storybook.json",
      },
    }
  },
}
// tsconfig.storybook.json
{
  "extends": "./tsconfig.json",
  "include": ["./src/**/*.stories.tsx"]
}

Are you able to assist to bring the feature to reality?

Can help with testing once it is installed onto master.

Additional context

#11804 (comment)

@sakit0
Copy link
Contributor

sakit0 commented Oct 20, 2020

@shilman
Can I try this?

@maneetgoyal
Copy link
Author

Hello all, a little heads up: fork-ts-checker-webpack-plugin recently released a 6.x pre-release (-alpha.1) which addresses TypeStrong/fork-ts-checker-webpack-plugin#36 as mentioned here: TypeStrong/fork-ts-checker-webpack-plugin#36 (comment). That fix is quite useful in Storybook's watch (start-storybook) mode as it makes the type checking feature more complete.

@stale
Copy link

stale bot commented Dec 25, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Dec 25, 2020
@gaetanmaisse gaetanmaisse self-assigned this Jan 25, 2021
@stale stale bot removed the inactive label Jan 25, 2021
@gaetanmaisse
Copy link
Member

I will take a look at that in the next couple of days 😉

@shilman
Copy link
Member

shilman commented Jan 29, 2021

cc @phated

@gaetanmaisse
Copy link
Member

I think we will need to wait for Storybook 7.0 to be able to update this dependency as the options format changed between fork-ts-checker-webpack-plugin 4 and 5, as these options are part of the Storybook configuration via .storybook/main.js. it will be a breaking change on Storybook side too.

@maneetgoyal
Copy link
Author

Hi @shilman, is this being considered for 7.x?

@shilman
Copy link
Member

shilman commented Dec 16, 2021

@maneetgoyal this is done. Storybook has a builder for webpack4 which is the default and ships with fork-ts-checker-webpack-plugin 4.x, and a builder for webpack5 that's currently opt-in and ships with 6.x. In 7.0, either webpack5 will become the default or there will be no default and everything will be opt in. Closing this issue--let me know if there is any follow up needed.

@shilman shilman closed this as completed Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants