Closed PilotConway closed 2 years ago
Hi, @andresz1 👋
I see, we have package_manager
in a documentation, but we haven't got this property in a last version (current is 1.7.0) =(
Could we release minor version?
Thanks, and thanks @PilotConway for PR :)
Hi @andresz1
could you please release a new version of this wonderful package? 🙏
We really miss this package_manager
feature as it allows to run size-limit-action
within monorepo package.
There is a hacky workaround, though. We currently create fake yarn.lock
to let action detect yarn
automatically, but we struggles, especially as feature in the documentation but not in the npm.
Thank you in advance!
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.https://github.com/PilotConway/size-limit-monorepo-test/pull/1