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

docs: update publish docs: dist-tag + publish case #7560

Merged
merged 1 commit into from
May 28, 2024
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
docs: update publish docs: dist-tag + publish case
With feedback from @mbtools
  • Loading branch information
davidlj95 committed May 28, 2024
commit 377c5b3a7437126177f09324d675b5b51ab11e15
7 changes: 5 additions & 2 deletions tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1612,12 +1612,15 @@ See also the \`ca\` config.
If you ask npm to install a package and don't tell it a specific version,
then it will install the specified tag.

Also the tag that is added to the package@version specified by the \`npm tag\`
command, if no explicit tag is given.
It is the tag added to the package@version specified in the \`npm dist-tag
add\` command, if no explicit tag is given.

When used by the \`npm diff\` command, this is the tag used to fetch the
tarball that will be compared with the local files by default.

If used in the \`npm publish\` command, this is the tag that will be added to
the package submitted to the registry.



#### \`tag-version-prefix\`
Expand Down
7 changes: 5 additions & 2 deletions workspaces/config/lib/definitions/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2012,11 +2012,14 @@ const definitions = {
If you ask npm to install a package and don't tell it a specific version,
then it will install the specified tag.

Also the tag that is added to the package@version specified by the \`npm
tag\` command, if no explicit tag is given.
It is the tag added to the package@version specified in the
\`npm dist-tag add\` command, if no explicit tag is given.
Copy link
Contributor

Choose a reason for hiding this comment

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

The grammar of this sentence was not and still is not correct.

"The tag is also added to ... "

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I read it several times and thought something was wrong but wasn't 100% sure as not a native English speaker.

The tag is also added for me sounds like same tag is added in two places, whilst they're describing two different scenarios (what happens for the config / CLI arg in npm i vs npm dist-tag add.

Updated it to be:

It is the tag added to the package@version specified in the npm dist-tag add command, if no explicit tag is given.

Changed also the by -> in as the users specifies the package@version to the command (it's not the command the one specifying that string)

Though suggestions very welcome ofc


When used by the \`npm diff\` command, this is the tag used to fetch the
tarball that will be compared with the local files by default.

If used in the \`npm publish\` command, this is the tag that will be
added to the package submitted to the registry.
davidlj95 marked this conversation as resolved.
Show resolved Hide resolved
`,
flatten (key, obj, flatOptions) {
flatOptions.defaultTag = obj[key]
Expand Down
Loading