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

Add package.json scripty options support for npm7 #94

Closed
wants to merge 2 commits into from

Conversation

Chocobozzz
Copy link

Closes #93

@jasonkarns
Copy link
Member

Looks good so far. Does npm7 document or guarantee that package_json_path will be absolute?

@rosston
Copy link
Member

rosston commented Mar 8, 2021

@jasonkarns I'm not sure it's a guarantee, but the RFC says that npm_package_json will come from @npmcli/run-script, which uses resolve in its implementation and therefore provides an absolute path.

Copy link
Member

@jasonkarns jasonkarns left a comment

Choose a reason for hiding this comment

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

Just a single nitpick: typically prefer to camelCase function names, which necessitates lowercasing the N+1 chars of an initialism. so packageJson instead of packageJSON

Do you also have a rationale for expanding the if/elseif into distinct if conditionals? Functionally, they're the same; though "spiritually" they are a single if-elseif statement. If JavaScript had expression-valued-conditionals, ala ruby, it would be a single if-elseif by necessity.

Otherwise, I'm 👍 and appreciative!

lib/load-option.js Outdated Show resolved Hide resolved
lib/load-option.js Outdated Show resolved Hide resolved
lib/load-option.js Outdated Show resolved Hide resolved
lib/load-option.js Outdated Show resolved Hide resolved
lib/load-option.js Outdated Show resolved Hide resolved
@Chocobozzz
Copy link
Author

Chocobozzz commented Mar 9, 2021

Do you also have a rationale for expanding the if/elseif into distinct if conditionals? Functionally, they're the same; though "spiritually" they are a single if-elseif statement. If JavaScript had expression-valued-conditionals, ala ruby, it would be a single if-elseif by necessity.

Not really, it's just that with 4 if I found that it was more readable to understand the multiple fallbacks. Thanks @jasoncaryallen for the review and the fixes :)

@Chocobozzz
Copy link
Author

Any news @jasonkarns? :)

@ben8p
Copy link

ben8p commented Sep 2, 2021

Is scripty still maintained ?

This is quite of a blocker for people using npm 7

@rosston
Copy link
Member

rosston commented Apr 8, 2022

Closing because I think this is resolved in scripty 2.1.0 (via #105). Feel free to comment/reopen if this is not actually fixed!

@rosston rosston closed this Apr 8, 2022
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.

Options won't work with npm >= 7
4 participants