feat: Allow node-notifier to work on Apple Silicon Macs - #441
Sebastian-Webster wants to merge 5 commits into
Conversation
|
FYI no activity by the owner and main contributor @mikaelbr on this project since 2022. |
|
Technically not true. He closed a spam issue here in 2024. But yes, practically true, after reaching somewhat stability of the scope of this package and not having used it personally for the last 8 years, maintaining it has become a low priority, and when other maintainers backed off I haven't actively vetted and recruited new maintainers. Problem with PRs like this is that it is vulnerable for supply chain attacks, as we have no checksum and no control of what is actually bundled, which can also trigger some security mechanisms. |
|
That's a fair point @mikaelbr. I guess a better approach could be to use GitHub Actions to pull the code from the terminal-notifier repository and compile it so it can be openly vetted by anyone? I imagine it won't be worth putting the effort into that if this project isn't actively maintained though. I just recompiled it as terminal-notifier is no longer actively maintained and didn't support Apple Silicon and I needed it to work on my Apple Silicon Mac without Rosetta being installed. A few months after creating this PR I no longer needed to use node-notifier so I had largely forgotten I created this PR. I'll leave this open in case anyone wants to make use of the changes but it makes sense why this won't be getting merged. |
|
Even worst, Apple will remove support for Intel based apps in short and this module will not run. My Mac is now spamming me with notifications about terminal-notifier |
|
I ran into this issue today too and found that terminal-notifier released 3.0.0 5 days ago with a universal binary. So no need to trust a built binary by someone else: https://github.com/julienXX/terminal-notifier/releases/tag/3.0.0 Maybe that can help move this ticket forward? |
The vendored terminal-notifier 1.7.2 is an x86_64-only binary. On Apple silicon it needs Rosetta, and on macOS 27 Intel binaries no longer run at all, so node-notifier fails on every build that uses webpack-notifier, gulp-notify and friends. Fixes mikaelbr#361, supersedes mikaelbr#441. terminal-notifier 3.x (julienXX/terminal-notifier, released August 2026) ships an official universal x86_64 + arm64 bundle built on Apple's UserNotifications framework. This commit vendors that release unchanged. Supply chain: the bundle is the upstream GitHub release asset terminal-notifier-3.1.0.zip, SHA-256 e969d4ae20287da1ba55495ae31dcedd8e9069deb8ce4eed24f6561a5fc3e4d5. scripts/update-terminal-notifier.sh downloads it, verifies that checksum and unpacks it into vendor/mac.noindex, so anyone can reproduce and audit what is committed. `codesign --verify --strict` passes on the bundle. Code changes needed for terminal-notifier 3: - Minimum macOS for native notifications is 10.14 (Darwin 18); utils.isMojaveOrLater() replaces isMountainLion() (kept as alias). - Responses are plain text instead of -json: the clicked action title, the typed reply, or @timeout / @closed / @ACTIONCLICKED. They are mapped back onto the existing { activationType, activationValue } shape, so callbacks and the click/replied/timeout events keep working. JSON output from older binaries used via customPath is still accepted. - Exit code 6 (timeout) is reported as a timeout, not an error. - -action is read from argv, one flag per button, unquoted; -reply may stand alone or take a placeholder string. - -appIcon and -sender are gone (the framework always uses the sending bundle's identity); they are dropped instead of producing stderr noise. - UNUserNotificationCenter refuses to request permission for a bundle LaunchServices has never seen, which is the case for an app inside node_modules. On that specific error the bundle is registered with lsregister once and the notification retried. Tested on macOS 27.0 arm64 without Rosetta (plain notification, action buttons with timeout, reply with placeholder) and with the jest suite.
Fixes #361
This was done by recompiling
terminal-notifierinto a universal binary so it can run on both Intel and Apple Silicon Macs.The latest macOS SDK at the time of writing (14.4) only supports macOS 10.13 - 14.4 so this will remove support for 10.9 - 10.12. For the no longer supported OS', Growl will be used instead.