-
Notifications
You must be signed in to change notification settings - Fork 3k
Replace metadata + fetch + cache code #15666
Conversation
692ff0e
to
892f531
Compare
@zkat If we can get this patch as is, passing tests, I think I'd like to merge it before we move on to further integration. What do you think? |
@iarna https://github.com/zkat/pacote/milestone/2 There is now a dedicated milestone for |
6465f26
to
d841f73
Compare
6f1b69a
to
2ae141b
Compare
82b69ca
to
cac64b7
Compare
@zkat I'm considering recommending |
@simonua I would even recommend you keep the npm4 cache around until you've confirmed npm5 is currently stable enough on your own project. But cache clear is the way to go once you're ready -- you can also manually preserve |
The npm 5 announcement says “ But only one of these can be true:
Which is it? |
@alanhogan they have been deprecated, and their semantics have been limited due to the design of the underlying cache (which works entirely through http cache rules). The reason they haven't been removed is so that anyone who had things like Furthermore, we consider the act of deprecation to be a breaking change, as a matter of policy. Deprecations might just not happen to break CI (they might, sometimes, if there's new |
This landed in |
Excellent explanation, thank you. |
Was
If so, docs should probably be updated now that v5 is out |
@rally25rs https://github.com/npm/npm/blob/latest/doc/cli/npm-cache.md the docs are updated, but there's issues with the auto-deploy scripts that push them to the site. The removal was intentional: the cache structure changed so much that it's gonna take a bit before there can be a replacement. |
Summary
This PR replaces everything in the current codebase having to do with "give me the metadata for this package" and "extract this package to this place" with a single library,
pacote
which abstracts away the whole thing. This includes all the caching code, sincepacote
handles all of that internally throughcacache
This means the following bits are being entirely replaced:
fetchPackageMetadata
lib/cache
mapToRegistry
cache.*
in various parts of the codebaselib/doctor
having to do with cache verification (cacache
has its own verifier this can call)On the user side, the only
breaking
change will be that the cache structure will have completely changed, and some incidentals of cache management may end up getting tweaked, but by the time this is done, it should be mostly compatible.Status
Initial registry dep support in
pacote
is sketched out, and integration can begin. Expect lots of loose ends and a lot of back-and-forth between the libraries as the API is sussed out in more detail.UPDATE (2017-04-17):
This branch is now usable. It needs some fixes, and the test suite is still failing due to compatibility issues and probably-minor issues. It is not production ready, but it runs and it works. All the work on it is now going into getting the npm test suite passing, at which point we'll be able to do a final review + merge.
UPDATE (2017-03-14):
Currently, cacache is production-ready, fast, and really damn reliable.
Most work is currently focused on pacote, and finishing up and testing that all of its package types actually work. This should be done soon, and then this branch can start moving again. The only major component left is git support.
pacote@1
will be tagged once that's done, and further versions added during integration and test fixing for the npm CLI test suite (which I haven't run and am kinda terrified about)I want to help!
Cool! Head on over to the pacote and cacache git repositories and look in the issues for
help-wanted
andstarter
bits and comment there if you want to help with those.