Support for JS Package Manager updates#107
Merged
sighmon merged 2 commits intosighmon:masterfrom May 12, 2023
Merged
Conversation
…nged to get the path with yarn bin mjml bin instead.
32fea54 to
301ad79
Compare
Author
|
@sighmon |
Owner
|
@yuta-hayashi Sorry for the delay - I'll have time this weekend to look through it. |
sighmon
approved these changes
May 12, 2023
Owner
sighmon
left a comment
There was a problem hiding this comment.
Looks great to me thanks @yuta-hayashi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: #104
As explained in #104, the behavior of
yarn binhas changed since yarn 2. Also, thenpm bincommand has been removed since npm 9.This PR has been modified to support the new versions of yarn and npm as follows.
For yarn, the
yarn bin mjmlcommand outputs the full path to the mjml binary, so use that.However, npm does not have such a command, and
npxandnpmexec have more overhead than executing the binary directly.So I used the
npm rootcommand to get the full path of the local node_modules and appended the.bindirectory. This is the same path as the result of executingnpm bin.Also, the
npm rootcommand works with npm 6~9.Refs:
https://docs.npmjs.com/cli/v9/commands/npm-root
https://docs.npmjs.com/cli/v9/configuring-npm/folders?v=true#executables
And I removed the
bin_path_frommethod that was common to yarn and npm because of the difference in execution commands and processing.It works correctly in my Rails Project using npm9, and I have verified it with yarn 2.