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

Download private packages for Firefox code review #185

Closed
Tracked by #222
aklinker1 opened this issue Oct 26, 2023 · 1 comment · Fixed by #507
Closed
Tracked by #222

Download private packages for Firefox code review #185

aklinker1 opened this issue Oct 26, 2023 · 1 comment · Fixed by #507
Labels

Comments

@aklinker1
Copy link
Collaborator

aklinker1 commented Oct 26, 2023

Feature Request

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.

Additional context

N/A

@aklinker1
Copy link
Collaborator Author

aklinker1 commented Nov 7, 2023

This is a big feature that requires lots of steps to be done automatically:

  1. Parse <root>/.npmrc for custom scopes
  2. Parse <root>/.npmrc and ~/.npmrc to find auth
  3. List all packages in the project
  4. Filter down to a list that start with scopes with auth
  5. Use npm view <package-name> --json | jq dist.tarball to grab the private package URLs
  6. Download all the tarballs into .wxt/private-packages using this code
  7. Copy all sources to a temp directory
  8. Update the temp directory's package.json to resolve all the private packages to their local file path
  9. 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.

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