Build & Scripts - Incomplete-Infinity/eve-companion GitHub Wiki

πŸ“œ Build & Scripts

This page outlines the key development and build scripts used in the EVE Companion App. It explains how we automate tasks like documentation, Swagger client generation, and packaging for distribution.


πŸ“¦ package.json Scripts

The following scripts are available for development and maintenance:

"scripts": {
  "start": "electron-forge start",
  "make": "electron-forge make",
  "package": "electron-forge package",
  "generate-esi": "swagger-typescript-api generate --path https://esi.evetech.net/latest/swagger.json --output ./src/api/esi --name index.ts --axios --modular --union-enums",
  "generate-docs": "jsdoc -c jsdoc.json",
  "prepare": "npm run generate-esi && npm run generate-docs",
  "test": "echo \"Error: no test specified\" && exit 1"
}

🧰 Script Breakdown

Script Purpose
start Launches the app in development mode using Electron Forge
make Builds distributable packages for the current platform
package Creates an unpackaged Electron app
generate-esi Regenerates the ESI Swagger client (src/api/esi)
generate-docs Generates developer documentation using JSDoc (/docs)
prepare Runs both ESI generation and documentation (generate-esi + generate-docs)

πŸ” Regenerating Swagger ESI Client

To regenerate the client from ESI's live Swagger definition:

npm run generate-esi

This will populate/update the folder:

src/api/esi/
β”œβ”€β”€ apis/
β”œβ”€β”€ models/
└── index.ts

⚠️ Recommended: Add src/api/esi/ to .gitignore if you don’t want to commit generated code.


πŸ“š Generating JSDoc Documentation

To build updated documentation for the entire src/ directory:

npm run generate-docs

Output will be saved to:

docs/

This uses jsdoc.json as the config file, and optionally better-docs for theming.


πŸ“¦ Building the App

To create a distributable version of the app:

npm run make

This will use Electron Forge to create .zip, .deb, .rpm, or .squirrel installers depending on your OS.

To test the built app:

npm run package

This creates a local unpackaged Electron bundle for testing before packaging fully.


πŸ“„ Summary

  • Scripts in package.json automate key parts of development
  • Use prepare to rebuild everything
  • Use make to create production-ready installers

Next: Dev & Debug Tools