plaid / npmserve-server Goto Github PK
View Code? Open in Web Editor NEWfast npm installs for slow clients
License: MIT License
fast npm installs for slow clients
License: MIT License
the default express timeout is 120000
(2 minutes). This means that any install running over 2 minutes will fail. Short-term let's dial up the timeout.
cc @soroushjp
We should add authentication to the server. Could use to investigate what existing auth services might work well here (maybe NPM or github) so that npmserve
can continue to be a natural extension of npm and wouldn't require new credentials (assuming that provides us with the right security guarantees)
Old builds on the server will eventually stop being downloaded. We should build a feature to expire and delete old build data to keep disk usage low. We should expose a web interface to configure expiration settings based on build date or last access date. Would be nice to have a way to configure the server to automatically run this job nightly.
The screenshot shows some buttons which we removed. Let's update it with a new version.
investigate and enable end-to-end server tests in circle CI.
see endtoend/server.js
.
Let's incorporate a DB to store build metadata, this is currently just reading files written to disk.
the raw node_modules
directories take up a lot of disk space, we can delete these after building the archive to prevent servers from filling up so quickly.
The server errors out when a package with no dependencies is uploaded. This is because node_modules
does not get created in the data directory, and then we try to tar
an archive that isn't there.
repro:
package.json
with no dependencies
or devDependencies
npmserve install
expected: return a tarball which decompresses, yielding an empty node_modules
actual: server 500 error, server responds with an error.
When we have a dependency like "foo": "0.0.x"
, npm might first install [email protected]
. Then when a new version 0.0.2
is a released, it'd be nice if npmserve
could detect a potential update and trigger a rebuild when the package is requested to make sure that all calls to /npm/install
return the latest dependencies.
npm shrinkwrap
POST /npm/install
builds with the latest dependencies and stores the node_modules.tar.gz
. It could also generate an npm shrinkwrap file indicating what dependency versions were used.POST /npm/install
generates a new shrinkwrap. If no changes, return cached node_modules.tar.gz
. If there are changes, do a full rebuild and return the result.npm update
Whenever we receive a POST /npm/install
for a cached package, run an npm update
on the server and rebuild the archive.
Configure a recurring job to rebuild and re-archive all packages on the server. This is the least intelligent approach but the easiest to implement.
These are ideas, not something we should necessarily jump into building as it has a high cost and will slow down installs in the average case. let's gather data on whether this would be worth the complexity before implementing. Right now users can do this manually by calling npmserve remove
and I suspect that might be good enough for most use cases.
s/conent-type/content-type
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.