Generate desktop build icons before electron packaging #299

Closed
opened 2026-06-05 16:34:53 +00:00 by steve · 0 comments
Owner

Electron packaging currently logs default Electron icon is used for macOS builds because required build-resource icons are not present when Electron Builder runs. The desktop package expects icons under packages/desktop-electron/build, but the repository intentionally ignores those generated files and no generation step runs before packaging.

Problem

pnpm --filter @lapis-notes/desktop-electron dist:mac:all and direct Electron Builder invocations can fall back to the default Electron icon (reason=application icon is not set) when build/icon.icns and related png assets are absent.

Goal

Ensure desktop package scripts always generate required icon assets before packaging so macOS x64/arm64 and Linux x64 artifacts use branded application icons.

Scope

  • Add a desktop icon generation script in packages/desktop-electron/scripts/.
  • Wire the icon generation step into desktop packaging scripts (package:dir, dist:mac, dist:mac:all, dist:linux).
  • Generate/update build/icon.png, build/icon-light.png, build/icon-dark.png, and macOS build/icon.icns (on macOS).
  • Keep package/spec docs in sync with the generated-icon workflow.

Non-goals

  • Redesign the app icon artwork.
  • Add Windows packaging targets.
  • Change release orchestration beyond ensuring icons are prepared before Electron Builder runs.

Acceptance Criteria

  • Desktop packaging scripts run an icon-generation step before Electron Builder.
  • On macOS, icon generation produces build/icon.icns from shared branding assets.
  • dist:mac:all no longer emits default Electron icon is used when run with generated assets present.
  • Linux packaging continues to use build/icon.png without regressions.
  • Spec documentation for @lapis-notes/desktop-electron reflects how icons are produced.

Implementation Notes

  • Source icon remains packages/workspace/src/assets/lapis.png.
  • Keep icon outputs generated (not committed) under packages/desktop-electron/build/ to match current ignore policy.
  • For macOS .icns, use host tooling (sips + iconutil) from a script rather than checking in binaries.

Suggested Files or Specs To Inspect

  • packages/desktop-electron/package.json
  • packages/desktop-electron/electron-builder.config.cjs
  • packages/desktop-electron/scripts/
  • packages/desktop-electron/spec.md
  • spec/src/20-packages/desktop-electron/index.md

Validation Commands

  • pnpm --filter @lapis-notes/desktop-electron package:dir
  • pnpm --filter @lapis-notes/desktop-electron dist:mac:all (macOS)
  • pnpm --filter @lapis-notes/desktop-electron dist:linux
  • pnpm --filter @lapis-notes/desktop-electron check:all
  • N/A

Follow-up Tasks

  • Add a lightweight CI assertion that required desktop icon build resources exist before Electron Builder runs.

Implementation Summary

Added desktop build icon generation preflight and wired package/dist scripts to regenerate icon resources before electron-builder for mac x64/arm64 and linux x64 packaging.

Electron packaging currently logs `default Electron icon is used` for macOS builds because required build-resource icons are not present when Electron Builder runs. The desktop package expects icons under `packages/desktop-electron/build`, but the repository intentionally ignores those generated files and no generation step runs before packaging. ## Problem `pnpm --filter @lapis-notes/desktop-electron dist:mac:all` and direct Electron Builder invocations can fall back to the default Electron icon (`reason=application icon is not set`) when `build/icon.icns` and related png assets are absent. ## Goal Ensure desktop package scripts always generate required icon assets before packaging so macOS x64/arm64 and Linux x64 artifacts use branded application icons. ## Scope - Add a desktop icon generation script in `packages/desktop-electron/scripts/`. - Wire the icon generation step into desktop packaging scripts (`package:dir`, `dist:mac`, `dist:mac:all`, `dist:linux`). - Generate/update `build/icon.png`, `build/icon-light.png`, `build/icon-dark.png`, and macOS `build/icon.icns` (on macOS). - Keep package/spec docs in sync with the generated-icon workflow. ## Non-goals - Redesign the app icon artwork. - Add Windows packaging targets. - Change release orchestration beyond ensuring icons are prepared before Electron Builder runs. ## Acceptance Criteria - Desktop packaging scripts run an icon-generation step before Electron Builder. - On macOS, icon generation produces `build/icon.icns` from shared branding assets. - `dist:mac:all` no longer emits `default Electron icon is used` when run with generated assets present. - Linux packaging continues to use `build/icon.png` without regressions. - Spec documentation for `@lapis-notes/desktop-electron` reflects how icons are produced. ## Implementation Notes - Source icon remains `packages/workspace/src/assets/lapis.png`. - Keep icon outputs generated (not committed) under `packages/desktop-electron/build/` to match current ignore policy. - For macOS `.icns`, use host tooling (`sips` + `iconutil`) from a script rather than checking in binaries. ## Suggested Files or Specs To Inspect - `packages/desktop-electron/package.json` - `packages/desktop-electron/electron-builder.config.cjs` - `packages/desktop-electron/scripts/` - `packages/desktop-electron/spec.md` - `spec/src/20-packages/desktop-electron/index.md` ## Validation Commands - `pnpm --filter @lapis-notes/desktop-electron package:dir` - `pnpm --filter @lapis-notes/desktop-electron dist:mac:all` (macOS) - `pnpm --filter @lapis-notes/desktop-electron dist:linux` - `pnpm --filter @lapis-notes/desktop-electron check:all` ## Related Issues - N/A ## Follow-up Tasks - Add a lightweight CI assertion that required desktop icon build resources exist before Electron Builder runs. ## Implementation Summary Added desktop build icon generation preflight and wired package/dist scripts to regenerate icon resources before electron-builder for mac x64/arm64 and linux x64 packaging. <!-- backlog:task_id=TASK-DESKTOP-ICON-BUILD-001 source_spec=spec/src/20-packages/desktop-electron/index.md -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#299
No description provided.