diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fb09b1196..fdf3ca504c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ # Changelog + + Please add one entry in this file for each change in Yarn's behavior. Use the same format for all entries, including the third-person verb. Make sure you don't add more than one line of text to keep it clean. Thanks! +## 1.22.12 + +- Support modifying .yarnrc if has hidden attr: https://github.com/yarnpkg/yarn/issues/4306 + ## 1.22.11 This version fixes a problem where Yarn wasn't forwarding SIGTERM to the binary spawned via `yarnPath`. It also makes `yarn init -2` compatible with [Corepack](https://github.com/nodejs/corepack). The behaviour of `yarn init` (without `-2`) doesn't change. @@ -69,7 +75,7 @@ Those versions didn't contain any changes and were just triggered by our infra w - Allows some dots in binary names again [#7811](https://github.com/yarnpkg/yarn/pull/7811) - [**Valery Bugakov**](https://github.com/valerybugakov) - + - Better error handling on `yarn set version` [#7848](https://github.com/yarnpkg/yarn/pull/7848) - [**Nick Olinger**](https://github.com/olingern) @@ -77,7 +83,7 @@ Those versions didn't contain any changes and were just triggered by our infra w - Passes arguments following `--` when running a workspace script (`yarn workspace pkg run command -- arg`) [#7776](https://github.com/yarnpkg/yarn/pull/7776) - [**Jeff Valore**](https://twitter.com/rally25rs) - + - Fixes an issue where the archive paths were incorrectly sanitized [#7831](https://github.com/yarnpkg/yarn/pull/7831) - [**Maël Nison**](https://twitter.com/arcanis) @@ -99,7 +105,7 @@ Those versions didn't contain any changes and were just triggered by our infra w - Implements `yarn init --install ` [#7723](https://github.com/yarnpkg/yarn/pull/7723) - [**Maël Nison**](https://twitter.com/arcanis) - + ## 1.19.2 - Folders like `.cache` won't be pruned from the `node_modules` after each install. diff --git a/package.json b/package.json index 0f45abf503..697ee8b4c0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "yarn", "installationMethod": "unknown", - "version": "1.23.0-0", + "version": "1.23.1-0", "license": "BSD-2-Clause", "preferGlobal": true, "description": "📦🐈 Fast, reliable, and secure dependency management.", diff --git a/src/util/fs.js b/src/util/fs.js index 498b9707d2..2d5c6c5b8f 100644 --- a/src/util/fs.js +++ b/src/util/fs.js @@ -27,7 +27,10 @@ export const constants = export const lockQueue = new BlockingQueue('fs lock'); export const readFileBuffer = promisify(fs.readFile); -export const open: (path: string, flags: string, mode?: number) => Promise> = promisify(fs.open); +export const open: (path: string, flags: string, mode?: number) => Promise = promisify(fs.open); +export const close: (fd: number) => Promise = promisify(fs.close); +export const ftruncate: (fd: number) => Promise = promisify(fs.ftruncate); +export const write: (fd: number, data: string | Buffer) => Promise = promisify(fs.write); export const writeFile: (path: string, data: string | Buffer, options?: Object) => Promise = promisify( fs.writeFile, ); @@ -786,7 +789,16 @@ export async function writeFilePreservingEol(path: string, data: string): Promis if (eol !== '\n') { data = data.replace(/\n/g, eol); } - await writeFile(path, data); + + if (os.platform() === 'win32' && await exists(path)) { + // Support modifying the file if has hidden attr + const fd = await open(path, "r+"); + await ftruncate(fd); + await write(fd, data); + await close(fd); + } else { + await writeFile(path, data); + } } export async function hardlinksWork(dir: string): Promise {