| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Handle optional compat patch failures for TypeScript 7 (#7190) ## Summary - Bound the generated TypeScript compatibility patch to TypeScript versions before 7.0.0, and committed the matching generated patch artifact so the compat patch generator stays reproducible. - Fixed optional patch handling so `optional!` patches fall back when a package no longer ships a target file (for example `lib/_tsc.js` in TypeScript 7 / TypeScript compatibility shims), instead of failing the install with `ENOENT`. - Added regression coverage for both direct `typescript@7.0.1-rc` installs and the TypeScript 7 side-by-side recommendation where the `typescript` ident aliases to `npm:@typescript/typescript6@^6.0.0`. - Stabilized the scoped `plugin-typescript` acceptance test by moving it from `@babel/traverse` (now reported by npm search metadata as having included types) to a fixture package that still exercises DefinitelyTyped scoped package insertion. - Added deferred version metadata for the changed workspaces. ## Test plan - `yarn workspace @yarnpkg/plugin-compat test:plugin-compat` - `yarn test:unit packages/plugin-patch` - `node ./scripts/run-yarn.js test:integration packages/acceptance-tests/pkg-tests-specs/sources/plugins/plugin-typescript.test.ts` - `yarn version check` ## Notes TypeScript 7 ships a native compiler package layout and no longer has the legacy JS compiler files patched by the existing PnP compatibility diff, such as `lib/_tsc.js`. Bounding the TypeScript compat patch makes this intent explicit, while the optional patch fallback fixes the broader bug that `optional!` patch failures caused by missing target files were still fatal. TypeScript 7 support should ship with microsoft/typescript-go#1966. Made with Cursor --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: John Doe <you@example.com> Co-authored-by: Maël Nison <mael.nison@mistral.ai> | 2 个月前 | |
fix(patch) Correctly handle Unicode paths (#7123) <!-- 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. --> https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath Git enables `core.quotePath` by default, which escapes Unicode characters in paths, causing Yarn to fail to replace them. https://github.com/git-for-windows/git/issues/3843 <!-- Link all issues that it closes. (Closes/Resolves #xxxx.) --> ... ## How did you fix it? This PR sets `core.quotePath=false` when generating the patch to avoid this issue. <!-- 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. --> - [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. | 4 个月前 | |
Perserve copyright notice for patch-package source (#852) Given that this package copies and modifies a portion of patch-package's source, the copyright should be maintained in accordance with the MIT license. | 6 年前 | |
Various minor tweaks for website (#5863) **What's the problem this PR addresses?** There are a number of build tooling and minor problems with the website. (Listed below) **How did you fix it?** Maintainers: I have marked this as draft for now due to the Questions/TODOs/TBDs. Most of these I just implemented the fix that I think is the most straightforward/reasonable. Feel free to edit/merge/cherry-pick anything here as you see fit. - [x] ~~The bundled TS type check is bugged (e.g. [xterm-headless](https://yarnpkg.com/package?q=xterm-head&name=xterm-headless) is reported as "no types")~~ - [x] ~~Fix: prioritize type entrypoints (`types` and `typings` fields in `pacakge.json`, `types` condition) instead of normal (JS) entrypoints when resolving the package.~~ - On second thought I think it is better to split this to another PR (#5867) - [x] Building the website fails on Windows due to [quirks of child_process](https://nodejs.org/api/child_process.html#child_process_spawning_bat_and_cmd_files_on_windows) on Windows - [x] Fix: use `cross-spawn`, which `@yarnpkg/core` already depends on - [x] There are a number of unused files/assets/patches/dependencyMetas - [x] Fix: delete them - [x] The README is the default one generated by Docusuarus - [x] Fix: Update it to have slightly more useful info - [x] There are a number of broken links, as reported by docusaurus during `build` - In particular, the [Release Workflow](https://v3.yarnpkg.com/features/release-workflow) was not ported to the new website. - [x] Fix: port the Release Workflow page from the old website - [x] Fix: Delete the extraneous "Publishing" page, for now - [x] Fix: change broken links to new URLs - [x] ~~**Question**: What is the "Publishing" page? Is it supposed to be a re-written Release Workflow page?~~ - [ ] There are also a number of broken links from other places in this repo - There are a total of 12 broken links (404 or not the intended page) - 1 of them is to https://yarnpkg.com/advanced/sherlock, where there is no short-term resolution (see #5859) - 2 of them are to https://yarnpkg.com/api, see below - 4 of them are in old blog posts. Let's leave them be - [x] Fix: Fix the other 5 - There are a few links to https://yarnpkg.com/features/zero-installs, which 301-redirects to https://yarnpkg.com/features/caching#zero-installs - 2 of them are in old blog posts / CHANGELOG. Let's leave them be - [x] Fix: Change the others to the canonical URL - There are a few links to package pages like https://yarnpkg.com/package/eslint, which 301-redirects to https://yarnpkg.com/package?name=eslint - [ ] **Question**: Should we change those to the canonical URLs - [x] There is an extraneous TOC block in the [Rulebook](https://yarnpkg.com/advanced/rulebook), a remnant of the old Gatsby-based website - [x] Fix: Remove it. Docusaurus adds a right sidebar/"On this page" block automatically - [x] The output during build is quite excessive. In particular, our own commandLineHighlight plugin is spewing multi-line "fail to parse" errors onto the console, which interferes with docusaurus' own progress bar - [x] Fix: reduce the commandLineHighlight plugin output to only display the command line that failed to parse - ~~**Question**: This a not a very elegant solution. Are there better alternatives?~~ - I have an idea for a better solution. Will be a separate PR - [x] There are two warnings during build: - `webpack` warns `js-yaml` on using `buffer` - [x] Fix: Explicitly disable the `buffer` polyfill as suggested - `autoprefixer` warns `src/css/custom.css` on using `text-decoration-skip` CSS property - [x] Fix: Use `text-decoration-skip-ink` instead as suggested - [x] Add a dropdown to the navbar that links to the old websites - [x] ~~**Question**: Should we use [versioned docs](https://docusaurus.io/docs/versioning) for v4+?~~ - ~~**TBD**: While generating the CLI docs, run the CLI in JS instead of via the OS shell to avoid spawning a terminal window~~ - ~~**TBD**: The API reference is completely removed. What should we do about it?~~ - ~~**TBD**: Should we update `caniuse-lite` as suggested? Should we do it regularly?~~ Closes #5667 (supersedes) Closes #5860 (supersedes) ~~Closes #5894 (supersedes)~~ Fixes #5707 Fixes #5805 Fixes #5832 ~~Fixes #5861~~ ~~Fixes #5869~~ Fixes #5926 **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 年前 | |
Sync master with the changes from master | 1 个月前 |
@yarnpkg/plugin-patch
This plugin adds support for the patch: protocol.
Install
This plugin is included by default in Yarn.
Usage
-
Run
yarn patch <package name>and edit the resulting folder. -
Once you're ready, run
yarn patch-commit -s <patch folder>to store the result inside a.patchfile. -
Add the
patch:protocol to your dependencies as such:
{
"dependencies": {
"lodash": "patch:lodash@1.0.0#./my-patch-file.patch"
}
}
Caveat
You cannot add dependencies through the patch: protocol. Check this FAQ entry for more details.