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

feat: Allow users to pass a custom headers URL #8785

Conversation

lamawithonel
Copy link
Contributor

Prior to this packages/app-builder-lib/src/util/yarn.ts hard-coded the Electron headers disturl with no option to configure it for a local mirror. This commit changes it to try the environment variable npm_config_electron_headers_disturl before using the hard-coded value. This lets users set the variable
electron_headers_disturl=https://example.com/custom-headers-mirror to use a local mirror.

Copy link

changeset-bot bot commented Jan 19, 2025

🦋 Changeset detected

Latest commit: d66003b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lamawithonel lamawithonel force-pushed the feature/add_electron_headers_disturl branch 6 times, most recently from b2da338 to 3f101e2 Compare January 22, 2025 00:04
@mmaietta
Copy link
Collaborator

mmaietta commented Feb 1, 2025

@lamawithonel can you try setting your mirror value to env var NPM_CONFIG_ELECTRON_MIRROR or npm_config_electron_mirror.

@mmaietta
Copy link
Collaborator

mmaietta commented Feb 1, 2025

Honestly, I'd love to just migrate the entire logic to @electron/get but it looks like the API would require some breaking changes and we just bumped the major semver to v26.

I'll prep a PR with the changes so that we have a draft PR for the v27 (which will be timed with @electron upstream's upgrade to minimum node 22 that is occurring in the near future)

@lamawithonel
Copy link
Contributor Author

Changing the version here doesn't work quite how I thought it would. There is still a line in @electron/rebuild that fails when it's changed. The calling code from my package.json looks like this:

  "scripts": {
    "ci:install": "ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install",
    "postinstall": "electron-builder install-app-deps",

Prior to this `packages/app-builder-lib/src/util/yarn.ts` hard-coded the
Electron headers `disturl` with no option to configure it for a local
mirror.  This commit changes it to try the environment variable
`npm_config_electron_headers_disturl` before using the hard-coded value.
This lets users set the variable
`electron_headers_disturl=https://example.com/custom-headers-mirror` to
use a local mirror.
@mmaietta mmaietta merged commit b3adf48 into electron-userland:master Feb 2, 2025
14 of 15 checks passed
@github-actions github-actions bot mentioned this pull request Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants