Skip to content

feat: support customize npmPublishHint #57

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

Merged
merged 3 commits into from
Mar 15, 2023
Merged

feat: support customize npmPublishHint #57

merged 3 commits into from
Mar 15, 2023

Conversation

bytemain
Copy link

@bytemain bytemain commented Feb 20, 2023

I'm using some npm client that not npm.

so I want it directly show yarn publish

BEGIN_COMMIT_OVERRIDE
feat: Support customizing the npm publish hint message with a new option: npmPublishHint
END_COMMIT_OVERRIDE

@TimothyJones
Copy link
Member

Hmm. Is it always publish for custom npm commands?

@bytemain
Copy link
Author

Yes, I'm just using yarn as an example. In our team, we can only use specific NPM Client to publish package.

@bytemain bytemain changed the title feat: support config npmClient feat: support custom configuration npmClient Feb 20, 2023
@bytemain
Copy link
Author

Oh, I see what you mean. You mean let the user customize the whole publish command?

@TimothyJones
Copy link
Member

Yeah. I'm not sure if there is a way to let the hint be easily parameterisable without running into potential issues (like the custom client not supporting publish). The git command isn't always correct either.

I think generally if the hint is not correct, then you probably already know what it means and how to translate it. However, I do take your point that it would be nice if the hint were correct.

It might be better to either:

  1. Allow the entire hint to be customised
    or
  2. For the common cases (npm and yarn) we could look for the respective lock file and hint accordingly.

@TimothyJones
Copy link
Member

What do you think?

@bytemain
Copy link
Author

We can use https://www.npmjs.com/package/detect-package-manager to detect current directory package manager.

And we can provide two options:

  • npmClientName
  • npmClientPublishCommand

How about this? then most user can only change the npmClientName.

@TimothyJones
Copy link
Member

TimothyJones commented Feb 20, 2023 via email

@bytemain
Copy link
Author

for [If you feel strongly that it should be configurable], my answer is yes.
because our package manager is a private package, it's an npm based manager, but with a changed name.

so we will provide an option:

  • npmPublishHint

If the user does not set this configuration, we will automatically detect package manager and construt it to${clientName} publish

@bytemain bytemain changed the title feat: support custom configuration npmClient feat: support customize configuration npmPublishHint Feb 23, 2023
@bytemain bytemain changed the title feat: support customize configuration npmPublishHint feat: support customize npmPublishHint Feb 23, 2023
@bytemain
Copy link
Author

@TimothyJones hello, I have implemented the relevant functions, pls have a look, thank you~

@TimothyJones
Copy link
Member

Apologies! I thought I had reviewed and merged this. I'll get it out now.

Thanks again!

@TimothyJones TimothyJones merged commit 1f77110 into absolute-version:master Mar 15, 2023
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.

2 participants