Skip to content

Commit

Permalink
feat: use the name and the version after prepack
Browse files Browse the repository at this point in the history
  • Loading branch information
zouguangxian committed Sep 24, 2024
1 parent 5ac7395 commit f026bc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .yarn/versions/c78e53dc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
"@yarnpkg/plugin-npm-cli": patch
5 changes: 5 additions & 0 deletions packages/plugin-npm-cli/sources/commands/npm/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ export default class NpmPublishCommand extends BaseCommand {
await scriptUtils.maybeExecuteWorkspaceLifecycleScript(workspace, `prepublish`, {report});

await packUtils.prepareForPack(workspace, {report}, async () => {
if (workspace.manifest.name === null || workspace.manifest.version === null)
throw new UsageError(`Workspaces must have valid names and versions to be published on an external registry`);

const ident = workspace.manifest.name;

const files = await packUtils.genPackList(workspace);

for (const file of files)
Expand Down

0 comments on commit f026bc7

Please sign in to comment.