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

Support list mode within install command #80

Open
g-elwell opened this issue May 3, 2023 · 1 comment
Open

Support list mode within install command #80

g-elwell opened this issue May 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@g-elwell
Copy link
Member

g-elwell commented May 3, 2023

The feature

Currently, the install command offered by the build tools will recursively run npm install across all projects.

Similar to the build command, this isn't always preferable. For example you may have installed a plugin that was build using the build tools and is detected as a project, but has built assets already.

This has came up for me on a project that has transitioned into a multisite. Originally the build tools were running within the theme directory, but now that multiple themes might exist, it makes sense to run the build tools from the project root.

This project also contains a few plugins that the build tools sees as projects, so we're using list mode to ensure that only the themes are built. Without list support for the install command, we need to rely on navigating through directories to run npm install, and having each install command listed in the ci config.

Alternative approaches

We can hook into the preinstall npm script to run npm install on our themes, e.g:

"preinstall": "(cd themes/parent-theme && npm i) && (cd themes/child-theme && npm i)",

This works well locally and should run in CI too, but if we support 'all projects' mode during install I think we should support 'list' mode too.

In fact, it probably makes sense that the project discovery logic and checks which are currently running within the build command should be extracted and shared to run across all commands.

@ampersarnie ampersarnie added the enhancement New feature or request label May 5, 2023
@ampersarnie
Copy link
Member

@g-elwell Absolutely see the need for this. I'll start planning it in for a release.

@ampersarnie ampersarnie changed the title [Feature]: Support list mode within install command Support list mode within install command Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

2 participants