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

Convert electron-builder config file to TS #1591

Merged
merged 10 commits into from
Apr 8, 2024
Merged

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Mar 29, 2024

Fixes #1462

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy added the T-Task Tasks for the team like planning label Mar 29, 2024
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy self-assigned this Mar 29, 2024
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
…into t3chguy/config-file-ts

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

# Conflicts:
#	yarn.lock
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy marked this pull request as ready for review April 5, 2024 17:44
@t3chguy t3chguy requested review from a team as code owners April 5, 2024 17:44
@t3chguy t3chguy requested review from dbkr, MidhunSureshR and richvdh and removed request for dbkr April 5, 2024 17:44
electron-builder.ts Show resolved Hide resolved
@@ -17,17 +17,17 @@ limitations under the License.
import path from "path";
import os from "os";
import nodePreGypVersioning from "node-pre-gyp/lib/util/versioning";
import { getElectronVersion } from "app-builder-lib/out/electron/electronVersion";
import { getElectronVersionFromInstalled } from "app-builder-lib/out/electron/electronVersion";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain how getElectronVersionFromInstalled differs from getElectronVersion, and why we need to change it as part of the TS translation? I couldn't find any documentation for them,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getElectronVersion evaluates the config and sees whether the electron version is overridden there, which requires evaluating electron-builder.ts which errors in the hak scripts like in https://github.com/element-hq/element-desktop/actions/runs/8480242660/job/23235652340?pr=1591

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... whereas getElectronVersionFromInstalled inspects what was actually used in the build, or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks at the version we dictate via package.json/yarn.lock, which is what getElectronVersion fell back to if it did not find an electron version specified in the builder config file (so no change for us)

@t3chguy t3chguy requested a review from richvdh April 8, 2024 09:57
@@ -123,6 +124,7 @@
"keytar": "^7.9.0"
},
"resolutions": {
"@types/node": "18.19.28"
"@types/node": "18.19.28",
"config-file-ts": "0.2.8-rc1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aaaaaaaaargh my kingdom for a config file format that lets you write COMMENTS

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the benefit of anyone who gets here via PR spelunking: this is a workaround for electron-userland/electron-builder#7775.

@t3chguy t3chguy merged commit 0461df8 into develop Apr 8, 2024
25 checks passed
@t3chguy t3chguy deleted the t3chguy/config-file-ts branch April 8, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.11.54 fails to build on windows
2 participants