简体   繁体   中英

Re-writing an npm package on github

I have a project that is used by a relatively decent number of people and has several contributors. I would like to rewrite the entire library in typescript but I'm not sure what the best way to go about it is. How do I preserve the history of the project while rewriting the entire project? My gut feel is to simply start with a fresh repo locally and then eventually push it as a new major revision but I'm not sure how that will effect the current for history? Any thoughts on this?

If you want to have everything in history same,

  1. create a new branch and replace all code with new typescript

  2. create a pull request.

  3. For conflicts you have to take local & ignore from server since you know your files are latest ones.

  4. merge pull request.
  5. verify all works.

By this approach it will have old history & contributors intact for tracking.

Although there are always some complications in something new from scratch like:

  • bugs/issues reported for old code are resolved or pending or even relevant now.

  • old un-merged pull request will either needs to merged if relevant otherwise it will become obsolete with new typescript code. I can see many open pull requests already.

  • new file names will have to history to track since added/replaced old but project will have intact history with contributions for reference.

Having new repository & replacing old will not track old contributions & there will be no way of tracking. You can also make new repository/project & leave old one intact but it is entirely up-to you and different decision.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM