@interopio/iocd-cli 1.1.0 → 1.1.2

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