Commit Graph

110 Commits

Author SHA1 Message Date
Kristoffer K. cba690575b
perf: prefer `module.enableCompileCache` over `v8-compile-cache` (#574) 2024-11-23 11:40:37 +01:00
chlorine d732259faf
doc: update directories to directory in corepack --help (#565) 2024-09-29 08:12:08 +00: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
Wojciech Maj 67463b2a3b
chore(deps): bump tar from 6.x to 7.x, selectively import required functions (#533)
Changes from 06e5872189 made it possible to update tar from 6.x to 7.x and use new `package.json` exports that are included in 7.x, allowing us to further reduce our bundle size.
2024-07-18 13:53:41 +02:00
Antoine du Hamel 6019d7b56e
fix: make `DEBUG=corepack` more useful (#538) 2024-07-18 13:52:19 +02:00
Wojciech Maj f0734e6e80
feat: parallelize linking, unlinking and installing (#524) 2024-07-12 12:42:41 +00:00
Wojciech Maj 4f3e28fcf0
chore: use renameSafe where applicable (#515) 2024-07-12 10:48:51 +02:00
Wojciech Maj e7ad533d43
fix: selectively import required semver functions (#511)
By selectively importing only the functions and classes we use, we avoid bundling in the entire semver package, and shave a few kB off from the Corepack bundle.
2024-07-12 10:47:18 +02:00
Antoine du Hamel db6fae50cf
fix: replace npm registry domain in tarball URL (#502) 2024-07-12 10:43:09 +02:00
Frieder Bluemle 09528a8ea8
chore: fix typos and add `.idea` to `.gitignore` (#482) 2024-05-17 06:20:17 +00:00
Leonardo Rocha f15ebc289e
feat: add support for `COREPACK_INTEGRITY_KEYS=0` (#470) 2024-05-10 10:05:26 +02:00
Alex Kessock 6efa349882
fix: COREPACK_NPM_REGISTRY should allow for username/password auth (#466) 2024-04-24 17:13:00 +02: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
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
Gavin King 2d63536413
fix: Incorrect authorization prefix for basic auth, and undocumented env var (#454)
Co-authored-by: Gavin King <gavin.king@cgi.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-04-12 23:28:11 +02: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
Antoine du Hamel 082fabf8b1
fix: download fewer metadata from npm registry (#436) 2024-03-26 15:08:33 +01:00
Steven a05aec69ff
chore: remove unused imports (#431)
These imports were unused so I removed them
2024-03-16 17:21:20 +01:00
Kristoffer K 47f1e2fadc
chore: remove unused `Cancellation` error (#428) 2024-03-15 23:14:12 +01:00
Kristoffer K 6054339f55
chore: remove `fsUtils.rimraf` (#429) 2024-03-15 22:43:33 +01:00
Antoine du Hamel b7ec137210
fix: ignore `EROFS` errors (#421) 2024-03-08 08:39:08 +00: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
Henry 295a1cdb9c
fix: Windows malicious file analysis waiting problem (#398)
Co-authored-by: Steven <steven@ceriously.com>
2024-02-27 09:16:55 +00:00
Maël Nison 00506b2a15
fix: group the download prompt together (#391) 2024-02-21 21:24:13 +01:00
Antoine du Hamel bc137a0073
fix: do not show download prompt when downloading JSON (#383) 2024-02-21 16:46:37 +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 f442366c1c
feat: add `corepack cache` command (#363) 2024-02-12 23:40:32 +00:00
Kristoffer K fe6a3072f6
feat!: use `fetch` (#365)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-02-11 23:52:38 +01: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
Kristoffer K 54e9510cda
feat!: remove old install folder migration (#373) 2024-02-10 00:52:18 +01: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 6b8d87f237
feat!: prompt user before downloading software (#360) 2024-01-30 23:38:33 +01:00
Antoine du Hamel 2950a8a30b
fix(use): create `package.json` when calling `corepack use` on empty dir (#350)
Co-authored-by: Maël Nison <nison.mael@gmail.com>
2024-01-12 18:52:39 +01:00
Antoine du Hamel addf455f74
chore: bump dev dependencies (#346) 2023-12-29 23:45:32 +01:00
Medhansh 518bed8b7d
fix: clarify `EACCES` errors (#343) 2023-12-29 23:39:52 +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
Maël Nison 0717c6af89
feat(yarn): fallback to npm when `COREPACK_NPM_REGISTRY` is set (#339)
Yarn publishing its versions on its own was inconvenient for people using private npm mirrors, so it makes sense to offer a way to fallback to the npm store when requested. This diff changes the logic so that we use the `@yarnpkg/cli-dist` package when the `COREPACK_NPM_REGISTRY` variable is set. It should be backward-compatible, since the `registry` field is still the same.
2023-12-29 12:28:27 +01:00
guibwl 6df5063b14
feat: add support for HTTP redirect (#341)
Corepack will now follow the `Location` header when receiving a 30x HTTP status code. This should allow Corepack to work with proxies that redirect to a different URL.
2023-12-29 12:15:57 +01:00
Michael Stramel 92f8e71f8c
feat: allow fallback to application/json for custom registries (#314) 2023-10-19 16:36:02 +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 2f3678cd79
fix: disable `v8-compile-cache` when using `npm@>=9.7.0` (#276)
Node.js segfaults when using `npm@>=9.7.0` and `v8-compile-cache`
```console
$ docker run -it node:20.3.0-slim corepack npm@9.7.1 --version
[SIGSEGV]
```
2023-06-13 11:35:21 +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