Commit Graph

63 Commits

Author SHA1 Message Date
Maël Nison 77fff3c1f3
Disables auto-pinning by default (#709)
* Disables auto-pinning by default

* Updates tests

* Updates the README
2025-05-16 19:14:38 +02:00
Antoine du Hamel 9b95b46f05
feat: add support for `.corepack.env` (#642) 2025-02-28 19:25:03 +00:00
Antoine du Hamel b456268851
feat: add limited support for `devEngines` (#643) 2025-02-28 20:06:33 +01:00
Thomas Scholtes b0608d1a60
chore(tests): remove temporary directories in test teardown (#662) 2025-02-28 12:09:16 +01:00
Antoine du Hamel d26a552daa
chore(tests): split `invalid_signature` test in two (#651)
Ranges and tags are not the same thing, it can be useful to have two
different tests in case only one of them fail.
2025-02-12 10:14:34 +00:00
Thomas Scholtes 7b193d8498
chore(tests): fix string matching expectations (#648)
Vitest does not support matching a regex with a string, it would fail to report unmatched output.
2025-02-12 10:01:48 +00:00
Antoine du Hamel 91ea527475
chore(test): fix some custom registry tests (#649)
Co-authored-by: Thomas Scholtes <geigerzaehler@axiom.fm>
2025-02-11 18:56:39 +01:00
Antoine du Hamel 12e77e5069
fix: do not resolve fallback descriptor when `packageManager` is defined (#632) 2025-02-08 18:55:54 +01:00
Antoine du Hamel eb63873c6c
fix: fallback to `shasum` when `integrity` is not defined (#542)
Some npm registries do not define an `integrity` field, in which case
we can try using the `shasum` field instead.
2024-07-21 16:38:30 +02:00
Kristoffer K. 85e556a1a9
test: migrate to vitest (#349) 2024-07-16 23:31:15 +02:00
Antoine du Hamel 7b8e33ac01
chore(tests): do not use outdated `fs.rmdir` API (#487) 2024-05-31 10:15:34 +00:00
Kristoffer K 0f9b748640
fix!: call `executePackageManagerRequest` directly (#430)
* fix!: call `executePackageManagerRequest` directly

* Apply suggestions from code review

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* test: update assertions

---------

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-04-20 19:33:05 +02:00
stduhpf e033b5f36c
chore(tests): handle windows path formatting more gracefully (#460) 2024-04-16 16:07:23 +02:00
Antoine du Hamel 32a93ea4f5
fix: add path to `package.json` in error message (#456) 2024-04-15 18:17:33 +00:00
Jakob Ackermann c449adc818
feat: separate read and write operations on lastKnownGood.json (#446)
Also skip overwriting `lastKnownGood.json` with same content.

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-04-13 11:38:56 +00:00
Antoine du Hamel e561dd00bb
feat: verify integrity signature when downloading from npm registry (#432)
When the user has not provided any hash (so when running `corepack up`/`corepack use …`), and the package manager is downloaded from the npm registry, we can verify the signature.

BREAKING CHANGE: attempting to download a version from the npm registry (or a mirror) that was published using the now deprecated PGP signature without providing a hash will trigger an error. Users can disable the signature verification using a environment variable.
2024-04-12 22:49:11 +00:00
Antoine du Hamel 73d9a1e2d2
fix: correctly set `Dispatcher` prototype for `ProxyAgent` (#451)
In an attempt to bundle only a subset of Undici code, we forgot to take
some side-effect into account.
2024-04-12 23:27:26 +02:00
zhyupe 467216281e
fix: hash check when downloading Yarn Berry from npm (#439)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Maël Nison <nison.mael@gmail.com>
2024-04-01 14:27:26 +02:00
Antoine du Hamel d2677538cd
fix: re-add support for custom registries with auth (#397) 2024-03-27 19:23:43 +01:00
Maël Nison 8b6c6d4b2b
feat: Pins the package manager as it's used for the first time (#413)
* feat: Pins the package manager as it's used for the first time

* Adds a warning when auto-pinning the package manager version

* Updates wording
2024-03-03 13:50:18 +01:00
zhyupe 47be27c9db
fix: improve support for `COREPACK_NPM_REGISTRY` with Yarn Berry (#396) 2024-02-27 10:55:04 +01:00
Maël Nison 00506b2a15
fix: group the download prompt together (#391) 2024-02-21 21:24:13 +01:00
Antoine du Hamel 9834f5790a
fix: do not hard fail if Corepack home folder cannot be created (#382) 2024-02-21 04:15:14 +01:00
Antoine du Hamel 4a8ce6d42f
feat: add support for URL in `"packageManager"` (#359) 2024-02-20 09:11:52 +01:00
Antoine du Hamel d9c70b91f6
feat!: remove `--all` flag (#351)
Force users to opt-in into the package managers they want to support.
As more and more package managers are added to Corepack, it's more and
more unlikely that our users will be interested in _all_ the package
managers Corepack supports, and it is unreasonable to expect Corepack
maintainers would be able to perform security audits.
2024-02-17 01:35:11 +01:00
Antoine du Hamel 12f1c31a0d
chore(tests): use separate envs for each tests (#371) 2024-02-12 22:33:51 +00:00
Kristoffer K 65880cafed
fix: remove unsafe remove of install folder (#372)
* fix: remove unsafe remove of install folder

* test: update to use folderUtils

* perf: skip `existsSync` check
2024-02-11 21:13:45 +01:00
Antoine du Hamel b9eea589b4
chore(tests): add test that validates download warning is shown (#370) 2024-01-30 23:46:38 +00:00
Antoine du Hamel a56c13bd0b
feat: bump Known Good Release when downloading new version (#364) 2024-01-30 22:51:09 +00:00
Antoine du Hamel 4eb1fd92fb
chore(tests): increase timeout to get more green on Windows CI (#366)
For some reason this test times out quite frequently on Windows CI.
Hopefully if we give it more time to succeed, and we won't need to
restart Windows CI as often.
2024-01-30 18:55:55 +01:00
Maël Nison 9bee415081
feat: add support for rangeless commands (#338)
This diff makes it possible to run the CLI commands without an explicit range, in which case we use an implicit `*`, e.g.: `corepack install -g yarn`.
2023-12-29 13:00:38 +01:00
Kristoffer K 2533d12887
test: check that a semver version is required (#312) 2023-10-09 00:33:54 +02:00
Maël Nison fe3e5cd86c
Refactoring of the CLI interface (#291)
* Refactoring of the CLI interface

* Updates the Nock snapshots

* Regenerates the Nock files on Node 16

* Update README.md

* Adds --cache-only to corepack install -g

* Fixes hash generation
2023-08-28 22:01:48 +02:00
Kristoffer K be2489cd0a
feat: support ESM (#270) 2023-06-13 17:18:46 +02:00
Kristoffer K 17d1f3dd41
fix: don't override `process.exitCode` (#268)
* fix: don't override exit codes

* chore: update nock files
2023-05-24 00:31:58 +02:00
Antoine du Hamel 863e0e0a50
chore(deps): upgrade all npm dependencies (#266) 2023-05-19 09:37:31 +00:00
Gamadril 7b5f2f9fcb
fix: recreate cache folder if necessary (#200)
Fixes: https://github.com/nodejs/corepack/issues/198
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-10-28 04:53:10 +02:00
Kenrick 5eadc50192
feat: when strict checking is off, treat like transparent (#197) 2022-10-24 17:06:47 +02:00
Teppei Sato f06e23d758
test: refactor with expect.stringMatching() (#176) 2022-09-04 11:17:42 +02:00
Teppei Sato 5a0727b439
fix: handle tags including numbers in `prepare` command (#165)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-09-01 20:24:03 +02:00
Antoine du Hamel c0df287a57
chore: reduce test flakiness (#168) 2022-09-01 11:44:17 +02:00
Antoine du Hamel 92b52f6b49
feat: add `COREPACK_ENABLE_STRICT` env variable (#167) 2022-09-01 10:13:16 +02:00
Antoine du Hamel 055b92807f
feat: download the latest version instead of a pinned one (#134)
Fixes: https://github.com/nodejs/corepack/issues/93
2022-08-19 23:53:18 +02:00
Antoine du Hamel a79a7637d8
test: fix tests when default versions contain hashes (#143)
Refs: https://github.com/nodejs/corepack/pull/137
2022-07-09 01:10:50 +02:00
Antoine du Hamel 6a480a72c2
feat: add support for hash checking (#133)
Fixes: https://github.com/nodejs/corepack/issues/37
Co-authored-by: Maël Nison <nison.mael@gmail.com>
2022-07-09 00:42:16 +02:00
Kyle Herock da3ed402d0
Fixes `corepack prepare` when no additional arguments are passed (#99)
* chore: update sdks

This fixes ZipFS paths in VSCode 1.66

* fix: `prepare` should infer the project packageManager version when no spec is passed
2022-05-15 10:42:46 +02:00
Maël Nison 1d41c48480
chore: auto-sync package manager versions (#88)
* chore: auto-sync package manager versions

* Disables nock

* Removes check for newline
2022-02-07 22:47:09 +01:00
Kristoffer K 5cfc6c9df0
fix: handle parallel installs (#84)
* fix: handle parallel installs

* build: skip unnecessary shims
2022-02-02 23:25:33 +01:00
Maël Nison d6e3e652ed
Makes it possible to call arbitrary package manager versions from the Corepack CLI (#47) 2021-08-15 20:05:04 +02:00
Maël Nison b77ed59321
Set of tweaks (#38)
* Inlines tar rather than move it as a separate vendor

* Updates network queries
2021-07-05 12:05:32 +02:00