Skip to content

Conversation

@manurgdev
Copy link
Contributor

This pull request improves cross-platform compatibility, especially for macOS, and updates documentation and packaging for the project. The main changes include updating file path handling to use process.resourcesPath, adding macOS build and packaging support, and enhancing the README with clearer installation instructions.

Cross-platform path handling and packaging:

  • Updated getIndexPath, getPreloadPath, and getTemplateDatabasePath in electron/src/utils/paths.ts to use process.resourcesPath for better cross-platform compatibility (Windows/macOS/Linux), and adjusted template DB path to use app.asar.unpacked in production. [1] [2] [3]
  • Improved tests in electron/src/utils/paths.spec.ts to mock and restore process.resourcesPath, ensuring test reliability across platforms. [1] [2]
  • Updated the packaging configuration in package.json to add macOS (dist:mac), specify macOS build targets, icons, and DMG settings, and ensure prisma/template.db is included in packaged builds. [1] [2] [3]

Documentation and developer experience:

  • Enhanced the installation section in README.md to provide a clear download table for all platforms and updated the Prisma version badge. [1] [2]
  • Added new npm scripts for building platform-specific installers and documented them in the README. [1] [2]

Prisma/database configuration:

  • Updated prisma.config.ts to set the database URL from the environment or default path, and removed the deprecated earlyAccess flag.
  • Changed the database template update script to use prisma db push --force-reset instead of migrations, ensuring the template is always up-to-date with the schema.

DISCLAIMER: It would be good to review the build in Windows before merging to check that everything works as expected.

- Added macOS distribution script to package.json.
- Updated prisma.config.ts to use environment variable for database URL.
- Modified paths.ts for cross-platform compatibility in resource paths.
- Added template database file for initialization.
- Included new application icon for macOS.
- Added afterEach hook to restore original process.resourcesPath.
- Mocked process.resourcesPath for packaged mode tests to ensure accurate path resolution.
- Updated assertions to check for 'app.asar.unpacked' in path results.
@altaskur altaskur changed the base branch from main to develop January 22, 2026 22:46
@altaskur altaskur self-requested a review January 22, 2026 22:46
Copy link
Owner

@altaskur altaskur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds macOS packaging support and improves cross-platform runtime path resolution for the Electron app, alongside packaging, Prisma config, and documentation updates.

Changes:

  • Switch Electron packaged asset resolution to process.resourcesPath, and move the template DB to app.asar.unpacked.
  • Add dist:mac and electron-builder macOS/DMG configuration; include/unpack prisma/template.db in packaged builds.
  • Update Prisma config defaults and adjust docs/scripts around installation and DB template generation.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/update-db-template.mjs Updates template regeneration to use prisma db push --force-reset instead of migration reset.
prisma/template.db Adds a generated SQLite template database used for initializing new DBs.
prisma.config.ts Sets datasource URL from environment with a default SQLite file path; removes deprecated config.
package.json Adds macOS build script and electron-builder mac/DMG config; ensures template DB is packaged and unpacked.
electron/src/utils/paths.ts Uses process.resourcesPath for packaged asset paths; points template DB to app.asar.unpacked.
electron/src/utils/paths.spec.ts Updates tests to mock/restore process.resourcesPath and validate new template DB location.
README.md Updates installation instructions and scripts table (including macOS DMG).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@altaskur altaskur merged commit dee4f03 into altaskur:develop Jan 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants