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

Tarball directory structure to mirror NPM registry #25

Open
deskoh opened this issue May 16, 2021 · 7 comments
Open

Tarball directory structure to mirror NPM registry #25

deskoh opened this issue May 16, 2021 · 7 comments

Comments

@deskoh
Copy link
Contributor

deskoh commented May 16, 2021

Is it possible to allow the tarballs download directory structure to mirror npm registry? Specifically the .tgz would be in a - directory (e.g. node-tgz-downloader/-/node-tgz-downloader-3.11.2-preview1.tgz)?

The intent is for mirroring npm packages into AirGap environment, something like package-bundle, however package-bundle does not allow you to download packages according to package-lock.json file.

@Meir017
Copy link
Owner

Meir017 commented May 16, 2021

@deskoh is your goal to serve the tgz files using a simple static server?
I first started this project to work together with https://github.com/verdaccio/verdaccio

@deskoh
Copy link
Contributor Author

deskoh commented May 16, 2021

Oh yes! I'm currently using verdaccio in an airgap environment currently as a portable registry to proxy to another internal airgap Artifactory. It certainly brought about much convenience! (It's portable cos we might need to move to a different site)

The intent is to allow developers to self-service to bring in packages. package-bundle works great to bring in packages for Artifactory but when we need specific versions in package-lock.json, that workflow doesn't work anymore.

Any advice?

@deskoh
Copy link
Contributor Author

deskoh commented May 16, 2021

To add on, verdaccio also requires '-' in the directory structure. Other than the lack of CLI, to import into Artifactory would mean that I need some scripts to move each tgz file into - directory.

@Meir017
Copy link
Owner

Meir017 commented May 16, 2021

@deskoh all you need to do is iterate over all of the downloaded .tgz files and npm publish then to your verdaccio server
it will keep the original shasum and all of the original values.

you might need to enable the https://docs.npmjs.com/cli/v7/using-npm/config#ignore-scripts flag

@Meir017
Copy link
Owner

Meir017 commented May 16, 2021

@deskoh some packages might need special handling, for example the node-sass module tries to download artifacts from github releases.
I created https://github.com/meir017/node-sass-downloader/ to help with that

@deskoh
Copy link
Contributor Author

deskoh commented May 16, 2021

@deskoh all you need to do is iterate over all of the downloaded .tgz files and npm publish then to your verdaccio server
it will keep the original shasum and all of the original values.

you might need to enable the https://docs.npmjs.com/cli/v7/using-npm/config#ignore-scripts flag

Learnt something new. Currently package-bundle outputs a single tgz file for potentially 100's of packages that our developers can just drag and drop in Artifactory UI to upload.
Trying my luck to strive for a workflow with better developer experience for my fellow devs =)

@deskoh
Copy link
Contributor Author

deskoh commented May 16, 2021

@deskoh some packages might need special handling, for example the node-sass module tries to download artifacts from github releases.
I created https://github.com/meir017/node-sass-downloader/ to help with that

Awesome. This would be useful too! Currently we are downloading it manually based on arch and version required to manually mirror them. Other packages we encountered with such requirements are electron, cypress...

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

No branches or pull requests

2 participants