Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: convert stories to CSF format for typescript stories (#253)
* update storybook packages to 5.3.9 * update storybook config files to 5.3 convention the addon.ts and config.ts file name convention from <=5.2 has been deprecated * add necessary dependencies for custom jscodeshift codemods * remove unused @storybook/addon-options dependency * fork stories-of-to-csf.js * remove deprecated @storybook/addon-options that was not being used * Don't run pretter when parser is ts or tsx * add script to run the jscodeshift transform * make storiesof-to-csf.js work for tsx files The tsx parser AST the word "StringLiteral" instead of "Literal", which the js parser AST uses. Because of this, the `storiesOf` stories were being filtered out, and nothing was being modified. Now it works for tsx. * run storiesof-to-csf.js on the component library stories * use the Storybook 5.3 main.js format for finding stories it seems necessary for CSF to work. note that this path is much less flexible than the current one: it only looks for stories in packages/component-library/ I couldn't get the regex or glob to work in the new format, so this will fixed in a later release. Currently this is the only directory where stories are found. * remove some unused and unecessary exports, so that the conversion script will work * rerun storiesof-to-csf, this time upgrading remaining stories * sort stories using latest recommend method This is described in https://github.com/storybookjs/storybook/blob/master/lib/ui/README.md * move transform script to a neater location * run prettier Co-authored-by: Seb Pearce <sebpearce@gmail.com>
- Loading branch information