feat: Add package_manager
option to set manager in the config
#87
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.
This PR would add a
package_manager
option to the configuration of the action to manually specify the package manager to use and skip auto detection. Issue #77.Details
Although the
script
option is useful for specifying the script to use to configure the size-limit script to run and can be used in monorepos to only run a specific workspace (usingyarn workspace package1 size-limit --json
for instance), this still runs the install and build scripts on the entire repo which can drastically increase build times for larger monorepos and add increase costs. We tried usingdirectory
option to specific just the directory to run, but in doing so the yarn.lock file is not in those subfolders sonpm
was used which didn't work in our repo.This new option allows users to manually specify the package manager to use such as
yarn
in this situation, allowing us to combinedirectory
option with a monorepo to just build and install a single subpackage reducing time and costs and allowing for more configuration of the tool.Tests
I have created a small test repo to show the use case my team is using, with two actions one using the original action and another using this PR. In the repo I blocked npm usage to show the action failing that is calling npm and the PR will succeed since
package_manager: yarn
is used in the config.PilotConway/size-limit-monorepo-test#1