-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 usage of .cjs
, .mjs
, and type=module
custom publishers
#8868
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d9878fd The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
…ppInfo` is created). clear listeners after build. enable listeners to be added as promises
…-publisher # Conflicts: # packages/electron-builder-squirrel-windows/src/SquirrelWindowsTarget.ts
@@ -288,36 +288,36 @@ File `myBeforePackHook.js` in the project root directory: | |||
} | |||
``` | |||
*/ | |||
readonly beforePack?: Hook<BeforePackContext, any> | string | null | |||
readonly beforePack?: Hook<BeforePackContext, void> | string | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second parameter for all Hooks is void. Given this, should we consider removing this void parameter for now and only keep the first parameter? We can always add it back later if needed.
this.eventEmitter.on("beforePack", resolveFunction(type, this.config.beforePack, "beforePack"), "user") | ||
this.eventEmitter.on("afterExtract", resolveFunction(type, this.config.afterExtract, "afterExtract"), "user") | ||
this.eventEmitter.on("afterPack", resolveFunction(type, this.config.afterPack, "afterPack"), "user") | ||
this.eventEmitter.on("afterSign", resolveFunction(type, this.config.afterSign, "afterSign"), "user") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we consider introducing a state machine in the future? If a certain state fails, it could revert to the previous state and retry?
@@ -132,6 +132,9 @@ export function build(options: PackagerOptions & PublishOptions, packager: Packa | |||
promise = publishManager.awaitTasks() | |||
} | |||
|
|||
return promise.then(() => process.removeListener("SIGINT", sigIntHandler)) | |||
return promise.then(() => { | |||
packager.clearPackagerEventListeners() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If any one of the states fails, will it be released here?
Resolves: #8862
Adds
AsyncEventEmitter
:emit
resolveFunction
for user hooks to the beginning of the packagerbuild
process so users can detect errors early if import is incorrectAdds unit test to cover all core user-provided hooks