Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(publish): error on missing name field #27131

Merged
merged 1 commit into from
Nov 28, 2024
Merged

Conversation

marvinhagemeister
Copy link
Contributor

This PR improves the error output on publish when the name filed is missing:

{
  "exports": "./mod.ts",
  "version": "0.0.1"
}

Before:

deno publish --dry-run
error: You did not specify an entrypoint in file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json. Add `exports` mapping in the configuration file, eg:
{
  "name": "@scope/name",
  "version": "0.0.0",
  "exports": "<path_to_entrypoint>"
}

After:

deno publish --dry-run
error: Missing 'name' field in 'file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json'.

Fixes #27116

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Seems I improved the exports error message too much lol

@marvinhagemeister marvinhagemeister merged commit 3553aa9 into main Nov 28, 2024
17 checks passed
@marvinhagemeister marvinhagemeister deleted the publish-name-error branch November 28, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing error message when trying to publish a package without a name
2 participants