From d08f705e31781a3549f77f7428025cae743bc6c8 Mon Sep 17 00:00:00 2001 From: Bram Gotink Date: Wed, 13 May 2020 20:59:46 +0200 Subject: [PATCH 1/3] Mark local yarn as commonjs file This ensures the file will correctly load in all workspaces, regardless of their "type". Fixes #985 --- packages/plugin-essentials/sources/commands/set/version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-essentials/sources/commands/set/version.ts b/packages/plugin-essentials/sources/commands/set/version.ts index 9189e3d6d950..4d4ed4099273 100644 --- a/packages/plugin-essentials/sources/commands/set/version.ts +++ b/packages/plugin-essentials/sources/commands/set/version.ts @@ -95,7 +95,7 @@ export async function setVersion(configuration: Configuration, bundleVersion: st } const releaseFolder = ppath.resolve(projectCwd, `.yarn/releases` as PortablePath); - const absolutePath = ppath.resolve(releaseFolder, `yarn-${bundleVersion}.js` as Filename); + const absolutePath = ppath.resolve(releaseFolder, `yarn-${bundleVersion}.cjs` as Filename); const displayPath = ppath.relative(configuration.startingCwd, absolutePath); const projectPath = ppath.relative(projectCwd, absolutePath); From 2586580cd3d012e8d2165bef96d434fafff88ec4 Mon Sep 17 00:00:00 2001 From: Bram Gotink Date: Wed, 13 May 2020 21:00:32 +0200 Subject: [PATCH 2/3] Make yarn set version slightly more robust Right now the command can fail if the temporary folder contains a package.json with `"type": "module"`. --- packages/plugin-essentials/sources/commands/set/version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-essentials/sources/commands/set/version.ts b/packages/plugin-essentials/sources/commands/set/version.ts index 4d4ed4099273..7ba0878869af 100644 --- a/packages/plugin-essentials/sources/commands/set/version.ts +++ b/packages/plugin-essentials/sources/commands/set/version.ts @@ -79,7 +79,7 @@ export async function setVersion(configuration: Configuration, bundleVersion: st if (bundleVersion === null) { await xfs.mktempPromise(async tmpDir => { - const temporaryPath = ppath.join(tmpDir, `yarn.js` as Filename); + const temporaryPath = ppath.join(tmpDir, `yarn.cjs` as Filename); await xfs.writeFilePromise(temporaryPath, bundleBuffer); const {stdout} = await execUtils.execvp(process.execPath, [npath.fromPortablePath(temporaryPath), `--version`], { From 21ec4b628c7ab6a22993368b3952d105d25dcfe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Thu, 14 May 2020 16:48:47 +0200 Subject: [PATCH 3/3] Versions --- .yarn/versions/966dd5b5.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .yarn/versions/966dd5b5.yml diff --git a/.yarn/versions/966dd5b5.yml b/.yarn/versions/966dd5b5.yml new file mode 100644 index 000000000000..0b9cf19610dc --- /dev/null +++ b/.yarn/versions/966dd5b5.yml @@ -0,0 +1,21 @@ +releases: + "@yarnpkg/cli": prerelease + "@yarnpkg/plugin-essentials": prerelease + +declined: + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-node-modules" + - "@yarnpkg/plugin-npm-cli" + - "@yarnpkg/plugin-pack" + - "@yarnpkg/plugin-patch" + - "@yarnpkg/plugin-pnp" + - "@yarnpkg/plugin-stage" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/plugin-version" + - "@yarnpkg/plugin-workspace-tools" + - "@yarnpkg/builder" + - "@yarnpkg/core" + - "@yarnpkg/doctor"