* fix: prefer .pnpmfile.mjs by default
* fix: handle ERR_MODULE_NOT_FOUND for missing optional .pnpmfile.mjs
Node's dynamic import() throws ERR_MODULE_NOT_FOUND (not MODULE_NOT_FOUND
like require()) when a file doesn't exist. This caused a hard error when
tryLoadDefaultPnpmfile was enabled and .pnpmfile.mjs was absent.
* fix: load only .pnpmfile.mjs when it exists, not both .mjs and .cjs
When both .pnpmfile.mjs and .pnpmfile.cjs exist, only the .mjs file
is now loaded. Previously both were loaded and their hooks combined.
Also adds .mjs support for config dependency plugins.
* fix: `shamefullyHoist` set via `updateConfig` in `.pnpmfile.cjs`
* refactor: consolidate derived config processing to cli-utils
Move shamefullyHoist → publicHoistPattern conversion from
config/config to cli-utils/getConfig.ts as suggested in review.
* test(config): update tests for derived config processing move
* refactor: move applyDerivedConfig to cli-utils
* refactor: move applyDerivedConfig to cli-utils
* test: use unit test for hoist: false in cli-utils
* revert: not needed changes
close#10271
* fix: fix packageManager field not working with prerelease version
* fix: remove hash from packageManager reference
* test: install should not fail for packageManager field with hash
* fix: packageManager field may contain URL instead of semver
corepack uses `URL.canParse()` to check if a given value is a URL or semver,
which was only added in recent Node versions and
is not supported by all node versions `"node" >= "18.12"` that pnpm supports.
So instead, we check if the value contains ':'
as it may not appear on semver, while it must appear on URL.
* test: install should not fail for packageManager field with url
* test: checking prerelease versions in package-is-installable
* fix: typo
---------
Co-authored-by: Zoltan Kochan <z@kochan.io>
* feat!: check the packageManager field
* test: fix
* refactor: update error message to match what corepack prints
* feat: add pm-strict option
* refactor: pm-strict=>package-manager-strict
* fix: remove packageManager field from package.json on publish