Skip to content

Commit c15f59c

Browse files
authored
fix(dlx): preserve tags (#4395)
1 parent 870ab9f commit c15f59c

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

.yarn/versions/27b23f7e.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
releases:
2+
"@yarnpkg/cli": patch
3+
"@yarnpkg/plugin-dlx": patch
4+
5+
declined:
6+
- "@yarnpkg/plugin-compat"
7+
- "@yarnpkg/plugin-constraints"
8+
- "@yarnpkg/plugin-essentials"
9+
- "@yarnpkg/plugin-init"
10+
- "@yarnpkg/plugin-interactive-tools"
11+
- "@yarnpkg/plugin-nm"
12+
- "@yarnpkg/plugin-npm-cli"
13+
- "@yarnpkg/plugin-pack"
14+
- "@yarnpkg/plugin-patch"
15+
- "@yarnpkg/plugin-pnp"
16+
- "@yarnpkg/plugin-pnpm"
17+
- "@yarnpkg/plugin-stage"
18+
- "@yarnpkg/plugin-typescript"
19+
- "@yarnpkg/plugin-version"
20+
- "@yarnpkg/plugin-workspace-tools"
21+
- "@yarnpkg/builder"
22+
- "@yarnpkg/core"
23+
- "@yarnpkg/doctor"

packages/acceptance-tests/pkg-tests-specs/sources/commands/dlx.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,14 @@ describe(`Commands`, () => {
150150
});
151151
}),
152152
);
153+
154+
test(
155+
`it should use the exact tag specified`,
156+
makeTemporaryEnv({}, async ({path, run, source}) => {
157+
await expect(run(`dlx`, `-p`, `has-bin-entries`, `-p`, `no-deps-tags@rc`, `has-bin-entries`)).resolves.toMatchObject({
158+
stdout: expect.stringContaining(`no-deps-tags@npm:1.0.0-rc.1`),
159+
});
160+
}),
161+
);
153162
});
154163
});

packages/plugin-dlx/sources/commands/dlx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class DlxCommand extends BaseCommand {
101101

102102
let command = structUtils.parseDescriptor(this.command).name;
103103

104-
const addExitCode = await this.cli.run([`add`, `--`, ...pkgs], {cwd: tmpDir, quiet: this.quiet});
104+
const addExitCode = await this.cli.run([`add`, `--fixed`, `--`, ...pkgs], {cwd: tmpDir, quiet: this.quiet});
105105
if (addExitCode !== 0)
106106
return addExitCode;
107107

0 commit comments

Comments
 (0)