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

Parameterize the command that install dependencies #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ilkecan
Copy link
Contributor

@ilkecan ilkecan commented Sep 25, 2021

Basically I want to be able to pass the --ignore-scripts flag. Normally just parameterizing npm flags would be better but one might want to use npm ci instead of npm install. One possibility is to replace npm install with npm ci, hard code the latter and take the flags with a parameter like npmFlags.

I also left --nodedir=${nodeSource nodejs} hardcoded since it is not possible to pass it otherwise since nodeSource is an internal function.

@ilkecan
Copy link
Contributor Author

ilkecan commented Sep 26, 2021

It seems npm ci doesn't run hook scripts, so it is not an option to make it replace npm install before resolving #110.

@ilkecan
Copy link
Contributor Author

ilkecan commented Sep 26, 2021

Actually I just realized even with the proposed changes the interface is not expressive enough for me. Ideally there should be a parameter named installCommands that defaults to [ "npm install --offline --nodedir=${nodeSource nodejs}" ], similar to buildCommands in npmlock2nix.build. But the problem is again, one can't reuse the --nodedir=${nodeSource nodejs}" part if they want to define the parameter themselves.

@ilkecan
Copy link
Contributor Author

ilkecan commented Sep 26, 2021

I just realized npmlock2nix has internal attribute, so it is actually possible to reuse nodeSource function. With this in mind, I think introducing installCommands is the better solution.

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.

1 participant