You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Download private packages for Firefox code review #185
If your extension has private npm packages that require auth to upload, you don't want to share you token when generating sources.
We should download tarballs for all private packages, and update the zipped package.json to resolve to the local versions instead of the ones on the remote.
Private packages are any dependencies or sub-dependencies that start with a scope with a custom token in your .npmrc file.
Is your feature request related to a bug?
N/A
What are the alternatives?
Alternatively, we need to allow the .npmrc file to be zipped.
This is a big feature that requires lots of steps to be done automatically:
Parse <root>/.npmrc for custom scopes
Parse <root>/.npmrc and ~/.npmrc to find auth
List all packages in the project
Filter down to a list that start with scopes with auth
Use npm view <package-name> --json | jq dist.tarball to grab the private package URLs
Download all the tarballs into .wxt/private-packages using this code
Copy all sources to a temp directory
Update the temp directory's package.json to resolve all the private packages to their local file path
Zip temp directory
So I'm gonna put this off since all my extensions either don't use private packages or use a "private" randomized URL, which doesn't need auth to access it.
Also, several of these steps require different logic for each package manager.
Activity
aklinker1 commentedon Nov 7, 2023
This is a big feature that requires lots of steps to be done automatically:
<root>/.npmrcfor custom scopes<root>/.npmrcand~/.npmrcto find authnpm view <package-name> --json | jq dist.tarballto grab the private package URLs.wxt/private-packagesusing this codeSo I'm gonna put this off since all my extensions either don't use private packages or use a "private" randomized URL, which doesn't need auth to access it.
Also, several of these steps require different logic for each package manager.