@interopio/iocd-cli 1.0.3 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +2 -839
  2. package/changelog.md +26 -0
  3. package/dist/cli.js +3 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/apps.command.js +78 -0
  6. package/dist/commands/apps.command.js.map +1 -1
  7. package/dist/commands/index.js +3 -1
  8. package/dist/commands/index.js.map +1 -1
  9. package/dist/commands/modifications.command.js +2 -2
  10. package/dist/commands/modifications.command.js.map +1 -1
  11. package/dist/commands/skills.command.js +56 -0
  12. package/dist/commands/skills.command.js.map +1 -0
  13. package/dist/commands/test.command.js +6 -0
  14. package/dist/commands/test.command.js.map +1 -1
  15. package/dist/services/components/components.service.js +17 -3
  16. package/dist/services/components/components.service.js.map +1 -1
  17. package/dist/services/components/stores/github.store.js +30 -2
  18. package/dist/services/components/stores/github.store.js.map +1 -1
  19. package/dist/services/installer/electronForge.js +5 -0
  20. package/dist/services/installer/electronForge.js.map +1 -1
  21. package/dist/services/installer/installer.service.js +26 -0
  22. package/dist/services/installer/installer.service.js.map +1 -1
  23. package/dist/services/installer/prerequisites.js +10 -3
  24. package/dist/services/installer/prerequisites.js.map +1 -1
  25. package/dist/services/installer/windows.helper.js +17 -1
  26. package/dist/services/installer/windows.helper.js.map +1 -1
  27. package/dist/services/installer/zip-maker.js +122 -0
  28. package/dist/services/installer/zip-maker.js.map +1 -0
  29. package/dist/services/installer/zip.helper.js +94 -0
  30. package/dist/services/installer/zip.helper.js.map +1 -0
  31. package/dist/services/license.service.js +58 -8
  32. package/dist/services/license.service.js.map +1 -1
  33. package/dist/services/modifications/modifications.service.js +22 -1
  34. package/dist/services/modifications/modifications.service.js.map +1 -1
  35. package/dist/services/modifications/windows.helper.js +95 -49
  36. package/dist/services/modifications/windows.helper.js.map +1 -1
  37. package/dist/services/skills.service.js +178 -0
  38. package/dist/services/skills.service.js.map +1 -0
  39. package/dist/services/template.service.js +141 -9
  40. package/dist/services/template.service.js.map +1 -1
  41. package/dist/services/test-infrastructure.service.js +30 -17
  42. package/dist/services/test-infrastructure.service.js.map +1 -1
  43. package/dist/services/test.service.js +57 -21
  44. package/dist/services/test.service.js.map +1 -1
  45. package/dist/templates/ioconnect-desktop/README.md +2 -839
  46. package/dist/templates/ioconnect-desktop/config/forge.config.js +2 -2
  47. package/dist/templates/ioconnect-desktop/package.json +1 -2
  48. package/dist/templates/launchpad/apps/launchpad/.gitignore.template +23 -1
  49. package/dist/templates/launchpad/apps/launchpad/.prettierignore +3 -0
  50. package/dist/templates/launchpad/apps/launchpad/.prettierrc +6 -0
  51. package/dist/templates/launchpad/apps/launchpad/README.md +220 -0
  52. package/dist/templates/launchpad/apps/launchpad/config/iocd.app.def.dev.json +1 -1
  53. package/dist/templates/launchpad/apps/launchpad/index.html +13 -14
  54. package/dist/templates/launchpad/apps/launchpad/package.json +17 -9
  55. package/dist/templates/launchpad/apps/launchpad/src/app/app.tsx +31 -37
  56. package/dist/templates/launchpad/apps/launchpad/src/components/launchpad.tsx +37 -0
  57. package/dist/templates/launchpad/apps/launchpad/src/{app → constants}/constants.ts +2 -1
  58. package/dist/templates/launchpad/apps/launchpad/src/main.tsx +1 -3
  59. package/dist/templates/launchpad/apps/launchpad/src/styles.css +2 -17
  60. package/dist/templates/launchpad/apps/launchpad/tsconfig.json +10 -8
  61. package/dist/templates/launchpad/apps/launchpad/vite-env.d.ts +1 -0
  62. package/dist/templates/launchpad/apps/launchpad/vite.config.ts +8 -3
  63. package/dist/templates/tests/.agents/skills/iocd-wdio-testing/references/configuration.md +7 -3
  64. package/dist/templates/tests/tests/package.json +1 -1
  65. package/dist/utils/error.handler.js +6 -2
  66. package/dist/utils/error.handler.js.map +1 -1
  67. package/dist/utils/external-tool.js +34 -0
  68. package/dist/utils/external-tool.js.map +1 -0
  69. package/dist/utils/template-update.js +15 -0
  70. package/dist/utils/template-update.js.map +1 -0
  71. package/dist/utils/terminal-output-guard.js +5 -0
  72. package/dist/utils/terminal-output-guard.js.map +1 -0
  73. package/dist/utils/terminal-output.js +25 -0
  74. package/dist/utils/terminal-output.js.map +1 -0
  75. package/package.json +4 -1
  76. package/dist/templates/launchpad/apps/launchpad/package-lock.json +0 -2778
  77. package/dist/templates/launchpad/apps/launchpad/src/components/logo.tsx +0 -11
  78. package/dist/templates/launchpad/apps/launchpad/src/components/main-context-menu.tsx +0 -212
  79. package/dist/templates/launchpad/apps/launchpad/src/components/notifications-button.tsx +0 -51
  80. package/dist/templates/tests/tests/package-lock.json +0 -8441
package/README.md CHANGED
@@ -2,846 +2,9 @@
2
2
 
3
3
  > A seed project for developing and building io.Connect Desktop based products
4
4
 
5
- - [io.Connect Desktop Seed Project](#ioconnect-desktop-seed-project)
6
- - [Overview](#overview)
7
- - [Quick Start](#quick-start)
8
- - [Prerequisites](#prerequisites)
9
- - [Creating Your Project](#creating-your-project)
10
- - [Installation](#installation)
11
- - [Running in Development Mode](#running-in-development-mode)
12
- - [Building for Production](#building-for-production)
13
- - [Project Structure](#project-structure)
14
- - [Configuration](#configuration)
15
- - [Basic Settings](#basic-settings)
16
- - [License Key](#license-key)
17
- - [Customization](#customization)
18
- - [Applying Modifications](#applying-modifications)
19
- - [Changing io.CD System Config](#changing-iocd-system-config)
20
- - [Changing the Logo](#changing-the-logo)
21
- - [Custom Applications](#custom-applications)
22
- - [Using Template Applications](#using-template-applications)
23
- - [Creating Custom Applications](#creating-custom-applications)
24
- - [Managing Applications](#managing-applications)
25
- - [Development](#development)
26
- - [Installing or Updating components during development](#installing-or-updating-components-during-development)
27
- - [Testing](#testing)
28
- - [Running Tests](#running-tests)
29
- - [Writing Tests](#writing-tests)
30
- - [Building for Production](#building-for-production-1)
31
- - [Build Commands](#build-commands)
32
- - [Build Output](#build-output)
33
- - [**Windows OS**:](#windows-os)
34
- - [**macOS**:](#macos)
35
- - [**Linux**:](#linux)
36
- - [Code Signing](#code-signing)
37
- - [Windows Code Signing](#windows-code-signing)
38
- - [Option 1: PFX Certificate File](#option-1-pfx-certificate-file)
39
- - [Option 2: Certificate Store (e.g., DigiCert KeyLocker)](#option-2-certificate-store-eg-digicert-keylocker)
40
- - [Option 3: Custom Script](#option-3-custom-script)
41
- - [macOS Code Signing](#macos-code-signing)
42
- - [Code Signing Configuration](#code-signing-configuration)
43
- - [Notarization Configuration](#notarization-configuration)
44
- - [CI/CD Integration](#cicd-integration)
45
- - [Auto-Updates](#auto-updates)
46
- - [Troubleshooting](#troubleshooting)
47
- - [Common Issues](#common-issues)
48
- - [Getting Help](#getting-help)
5
+ ### Resources
49
6
 
50
- ---
51
-
52
- ## Overview
53
-
54
- This seed project provides everything needed to build, test, and deploy your branded version of io.Connect Desktop distribution. It includes pre-configured components, build scripts, and CI/CD integration examples.
55
-
56
- **What's Included:**
57
- - ✅ Licensed io.Connect Desktop components
58
- - ✅ Build and packaging scripts
59
- - ✅ Configuration templates
60
- - ✅ Automated testing framework
61
- - ✅ CI/CD pipeline examples
62
- - ✅ Code signing setup guides
63
-
64
- ---
65
-
66
- ## Quick Start
67
-
68
- ### Prerequisites
69
-
70
- - **Node.js**: v22 or higher
71
- - **npm**: v9 or higher
72
- - **Operating System**: Windows 10+ or macOS 11+
73
- - **License**: This seed project requires a valid io.Connect Desktop license to use the included components. For licensing questions, contact sales@interop.io
74
-
75
- ### Creating Your Project
76
-
77
- ```bash
78
- npx @interopio/iocd-cli@latest create # Follow prompts to set up your project
79
- ```
80
-
81
- ### Installation
82
-
83
- ```bash
84
- cd your-project-name
85
-
86
- # Install dependencies
87
- npm install
88
-
89
- # Install components
90
- npm run setup
91
- ```
92
-
93
- ### Running in Development Mode
94
-
95
- ```bash
96
- # Start io.Connect Desktop in dev mode
97
- npm run dev
98
- ```
99
-
100
- ### Building for Production
101
-
102
- ```bash
103
- # Build production installer
104
- npm run build
105
- ```
106
-
107
- ---
108
-
109
- ## Project Structure
110
-
111
- ```
112
- .
113
- ├── apps/ # Custom applications (add your own)
114
- ├── components/ # Downloaded io.Connect Desktop components
115
- │ ├── iocd/ # Main io.Connect Desktop component (required)
116
- │ └── [other-components]/ # Additional licensed components (devTools, demos, etc.)
117
- ├── config/ # Configuration files
118
- │ ├── forge.config.js # Electron Forge configuration
119
- │ ├── iocd.cli.config.json # CLI configuration
120
- │ └── iocd.license.key # License key file (optional)
121
- ├── modifications/ # Customizations and overrides
122
- │ ├── base/ # Applied in all modes (dev/build)
123
- │ ├── dev/ # Applied only in development mode
124
- │ └── build/ # Applied only during production builds
125
- ├── tests/ # Automated tests
126
- │ └── basic.test.js # Example Playwright test suite
127
- ├── .github/workflows/ # CI/CD pipeline examples
128
- ├── package.json
129
- └── README.md
130
- ```
131
-
132
- ---
133
-
134
- ## Configuration
135
-
136
- ### Basic Settings
137
-
138
- Product metadata is configured in your `package.json` file:
139
-
140
- ```json
141
- {
142
- "name": "your-product-slug",
143
- "version": "1.0.0",
144
- "description": "Your product description",
145
- "productName": "Your Product Name",
146
- "author": "Your Company"
147
- }
148
- ```
149
-
150
- These values are automatically populated by the create script and are used for:
151
- - **name** → Project identifier (folder name, exe name, package name, etc.)
152
- - **productName** → Display name shown to users
153
- - **description** → Product description in installers and metadata
154
- - **author** → Company name (also used to auto-generate copyright)
155
- - **version** → Application version
156
-
157
- CLI-specific settings go in `config/iocd.cli.config.json`:
158
-
159
- ```json
160
- {
161
- "components": {
162
- "store": {
163
- "github": {
164
- "repo": "interopio/iocd-components/releases"
165
- }
166
- },
167
- "list": {
168
- "iocd": "latest"
169
- }
170
- }
171
- }
172
- ```
173
-
174
- > **Tip**: You can view the full JSON schema for `iocd.cli.config.json` in `node_modules/@interopio/iocd-cli/dist/schemas/iocd.cli.config.schema.json`. Add a `$schema` property to your config file for IDE autocompletion and validation.
175
-
176
- ### License Key
177
-
178
- Set your license key using:
179
- - **Environment variable**: `IOCD_LICENSE_KEY`
180
- - **Config file**: `config/iocd.license.key`
181
-
182
- ---
183
-
184
- ## Customization
185
-
186
- ### Applying Modifications
187
-
188
- Modifications are the recommended way to customize io.Connect Desktop components without directly editing component files. They allow you to change configurations, add applications, modify assets, and override default behavior while preserving your changes across component updates.
189
-
190
- **Key Concepts:**
191
-
192
- - **Modifications are stored separately** from components in the `modifications/` folder
193
- - **Changes persist** when components are updated or reinstalled
194
- - **Mode-specific modifications** allow different behavior in dev vs. build mode
195
- - **Files are copied or merged** into components when running `iocd dev` or `iocd build`
196
-
197
- **Directory Structure:**
198
-
199
- ```
200
- modifications/
201
- ├── base/ # Applied in all modes
202
- │ └── iocd/
203
- │ ├── config/
204
- │ ├── assets/
205
- │ └── apps/
206
- ├── dev/ # Applied only in dev mode
207
- │ └── iocd/
208
- │ └── config/
209
- └── build/ # Applied only in build mode
210
- └── iocd/
211
- └── config/
212
- ```
213
-
214
- **Processing Order:**
215
-
216
- 1. **Base modifications** (`modifications/base/`) are applied first
217
- 2. **Mode-specific modifications** (`modifications/dev/` or `modifications/build/`) are applied second, overriding base when needed
218
-
219
- **Common Use Cases:**
220
-
221
- - Replace logos and icons in `modifications/base/iocd/assets/`
222
- - Configure system settings in `modifications/base/iocd/config/`
223
- - Add application definitions in `modifications/base/iocd/apps/`
224
- - Use different URLs for dev (localhost) vs. build (file://) in mode-specific folders
225
-
226
- **Special File Types:**
227
-
228
- - **`.json.merge`** - Deep merges with existing JSON instead of replacing
229
- - **`.delete`** - Removes the corresponding file
230
- - **`.replace`** marker - Replaces entire directory (place in directory to replace)
231
-
232
- ### Changing io.CD System Config
233
-
234
- The io.Connect Desktop system configuration (`system.json`) controls platform-wide settings like auto-updates, logging, and feature flags. To customize these settings, create modification files that merge with the default configuration.
235
-
236
- **Location:**
237
- ```
238
- modifications/base/iocd/config/system.json.merge
239
- ```
240
-
241
- **Example - Enable Auto-Updates:**
242
-
243
- ```json
244
- {
245
- "autoUpdater": {
246
- "enabled": true,
247
- "updateSource": {
248
- "type": "Service",
249
- "baseUrl": "https://updates.yourcompany.com"
250
- },
251
- "interval": 60
252
- }
253
- }
254
- ```
255
-
256
- **Example - Configure Logging:**
257
-
258
- ```json
259
- {
260
- "logging": {
261
- "level": "info",
262
- "appender": "default"
263
- }
264
- }
265
- ```
266
-
267
- **Mode-Specific Configuration:**
268
-
269
- Use different settings for dev vs. build mode:
270
-
271
- **Dev mode** (`modifications/dev/iocd/config/system.json.merge`):
272
- ```json
273
- {
274
- "logging": {
275
- "level": "debug"
276
- },
277
- "features": {
278
- "devTools": true
279
- }
280
- }
281
- ```
282
-
283
- **Build mode** (`modifications/build/iocd/config/system.json.merge`):
284
- ```json
285
- {
286
- "logging": {
287
- "level": "error"
288
- },
289
- "features": {
290
- "telemetry": true
291
- }
292
- }
293
- ```
294
-
295
- **Important Notes:**
296
-
297
- - Use `.merge` extension to deep merge with existing configuration
298
- - Without `.merge`, the file completely replaces the original
299
- - Changes are applied when running `iocd dev` or `iocd build`
300
- - Environment variables like `${PRODUCT_VERSION}` are automatically expanded
301
-
302
- ### Changing the Logo
303
-
304
- Replace the default logo files in `modifications/base/iocd/assets/images/`:
305
-
306
- ```bash
307
- modifications/base/iocd/assets/
308
- └── images/
309
- ├── logo.ico # Windows executable icon (multiple resolutions)
310
- ├── logo.icns # macOS app bundle icon (multiple resolutions)
311
- └── logo.png # Application icon (used in UI)
312
- ```
313
-
314
- **Requirements:**
315
- - **logo.ico**: Windows icon file with multiple sizes (16x16, 32x32, 48x48, 256x256)
316
- - **logo.icns**: macOS icon file with multiple sizes (use Icon Composer or iconutil)
317
- - **logo.png**: PNG file, recommended size 512x512
318
-
319
- ### Custom Applications
320
-
321
- io.Connect Desktop includes several built-in applications that you can replace with your own custom versions:
322
-
323
- - **Workspaces** - Workspace management UI
324
- - **Groups** - Window grouping UI
325
- - **Splash Screen** - Application splash screen
326
- - **Launchpad** - Application launcher
327
- - **Notifications** - Notification center
328
-
329
- Applications in the `apps/` folder allow you to customize these built-in apps or add entirely new functionality. This approach keeps your core platform applications in the same repository, eliminating the need to manage them across multiple repositories and simplifying version control, deployment, and coordination.
330
-
331
- #### Using Template Applications
332
-
333
- Template applications can be selected during project creation or added later:
334
-
335
- ```bash
336
- # Add template application
337
- iocd apps add workspaces
338
-
339
- # List available templates
340
- iocd apps list --available
341
- ```
342
-
343
- **Available templates:**
344
- - `workspaces` - Workspace management
345
- - `groups` - Window grouping
346
- - `splash-screen` - Loading screen
347
- - `launchpad` - Application launcher
348
-
349
- Once added, build your implementation on top of the template in the `apps/` folder.
350
-
351
- #### Creating Custom Applications
352
-
353
- For custom applications, create a folder in `apps/` with an `iocd.app.json` file:
354
-
355
- ```
356
- apps/
357
- └── my-custom-app/
358
- ├── iocd.app.json # Defines modifications and build behavior
359
- ├── package.json
360
- └── src/
361
- ```
362
-
363
- **Example `iocd.app.json`:**
364
-
365
- In this example:
366
- - **Dev mode** (triggered by `iocd dev` or `npm run dev`): Executes a `start` script (typically starts a dev server with hot-reload) and copies the development app configuration so the app definition points to the dev server
367
- - **Build mode** (triggered by `iocd build` or `npm run build`): Executes a `build` script (typically builds optimized production assets) and copies the final built assets to the modifications folder
368
-
369
- ```json
370
- {
371
- "dev": {
372
- "script": "start",
373
- "modifications": [
374
- {
375
- "source": "/config/my-app-dev.json",
376
- "destination": "/modifications/dev/iocd/config/apps/my-app.json"
377
- }
378
- ]
379
- },
380
- "build": {
381
- "script": "build",
382
- "modifications": [
383
- {
384
- "source": "/dist/",
385
- "destination": "/modifications/build/iocd/assets/my-app"
386
- }
387
- ]
388
- }
389
- }
390
- ```
391
-
392
- The `iocd.app.json` file defines:
393
- - **base**: Array of modifications applied in all modes
394
- - **dev**: Object with optional `script` (npm script name) and `modifications` array
395
- - **build**: Object with optional `script` (npm script name) and `modifications` array
396
-
397
- #### Managing Applications
398
-
399
- ```bash
400
- # Install application dependencies
401
- iocd apps install
402
-
403
- # Start applications in dev mode
404
- iocd apps dev
405
-
406
- # Build applications for production
407
- iocd apps build
408
- ```
409
-
410
- ---
411
-
412
- ## Development
413
-
414
- Development mode allows you to quickly start io.Connect Desktop with all your configured changes and applications, enabling rapid iteration and testing during development.
415
-
416
- When you run dev mode, the CLI will:
417
- 1. **Apply all relevant modifications** - Base modifications and dev-specific modifications are copied to components
418
- 2. **Start all applications** - Runs the dev script for each app (typically starting dev servers with hot-reload)
419
- 3. **Launch io.Connect Desktop** - Starts the platform with all changes applied
420
-
421
- ```bash
422
- # Start io.Connect Desktop in dev mode
423
- iocd dev
424
-
425
- # Or using npm script
426
- npm run dev
427
- ```
428
-
429
- ### Installing or Updating components during development
430
- To install a component or update existing component while in development mode, use the following command:
431
-
432
- ```bash
433
- # Update components
434
- iocd components install <component-name>
435
-
436
- # Or using npm script (note the -- before the component name)
437
- npm run components-install -- <component-name>
438
- ```
439
-
440
- This command will download and install the latest version of the specified component.
441
-
442
- If you want to install a specific version, use:
443
-
444
- ```bash
445
- iocd components install <component-name>@<version>
446
-
447
- # Or using npm script (note the -- before the component name)
448
- npm run components-install -- <component-name>@<version>
449
- ```
450
- ---
451
-
452
- ## Testing
453
-
454
- Testing is based on **WebdriverIO** and depends on the `@interopio/wdio-iocd-service` package, which enables starting and controlling io.Connect Desktop from WebDriver. This allows you to create and run comprehensive end-to-end (E2E) tests for your io.Connect Desktop application.
455
-
456
- ### Running Tests
457
-
458
- Tests are written in the `tests/` folder and can be executed using:
459
-
460
- ```bash
461
- # Run all tests
462
- npm test
463
-
464
- # Or using the WebdriverIO CLI directly
465
- npx wdio run ./wdio.config.ts
466
- ```
467
-
468
- ### Writing Tests
469
-
470
- Tests are written using WebdriverIO syntax with the io.Connect Desktop service handling application lifecycle. Example test structure:
471
-
472
- ```javascript
473
- describe('io.Connect Desktop Application', () => {
474
- it('should launch successfully', async () => {
475
- // Your test logic here
476
- // The @interopio/wdio-iocd-service handles starting/stopping io.Connect Desktop
477
- });
478
- });
479
- ```
480
-
481
- Add your test files to the `tests/` directory. They'll run automatically in CI/CD pipelines.
482
-
483
- ---
484
-
485
- ## Building for Production
486
-
487
- The build process creates production-ready installers for distribution. It orchestrates multiple steps to produce signed, optimized packages ready for deployment.
488
-
489
- **What happens during build:**
490
-
491
- 1. **Build all applications** - Executes build scripts for each app in production mode
492
- 2. **Reinstall components** - Downloads and installs fresh component versions
493
- 3. **Apply all modifications** - Copies base and build-specific modifications to components
494
- 4. **Code sign binaries** - Signs executables and libraries (if configured)
495
- 5. **Create build artifacts** - Generates installers (`.exe` setup on Windows, `.dmg` on macOS, `.zip` archives)
496
- 6. **Publish to release server** - Uploads artifacts for auto-updates (if configured)
497
-
498
- **Build System:**
499
-
500
- The build process is based on [Electron Forge](https://www.electronforge.io/), a complete toolchain for building and packaging Electron applications. The main configuration is located in `config/forge.config.js`, where you can customize makers, publishers, and build behavior.
501
-
502
- ### Build Commands
503
-
504
- ```bash
505
- # Build installer
506
- iocd build
507
-
508
- # Or using npm script
509
- npm run build
510
-
511
- # Build options
512
- iocd build --output custom/path # Custom output directory
513
- iocd build --publish-only # Skip build, only publish
514
- iocd build --skip-install # Skip component installation
515
- ```
516
-
517
- ### Build Output
518
-
519
- Depending on OS you can configure Electron Forge makers to produce different types of artifacts. We have tested the following configurations:
520
-
521
- #### **Windows OS**:
522
- 1. Squirrel.Windows installer (`.exe` setup)
523
- * You can change the install GIF by replacing the **install.gif** in assets folder.
524
- * The app will be installed into **%LocalAppData%\YourAppName**. Squirrel is opinionated and does not allow changing this path.
525
- * By default the UserData folder generated by the platform will stay in **%LocalAppData%\interop.io\io.Connect Desktop** folder. You can change this by add the following system.json.merge-win32 file in modifications/base/iocd/config/system.json.merge-win32 (the merge file has win32 suffix which indicates it is only applied on Windows OS):
526
-
527
- ```json
528
- {
529
- "paths": {
530
- "userData": "%LocalAppData%/${PRODUCT_SLUG}/UserData/%IO_CD_ENV%-%IO_CD_REGION%",
531
- "cache": {
532
- "location": "%LocalAppData%/${PRODUCT_SLUG}/Cache/%IO_CD_ENV%-%IO_CD_REGION%",
533
- "copy": true
534
- }
535
- }
536
- }
537
- ```
538
- 1. Portable ZIP archive
539
-
540
- #### **macOS**:
541
- 1. DMG disk image
542
- 2. ZIP archive
543
-
544
- #### **Linux**
545
- You can build Windows OS installers on Linux, but [Wine](https://www.winehq.org/) and [Mono](https://www.mono-project.com/) must be installed on the runner.
546
-
547
- **NOTE:** It may also be necessary to install the `zip` command, because it is used to create ZIP archives, and you may also have to alias `wine64` as `wine`. Linux does not support code signing for Windows OS.
548
-
549
- The full list of makers is available in the [Electron Forge documentation](https://www.electronforge.io/config/makers).
550
-
551
- ### Code Signing
552
-
553
- Code signing ensures that your application is trusted by operating systems and users can verify it hasn't been tampered with. Both Windows and macOS require code signing for distribution.
554
-
555
- #### Windows Code Signing
556
-
557
- ##### Option 1: PFX Certificate File
558
-
559
- ```json
560
- {
561
- "win": {
562
- "codeSign": {
563
- "type": "signtool",
564
- "pfxPath": "path/to/certificate.pfx",
565
- "pfxPassword": "${WIN_PFX_PASS}"
566
- }
567
- }
568
- }
569
- ```
570
-
571
- ##### Option 2: Certificate Store (e.g., DigiCert KeyLocker)
572
-
573
- ```json
574
- {
575
- "win": {
576
- "codeSign": {
577
- "type": "signtool",
578
- "certificateSha1": "${WIN_CERT_SHA1}"
579
- }
580
- }
581
- }
582
- ```
583
-
584
- **Important**:
585
- - If using DigiCert KeyLocker, run `smctl windows certsync` before building to sync certificates to Windows store
586
- - Either `pfxPath` or `certificateSha1` must be provided (not both)
587
- - Set type to `"off"` to disable code signing
588
-
589
- ##### Option 3: Custom Script
590
-
591
- For advanced signing scenarios, you can provide a custom signing script:
592
-
593
- ```json
594
- {
595
- "win": {
596
- "codeSign": {
597
- "type": "custom",
598
- "customCodeSignScriptPath": "path/to/custom-sign.js"
599
- }
600
- }
601
- }
602
- ```
603
-
604
- Your custom script should export a function that receives the binary path and config:
605
-
606
- ```javascript
607
- // custom-sign.js
608
- module.exports = async function(binaryPath, config) {
609
- // Your custom signing logic here
610
- console.log(`Signing ${binaryPath}`);
611
- // Use any signing tool or API you need
612
- };
613
- ```
614
-
615
- #### macOS Code Signing
616
-
617
- ##### Code Signing Configuration
618
-
619
- ```json
620
- {
621
- "mac": {
622
- "codeSign": {
623
- "type": "keychain",
624
- "identity": "Developer ID Application: Your Company (TEAM_ID)"
625
- }
626
- }
627
- }
628
- ```
629
-
630
- **Options**:
631
- - `type`: `"keychain"` (use keychain certificate), `"certificate"` (use .p12 file), `"custom"` (custom script), or `"off"` (no signing)
632
- - `identity`: Developer ID Application identity or SHA-1 hash (optional - auto-selected if not specified)
633
- - `keychain`: Keychain name or path (optional - uses default keychain if not specified)
634
-
635
- **Custom Script Option:**
636
-
637
- For advanced signing scenarios, you can provide a custom signing script:
638
-
639
- ```json
640
- {
641
- "mac": {
642
- "codeSign": {
643
- "type": "custom",
644
- "customCodeSignScriptPath": "path/to/custom-sign.js"
645
- }
646
- }
647
- }
648
- ```
649
-
650
- Your custom script should export a function that receives the app bundle path and config:
651
-
652
- ```javascript
653
- // custom-sign.js
654
- module.exports = async function(appBundlePath, config) {
655
- // Your custom signing logic here
656
- console.log(`Signing ${appBundlePath}`);
657
- // Use any signing tool or API you need
658
- };
659
- ```
660
-
661
- ##### Notarization Configuration
662
-
663
- ```json
664
- {
665
- "mac": {
666
- "notarization": {
667
- "type": "notarytool",
668
- "appleId": "${MAC_NOTARIZATION_APPLE_ID}",
669
- "appleIdPassword": "${MAC_NOTARIZATION_APPLE_ID_PASSWORD}",
670
- "appleTeamId": "${MAC_NOTARIZATION_APPLE_TEAM_ID}"
671
- }
672
- }
673
- }
674
- ```
675
-
676
- **Important**:
677
- - Notarization is required for distribution outside Mac App Store
678
- - Use app-specific password (not your regular Apple ID password)
679
- - Generate app-specific password at appleid.apple.com
680
- - Set type to `"off"` to skip notarization (for development builds)
681
-
682
- **Custom Script Option:**
683
-
684
- For advanced notarization scenarios, you can provide a custom notarization script:
685
-
686
- ```json
687
- {
688
- "mac": {
689
- "notarization": {
690
- "type": "custom",
691
- "customNotarizationScriptPath": "path/to/custom-notarize.js"
692
- }
693
- }
694
- }
695
- ```
696
-
697
- Your custom script should export a function that receives the app bundle path and config:
698
-
699
- ```javascript
700
- // custom-notarize.js
701
- module.exports = async function(appBundlePath, config) {
702
- // Your custom notarization logic here
703
- console.log(`Notarizing ${appBundlePath}`);
704
- // Use any notarization tool or API you need
705
- };
706
- ```
707
-
708
- ### CI/CD Integration
709
-
710
- Continuous Integration and Continuous Deployment (CI/CD) automates building, testing, and publishing your io.Connect Desktop application. The seed project includes an GitHub Actions workflow located in `.github/workflows/build.yml`. It produces signed installers and can publish them to a release server.
711
-
712
- It is possible to build a Windows installer on Linux. Below is an example Dockerfile that sets up a Linux container to build a Windows installer:
713
- ```Docker
714
- FROM node:lts-alpine
715
-
716
- # install wine
717
- RUN apk update
718
- RUN apk add --no-cache wine dpkg
719
- RUN dpkg --add-architecture i386
720
- RUN alias wine=win64 # electron-forge uses wine command, so we need an alias
721
-
722
- # Install Mono
723
- RUN apk update
724
- RUN apk add mono-dev
725
-
726
- # Install zip command
727
- # This is necessary for this Dockerfile, but may not be necessary for a Linux
728
- # runner in CI.
729
- RUN apk update
730
- RUN apk add zip
731
-
732
- # Generate io.Connect Desktop project
733
- RUN npx @interopio/iocd-cli@latest create \
734
- --non-interactive \
735
- --product-name "io.Connect Desktop" \
736
- --folder-name io-connect-desktop \
737
- --license-key <paste license key here>
738
-
739
- # Build installer
740
- WORKDIR /io-connect-desktop
741
- RUN npm install
742
- RUN npm run setup
743
- RUN npm run build
744
- ```
745
-
746
- ### Auto-Updates
747
-
748
- Setting up auto-updates allows your users to automatically receive new versions of your application.
749
-
750
- **Requirements:**
751
-
752
- Auto-updates are supported for specific build artifact types:
753
- - **Windows**: Squirrel.Windows installers (`.exe` setup files)
754
- - **macOS**: ZIP archives
755
-
756
- Other build outputs (portable ZIP on Windows, DMG on macOS) do not support automatic updates.
757
-
758
- **Setup Steps:**
759
-
760
- **1. Set up a release server**
761
-
762
- You can use existing solutions or build your own:
763
- - **Existing services**: Nucleus, Hazel, or other update servers (see [Electron update services](https://www.electronjs.org/docs/latest/tutorial/updates#using-other-update-services))
764
- - **Custom solution**: Build your own update server following Squirrel protocols
765
-
766
- **2. Configure io.Connect Desktop to check the update server**
767
-
768
- Create or modify `modifications/base/iocd/config/system.json.merge`:
769
-
770
- ```json
771
- {
772
- "autoUpdater": {
773
- "enabled": true,
774
- "updateSource": {
775
- "type": "Service",
776
- "baseUrl": "https://updates.yourcompany.com"
777
- },
778
- "interval": 60
779
- }
780
- }
781
- ```
782
-
783
- **3. Publish updates**
784
-
785
- Choose one of the following approaches:
786
-
787
- **Option A: Automatic publishing during build** - Configure publishers in `config/forge.config.js`:
788
-
789
- ```javascript
790
- publishers: [
791
- {
792
- name: '@electron-forge/publisher-electron-release-server',
793
- config: {
794
- baseUrl: 'https://updates.yourcompany.com',
795
- username: process.env.RELEASE_SERVER_USERNAME,
796
- password: process.env.RELEASE_SERVER_PASSWORD
797
- }
798
- }
799
- ]
800
- ```
801
-
802
- **Option B: Manual upload** - After building, manually upload the installer artifacts to your release server.
803
-
804
- **4. Test auto-updates**
805
-
806
- - Install your application using the signed installer
807
- - Publish a new version to your update server
808
- - Launch the application and verify it detects and installs the update
809
-
810
- ---
811
-
812
- ## Troubleshooting
813
-
814
- ### Common Issues
815
-
816
- **Build fails with "License not found"**
817
- - Ensure `IOCD_LICENSE_KEY` environment variable is set
818
- - Or create `config/iocd.license.key` file with your license key
819
-
820
- **Code signing fails on Windows**
821
- - Verify certificate is valid and not expired
822
- - Check that `pfxPassword` is correct
823
- - For certificate store signing: Ensure `smctl windows certsync` was run first
824
- - Verify exactly one of `pfxPath` or `certificateSha1` is configured (not both)
825
-
826
- **macOS notarization fails**
827
- - Use app-specific password, not regular Apple ID password
828
- - Generate app-specific password at appleid.apple.com
829
- - Verify Apple Developer Program membership is active
830
- - Check that `appleTeamId` matches your Developer Team ID
831
-
832
- **Application won't start in dev mode**
833
- - Run `iocd setup` to verify component installation
834
- - Check that `components/iocd` directory exists
835
- - Review logs in system temp directory
836
-
837
- **Components not downloading**
838
- - Verify network connectivity
839
- - Check component store configuration in `config/iocd.cli.config.json`
840
- - For GitHub store: Ensure repository access and credentials are correct
841
-
842
- ### Getting Help
843
-
844
- - 📚 [Documentation](https://docs.interop.io/desktop)
7
+ - 📚 [Documentation](https://docs.interop.io/desktop/developers/seed-project/index.html)
845
8
  - 💬 [Community Forum](https://community.interop.io)
846
9
  - 📧 [Support Portal](https://support.interop.io)
847
10
  ---