@interopio/iocd-cli 0.0.41 → 0.0.43

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