Skip to content

Tags: electron/get

Tags

v5.0.0

Toggle v5.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat!: replace got with native fetch as default downloader (#376)

BREAKING CHANGE: The default downloader now uses the built-in Fetch API
instead of the got package. The GotDownloader and GotDownloaderOptions
exports have been removed; use FetchDownloader and FetchDownloaderOptions
instead. Download options now accept RequestInit options instead of got
options. The initializeProxy() function now uses undici's EnvHttpProxyAgent
instead of global-agent, reading HTTP_PROXY/HTTPS_PROXY/NO_PROXY environment
variables directly (GLOBAL_AGENT_* prefixed variables are no longer
supported).

Co-authored-by: Claude <noreply@anthropic.com>

v4.0.3

Toggle v4.0.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: proxy ESM loading, progress bar suppression, and temp directory …

…handling (#375)

* test: add failing tests documenting identified bugs

Adds test/bugs.spec.ts with 6 failing tests that demonstrate 5 bugs:

1. GotDownloader progress bar suppression uses || instead of &&,
   so neither quiet:true nor ELECTRON_GET_NO_PROGRESS alone
   suppresses the progress bar (src/GotDownloader.ts:52).

2. GotDownloader leaks its 30s progress timer when a download
   fails because clearTimeout is not in a finally block
   (src/GotDownloader.ts:79-91).

3. initializeProxy() calls require() which is undefined in ESM,
   silently breaking proxy support (src/proxy.ts:36).

4. validateArtifact() does not forward tempDirectory to the
   nested SHASUMS256.txt download, so checksums are written to
   os.tmpdir() regardless of user config (src/index.ts:77-88).

5. validateArtifact() leaks an empty temp directory when
   cacheMode is ReadOnly/Bypass and checksums are not provided,
   because the cleanup finally deletes the wrong directory
   (src/index.ts:111-120).

* fix: use createRequire to load global-agent in ESM context

The package is published as ESM ("type": "module"), so bare
require() is undefined at runtime. The try/catch swallowed the
ReferenceError, causing proxy support to silently never work.

Define require via createRequire(import.meta.url) so the optional
dependency can be loaded synchronously as before.

* fix: correct progress bar suppression condition

The condition used || instead of &&, so neither `quiet: true`
alone nor ELECTRON_GET_NO_PROGRESS alone suppressed the progress
bar. Both had to be set simultaneously, contradicting the
documented behavior.

* fix: clear progress timer on download failure

If pipeline() threw, the 30-second progress-bar timer was never
cleared and would fire after the download had already failed,
rendering a progress bar for a dead download. Move the cleanup
into a finally block.

* fix: propagate tempDirectory to SHASUMS256.txt download

The nested downloadArtifact call for checksum validation forwarded
most options but omitted tempDirectory, so SHASUMS256.txt was
always written under os.tmpdir() regardless of the caller's
configuration. This breaks setups where os.tmpdir() is read-only
or on a different filesystem.

* fix: always clean up validateArtifact temp directory

validateArtifact created its temp directory with ORPHAN mode when
the caller owned the output (ReadOnly/Bypass cache modes), but the
validation tempFolder never needs to outlive the function. When
checksums were not provided, the inner finally block deleted the
SHASUMS256 download directory instead, leaving an empty
electron-download-* directory behind on every ReadOnly/Bypass
download. Always use CLEAN mode for the validation tempFolder.

* refactor: replace deprecated url.parse with WHATWG URL

url.parse() and url.format() (legacy) are deprecated since
Node.js 11. Switch to the WHATWG URL API.

The new implementation produces identical cache-directory hashes
for all real-world Electron download URLs (verified against
github.com, nightlies, ports, and userinfo). Only the synthetic
test fixture URL with no path component hashes differently, so
the hardcoded expected hash in Cache.spec.ts is updated.

* test: reorganize new tests into appropriately named files

Split the tests from bugs.spec.ts into:
- test/GotDownloader.spec.ts (progress bar and timer cleanup)
- test/proxy.spec.ts (createRequire guard)
- test/index.spec.ts (tempDirectory handling, added to existing
  downloadArtifact describe block)

* test: add stable cache-key fixture for real download URL

Lock in the cache-directory hash for a real Electron release URL
so any future URL-parsing change that would invalidate on-disk
caches fails this test instead of silently shipping.

---------

Co-authored-by: Claude <noreply@anthropic.com>

v4.0.2

Toggle v4.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: avoid permission errors on windows during double-installs (#337)

* fix: avoid permission errors on windows during double-installs

* fix: dodgy test and use pipeline more

* wat

* damm internet 2 fast

v4.0.1

Toggle v4.0.1's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
fix: handle cross-device cache locations (#336)

Co-authored-by: Cacie Prins <142877+cacieprins@users.noreply.github.com>
Co-authored-by: Kevin Cui <bh@bugs.cc>

v4.0.0

Toggle v4.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat!: force v4 release (#316)

BREAKING CHANGE: Requires Node.js v22.12.0 LTS or higher. ESM-only.

v3.1.0

Toggle v3.1.0's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
feat: cacheMode option (#267)

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>

v3.0.0

Toggle v3.0.0's commit message

Verified

This commit was signed with the committer’s verified signature.
MarshallOfSound Samuel Attard
fix: force major release

BREAKING CHANGE: New minimum node version is node 14

v2.0.3

Toggle v2.0.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: validate checksum of cached artifacts too (#212)

v2.0.2

Toggle v2.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: remove global-tunnel-ng library (#227)

v2.0.1

Toggle v2.0.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #221 from electron/ddramone/custom-version

fix: support npmrc for custom-version env variable