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

add codemod for deprecated addon-links and addon-actions from app #1368

Merged
merged 5 commits into from
Sep 6, 2017

Conversation

kebot
Copy link
Contributor

@kebot kebot commented Jun 27, 2017

Issue:

Part of #1268

What I did

add a Codemod to help developers easily migration to v3.0

How to test

You can play around the codemod here:
https://astexplorer.net/#/gist/0f953dcda14eaed7df453ead00a25479/318680017de50a980ff95bd83c310bbb58631090

@kebot kebot changed the title add migration tool for deprecate addon-links and addon-actions feat: add migration tool for deprecate addon-links and addon-actions Jun 27, 2017
@usulpro
Copy link
Member

usulpro commented Jun 28, 2017

Thanks @kebot!
But looks like we have migration tool here: https://github.com/storybooks/storybook/blob/master/lib/cli/generators/UPDATE_PACKAGE_ORGANIZATIONS/index.js
(see MIGRATION.md)
Could you check is this feature already included in it?

@kebot
Copy link
Contributor Author

kebot commented Jun 29, 2017

@usulpro No, it only changes the org name from "@kadira" to "@storybook".
My PR is part of the migration tool from v2.0 to v3.0, not familiar with the CLI tool. Maybe @tmeasday can help.

@tmeasday
Copy link
Member

I think @ndelangen and @aaronmcadam wrote the original codemod, so they can correct me if I am wrong, but my understanding is that it just changes the names of the packages you import from, rather than any code changes like @kebot proposes here.

This looks great!

@ndelangen
Copy link
Member

This is fantastic!!!
Sorry this went unnoticed by me for so long, my github notifications are a mess 😓

Copy link
Member

@ndelangen ndelangen left a comment

Choose a reason for hiding this comment

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

I love the tests mate, WOW!

@ndelangen
Copy link
Member

ndelangen commented Jul 11, 2017

I'm missing some documentation on this change, do you think you can add it?

How does a user execute this? or is this an unsolved problem right now?

If not, that's ok, I can write something then, thank you @kebot

@codecov
Copy link

codecov bot commented Jul 11, 2017

Codecov Report

Merging #1368 into master will increase coverage by 0.15%.
The diff coverage is 65.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1368      +/-   ##
==========================================
+ Coverage   21.16%   21.32%   +0.15%     
==========================================
  Files         252      257       +5     
  Lines        5711     5739      +28     
  Branches      671      685      +14     
==========================================
+ Hits         1209     1224      +15     
+ Misses       3997     3995       -2     
- Partials      505      520      +15
Impacted Files Coverage Δ
...stfixtures__/move-buildin-addons/default.output.js 0% <0%> (ø)
...estfixtures__/move-buildin-addons/default.input.js 0% <0%> (ø)
...ures__/move-buildin-addons/with-no-change.input.js 0% <0%> (ø)
...res__/move-buildin-addons/with-no-change.output.js 0% <0%> (ø)
lib/codemod/src/transforms/move-buildin-addons.js 100% <100%> (ø)
app/vue/src/server/config/babel.js 0% <0%> (-100%) ⬇️
app/vue/src/server/babel_config.js 0% <0%> (-77.42%) ⬇️
lib/components/src/navigation/menu_link.js 0% <0%> (ø) ⬆️
lib/ui/src/modules/ui/configs/init_panels.js 25% <0%> (ø) ⬆️
.../src/manager/containers/CommentsPanel/dataStore.js 34.97% <0%> (ø) ⬆️
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b34c32...54c7dc9. Read the comment docs.

@ndelangen
Copy link
Member

@aaronmcadam Do you have some thoughts on how to enable this from the CLI?

@aaronmcadam
Copy link
Contributor

I don't know how the CLI works @ndelangen, I've not had a chance to look at it. Would it make sense to add this as an extra step in the codemod we already have?

@tmeasday
Copy link
Member

We may as well continue in the pattern from 3.0 and make getstorybook run the latest set of codemods if you already have storybook installed when you run it?

We may need to update the CLI to understand which codemods have been run before (maybe it just looks at storybook version before and after), but it seems sensible?

@ndelangen ndelangen self-assigned this Aug 25, 2017
@ndelangen ndelangen changed the title feat: add migration tool for deprecate addon-links and addon-actions add codemod for deprecated addon-links and addon-actions Aug 25, 2017
@ndelangen ndelangen changed the title add codemod for deprecated addon-links and addon-actions add codemod for deprecated addon-links and addon-actions from app Aug 25, 2017
@ndelangen ndelangen merged commit 7b4c192 into storybookjs:master Sep 6, 2017
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.

5 participants