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

[RRFC] Obey the specific dist-tag #606

Closed
2 of 3 tasks
gemwuu opened this issue Jun 29, 2022 · 2 comments
Closed
2 of 3 tasks

[RRFC] Obey the specific dist-tag #606

gemwuu opened this issue Jun 29, 2022 · 2 comments

Comments

@gemwuu
Copy link

gemwuu commented Jun 29, 2022

Motivation ("The Why")

Since @ljharb has already proposed an RRFC of obey user specifier, which will be implemented at the next major version of npm@9.

In my cases, when installing a new dependency using npm install antd@conch, I want my antd to keep the exact conch dist-tag in my package.json, because this is exactly the version I need in my project. By saying version, I mean the version conch points to, not the moment I run the install command.

And in the obey user specifier RRFC, @wesleytodd suggested a new flag to support that behavior is more reasonable.

Example

Assuming the dist-tag conch of antd currently binding to the exact version 4.20.7.

How

Current Behaviour

  1. Running npm install antd@conch should save the semantic versioning into package.json, hence ^4.20.7 shall be saved;
  2. Running npm install antd@conch --save-exact should save the exact version into package.json, hence 4.20.7 shall be saved.

Desired Behaviour

  1. Running npm install antd@conch --force should save the dist-tag into package.json, hence conch shall be saved;

References

@wesleytodd
Copy link

wesleytodd commented Jun 29, 2022

npm install antd@conch --force

I think that another flag would be my preference. I think --force in this case is ambiguous and since it is a common flag might already have some associated behavior (although I cannot think of one off the top of my head).

Something like --no-resolve-dist-tag? IDK, that seems weird to, but just thinking something which is more explicit to the expected behavior for this feature would be good.

EDIT: Sorry I just noticed you opened a PR, and I think I also see that you did update the flag. Should we close this issue in favor of the RFC itself?

@gemwuu
Copy link
Author

gemwuu commented Jun 30, 2022

npm install antd@conch --force

I think that another flag would be my preference. I think --force in this case is ambiguous and since it is a common flag might already have some associated behavior (although I cannot think of one off the top of my head).

Something like --no-resolve-dist-tag? IDK, that seems weird to, but just thinking something which is more explicit to the expected behavior for this feature would be good.

EDIT: Sorry I just noticed you opened a PR, and I think I also see that you did update the flag. Should we close this issue in favor of the RFC itself?

Of course

@gemwuu gemwuu closed this as completed Jun 30, 2022
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

No branches or pull requests

2 participants