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

fix(npm): run pre and post tasks if present #19178

Merged
merged 3 commits into from May 18, 2023

Conversation

marvinhagemeister
Copy link
Contributor

This PR optionally runs pre and posts tasks from package.json if available.

Fixes #19157

@bartlomieju bartlomieju requested a review from dsherret May 18, 2023 10:56
@marvinhagemeister
Copy link
Contributor Author

Amended a couple more test cases.

cli/tools/task.rs Outdated Show resolved Hide resolved
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Can you add a test that ensure that pre- and post- scripts are not automatically run from deno.json. This feature is fine for compatibility with npm, but I'm not in favor of adding it to Deno's tasks.

@marvinhagemeister
Copy link
Contributor Author

@bartlomieju the changes in this PR only affect scripts from package.json because they're guarded by an earlier check here https://github.com/denoland/deno/pull/19178/files#diff-25b821ac9f791d719c4d772c106c89752c2da633d53159d615e048990ccc9613L68 Happy to add tests that it doesn't affect tasks from deno.json nonetheless.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @marvinhagemeister!

@dsherret dsherret merged commit 66d25df into denoland:main May 18, 2023
11 checks passed
@marvinhagemeister marvinhagemeister deleted the npm-pre-post-scripts branch May 18, 2023 20:10
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.

[npm] Pre and post scripts are not executed
4 participants