Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .yarn/versions/2a82f92f.yml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe(`Commands`, () => {
});

expect(manifest.resolutions).toEqual({
[`no-deps@npm:1.0.0`]: expect.stringMatching(/^patch:no-deps/),
[`no-deps@npm:1.0.0`]: expect.stringMatching(/^patch:no-deps/),
});
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,31 @@ describe(`publish`, () => {
expect(Array.isArray(result.files)).toBe(true);
}));

test(`should correctly log name of scoped workspace`, makeTemporaryEnv({
name: `@scope/json-test`,
version: `1.0.0`,
}, async ({path, run, source}) => {
await run(`install`);

const {stdout} = await run(`npm`, `publish`, `--json`, `--dry-run`, `--tolerate-republish`);
const jsonObjects = misc.parseJsonStream(stdout);
const result = jsonObjects.find((obj: any) => obj.name && obj.version);

expect(result).toBeDefined();
expect(result).toHaveProperty(`name`, `@scope/json-test`);
expect(result).toHaveProperty(`version`, `1.0.0`);
expect(result).toHaveProperty(`dryRun`, true);
expect(result).toHaveProperty(`registry`);
expect(result).toHaveProperty(`published`, false);
expect(result).toHaveProperty(`message`);

expect(result).toHaveProperty(`tag`);
expect(result).toHaveProperty(`provenance`);

expect(result).toHaveProperty(`files`);
expect(Array.isArray(result.files)).toBe(true);
}));

testIf(
() => !!process.env.ACTIONS_ID_TOKEN_REQUEST_URL,
`should publish a package with a valid provenance statement`,
Expand Down
16 changes: 8 additions & 8 deletions packages/plugin-npm-cli/sources/commands/npm/publish.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {BaseCommand, WorkspaceRequiredError} from '@yarnpkg/cli';
import {Configuration, MessageName, Project, ReportError, StreamReport, scriptUtils, miscUtils} from '@yarnpkg/core';
import {npath} from '@yarnpkg/fslib';
import {npmConfigUtils, npmHttpUtils, npmPublishUtils} from '@yarnpkg/plugin-npm';
import {packUtils} from '@yarnpkg/plugin-pack';
import {Command, Option, Usage, UsageError} from 'clipanion';
import {BaseCommand, WorkspaceRequiredError} from '@yarnpkg/cli';
import {Configuration, MessageName, Project, ReportError, StreamReport, scriptUtils, miscUtils, structUtils} from '@yarnpkg/core';
import {npath} from '@yarnpkg/fslib';
import {npmConfigUtils, npmHttpUtils, npmPublishUtils} from '@yarnpkg/plugin-npm';
import {packUtils} from '@yarnpkg/plugin-pack';
import {Command, Option, Usage, UsageError} from 'clipanion';

// eslint-disable-next-line arca/no-default-export
export default class NpmPublishCommand extends BaseCommand {
Expand Down Expand Up @@ -97,7 +97,7 @@ export default class NpmPublishCommand extends BaseCommand {
const warning = `Registry already knows about version ${version}; skipping.`;
report.reportWarning(MessageName.UNNAMED, warning);
report.reportJson({
name: ident.name,
name: structUtils.stringifyIdent(ident),
version,
registry,
warning,
Expand Down Expand Up @@ -176,7 +176,7 @@ export default class NpmPublishCommand extends BaseCommand {

report.reportInfo(MessageName.UNNAMED, finalMessage);
report.reportJson({
name: ident.name,
name: structUtils.stringifyIdent(ident),
version,
registry,
tag: this.tag || `latest`,
Expand Down