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

feat(nx-plugin): add migration schematic #2692

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

devinshoemaker
Copy link
Contributor

This change adds a new schematic that generates a migration for an Nx plugin. The user can specify the version for the migration, and optionally add a custom name, description, and whether or not to include package.json updates.

Examples:

nx g @nrwl/nx-plugin:migration --project=ionic-react --version=1.2.0
nx g @nrwl/nx-plugin:migration fix-files-1.2.0 --project=ionic-react --version=1.2.0

@devinshoemaker devinshoemaker force-pushed the nx-plugin-migration-schematic branch 4 times, most recently from ce4842f to 62013d0 Compare March 20, 2020 20:24
@Cammisuli Cammisuli self-assigned this Mar 20, 2020
@Cammisuli Cammisuli self-requested a review March 20, 2020 22:33
@devinshoemaker devinshoemaker force-pushed the nx-plugin-migration-schematic branch 4 times, most recently from dfbff79 to 3ee9dbc Compare March 23, 2020 16:33
@devinshoemaker
Copy link
Contributor Author

Update: small e2e test improvement, and rebased onto latest master.

@devinshoemaker devinshoemaker force-pushed the nx-plugin-migration-schematic branch 3 times, most recently from 9b328b2 to 6b904c7 Compare March 25, 2020 13:58
Copy link
Member

@Cammisuli Cammisuli left a comment

Choose a reason for hiding this comment

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

Thanks @devinshoemaker! Everything looks good, but there's one thing to make sure this works well for everyone.

Since migrations.json is a new asset file, you're going to have to modify the assets property in the workspace.json to include the migrations file (similar to builders.json and collection.json).

Also, we removed docs for web, so you might want to rebase on master and regenerate. (Delete the web doc if it doesn't remove it)

@devinshoemaker
Copy link
Contributor Author

Since migrations.json is a new asset file, you're going to have to modify the assets property in the workspace.json to include the migrations file (similar to builders.json and collection.json).

Do you want the same kind of change to be applied in #2708?

@devinshoemaker
Copy link
Contributor Author

devinshoemaker commented Mar 30, 2020

migrations.json is added by default to a generated nx-plugin, so it sounds like you want to support adding migrations to libs that weren't generated with nx-plugin. I'm happy to make the change, but if you want the "schematic" schematic to work the same way then it sounds like I would need to make a similar change over there.

EDIT
Never mind, I misread the code at first and am on the same page now. 👍

This change adds a new schematic that generates a migration for an Nx plugin. The user can specify the version for the migration, and optionally add a custom name, description, and whether or not to include package.json updates.
@devinshoemaker
Copy link
Contributor Author

Requested changes made, rebased, and documentation regenerated.

Copy link
Member

@Cammisuli Cammisuli left a comment

Choose a reason for hiding this comment

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

LGTM!

@Cammisuli Cammisuli merged commit e44af49 into nrwl:master Apr 16, 2020
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants