From 751bc66cadb4f1e089548e96d40dd2314029f82b Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Wed, 26 Jun 2024 12:17:51 +0200 Subject: [PATCH 1/3] esbuild strip `node:` prefix Signed-off-by: Jan Kowalleck --- .../yarnpkg-builder/sources/commands/build/plugin.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/yarnpkg-builder/sources/commands/build/plugin.ts b/packages/yarnpkg-builder/sources/commands/build/plugin.ts index 2576e7111ba5..808a2d842eff 100644 --- a/packages/yarnpkg-builder/sources/commands/build/plugin.ts +++ b/packages/yarnpkg-builder/sources/commands/build/plugin.ts @@ -128,6 +128,15 @@ export default class BuildPluginCommand extends Command { minify: !this.noMinify, sourcemap: this.sourceMap ? `inline` : false, target: `node${semver.minVersion(pkg.engines.node)!.version}`, + supported: { + /* + Yarn plugin runtime did not support builtin modules prefixed with "node:". + See https://github.com/yarnpkg/berry/pull/5997 + As a solution, and for backwards compatibility, esbuild should strip these prefixes. + */ + 'node-colon-prefix-import': false, + 'node-colon-prefix-require': false, + }, }); for (const warning of res.warnings) { From 7d7461c25ae14a7c058dcba46220792ec67b338d Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Wed, 26 Jun 2024 12:25:45 +0200 Subject: [PATCH 2/3] yarn version bump Signed-off-by: Jan Kowalleck --- .yarn/versions/c8b9b062.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .yarn/versions/c8b9b062.yml diff --git a/.yarn/versions/c8b9b062.yml b/.yarn/versions/c8b9b062.yml new file mode 100644 index 000000000000..66f1a5abf11a --- /dev/null +++ b/.yarn/versions/c8b9b062.yml @@ -0,0 +1,12 @@ +releases: + "@yarnpkg/builder": minor + +declined: + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-exec" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-stage" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/plugin-version" + - "@yarnpkg/plugin-workspace-tools" + - "@yarnpkg/cli" From 7a5dde8f7a4745b325c68874d4a2a0ea78899d16 Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Wed, 26 Jun 2024 13:21:37 +0200 Subject: [PATCH 3/3] typo --- packages/yarnpkg-builder/sources/commands/build/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/yarnpkg-builder/sources/commands/build/plugin.ts b/packages/yarnpkg-builder/sources/commands/build/plugin.ts index 808a2d842eff..12dc07b5ad0f 100644 --- a/packages/yarnpkg-builder/sources/commands/build/plugin.ts +++ b/packages/yarnpkg-builder/sources/commands/build/plugin.ts @@ -130,7 +130,7 @@ export default class BuildPluginCommand extends Command { target: `node${semver.minVersion(pkg.engines.node)!.version}`, supported: { /* - Yarn plugin runtime did not support builtin modules prefixed with "node:". + Yarn plugin-runtime did not support builtin modules prefixed with "node:". See https://github.com/yarnpkg/berry/pull/5997 As a solution, and for backwards compatibility, esbuild should strip these prefixes. */