Modernize - Windows Build - #1401
Open
aaroncox wants to merge 7 commits into
Open
Conversation
Migrates config to the v26 schema: linux.desktop entries nest under `entry`, and win.publisherName moves into signtoolOptions. Drops the dead greymass.pfx reference. Windows packaging can no longer be cross-compiled from macOS — @electron/rebuild does not support node-hid's pkg-prebuilds binaries. Documented in AGENTS.md.
`@ledgerhq/hw-transport-node-hid@6.6.0` is TypeScript-compiled to ES5 and
inherits via the `__extends` helper, whose generated constructor calls
`_super.apply(this, arguments)`. It declares its base class as
`@ledgerhq/hw-transport-node-hid-noevents@^6.6.0`, and that caret range had
floated to 6.35.4, which ships a native ES6 `class`. Invoking an ES6 class
via `.apply()` throws, so every connection attempt failed with:
TypeError: Class constructor TransportNodeHidNoEvents
cannot be invoked without 'new'
This regressed in 77819d0, which added the node-hid/usb resolutions and
regenerated app/yarn.lock; the base class drifted as a side effect. Ledger
has been broken on this branch since, on all platforms.
The failure also leaked HID handles. `TransportNodeHid.open()` evaluates
`new HID(path)` as an argument before the constructor that throws, so the
opened device was orphaned with no reference and no close(). The leaked
handle blocked the next retry with "cannot open device" until GC reclaimed
it, producing an endless alternation between the two errors.
Upgrade the transport to 6.33.5 so both sides of the inheritance are ES6.
This requires moving the `usb` resolution from 1.7.2 to 2.9.0: 6.33.5's
listenDevices.js uses the usb 2.x named-export API (`usb.usb.on("attach")`),
which does not exist in 1.7.2 where the module *is* the binding. usb 2.9.0
also ships N-API prebuilds for win32-x64 and win32-ia32, removing the
per-arch source compile and surviving future Electron upgrades.
Bound the reconnect loop so a persistent failure no longer retries forever
and keeps the device busy. A renderer-initiated request resets the budget.
Also align before-quit on clearTimeout, matching the setTimeout handle.
Verified on Windows against a Nano X: transport opens and transactions sign.
The suite was written in 2019 and enforced by CircleCI until the npm to yarn migration broke that config, which then went unnoticed for years. By now 55 of the 61 files only asserted that components rendered exactly as they did in 2019, and Jest 24 could no longer parse its own dependencies, so nothing had run in a long time. Drops jest, enzyme, react-test-renderer and eslint-plugin-jest along with the test files, the dead CircleCI config, and the RunTests script no package script referenced. 221 packages leave the lockfile. @babel/polyfill stays: the main webpack config and main.dev.js both import it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.