📦🐈 Active development trunk for Yarn ⚒
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
E2E: Fix most E2E tests (#7228) <!-- IMPORTANT: While Yarn 4.x is still actively developed we're now focusing work on our next major releases (5.x and 6.x). These sister releases use the same pattern as TypeScript-Go: - 5.x will only contain a handful of breaking changes to provide a safe migration path. - 6.x will be the "true" release, notable for being implemented in Rust and including a significantly improved core. While PRs can still be opened against 4.x, we recommend power users to try Yarn 6.x now and help us get it over the finish line. It uses the same testsuite as Berry, so compatibility should be at its best. To check out the working trunk for Yarn 6.x, please refer to this repository: https://github.com/yarnpkg/zpm --> ## What's the problem this PR addresses? Many of our E2E tests are failing ## How did you fix it? Some of the tests are failing because they install the latest `typescript`, which currently has no PnP support. These are fixed by limiting the range to `<7.0.0-0` - **Create-Vue**: Added built-in extensions to resolve peer dependency issue - **ESBuild**: Limited `typescript` range - **ESLint**: Limited `typescript` range - **Gatsby**: Unplugged `gatsby`. See https://github.com/gatsbyjs/gatsby/pull/39616 - **Next**: Bypassed the default time gate (the test is against `canary`) - **Parcel**: Added built-in extensions to resolve peer dependency issue - **Angular (PnP)**: Unpinned the node version used in the test from v20 - **SvelteKit**: Migrate away from deprecated `create-svelte` CLI - **TypeScript**: Limited `typescript` range - **WebPack**: Limited `typescript` range Also fixed a few [UUOC](https://en.wikipedia.org/w/index.php?title=Cat_(Unix)&oldid=1362918950#Useless_use_of_cat) Didn't fix the Husky and Storybook tests, as those seem to require code changes on their side. The TypeScript test isn't fully fixed either; looks like it was already broken before 7.0 when TS 6.0 made breaking default config changes. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. --------- Co-authored-by: Maël Nison <nison.mael@gmail.com> | 2 个月前 | |
fix(pnpify): make go to definition work with coc.nvim (#2598) * fix(pnpify): make go to definition work with coc.nvim * minor * fix the template * Update base.ts * fix * handle virtual path correctly * pnpify self * extract predicate for virtual path * pnpify self * normalize paths * cleanup Co-authored-by: Maël Nison <nison.mael@gmail.com> | 5 年前 | |
Migrates to Eslint's flat config (#6276) ## What's the problem this PR addresses? This lets us remove the Rushstack fix, and dogfood the VSCode SDK with the flat config (which is the only available config in Eslint 9). I would have migrated us to Eslint 9, but eslint-plugin-react [isn't compatible yet](https://github.com/jsx-eslint/eslint-plugin-react/issues/3699). ## How did you fix it? Migrate to eslint.config.mjs. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 2 年前 | |
Releasing 2 new packages | Package name | Version | | --- | --- | | `@yarnpkg/cli` | `4.18.1` | | `@yarnpkg/core` | `4.9.2` | | 28 天前 | |
Sync master with the changes from master | 28 天前 | |
Update npm publish command in release script Removed '--staged' option from npm publish command. | 4 个月前 | |
Adds a patchfile for fsevents (#692) * Adds a patchfile for fsevents * Fix & debug * Removes old-style from the tests * Increases the timeout on CI? * Refactors the test * Removes snapshot * Escapes heredoc * Adds the release file * No backticks allowed in Bash * Checks whether the problem comes from the patch or native * Skips fsevents@1 and goes to latest * Calls the watch fn * Fixes the 2.x patch * Adds the CI tests to the README * Updates FSEvents * Fixes the patch * Fixes the checked-in artifacts | 6 年前 | |
Migrate docs to Docusaurus v3 (#6133) **What's the problem this PR addresses?** <!-- Describe the rationale of your PR. --> <!-- Link all issues that it closes. (Closes/Resolves #xxxx.) --> The docs website is on Docsaurus v2 which is not the latest major version Closes #5918 Closes #6153 **How did you fix it?** <!-- A detailed description of your implementation. --> Migrate to Docsaurus v3. There are other improvements to the build process and website I'd like to make, but I have left them out and kept most of the logic intact since the migration is quite a large undertaking already. **Checklist** <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 2 年前 | |
Refactors tests to abstract implementation details (#6711) ## What's the problem this PR addresses? Some of our tests rely on implementation details which can make refactoring more difficult. ## How did you fix it? This diff attempts to remove checks for things that don't directly match the test description, by using standard APIs as much as possible. For example, if a test wants to read a file from a dependency, it should do so by calling `require.resolve` to find out the location of this file rather than by hardcoding it. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 1 年前 | |
fix(core): patch got to prevent crash on settled promise cancelation (#7249) <!-- IMPORTANT: While Yarn 4.x is still actively developed we're now focusing work on our next major releases (5.x and 6.x). These sister releases use the same pattern as TypeScript-Go: - 5.x will only contain a handful of breaking changes to provide a safe migration path. - 6.x will be the "true" release, notable for being implemented in Rust and including a significantly improved core. While PRs can still be opened against 4.x, we recommend power users to try Yarn 6.x now and help us get it over the finish line. It uses the same testsuite as Berry, so compatibility should be at its best. To check out the working trunk for Yarn 6.x, please refer to this repository: https://github.com/yarnpkg/zpm --> ## What's the problem this PR addresses? When running interactive upgrade sessions via `yarn upgrade-interactive` (or `yarn update`), Yarn queries the package registry for version suggestions (current, range, and latest versions) for all dependencies in parallel. Under high concurrency, some of these requests may timeout or fail, triggering a retry or a cancellation. In `got` v11 (specifically `v11.8.2` used by `@yarnpkg/core`), a race condition occurs when `got` attempts to attach an `onCancel` handler from `p-cancelable` to a promise that has already settled (either resolved or rejected). Under modern Node.js runtimes (Node 15+), this unhandled promise rejection causes a fatal crash with: `Error: The onCancel handler was attached after the promise settled.` Closes #7245. ## How did you fix it? We resolved the crash by applying a patch to the vendorised `got@npm:11.8.2` dependency: 1. Introduced a `promiseSettled` boolean flag inside `asPromise` to track whether the HTTP request promise has already resolved, rejected, or been cancelled. 2. Modified the `'retry'` event listener inside `got`'s promise handler to immediately return and abort retry actions if `promiseSettled` is true. This prevents `got` from attempting to cancel or retry an already settled promise. 3. Registered the patch via Yarn's native patch protocol under `package.json`, updating the lockfile and PnP cache accordingly. ## Checklist <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). - [ ] I have set the packages that need to be released for my changes to be effective. - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 1 个月前 | |
fix: Stop using EBADF workaround for Node 24.16.0+ (#7152) <!-- IMPORTANT: While Yarn 4.x is still actively developed we're now focusing work on our next major releases (5.x and 6.x). These sister releases use the same pattern as TypeScript-Go: - 5.x will only contain a handful of breaking changes to provide a safe migration path. - 6.x will be the "true" release, notable for being implemented in Rust and including a significantly improved core. While PRs can still be opened against 4.x, we recommend power users to try Yarn 6.x now and help us get it over the finish line. It uses the same testsuite as Berry, so compatibility should be at its best. To check out the working trunk for Yarn 6.x, please refer to this repository: https://github.com/yarnpkg/zpm --> ## What's the problem this PR addresses? Node backported https://github.com/nodejs/node/pull/62835 restoring `fs` patchability, so we can now disable the same EBADF workaround for it. This follows the same pattern as #7133. ... ## How did you fix it? Changed the condition to only enable the workaround for node 24.15.x, as it is the only release with the issue. I tested the adjusted version works on 24.16.0. ... ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. (I used the same version bumps as #7133) <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 4 个月前 | |
Rename the `berry` references into `yarnpkg` (#395) * Renames everything to the yarnpkg scope * More renaming * Fixes snapshots * Updates the README * Fixes the merge conflict resolution test * Updates the documentation | 7 年前 | |
Renames yarnrc -> yarnrc.yml (#244) * Removes @types/decamelize (and one other) Commit generated via `yarn stage` * Implements .yarnrc.yml * Fixes the yarn binary used for CI * Adds more information when the binary is wrong * Removes instances of yarnrc * Updates the checked-in builds * Updates the tests * Updates the warn script to support Windows | 7 年前 | |
Makes `npmMinimalAgeGate: 1d` the default (#7135) <!-- IMPORTANT: While Yarn 4.x is still actively developed we're now focusing work on our next major releases (5.x and 6.x). These sister releases use the same pattern as TypeScript-Go: - 5.x will only contain a handful of breaking changes to provide a safe migration path. - 6.x will be the "true" release, notable for being implemented in Rust and including a significantly improved core. While PRs can still be opened against 4.x, we recommend power users to try Yarn 6.x now and help us get it over the finish line. It uses the same testsuite as Berry, so compatibility should be at its best. To check out the working trunk for Yarn 6.x, please refer to this repository: https://github.com/yarnpkg/zpm --> ## What's the problem this PR addresses? <!-- Describe the rationale of your PR. --> <!-- Link all issues that it closes. (Closes/Resolves #xxxx.) --> The rate at which supply chain attacks occur is growing, and given that we can't rely on the npm registry for good practices it means we need to become stricter to protect our users. ## How did you fix it? <!-- A detailed description of your implementation. --> The `npmMinimalAgeGate` settings will now default to `1d`. Following the same pattern as in previous PRs (#7089, #7091) it will apply to all new projects, and the configuration of existing projects will be patched when upgrading their Yarn version to hardcode the previous defaults until users can ensure their projects are compatible with the new ones. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 5 个月前 | |
fix(nm): optimize hoisting by treating peer deps same as other deps (#6517) ## What's the problem this PR addresses? Fixes #6516 ## How did you fix it? Simplified the sorting algorithm in `getHoistIndetMap`. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. --------- Co-authored-by: Victor Vlasenko <victor.vlasenko@sysgears.com> | 2 年前 | |
chore: remove @yarnpkg/core CODEOWNERS (#4860) | 4 年前 | |
Updates the CoC contact email | 6 年前 | |
Update site domains (#879) Replaces `legacy.yarnpkg.com` with `classic.yarnpkg.com`, and `next.yarnpkg.com` with `yarnpkg.com` | 6 年前 | |
Governance file (#2237) * Create GOVERNANCE.md * Typo Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com> * Improve wording Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com> Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com> Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com> | 5 年前 | |
Describes a bit the project history (#468) * Create HISTORY.md * Update HISTORY.md | 6 年前 | |
Update LICENSE.md | 6 年前 | |
Update README.md badge link (#6947) ## What's the problem this PR addresses? <!-- Describe the rationale of your PR. --> <!-- Link all issues that it closes. (Closes/Resolves #xxxx.) --> ... ## How did you fix it? <!-- A detailed description of your implementation. --> ... ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [ ] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [ ] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [ ] I will check that all automated PR checks pass before the PR gets reviewed. | 11 个月前 | |
Revise vulnerability reporting process Updated the vulnerability reporting instructions to direct users to open a draft security advisory instead of emailing stewards. | 4 个月前 | |
Renames yarn.config.js -> yarn.config.cjs (#5733) **What's the problem this PR addresses?** The `yarn.config.cjs` file doesn't work with projects using `type: "module"`. Fixes https://github.com/yarnpkg/berry/issues/5720 **How did you fix it?** Renames the file into `yarn.config.cjs`. Since it never got released in a stable release, it should be acceptable to do so without backward compatibility. **Checklist** <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 3 年前 | |
Bumps TypeScript to 5.9 (#6889) ## What's the problem this PR addresses? I'm looking at migrating to TypeScript-go whenever it supports PnP; to that end we first need to upgrade to the latest stable TypeScript releases. ## How did you fix it? Mostly just a matter of upgrading `@types/node` and updating the various types in FakeFS that got changed. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 1 年前 | |
test: transpile using esbuild (#5581) **What's the problem this PR addresses?** We use esbuild to build and run Yarn from sources but not for our test files. Follow-up to https://github.com/yarnpkg/berry/pull/5180 **How did you fix it?** Use esbuild to transpile files in our testing setup. **Checklist** - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). - [x] I have set the packages that need to be released for my changes to be effective. - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 2 年前 | |
fix(core): patch got to prevent crash on settled promise cancelation (#7249) <!-- IMPORTANT: While Yarn 4.x is still actively developed we're now focusing work on our next major releases (5.x and 6.x). These sister releases use the same pattern as TypeScript-Go: - 5.x will only contain a handful of breaking changes to provide a safe migration path. - 6.x will be the "true" release, notable for being implemented in Rust and including a significantly improved core. While PRs can still be opened against 4.x, we recommend power users to try Yarn 6.x now and help us get it over the finish line. It uses the same testsuite as Berry, so compatibility should be at its best. To check out the working trunk for Yarn 6.x, please refer to this repository: https://github.com/yarnpkg/zpm --> ## What's the problem this PR addresses? When running interactive upgrade sessions via `yarn upgrade-interactive` (or `yarn update`), Yarn queries the package registry for version suggestions (current, range, and latest versions) for all dependencies in parallel. Under high concurrency, some of these requests may timeout or fail, triggering a retry or a cancellation. In `got` v11 (specifically `v11.8.2` used by `@yarnpkg/core`), a race condition occurs when `got` attempts to attach an `onCancel` handler from `p-cancelable` to a promise that has already settled (either resolved or rejected). Under modern Node.js runtimes (Node 15+), this unhandled promise rejection causes a fatal crash with: `Error: The onCancel handler was attached after the promise settled.` Closes #7245. ## How did you fix it? We resolved the crash by applying a patch to the vendorised `got@npm:11.8.2` dependency: 1. Introduced a `promiseSettled` boolean flag inside `asPromise` to track whether the HTTP request promise has already resolved, rejected, or been cancelled. 2. Modified the `'retry'` event listener inside `got`'s promise handler to immediately return and abort retry actions if `promiseSettled` is true. This prevents `got` from attempting to cancel or retry an already settled promise. 3. Registered the patch via Yarn's native patch protocol under `package.json`, updating the lockfile and PnP cache accordingly. ## Checklist <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). - [ ] I have set the packages that need to be released for my changes to be effective. - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 1 个月前 | |
Fixes plugin urls | 3 年前 | |
refactor: rename `motd` to `tips` (#5561) **What's the problem this PR addresses?** <!-- Describe the rationale of your PR. --> <!-- Link all issues that it closes. (Closes/Resolves #xxxx.) --> After some discussions, we've agreed on changing `motd` to `tips`, as the `motd` acronym (`message of the day`) might not be widespread enough. **How did you fix it?** <!-- A detailed description of your implementation. --> This PR changes: - `enableMotd` to `enableTips` - the `MOTD_NOTICE` message name to `TIPS_NOTICE` - `motd.json` to `tips.json` (CC @arcanis since you need to change the cloudflare worker) - `TelemetryManager#isMotd` to `TelemetryManager#shouldShowTips` as it's more descriptive and also more consistent with the existing `shouldCommitTips` **Checklist** <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [X] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [X] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [X] I will check that all automated PR checks pass before the PR gets reviewed. | 3 年前 | |
Bumps TypeScript to 5.9 (#6889) ## What's the problem this PR addresses? I'm looking at migrating to TypeScript-go whenever it supports PnP; to that end we first need to upgrade to the latest stable TypeScript releases. ## How did you fix it? Mostly just a matter of upgrading `@types/node` and updating the various types in FakeFS that got changed. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 1 年前 | |
chore: replace lodash with es-toolkit (#6502) ## What's the problem this PR addresses? es-toolkit is a modern lodash alternative that claims to be much faster and lighter, potentially improving Yarn overall performance: https://es-toolkit.slash.page/intro.html ## How did you fix it? The lazy way, frankly: using es-toolkit/compat to provide practically drop-in lodash replacement with minimal effort. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. --------- Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com> | 1 年前 | |
fix(core): patch got to prevent crash on settled promise cancelation (#7249) <!-- IMPORTANT: While Yarn 4.x is still actively developed we're now focusing work on our next major releases (5.x and 6.x). These sister releases use the same pattern as TypeScript-Go: - 5.x will only contain a handful of breaking changes to provide a safe migration path. - 6.x will be the "true" release, notable for being implemented in Rust and including a significantly improved core. While PRs can still be opened against 4.x, we recommend power users to try Yarn 6.x now and help us get it over the finish line. It uses the same testsuite as Berry, so compatibility should be at its best. To check out the working trunk for Yarn 6.x, please refer to this repository: https://github.com/yarnpkg/zpm --> ## What's the problem this PR addresses? When running interactive upgrade sessions via `yarn upgrade-interactive` (or `yarn update`), Yarn queries the package registry for version suggestions (current, range, and latest versions) for all dependencies in parallel. Under high concurrency, some of these requests may timeout or fail, triggering a retry or a cancellation. In `got` v11 (specifically `v11.8.2` used by `@yarnpkg/core`), a race condition occurs when `got` attempts to attach an `onCancel` handler from `p-cancelable` to a promise that has already settled (either resolved or rejected). Under modern Node.js runtimes (Node 15+), this unhandled promise rejection causes a fatal crash with: `Error: The onCancel handler was attached after the promise settled.` Closes #7245. ## How did you fix it? We resolved the crash by applying a patch to the vendorised `got@npm:11.8.2` dependency: 1. Introduced a `promiseSettled` boolean flag inside `asPromise` to track whether the HTTP request promise has already resolved, rejected, or been cancelled. 2. Modified the `'retry'` event listener inside `got`'s promise handler to immediately return and abort retry actions if `promiseSettled` is true. This prevents `got` from attempting to cancel or retry an already settled promise. 3. Registered the patch via Yarn's native patch protocol under `package.json`, updating the lockfile and PnP cache accordingly. ## Checklist <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). - [ ] I have set the packages that need to be released for my changes to be effective. - [x] I will check that all automated PR checks pass before the PR gets reviewed. | 1 个月前 |
以下内容由 AI 翻译,如有问题请 点此提交 issue 反馈
快速、可靠且安全的依赖管理工具。
Yarn 是一款现代化的包管理器,由多个包组件构成。其创新架构使其能够实现现有解决方案无法完成的功能:
- Yarn 支持插件;添加插件就像将其添加到您的代码库中一样简单
- Yarn 默认支持 Node,但不仅限于此——插件可以添加对其他语言的支持
- Yarn 原生支持工作区,其 CLI 充分利用了这一特性
- Yarn 使用类 bash 的可移植 shell,使包脚本可在 Windows、Linux 和 macOS 之间移植
- Yarn 首先是一个可通过编程方式使用的Node API(通过@yarnpkg/core)
- Yarn 采用TypeScript编写,并进行了全面的类型检查
支持我们
金牌赞助商
|
|
所有环境变量,集中管理。无需再为零散的 API 密钥而烦恼,无需再拼凑自制工具,无需再回避访问控制。借助Doppler,让您的团队和服务器保持同步。 |
|
|
您的应用,企业级就绪。只需几行代码,即可开始向企业客户销售。借助WorkOS,在几分钟内(而非几个月)添加单点登录(及更多功能)。 |
同时也感谢以下机构
|
Datadog 已赞助我们首席维护者的工作时间超过一年。他们还为我们升级了账户,使我们能够受益于长期遥测功能(RFC)。 |
|
|
SysGears 同样在 2.x 版本开发初期就提供了时间赞助。特别是,他们的大力投入是 Yarn 2 对 node_modules 安装的支持甚至比以往更好的原因。 |
|
|
Netlify 一直是我们网站的长期服务提供商。每当我们遇到问题,他们都会及时伸出援手。他们的实时预览功能在我们的开发过程中非常有帮助。 |
|
Cloudflare 也是我们的长期合作伙伴。虽然我们不再直接镜像 npm 注册表,但他们仍然为我们的网站提供支持,以确保其交付速度尽可能快。 |
|
|
Algolia 多年来为我们的文档做出了巨大贡献。他们仍然为我们两个版本的文档提供搜索引擎支持。 |
安装
请参考 安装指南。
迁移
请参考 迁移指南。
文档
文档可在 yarnpkg.com 查阅。
API
API 文档可在 yarnpkg.com/api 查阅。
当前状态
除了传统的集成测试外,我们每天还会使用社区最新版本的工具链运行 Yarn 进行测试,以防万一。所有测试都应显示为绿色!
贡献指南
请参考 贡献指南。
构建您自己的包
克隆此仓库,然后运行以下命令:
yarn build:cli
工作原理
构建 CLI 后,全局的 yarn 将立即反映您的本地更改。这是因为 Yarn 会读取此仓库 .yarnrc.yml 中的 yarnPath 设置,该设置配置为在新构建的 CLI 可用时使用它。
开箱即用!
请注意,无需其他任何命令!由于我们的依赖项已签入仓库(位于 .yarn/cache 目录中),您甚至无需运行 yarn install。克隆项目后一切即可正常工作,并且保证十年后依然可用 🙂
Yarn 插件
默认插件
这些插件通常与 Yarn 捆绑提供。您无需执行任何特殊操作即可使用它们。
- plugin-compat 包含一些内置补丁,用于改进 PnP 支持。
- plugin-constraints 为 Yarn 添加了对 约束 的支持。
- plugin-dlx 添加了对
yarn dlx命令的支持。 - plugin-essentials 添加了各种被认为是包管理器必备的命令(add、remove 等)。
- plugin-exec 添加了在依赖项中使用
exec:协议的支持。 - plugin-file 添加了在依赖项中使用
file:协议的支持。 - plugin-git 添加了从 Git 仓库克隆包的支持。
- plugin-github 添加了使用 GitHub 引用作为依赖项的支持。此插件不使用 git。
- plugin-http 添加了使用直接 URL 引用作为依赖项的支持(仅限 tgz 归档)。
- plugin-init 添加了对
yarn init命令的支持。 - plugin-interactive-tools 添加了对各种交互式命令的支持(如
yarn upgrade-interactive)。 - plugin-link 添加了在依赖项中使用
link:和portal:引用的支持。 - plugin-nm 添加了通过
node_modules文件夹安装包的支持。 - plugin-npm 添加了对使用 语义化版本范围 依赖项的支持,并从类 npm 注册表解析它们。
- plugin-npm-cli 添加了对 npm 特定命令的支持(如
yarn npm login、yarn npm publish等)。 - plugin-pack 添加了对
yarn pack命令的支持。 - plugin-patch 添加了对
patch:协议的支持。 - plugin-pnp 添加了通过 Plug'n'Play 规范安装 JavaScript 依赖项的支持。
- plugin-stage 添加了对
yarn stage命令的支持。 - plugin-typescript 改善了使用 TypeScript 时的用户体验。
- plugin-version 添加了对新 发布工作流 的支持。
- plugin-workspace-tools 添加了对
yarn workspaces foreach命令的支持。
第三方插件
第三方机构可以开发插件。要在您的应用程序中使用这些插件,只需在调用 yarn plugin import 时指定完整的插件 URL。请注意,目前插件并非从 npm 注册表获取,它们必须以单个 JavaScript 文件的形式分发。
创建新插件
如需创建您自己的插件,请参阅 文档。
通用包
以下包为通用包,可用于多种用途(包括实现其他包管理器,但不仅限于此):
- @yarnpkg/core 允许任何应用程序以编程方式操作项目。
- @yarnpkg/fslib 是一组工具,用于通过类型安全的基元抽象文件系统。
- @yarnpkg/libzip 包含编译为 WebAssembly 的 zlib+libzip 绑定。
- @yarnpkg/nm 包含
node_modules树构建器和提升器。 - @yarnpkg/parsers 可用于解析 @yarnpkg/shell 所使用的语言。
- @yarnpkg/pnp 可用于生成 Plug'n'Play 兼容的钩子。
- @yarnpkg/pnpify 是一个 CLI 工具,用于透明地为各种工具添加 PnP 支持。
- @yarnpkg/sdks 是一个 CLI 工具,用于生成 PnP 编辑器 SDK。
- @yarnpkg/shell 是一个可移植的类 bash shell 解释器。
Yarn 专用包
以下包旨在供 Yarn 自身使用,可能对其他应用程序没有用处:
- @yarnpkg/builder 包含一个用于打包 berry 及其插件的 CLI 工具。
- @yarnpkg/cli 是一个基于 @yarnpkg/core 构建的 CLI 入口点。