Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

[BUG] [Improvement] Redirect a npmjs A package to npmjs B package from package.json config #76

Closed
1 task done
ganeshkbhat opened this issue Aug 16, 2022 · 5 comments
Closed
1 task done
Labels
Needs Triage needs an initial review

Comments

@ganeshkbhat
Copy link

ganeshkbhat commented Aug 16, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have to change the entire sourcecode for the npmjs project or use an local alias to install a different package B instead of package A.

Expected Behavior

I should be able to redirect a npmjs A package to npmjs B package from package.json config.

Citing my repositories as an example to ensure not to make phpcgijs old versions unfindable. What I am wishing to do is redirect phpcgijs to cgijs

package.json


{
...
"repository": {
    "type": "git",
    "url": "https://github.com/ganeshkbhat/cgi-js.git",
    "redirect": "newpackagename_preferably--OR--differentrepository"
  }
}

OR

{
...
"redirect": "newpackagename_preferably"
"repository": {
    "type": "git",
    "url": "https://github.com/ganeshkbhat/cgi-js.git"
  }
}

Steps To Reproduce

NA

Environment

  • npm: current
  • Node: current
  • OS: Windows/ OS/ Linux
  • platform: Windows/ OS/ Linux
@ganeshkbhat ganeshkbhat added the Needs Triage needs an initial review label Aug 16, 2022
@ljharb
Copy link

ljharb commented Aug 16, 2022

What's the use case? Either way, there's no current facility to do that, so that would need to be an RFC, not an issue on the config repo.

@ganeshkbhat
Copy link
Author

ganeshkbhat commented Aug 25, 2022

There are two needs for the feature request (bug).

  1. Redirect new versions of phpcgijs with old git repository to cgi-js with new cgijs git repository
  2. When version 1.0.0-beta7 of phpcgijs is installed it should point to old package and old git repository as it is now currently

The above was needed since phpcgijs was created first and then cgijs. Second, the cgijs codebase/method of usage became simpler and better codebase than phpcgijs implementation.

Using an local alias for these cases may not be an appropriate solution.

Would this be an RFC? If so, how do I create an RFC. I tried searching how to request new features but did not find where and how to?

Is this the place? https://github.com/npm/rfcs . I need help

@ljharb
Copy link

ljharb commented Aug 25, 2022

so do npm deprecate phpcgijs 'this package is deprecated; please `npm install cgi-js` instead'?

@nlf
Copy link
Contributor

nlf commented Aug 25, 2022

a local override is the only way to accomplish this, and we do not have plans to add package redirects. if it's something you're interested in you could start a discussion over at https://github.com/npm/feedback/discussions

@ganeshkbhat
Copy link
Author

ganeshkbhat commented Sep 22, 2022

Merging Issues. Seems this feature is being worked on already. I was not aware nor communicated. I though that was not nice at all.

npm/cli#5009
#76
npm/package-json#9

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs Triage needs an initial review
Projects
None yet
Development

No branches or pull requests

3 participants