crudh / septagon-repository

A simple Node.js based private npm repository manager and proxy.
0 stars 0 forks source link

Add local package storage #16

Closed crudh closed 7 years ago

crudh commented 8 years ago

In preparation for local publishing. This storage should override everything that is proxied from upstream. If we have that in place before we build the user handling and publishing it will be much simpler.

crudh commented 7 years ago

This should be fairly simple:

  1. In the repository dir create local and upstream dirs.
  2. When a request comes in then check local for the package dir, and if it exists or if the repo has no upstream then use it.
  3. Otherwise use upstream.
  4. No need for any cascading logic, if there is a package dir in local that will be used and upstream will never be checked.

This needs to be done for both package files and dist files.

crudh commented 7 years ago

Until we support publishing local packages we can add tests where simply creating a package dir in local overrides upstream and returns 404 if it contains no package files. And we can do a test where we put an older version in local and make sure that that is used instead of the upstream one.

crudh commented 7 years ago

Implementation done in branch separate-local-and-upstream. But needs tests before merge.