diff --git a/.pnp.cjs b/.pnp.cjs index f86d6d5b5f87..55897a695929 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -9521,6 +9521,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/yarnpkg-fslib/",\ "packageDependencies": [\ ["@yarnpkg/fslib", "workspace:packages/yarnpkg-fslib"],\ + ["@iarna/toml", "npm:2.2.5"],\ ["@yarnpkg/libzip", "virtual:b73ceab179a3b4f89c4a5be81bd0c20a80eda623489cb284f304cc8104dbb771916bbc246d0ba809faebd8459cb6554cf114954badb021279ea7aee216456122#workspace:packages/yarnpkg-libzip"],\ ["tslib", "npm:2.6.2"]\ ],\ diff --git a/.yarn/versions/30105cf3.yml b/.yarn/versions/30105cf3.yml new file mode 100644 index 000000000000..d648e285cff4 --- /dev/null +++ b/.yarn/versions/30105cf3.yml @@ -0,0 +1,36 @@ +releases: + "@yarnpkg/fslib": minor + "@yarnpkg/sdks": patch + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-essentials" + - "@yarnpkg/plugin-exec" + - "@yarnpkg/plugin-file" + - "@yarnpkg/plugin-git" + - "@yarnpkg/plugin-github" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-link" + - "@yarnpkg/plugin-nm" + - "@yarnpkg/plugin-npm" + - "@yarnpkg/plugin-npm-cli" + - "@yarnpkg/plugin-pack" + - "@yarnpkg/plugin-patch" + - "@yarnpkg/plugin-pnp" + - "@yarnpkg/plugin-pnpm" + - "@yarnpkg/plugin-stage" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/plugin-version" + - "@yarnpkg/plugin-workspace-tools" + - vscode-zipfs + - "@yarnpkg/builder" + - "@yarnpkg/cli" + - "@yarnpkg/core" + - "@yarnpkg/doctor" + - "@yarnpkg/libzip" + - "@yarnpkg/nm" + - "@yarnpkg/pnp" + - "@yarnpkg/pnpify" + - "@yarnpkg/shell" diff --git a/packages/yarnpkg-fslib/package.json b/packages/yarnpkg-fslib/package.json index 873bfb5777a9..a325e8ea46be 100644 --- a/packages/yarnpkg-fslib/package.json +++ b/packages/yarnpkg-fslib/package.json @@ -9,6 +9,7 @@ }, "sideEffects": false, "dependencies": { + "@iarna/toml": "^2.2.5", "tslib": "^2.4.0" }, "devDependencies": { diff --git a/packages/yarnpkg-fslib/sources/FakeFS.ts b/packages/yarnpkg-fslib/sources/FakeFS.ts index 27ccfc8eebbb..8a589843dd7b 100644 --- a/packages/yarnpkg-fslib/sources/FakeFS.ts +++ b/packages/yarnpkg-fslib/sources/FakeFS.ts @@ -1,3 +1,4 @@ +import {stringify as tomlStringify} from '@iarna/toml'; import {createHash} from 'crypto'; import {EventEmitter} from 'events'; import {Dirent as NodeDirent, ReadStream} from 'fs'; @@ -767,6 +768,14 @@ export abstract class FakeFS
{ return this.writeFileSync(p, `${JSON.stringify(data, null, space)}\n`); } + async writeTomlPromise(p: P, data: any) { + return await this.writeFilePromise(p, tomlStringify(data)); + } + + writeTomlSync(p: P, data: any) { + return this.writeFileSync(p, tomlStringify(data)); + } + async preserveTimePromise(p: P, cb: () => Promise
) {
const stat = await this.lstatPromise(p);
diff --git a/packages/yarnpkg-fslib/sources/path.ts b/packages/yarnpkg-fslib/sources/path.ts
index ec12897452b0..383439a54814 100644
--- a/packages/yarnpkg-fslib/sources/path.ts
+++ b/packages/yarnpkg-fslib/sources/path.ts
@@ -33,6 +33,7 @@ export const Filename = {
pnpEsmLoader: `.pnp.loader.mjs` as Filename,
rc: `.yarnrc.yml` as Filename,
env: `.env` as Filename,
+ reuseToml: `REUSE.toml` as Filename,
};
export type TolerateLiterals