mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
## **Type**
enhancement
___
## **Description**
- Introduced a custom DMG packaging solution `@affine/appdmg-patch` for Electron applications.
- Implemented a new TypeScript class `MakerDmg` to handle the custom packaging logic, including support for custom backgrounds, icons, and app positioning within the DMG.
- Updated Electron Forge configuration to use the new `@affine/appdmg-patch` package instead of `@electron-forge/maker-dmg`.
- Adjusted package dependencies in `packages/frontend/electron/package.json`, adding `@affine/appdmg-patch` and removing `@electron-forge/maker-dmg`.
___
## **Changes walkthrough**
<table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement
</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>index.ts</strong><dd><code>Implement Custom DMG Packaging Logic</code> </dd></summary>
<hr>
tools/appdmg-patch/index.ts
<li>Introduced a new class <code>MakerDmg</code> extending <code>MakerBase</code> with support for <br>custom DMG packaging.<br> <li> Implemented custom DMG packaging logic including background, icon, and <br>app positioning.<br> <li> Added support for custom <code>contents</code> configuration to define the DMG <br>layout.<br>
</details>
</td>
<td><a href="https:/toeverything/AFFiNE/pull/5922/files#diff-96a537c04a2a740dca542688b3e6a65c67e6cf339b146bf0a9c49008ad58ea77">+80/-0</a> </td>
</tr>
</table></td></tr><tr><td><strong>Configuration changes
</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>forge.config.mjs</strong><dd><code>Update Electron Forge Configuration for Custom DMG Packaging</code></dd></summary>
<hr>
packages/frontend/electron/forge.config.mjs
<li>Replaced <code>@electron-forge/maker-dmg</code> with <code>@affine/appdmg-patch</code> in the <br>makers configuration.<br> <li> Adjusted DMG icon size and background configuration.<br>
</details>
</td>
<td><a href="https:/toeverything/AFFiNE/pull/5922/files#diff-bd3343a702deabb8f5f6f77e34fbc215615538875f59b68d82612c0f5ed532a3">+2/-3</a> </td>
</tr>
<tr>
<td>
<details>
<summary><strong>package.json</strong><dd><code>Introduce Package Configuration for Custom DMG Packaging</code> </dd></summary>
<hr>
tools/appdmg-patch/package.json
<li>Created a new package <code>@affine/appdmg-patch</code> with necessary dependencies <br>for custom DMG packaging.<br>
</details>
</td>
<td><a href="https:/toeverything/AFFiNE/pull/5922/files#diff-395b189951512e67d55b0abc55a167f014f239f608ec5b180f9c7d48e1ea9e8b">+16/-0</a> </td>
</tr>
</table></td></tr><tr><td><strong>Dependencies
</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>package.json</strong><dd><code>Update Package Dependencies for Electron Frontend</code> </dd></summary>
<hr>
packages/frontend/electron/package.json
<li>Added <code>@affine/appdmg-patch</code> to <code>devDependencies</code>.<br> <li> Removed <code>@electron-forge/maker-dmg</code> from <code>devDependencies</code>.<br>
</details>
</td>
<td><a href="https:/toeverything/AFFiNE/pull/5922/files#diff-37323e9da5e4b1606abb6eb8e5ff1516ae5fce925bceaafeeade61bd80c0b62d">+1/-1</a> </td>
</tr>
</table></td></tr></tr></tbody></table>
___
> ✨ **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions
7.8 KiB
7.8 KiB