Commit Graph

86 Commits

Author SHA1 Message Date
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
Antoine du Hamel 863e0e0a50
chore(deps): upgrade all npm dependencies (#266) 2023-05-19 09:37:31 +00:00
Kristoffer K df89e38200
refactor: separate library and cli entry point (#250) 2023-05-19 10:08:16 +02:00
tison 25fa62354b
chore: report URL on `fetchUrlStream` error message (#261) 2023-04-29 13:00:31 -04:00
Spencer Kaiser aa3cbdb54f
fix(doc): add a note about troubleshooting network errors (#259)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-04-29 14:02:40 +02:00
ZHAO Jin-Xiang 1b353624e6
fix: npm registry override (#219)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-02-17 01:31:31 +01:00
Kristoffer K 15ceb832a3
build: migrate to esbuild (#229) 2023-01-08 15:19:08 +01:00
Kristoffer K 82a6715702
chore: fix linting (#223)
* chore: fix linting

* chore: lint
2023-01-04 13:15:07 +01:00
Kristoffer K 8c8e329700
refactor: simplify `v8-compile-cache` setup (#222) 2023-01-03 00:32:45 +01: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
Mike Scott 662ae9057c
feat: add support for configurable registries and applicable auth options (#186)
Fixes: https://github.com/nodejs/corepack/issues/66
2022-10-28 04:50:07 +02:00
Kenrick 5eadc50192
feat: when strict checking is off, treat like transparent (#197) 2022-10-24 17:06:47 +02:00
Shalvah 42e53d5eda
Fix typo: `corepath` -> `corepack` (#191) 2022-09-29 05:33:40 +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 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 09e24cf497
feat: do not use `~/.node` as default value for `COREPACK_HOME` (#152)
* feat: do not use `~/.node` as default value for `COREPACK_HOME`

Fixes: https://github.com/nodejs/corepack/issues/145
Refs: https://github.com/nodejs/node/issues/43859

* fixup! feat: do not use `~/.node` as default value for `COREPACK_HOME`

* Update sources/folderUtils.ts

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>

* Update README

* migrate old corepack home folder

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
2022-08-15 20:35:45 +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
Antoine du Hamel 185da44078
fix: streamline the cache exploration (#135)
If a large number of versions are cached on the host system, trying to
read the whole cache at once can be quite memory intensive. Instead, we
can use an iterative approach that doesn't hold the whole directory
content in memory.
2022-07-08 19:21:38 +02:00
Antoine du Hamel 29da06c515
feat: add support for tags and ranges in `prepare` command (#136)
Fixes: https://github.com/nodejs/corepack/issues/72
2022-07-08 19:18:47 +02:00
Steven 31913aa317
chore: include install directory in debug log (#111)
This is useful when `DEBUG=corepack` is set because it tells you where it installed to.

Alternatively, we could add this to the `Install finished` debug line at the end.
2022-05-28 11:33:09 +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
Antoine du Hamel 6c736c3950
chore: update dependencies, remove unused ones (#100)
* chore: update dependencies, remove unused ones

* fix types

* Updates snapshots

* Fixes prepack

* try with Node.js 16.x

* Update more packages

* Upgrade to Jest 28

* Bump other packages

* Bump other packages

* Use Node.js 14.19.2

* Revert "try with Node.js 16.x"

This reverts commit 45aa8a3a96.
This reverts commit 4a275f68b6.

* Use specific Node.js version

* trying something

* Pin exact Node.js version number

* Bump Jest to 28.1.0

* dist-upgrade

* Don't pin Node.js version when it's not necessary

* Update more dependencies

* Update more dependencies

* Revert "Pin exact Node.js version number"

This reverts commit dd72a68061.

Co-authored-by: Maël Nison <nison.mael@gmail.com>
2022-05-15 10:35:13 +02:00
Paul Soporan 5ff6e82028
perf: load binaries in the same process (#97) 2022-04-08 00:07:29 +02:00
Kirill Romanov 876ce02fe7
feat: auto setup proxy for http requests (#69)
* feat: auto setup proxy for http requests

* Adds dependencies

* Triggers CI again

Co-authored-by: Maël Nison <nison.mael@gmail.com>
2022-04-08 00:05:54 +02:00