99 Commits

Author SHA1 Message Date
Ben Gotow
4f09302077 Move to Electron 41, replace Electron clipboard API with navigator.clipboard (#2643)
* Upgrade Electron from 39.2.7 to 41.0.2 and address deprecations

- Bump `electron` from 39.2.7 → 41.0.2 in package.json
- Electron 40 deprecated direct clipboard API access from renderer
  processes. Migrate all renderer-side `clipboard.writeText()` calls
  (imported from 'electron') to the standard Web API
  `navigator.clipboard.writeText()` across 9 files:
    app/src/components/evented-iframe.tsx
    app/src/components/participants-text-field.tsx
    app/internal_packages/activity/lib/dashboard/share-button.tsx
    app/internal_packages/main-calendar/lib/core/event-attendees-input.tsx
    app/internal_packages/message-list/lib/message-controls.tsx
    app/internal_packages/onboarding/lib/oauth-signin-page.tsx
    app/internal_packages/thread-list/lib/thread-list-context-menu.ts
    app/internal_packages/thread-sharing/lib/copy-button.tsx
    app/internal_packages/thread-sharing/lib/thread-sharing-button.tsx
- Keep Electron clipboard.read() in composer-editor.tsx for
  platform-specific format reads (public.file-url, FileNameW,
  text/uri-list) which have no navigator.clipboard equivalent
- Main-process clipboard usage in application.ts is unchanged (not
  subject to the renderer deprecation)
- No action needed for Electron 41 breaking changes: the PDF
  WebContents change does not affect this app (PDFs are rendered via
  pdf.js in a separate BrowserWindow, not via MimeHandlerViewGuest),
  and the cookie change-event cause update does not affect this app
  (no cookie change listeners present)

https://claude.ai/code/session_01WBGx8XkrU7X1FhuXGdMygt

* Update package-lock.json for Electron 41.0.2 upgrade

Regenerate lock file to satisfy npm ci after bumping electron from
39.2.7 to 41.0.2. Also updates transitive deps @types/node and
undici-types to versions compatible with Node 24 (bundled in Electron 41).

https://claude.ai/code/session_01WBGx8XkrU7X1FhuXGdMygt

* Fix unhandled Promise rejections and dead clipboard test spies

navigator.clipboard.writeText() is async; the previous change left all
call sites fire-and-forget. Two problems fixed:

1. All 8 non-CopyButton call sites now chain .catch() so failures are
   logged to the console instead of producing unhandled rejection
   warnings (e.g. when context menu callbacks fire after the window
   loses focus).

2. copy-button.tsx previously showed "Copied" immediately regardless of
   whether the write succeeded. The UI update and 2-second timer are now
   moved into .then() so the label only changes on success. A truthy
   sentinel (true) is assigned to _timeout before the async call to
   block re-entry while the write is in-flight; clearTimeout(true) is a
   safe no-op so componentWillUnmount is unaffected. On failure _timeout
   is reset to null so the user can retry.

3. master-before-each.ts: remove dead spyOn(electron.clipboard, ...)
   stubs (production code no longer calls electron.clipboard.writeText
   from renderer) and replace with spyOn(navigator.clipboard, ...)
   stubs that return resolved Promises, matching the async API contract.

https://claude.ai/code/session_01WBGx8XkrU7X1FhuXGdMygt

* Fix node-gyp config so better-sqlite3 finds its prebuilt for Electron 41

Two related problems:

1. app/package.json pinned electron to "39.2.7" in its resolutions field
   while the root package.json (and npm_config_target in postinstall) was
   already at "41.0.2". The stale pin would override the correct version in
   the app's dependency subtree. Updated to "41.0.2" to stay in sync.

2. The electron npm environment in postinstall.js did not set
   npm_config_node_gyp. Without it, npm falls back to its own bundled
   node-gyp, which is typically older and does not recognise Electron 41 /
   Node.js 22 headers. prebuild-install (used by better-sqlite3) calls
   node-gyp when resolving the prebuilt binary URL; if it gets the wrong
   version it fails to match the ABI and either falls back to a slow
   source compile or errors out. Pointing npm_config_node_gyp at the
   project's node-gyp v12 binary ensures the correct headers are fetched
   and the prebuilt .node file is used.

https://claude.ai/code/session_01WBGx8XkrU7X1FhuXGdMygt

* Fix

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-17 20:46:53 -05:00
Ben Gotow
7c955071c7 Add ARM64 (aarch64) Linux build support (#2601)
* Add ARM64 (aarch64) Linux build support

Add the infrastructure to build, package, and test Mailspring on ARM64
Linux, following the same pattern used for x64 Linux and Apple Silicon.

Build system changes:
- postinstall.js: Add linux-arm64 mailsync S3 download path
- package-task.js: Explicitly set Linux arch via process.arch
- installer-linux-task.js: Add arm64 -> arm64 Debian arch mapping
- mkdeb: Skip execstack (x86-only tool) on non-x86 architectures
- snapcraft.yaml: Add arm64 to supported platforms

CI/CD:
- Add build-linux-arm64.yaml workflow using GitHub's native
  ubuntu-24.04-arm runners for building DEB, RPM, and Snap packages
- Include installation tests on Ubuntu, and Fedora arm64 containers

The RPM spec already handles ARM64 correctly since its %else branch
(64-bit library qualifiers) applies to both x86_64 and aarch64.

Prerequisite: ARM64 mailsync binaries must be built and uploaded to
S3 at mailspring-builds/mailsync/{hash}/linux-arm64/mailsync.tar.gz

https://claude.ai/code/session_019RpF8j6PpEQ4B1ME8x3Rbn

* Update .github/workflows/build-linux-arm64.yaml

Co-authored-by: indent-staging[bot] <246363610+indent-staging[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: indent-staging[bot] <246363610+indent-staging[bot]@users.noreply.github.com>
2026-02-10 21:35:32 -06:00
Ben Gotow
e606bfd1f4 Update node-abi to 3.87.0 and support prebuilt better-sqlite3 binaries (#2598)
- Bump node-abi from 3.67.0 to 3.87.0 so prebuild-install knows about
  Electron 39 (ABI 140)
- Remove npm_config_build_from_source: true so npm uses prebuilt
  binaries when available
- Update the nanosleep safety check to fall back to the .node shared
  library when the static sqlite3.a is absent (prebuilt case)

https://claude.ai/code/session_01TXFueZPdYvdMDJFDBjGMfV

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-07 13:18:29 -06:00
Ben Gotow
7dfa97473f Add an env var for running Intel builds on MacOS Silicon 2025-09-14 22:09:13 -05:00
Ben Gotow
450c85b121 Upgrade sqlite to 3.47.2 and fix npm install issue, no need to override HAVE_USLEEP anymore! 2024-12-31 13:37:49 -06:00
qiuzhiqian
07c62cca53 update zh-CN localization files (#2486)
* update zh-CN localization files

* fix: Mail server configuration cannot be performed when the domain name does not have a built-in template.

Create a fallback template. When the built-in template corresponding to the domain name cannot be found, use the fallback template to configure the server.

---------

Co-authored-by: xml <xiamengliang@uniontech.com>
2024-09-14 18:15:01 -05:00
Thomas Cauquil
4643adff0d Improve localization (#2466)
* feats: add script to improve localization

* fix: the script used to generate the translations didn't take certain concatenations into account.

Previously :
Many features are unavailable in plain-text mode. To create a single
Now :
Many features are unavailable in plain-text mode. To create a single plain-text draft, hold Alt or Option while clicking Compose or Reply.
-
Previously :
These features were %@ of the messages you sentin this time period, so these numbers do not reflect all of your activity. To enableread receipts and link tracking on emails you send, click the %@ or link tracking %@ icons in the composer.
Now :
These features were %@ of the messages you sent in this time period, so these numbers do not reflect all of your activity. To enable read receipts and link tracking on emails you send, click the %@ or link tracking %@ icons in the composer.
-
Previously :
To make changes to contacts in this account, you'll need to re-authorize Mailspring to access your data.\n\n
Now :
To make changes to contacts in this account, you'll need to re-authorize Mailspring to access your data.\n\nIn Mailspring's main window, go to Preferences > Accounts, select this account, and click \"Re-authenticate\". You'll be prompted to give Mailspring additional permission to update and delete your contacts.
...

* chore: improving the french and format-localizations.js executed

* feats: add templates to localizations

* fix(localization): define default template to english

* chore(localization): added explanations on how to use script files

---------

Co-authored-by: Ben Gotow <ben@foundry376.com>
2023-10-16 08:55:45 -05:00
Ben Gotow
b1ed7fbb8e Update URL for resolving Electron headers, atom.io is going away 2022-08-09 08:34:36 -05:00
Ben Gotow
af83444a63 Bump to 1.10.4, update changelog 2022-08-09 07:25:37 -05:00
Ben Gotow
e24c433b55 Move Windows assets to an x64 folder on the asset server 2022-08-08 18:07:54 -05:00
Rony Mesquita da Silva
79a0670995 Fix sync issue windows 11 (#2396)
* Changed postinstall.js and updated better-sqlite3 to fix Windows 11 version

* Updated Grunt build to avoid error on Windows 11

Co-authored-by: Ben Gotow <ben@foundry376.com>
2022-08-08 17:58:54 -05:00
Ben Gotow
3001c1c282 Build mailsync separately from Electron + Node deps so it can use separate a Visual Studio version 2022-04-17 21:16:55 -05:00
Ben Gotow
5cf60d4ba4 Fix rebuild of sqlite on win32 2022-03-11 17:10:01 -06:00
Ben Gotow
30ef802f84 Fix postinstall script, $(pwd) resolving incorrectly on AppVeyor 2021-04-16 10:25:15 -05:00
Ben Gotow
c10b917468 Fix postinstall script, npm dedupe can revert changes to a package install 2021-04-16 00:52:05 -05:00
Ben Gotow
fa46d4061d Stop npm from auditing a second time during better-sqlite3 installation 2021-04-16 00:32:14 -05:00
Ben Gotow
5a9d59dfac Use a custom build of sqlite that sets HAVE_USLEEP to resolve UI timeouts on Windows, macOS 2021-04-16 00:17:23 -05:00
Ben Gotow
8587133002 Fix Appveyor 2021-04-13 12:02:06 -05:00
Ben Gotow
02cb922dea When running from the Linux snap, use no-sandbox 2021-04-13 11:44:19 -05:00
Ben Gotow
4982064fba Fix AppVeyor build 2021-04-13 10:39:34 -05:00
Ben Gotow
31fae07129 Switch from root devDeps (conceptually correct) to deps so npm ci installs everything 2021-04-08 01:52:52 -05:00
Ben Gotow
149b389508 Replace Babel with TypeScript compiler, switch entire app to TypeScript 🎉 (#1404)
* Switch to using Typescript instead of Babel

* Switch all es6 / jsx file extensions to ts / tsx

* Convert Utils to a TS module from module.exports style module

* Move everything from module.exports to typescript exports

* Define .d.ts files for mailspring-exports and component kit… Yes it seems this is the best option :(

* Load up on those @types

* Synthesize TS types from PropTypes for standard components

* Add types to Model classes and move constructor constants to instance vars

* 9800 => 7700 TS errors

* 7700 => 5600 TS errors

* 5600 => 5330 TS errors

* 5330 => 4866 TS errors

* 4866 => 4426 TS errors

* 4426 => 2411 TS errors

* 2411 > 1598 TS errors

* 1598 > 769 TS errors

* 769 > 129 TS errors

* 129 > 22 TS errors

* Fix runtime errors

* More runtime error fixes

* Remove support for custom .es6 file extension

* Remove a few odd remaining references to Nylas

* Don’t ship Typescript support in the compiled app for now

* Fix issues in compiled app - module resolution in TS is case sensitive?

* README updates

* Fix a few more TS errors

* Make “No Signature” option clickable + selectable

* Remove flicker when saving file and reloading keymaps

* Fix mail rule item height in preferences

* Fix missing spacing in thread sharing popover

* Fix scrollbar ticks being nested incorrectly

* Add Japanese as a manually reviewed language

* Prevent the thread list from “sticking”

* Re-use Sheet when switching root tabs, prevent sidebar from resetting

* Ensure specs run

* Update package configuration to avoid shpping types

* Turn eslint back on - we will opt-in to the TS rules one by one
2019-03-04 11:03:12 -08:00
Ben Gotow
4cb1851b47 Fix regression on some linux distros - need to set curl CURLOPT_CAINFO 2019-02-11 08:51:17 -08:00
Ben Gotow
69cbfd3fc2 Fix handling of newlines in localized string extraction script 2018-10-09 17:17:46 -07:00
Ben Gotow
b38afe5e3f Make the find-strings script prune localizations and give an overview of completeness 2018-10-07 01:24:55 -07:00
Ben Gotow
05bd2cdc8c Make all strings in the app run through intl lookup 2018-10-06 23:27:27 -07:00
Ben Gotow
23081d2e10 Bump to a newer version of runas with 1.8.x support 2018-01-28 22:45:23 -08:00
Ben Gotow
c7e63bfe52 Lock Slate versions to prevent missing dep issue in prod, add warning 2018-01-21 10:36:21 -08:00
Ben Gotow
71eee04b42 Make postinstall script download last released version of mailsync #274 2017-10-30 12:51:08 -07:00
Ben Gotow
4e8a2abfc3 Make postinstall script to untar mailsync 2017-10-23 10:51:32 -07:00
Ben Gotow
ce090d82ae Package linux .so and .bin, ship a compressed tar.gz file, not just tar 2017-10-03 17:12:09 -07:00
Ben Gotow
78c975915a On Linux, link against most deps statically, bundle remaining with product 2017-10-03 00:20:02 -05:00
Ben Gotow
efcf5162d0 Enable postinstall downloading of C++ binaries 2017-09-05 14:16:34 -07:00
Ben Gotow
b698458766 Switch product name to “Mailspring” 2017-09-05 13:40:25 -07:00
Ben Gotow
cc486ce72a Stop shipping an entire extra copy of Electron inside the app… 🙃 2017-09-01 23:22:35 -07:00
Ben Gotow
717fe440e8 Replace references to Nylas in many places 2017-08-16 13:20:54 -07:00
Ben Gotow
38e5362b50 Place mailsync binary in ./app/dist to fix S3 path 2017-08-12 19:34:24 -07:00
Ben Gotow
c549fcc8ba Fix documentation generation, clean up ./app package dependencies 2017-08-11 11:38:25 -07:00
Ben Gotow
643a589974 Fix .travis.yml formatting, was not installing apt packages 2017-08-10 23:31:37 -07:00
Ben Gotow
b83a7fd426 Revert to Node 6.9+, Linux build failing with npm 4 2017-08-10 23:20:34 -07:00
Ben Gotow
29c89acb60 Enable app/node_modules caching, make postinstall check its Electron version 2017-08-10 22:47:06 -07:00
Ben Gotow
653618133b Remove “matrix” nesting in deploy block of .travis.yml 2017-08-10 21:45:05 -07:00
Ben Gotow
89200b5e67 Encrypt and commit Mac build secrets 2017-08-10 21:24:12 -07:00
Ben Gotow
7f3731bc10 Clean up project directory structure, removing legacy packages folder 2017-08-10 19:24:10 -07:00
Ben Gotow
c71d8fad72 Remove benchmark mode, npm scripts related to cloud codebase 2017-08-02 13:33:52 -07:00
Ben Gotow
555b4136b8 Remove lerna, revert postinstall script to Nov 2016 version 2017-08-02 13:13:30 -07:00
Ben Gotow
aa2e2a7624 Remove APM for now 2017-07-11 12:15:47 -07:00
Ben Gotow
efbea58e1e Overhaul TaskFactory.tasksForApplyingCategories, fix many specs 2017-06-27 11:31:22 -07:00
Ben Gotow
3c56e2fbfd Remove isomorphic-core and related packages 2017-06-24 20:34:01 -07:00
Ben Gotow
973a411145 Remote client-sync 2017-06-22 13:37:29 -07:00