From aa0c78f798d5c95e4a05853997fb6f001fa931c4 Mon Sep 17 00:00:00 2001 From: Edwin Jarvis Date: Wed, 15 Apr 2026 12:41:49 +0300 Subject: [PATCH 1/2] docs: clarify yarn dlx version and bin resolution behavior --- packages/plugin-dlx/sources/commands/dlx.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/plugin-dlx/sources/commands/dlx.ts b/packages/plugin-dlx/sources/commands/dlx.ts index d85668ea6458..6803ef40d72c 100644 --- a/packages/plugin-dlx/sources/commands/dlx.ts +++ b/packages/plugin-dlx/sources/commands/dlx.ts @@ -17,14 +17,24 @@ export default class DlxCommand extends BaseCommand { By default Yarn will download the package named \`command\`, but this can be changed through the use of the \`-p,--package\` flag which will instruct Yarn to still run the same command but from a different package. + The package name can include a version (e.g., \`create-vite@4\`), which will install that specific version. + Using \`yarn dlx\` as a replacement of \`yarn add\` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through \`dlx\` - neither their name, nor their version). + + If the specified command doesn't match any binary exposed by the installed package, but that package exposes exactly one binary, Yarn will automatically run that binary instead. This behavior only applies when installing a single package via the command argument (not when using \`-p,--package\`). `, examples: [[ `Use create-vite to scaffold a new Vite project`, `yarn dlx create-vite`, + ], [ + `Install a specific version of a package`, + `yarn dlx create-vite@4 my-project`, ], [ `Install multiple packages for a single command`, `yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`, + ], [ + `Install a specific version using the -p flag`, + `yarn dlx -p typescript@5.0.4 tsc --version`, ]], }); From 9e850e03f1463497819d2a40a878a8c6eaf7d573 Mon Sep 17 00:00:00 2001 From: Edwin Jarvis Date: Wed, 15 Apr 2026 14:00:47 +0300 Subject: [PATCH 2/2] chore: add release strategy for dlx docs update --- .yarn/versions/725295c4.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .yarn/versions/725295c4.yml diff --git a/.yarn/versions/725295c4.yml b/.yarn/versions/725295c4.yml new file mode 100644 index 000000000000..a2b44ea5cb21 --- /dev/null +++ b/.yarn/versions/725295c4.yml @@ -0,0 +1,2 @@ +declined: + - "@yarnpkg/plugin-dlx" \ No newline at end of file