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: add shell executor interface for running shell commands during recipe execution #4326

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

natedanner
Copy link
Contributor

What's changed?

Adding a default executor for running npm commands in code mod recipes.

What's your motivation?

Standardize execution of npm commands in codemod recipes and allow for customization of the environment the commands are running in. The moderne platform needs to be able to customize the environment when running codemods recipes on the moderne platform to allow custom registries.

Duplicate shell running code in these code mod repos.
https://github.com/moderneinc/rewrite-codemods/blob/main/src/main/java/org/openrewrite/codemods/NodeBasedRecipe.java#L111
https://github.com/moderneinc/rewrite-codemods-ng/blob/main/src/main/java/org/openrewrite/codemods/migrate/angular/NodeBasedRecipe.java#L150

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@timtebeek timtebeek added the enhancement New feature or request label Jul 14, 2024
@natedanner natedanner force-pushed the feat/npm-executor-for-codemods branch from f24c34f to d54b8df Compare July 15, 2024 16:35
@natedanner natedanner changed the title feat: add default npm executor and context view for code mod recipes feat: add shell executor interface for running shell commands during recipe execution Jul 15, 2024
@natedanner natedanner force-pushed the feat/npm-executor-for-codemods branch from d54b8df to 636e51a Compare July 15, 2024 16:38
@natedanner natedanner requested a review from timtebeek July 15, 2024 16:38
@natedanner natedanner force-pushed the feat/npm-executor-for-codemods branch from 636e51a to 49a4c63 Compare July 15, 2024 16:53
@natedanner natedanner force-pushed the feat/npm-executor-for-codemods branch from 49a4c63 to dc50e11 Compare July 15, 2024 20:26
@natedanner natedanner merged commit 4299aff into main Jul 15, 2024
2 checks passed
@natedanner natedanner deleted the feat/npm-executor-for-codemods branch July 15, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants