chore(suite-desktop): rewrite builder hooks to ESM#18680
Merged
Conversation
Lemonexe
commented
May 1, 2025
| "main": "src/app.ts", | ||
| "scripts": { | ||
| "build:scripts": "yarn g:rimraf ./lib && yarn g:tsc --build tsconfig.scripts.json", | ||
| "build:scripts": "yarn g:rimraf ./lib && yarn g:tsc --build tsconfig.scripts.json && find ./lib -name '*.js' -exec bash -c 'mv \"$0\" \"${0%.js}.mjs\"' {} \\;", |
Contributor
Author
There was a problem hiding this comment.
kinda hacky; what's going on here?
We have to indicate ESM to electron-builder somehow, it can't tell automatically.
Two ways to do that:
"type": "module"insuite-desktop/package.json- can't do that yet, because it's this line that indicates to electron-builder if Electron Main is ESM/CJS, so I'll do that in Electron-main with ESM-only deps #14482
mjsextension, but tsconfig doesn't offer custom extension- so this bash script is a temporary measure to be removed when
suite-desktopis entirely ESM - this shouldn't break Windows-native development because that's done only in Git Bash for Windows..
- so this bash script is a temporary measure to be removed when
Lemonexe
commented
May 1, 2025
| const TOKEN_PASSWORD = process.env.WINDOWS_SIGN_TOKEN_PASSWORD; | ||
|
|
||
| require('child_process').execSync( | ||
| execSync( |
Contributor
Author
There was a problem hiding this comment.
Because I broke app update on Windows the last time I touched this, I tested now that the sha sums are correct with codesign windows build (locally self-signed):
$ shasum -a 512 ./Trezor-Suite-25.5.0-win-x64.exe | awk '{print $1}' | xxd -r -p | base64
tRQT0caKMhW0Tn90OXtaHsbXR4PJbUnVWcXTjaDYjF8M4PVZYoAuQYVXwN1gIJJEczE+rGQaTboi
nvgnhPVqRQ==
$ cat latest.yml | head -7 | tail -1
sha512: tRQT0caKMhW0Tn90OXtaHsbXR4PJbUnVWcXTjaDYjF8M4PVZYoAuQYVXwN1gIJJEczE+rGQaTboinvgnhPVqRQ==
Linux build just for completeness:
$ shasum -a 512 ./Trezor-Suite-25.5.0-linux-x86_64.AppImage | awk '{print $1}' | xxd -r -p | base64
rKO5i6aVHMuOTV6maqwyI3xpXn3TcgYAZWnMKh0WoPS1ptm7hC0LAc2N+0UzYu0avhMMZrenc13P
LFXJ9lO0xw==
$ cat latest-linux.yml | head -4 | tail -1
sha512: rKO5i6aVHMuOTV6maqwyI3xpXn3TcgYAZWnMKh0WoPS1ptm7hC0LAc2N+0UzYu0avhMMZrenc13PLFXJ9lO0xw==
Lemonexe
commented
May 1, 2025
| "module": "ESNext", | ||
| "declaration": false, | ||
| "sourceMap": false, | ||
| "declarationMap": false, |
Contributor
Author
There was a problem hiding this comment.
Do not emit .map.js, d.ts, .map.d.ts
It's not a library, the point of using TS is to just typecheck during transpilation & execute it right away.
Lemonexe
commented
May 1, 2025
| console.log(`notarizing ${appPath} ...`); | ||
|
|
||
| return notarize({ | ||
| tool: 'notarytool', |
Contributor
Author
There was a problem hiding this comment.
'notarytool' is now the only tool, after 'legacy' tool was deprecated & removed in previous version.
komret
approved these changes
May 2, 2025
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.
Description
@electron/notarizeto 3, which is now available only as ESMRelated Issue
Resolve #18091
🔍🖥️ Suite web test results: View in Currents
🔍🖥️ Suite desktop test results: View in Currents