Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import packages from registry.npmjs.org #39

Open
sonoman opened this issue Nov 4, 2013 · 4 comments
Open

Import packages from registry.npmjs.org #39

sonoman opened this issue Nov 4, 2013 · 4 comments

Comments

@sonoman
Copy link

sonoman commented Nov 4, 2013

I want to maintain a "snapshot" of packages I use for my products, as well as its dependencies. Is it possible ?

@bajtos
Copy link
Collaborator

bajtos commented Nov 5, 2013

Hi @sonoman, thank you for reporting the issue. See my comment in #9 for instructions on how to manually download packages from npmjs.org and store them in Reggie.

Since this requirement is recurring, I'll keep this issue open to serve as a reminded of a missing feature. My vision is to add a new command to the Reggie client that will do the snapshot in an automated way:

$ reggie mirror semver
$ reggie mirror semver@latest 
$ reggie mirror [email protected]

Having said that, I won't have bandwidth to implement this feature any time soon. I am happy to provide help and guidance if you (or anybody else) decide to contribute the implementation.

@sonoman
Copy link
Author

sonoman commented Nov 5, 2013

there's a tool called npm-mirror that uses the same package.json format to specify which packages do you want to synchronize.....you could specify reggie mirror ./package.json

@paolodm
Copy link
Contributor

paolodm commented Nov 8, 2013

I may be interested in taking this on.

How I'm seeing this working:

1. Download packages from npmjs.org into a local cache dir.
    a. If it is `reggie mirror semver`, it gets all versions, if a version is provided, then only that version.
2. Calls npm install --registry=reggie_url on the downloaded packages

@bajtos Were you thinking of running this as a one-time event or as a job that frequently checks?

@bajtos
Copy link
Collaborator

bajtos commented Nov 8, 2013

@paolodm Great!

Calls npm install --registry=reggie_url on the downloaded packages

I would prefer a solution that does not invoke npm. Dependencies should be (recursively) extracted from package.json or even directly from the data returned by npmjs.org. See how npm-mirror is doing this.

It would be super nice to extract the discovery of dependencies into a standalone module that can be used & shared by multiple projects - reggie, npm-mirror, even npm client itself.

Were you thinking of running this as a one-time event or as a job that frequently checks?

As an one-time event to keep reggie small and focused. There are already solutions for running a job periodically (e.g. cron or Windows Scheduler), there is no need to reinvent the wheel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants