@centrid/theia-installer-creator
v1.39.2
Published
Package for building/packaging a Apache theia project into an installer on different platforms
Downloads
1
Readme
Theia Installer Creator
Create installers for Apache Theia projects.
Please Note:
- This project is maintained on GitLab.
The Theia Installer Creator is a library that serves as an electron-builder wrapper for Theia projects. It enables you to create installers for standard Theia projects with minimal configuration.
Additionally, this package utilizes the Native Module Prebuilds Creator, which embeds all the required native dependencies for Windows and Linux, specifically for electron versions v23, v24, and v25 (Mac is currently not supported by default). This means that you can cross-build between Linux and Windows (given that no additional native dependencies are needed beyond the default).
Notes:
- The major and minor version number of this package is associated with the version of Apache Theia this version is compatible with. i.e if the version of theia-installer-creator is 1.39.23, then the version of Apache Theia it's compatible with is version 1.39.x.
- This package default settings assumes the project structure specified here. The easiest way to obtain that structure is by using Apache Theia's code generator.
- The package assumes that all the extensions (e.g custom extensions) your electron app is referencing have already been built (i.e there is a lib folder with the latest changes). If you used Apache Theia's code generator, you just need to run
npm run prepare
before using the Theia-install-creator. - If you need additional native dependencies (e.g., for Mac), you can create your own using the Native Module Prebuilds Creator package and include them in the build process. Refer to the package's homepage for instructions.
Installation
npm install @centrid/theia-installer-creator
or
yarn add @centrid/theia-installer-creator
Usage
This package can be used through its CLI interface or through its programmatic API (although CLI usage is preferred).
CLI Usage
npx theia-installer-creator <options>
| CLI | Default | Description | Required |
| --- | --- | --- | --- |
| --projectDir | process.cwd()
| Root project directory. Please Note: This has to be the parent of the electron-app folder/monorepo | No |
| --configPath | path.join(${projectDir}, 'theia-installer-creator-config.js')
| Path of the configuration to use | No |
| --mode | production
| Webpack mode to use when package the theia project. Production
or development
| No |
| --electronAppPath | electron-app
| Path to the electron-app monorepo | No |
| --mergeElectronAppPackageJson | true | Specify if the electron-app package.json details should be merged with the main package.json found in the root of the project | No |
Configuration
The Theia Installer Creator uses a configuration file that is a superset of the electron-builder CliOptions (these options are passed directly to electron-builder, with some modifications). This means that any configuration you can use with electron-builder can be specified within the configuration.
The Theia Installer Creator also has specific configuration options. Here are the details:
installerTargets
: An alternate way to specify targets using a plain object (instead of passing an electron-builder Platform Map). Note that if bothtargets
andinstallerTargets
are specified, thetargets
value will be used.electronAppPath
: Path to the electron-app monorepo (default: 'electron-app').mergeElectronAppPackageJson
: Specify if the electron-app package.json details should be merged with the main package.json found in the root of the project (default:false
).webpackBuildArgs
: Extra webpack args to use when building the theia app. e.g["--color"]
Note: CLI options override values specified in the configuration.
Configuration Example
Create a theia-installer-creator-config.js
file with the following content:
module.exports = {
config: {
win: {
target: "nsis"
},
files: [
"myFiles"
],
extraMetadata: {
distributionVersion: "Lite",
}
},
installerTargets: [
{
platform: "win",
arch: [
{
name: "x64",
type: ["nsis"]
}
]
},
{
platform: "linux",
arch: [
{
name: "x64",
type: ["snap"]
}
]
}
]
};
Contributing
Theia Installer Creator is an open-source project, and contributions are welcome. If you have a bug fix, please create a pull request explaining the bug, how you fixed it, and how you tested it.
If you want to add a new feature, please create an issue with the "enhancement" label. Provide details about the new feature and why you think it's needed. We will discuss it there, and once it's agreed upon, you can create a pull request with the highlighted details.
Authors
- Chido W - Initial Work - [email protected]
License
This project is licensed under the MIT License - see the LICENSE file for details.