diff --git a/.yarn/versions/06061960.yml b/.yarn/versions/06061960.yml new file mode 100644 index 000000000000..54642a287609 --- /dev/null +++ b/.yarn/versions/06061960.yml @@ -0,0 +1,23 @@ +releases: + "@yarnpkg/cli": minor + "@yarnpkg/plugin-essentials": minor + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-nm" + - "@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" + - "@yarnpkg/builder" + - "@yarnpkg/core" + - "@yarnpkg/doctor" diff --git a/packages/plugin-essentials/sources/commands/run.ts b/packages/plugin-essentials/sources/commands/run.ts index 13807db7b713..132fc7d4bb52 100644 --- a/packages/plugin-essentials/sources/commands/run.ts +++ b/packages/plugin-essentials/sources/commands/run.ts @@ -52,6 +52,10 @@ export default class RunCommand extends BaseCommand { description: `Ignore any user defined scripts and only check for binaries`, }); + require = Option.String(`--require`, { + description: `Forwarded to the underlying Node process when executing a binary`, + }); + // The v1 used to print the Yarn version header when using "yarn run", which // was messing with the output of things like `--version` & co. We don't do // this anymore, but many workflows use `yarn run --silent` to make sure that @@ -103,6 +107,9 @@ export default class RunCommand extends BaseCommand { } } + if (this.require) + nodeArgs.push(`--require=${this.require}`); + return await scriptUtils.executePackageAccessibleBinary(effectiveLocator, this.scriptName, this.args, { cwd: this.context.cwd, project,