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

CLI: Add migrate command #7414

Merged
merged 8 commits into from
Jul 15, 2019
Merged

CLI: Add migrate command #7414

merged 8 commits into from
Jul 15, 2019

Conversation

shilman
Copy link
Member

@shilman shilman commented Jul 14, 2019

Issue: #1108

What I did

Add CLI migrate command:

Usage: migrate [options] [migration]

Run a storybook codemod migration on your source files

Options:
  -l --list         List available migrations
  -g --glob <glob>  Glob for files upon which to apply the migration (default: "**/*.js")
  -n --dry-run      Dry run: verify the migration exists and show the files to which it will be applied
  -h, --help        output usage information

How to test

./lib/cli/bin/index.js migrate --list"
./lib/cli/bin/index.js migrate convert-to-module-format --glob "lib/ui/**/*.stories.js"

@vercel
Copy link

vercel bot commented Jul 14, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://monorepo-git-1108-cli-migrate.storybook.now.sh

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

Run a storybook code migration from an addon

But if I am reading this right it is just reading codemods from lib/codemod/src/transforms -- is that right?

I'm OK with that but the comment may have to change

@shilman
Copy link
Member Author

shilman commented Jul 14, 2019

@tmeasday Thanks! That was an old version. Updated the comment (the code was already updated).

@shilman
Copy link
Member Author

shilman commented Jul 15, 2019

Interpreting @tmeasday 's comment as an approval, since I'm blocked on this.

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

Successfully merging this pull request may close these issues.

2 participants