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(repair): add lerna repair command #3314

Merged
merged 2 commits into from Sep 29, 2022
Merged

feat(repair): add lerna repair command #3314

merged 2 commits into from Sep 29, 2022

Conversation

JamesHenry
Copy link
Member

Description

Adds a new command: lerna repair. This command will run any available migrations which have been designed to bring a lerna workspace up to date with the latest and greatest.

This PR does not ship with a real implementation of such a migration, so instead a noop example migration is provided to concretely illustrate how a migration is both written and unit tested within the lerna package.

NOTE: the implementation for the repair command is intentionally inlined into the lerna package. Because of the way migrations are orchestrated, having repair be its own package would result in a cyclical dependency between it and the core package. Plus, in general, we are not looking to continue with the pattern of having an ever-increasing number of tiny published packages.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (change that has absolutely no effect on users)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@JamesHenry JamesHenry marked this pull request as ready for review September 1, 2022 13:00
@@ -49,7 +49,10 @@ class Command {
chain = chain.then(() => this.configureOptions());
chain = chain.then(() => this.configureProperties());
chain = chain.then(() => this.configureLogging());
chain = chain.then(() => this.runValidations());
// For the special "repair" command we want to intitialize everything but don't want to run validations as that will end up becoming cyclical
Copy link
Contributor

Choose a reason for hiding this comment

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

Type: "intitialize" -> "initialize"

@JamesHenry JamesHenry marked this pull request as draft September 1, 2022 15:11
@JamesHenry
Copy link
Member Author

JamesHenry commented Sep 1, 2022

Blocked: This is pending a change on the repair implementation

Resolved

@JamesHenry JamesHenry marked this pull request as ready for review September 29, 2022 17:20
@JamesHenry JamesHenry merged commit 7defab3 into main Sep 29, 2022
@JamesHenry JamesHenry deleted the lerna-repair-2 branch September 29, 2022 18:22
rrhodes pushed a commit to rrhodes/lerna that referenced this pull request Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants