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

Supplying more arguments for npm install #132

Closed

Conversation

computerlove
Copy link
Contributor

In our CI build we run

npm ci --cache $CACHE_DIR/.npm --prefer-offline 

This code outlines support for supplying more arguments for the install-step.

quarkus.quinoa.install-arguments=--cache $CACHE_DIR/.npm --prefer-offline
[INFO] --- quarkus-maven-plugin:2.10.1.Final:build (default) @ swarm-overview ---
[INFO] [io.quarkiverse.quinoa.deployment.PackageManager] Running Quinoa package manager install command: npm ci --cache $CACHE_DIR/.npm --prefer-offline
[INFO] [io.quarkiverse.quinoa.deployment.PackageManager] 
[INFO] [io.quarkiverse.quinoa.deployment.PackageManager] added 1571 packages in 1m

Any feedback on this feature?
I guess the same change should be done for all steps in the process.

@ia3andy
Copy link
Collaborator

ia3andy commented Jul 4, 2022

Thanks @computerlove, this is indeed a nice feature.

As the config is "hard" to change without impacting the consuming users, we shouldn't rush and consider the naming and usage carefully.

I've been thinking into improving the customization of package manager commands in the long run (and not just "install").
I believe it would be nice to have something close to the script section in the package.json. e.g.:

quarkus:
  package-manager:
     install-frozen: "npm ci --cache $CACHE_DIR/.npm --prefer-offline"
     // install: npm install (would still be the default)
     build-prod: "npm build-prod"
     build-dev: "npm build-dev"
     dev: "BROWSER=OFF npm dev" // default is "BROWSER=NONE npm start"

Instead of just the argument it would allow to edit the entire command (including envs) for one or more the available "actions". If not set if would keep the default (what we currently have).

To allow this, we might need to use something like https://commons.apache.org/proper/commons-exec/ and be careful about os compat.

Any thoughts? Maybe we should move this to a GitHub discussion?

@computerlove
Copy link
Contributor Author

Looks like a better solution!
A GitHub discussion is probably a good idea :)

@ia3andy
Copy link
Collaborator

ia3andy commented Jul 4, 2022

Closing (to be continued in a another larger feature PR): #133

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.

2 participants