From 68017b018d57d1eb0e5fe803d589941059c5126f Mon Sep 17 00:00:00 2001 From: KyeongJooni <165972574+KyeongJooni@users.noreply.github.com> Date: Wed, 17 Dec 2025 22:55:58 +0900 Subject: [PATCH 1/2] feat: display registry URL when publishing packages Display the target registry URL at the start of yarn npm publish to help users verify their configuration and debug authentication errors Closes #6191 --- .yarn/versions/1cdc2320.yml | 23 +++++++++++++++++++ .../sources/commands/publish.test.ts | 1 + .../sources/commands/npm/publish.ts | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 .yarn/versions/1cdc2320.yml diff --git a/.yarn/versions/1cdc2320.yml b/.yarn/versions/1cdc2320.yml new file mode 100644 index 000000000000..31f0d02b09d1 --- /dev/null +++ b/.yarn/versions/1cdc2320.yml @@ -0,0 +1,23 @@ +releases: + "@yarnpkg/cli": patch + "@yarnpkg/plugin-npm-cli": patch + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-essentials" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-nm" + - "@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/acceptance-tests/pkg-tests-specs/sources/commands/publish.test.ts b/packages/acceptance-tests/pkg-tests-specs/sources/commands/publish.test.ts index 2f2de4430a13..ae4b02599849 100644 --- a/packages/acceptance-tests/pkg-tests-specs/sources/commands/publish.test.ts +++ b/packages/acceptance-tests/pkg-tests-specs/sources/commands/publish.test.ts @@ -97,6 +97,7 @@ describe(`publish`, () => { await run(`install`); const {stdout} = await run(`npm`, `publish`, `--dry-run`, `--tolerate-republish`); + expect(stdout).toContain(`Publishing to`); expect(stdout).toContain(`[DRY RUN]`); })); diff --git a/packages/plugin-npm-cli/sources/commands/npm/publish.ts b/packages/plugin-npm-cli/sources/commands/npm/publish.ts index 04bc719d1dc4..1bd1904732c4 100644 --- a/packages/plugin-npm-cli/sources/commands/npm/publish.ts +++ b/packages/plugin-npm-cli/sources/commands/npm/publish.ts @@ -80,6 +80,8 @@ export default class NpmPublishCommand extends BaseCommand { stdout: this.context.stdout, json: this.json, }, async report => { + report.reportInfo(MessageName.UNNAMED, `Publishing to ${registry}`); + // Not an error if --tolerate-republish is set if (this.tolerateRepublish) { try { From 78564e7a1ddcb4649fa37b6c2e1904fef0993438 Mon Sep 17 00:00:00 2001 From: KyeongJooni <165972574+KyeongJooni@users.noreply.github.com> Date: Thu, 18 Dec 2025 09:49:01 +0900 Subject: [PATCH 2/2] feat: simplify dry-run message and add tag info to publish log - Include tag in initial publish message - Remove redundant registry/tag info from dry-run message --- .../pkg-tests-specs/sources/commands/publish.test.ts | 2 +- packages/plugin-npm-cli/sources/commands/npm/publish.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/acceptance-tests/pkg-tests-specs/sources/commands/publish.test.ts b/packages/acceptance-tests/pkg-tests-specs/sources/commands/publish.test.ts index ae4b02599849..49b49b46b900 100644 --- a/packages/acceptance-tests/pkg-tests-specs/sources/commands/publish.test.ts +++ b/packages/acceptance-tests/pkg-tests-specs/sources/commands/publish.test.ts @@ -98,7 +98,7 @@ describe(`publish`, () => { const {stdout} = await run(`npm`, `publish`, `--dry-run`, `--tolerate-republish`); expect(stdout).toContain(`Publishing to`); - expect(stdout).toContain(`[DRY RUN]`); + expect(stdout).toContain(`dry run`); })); test(`should support --json flag`, makeTemporaryEnv({ diff --git a/packages/plugin-npm-cli/sources/commands/npm/publish.ts b/packages/plugin-npm-cli/sources/commands/npm/publish.ts index 1bd1904732c4..4d8d108733e5 100644 --- a/packages/plugin-npm-cli/sources/commands/npm/publish.ts +++ b/packages/plugin-npm-cli/sources/commands/npm/publish.ts @@ -80,7 +80,7 @@ export default class NpmPublishCommand extends BaseCommand { stdout: this.context.stdout, json: this.json, }, async report => { - report.reportInfo(MessageName.UNNAMED, `Publishing to ${registry}`); + report.reportInfo(MessageName.UNNAMED, `Publishing to ${registry} with tag ${this.tag}`); // Not an error if --tolerate-republish is set if (this.tolerateRepublish) { @@ -173,7 +173,7 @@ export default class NpmPublishCommand extends BaseCommand { } const finalMessage = this.dryRun - ? `[DRY RUN] Package would be published to ${registry} with tag ${this.tag}` + ? `Package archive not published (dry run)` : `Package archive published`; report.reportInfo(MessageName.UNNAMED, finalMessage);