@interopio/iocd-cli 0.0.25 → 0.0.26

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 (34) hide show
  1. package/dist/cli.js +2 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/dev.command.js +1 -9
  4. package/dist/commands/dev.command.js.map +1 -1
  5. package/dist/commands/test.command.js +18 -0
  6. package/dist/commands/test.command.js.map +1 -0
  7. package/dist/schemas/iocd.cli.config.schema.json +323 -0
  8. package/dist/services/create.service.js +36 -43
  9. package/dist/services/create.service.js.map +1 -1
  10. package/dist/services/dev.service.js +3 -1
  11. package/dist/services/dev.service.js.map +1 -1
  12. package/dist/services/installer/installer.service.js +3 -0
  13. package/dist/services/installer/installer.service.js.map +1 -1
  14. package/dist/services/installer/macOS.helper.js +5 -10
  15. package/dist/services/installer/macOS.helper.js.map +1 -1
  16. package/dist/services/license-file.service.js +46 -0
  17. package/dist/services/license-file.service.js.map +1 -0
  18. package/dist/services/license.service.js +12 -4
  19. package/dist/services/license.service.js.map +1 -1
  20. package/dist/services/template.service.js.map +1 -1
  21. package/dist/services/test.service.js +160 -0
  22. package/dist/services/test.service.js.map +1 -0
  23. package/dist/templates/ioconnect-desktop/config/iocd.cli.config.json +2 -1
  24. package/dist/templates/ioconnect-desktop/package.json +1 -1
  25. package/dist/templates/{auto-tests → tests}/template.json +2 -6
  26. package/dist/templates/tests/tests/interopio-wdio-iocd-service-0.1.0.tgz +0 -0
  27. package/dist/templates/tests/tests/package-lock.json +7283 -0
  28. package/dist/templates/tests/tests/package.json +23 -0
  29. package/dist/templates/tests/tests/tests/sample.spec.ts +30 -0
  30. package/dist/templates/tests/tests/tsconfig.json +11 -0
  31. package/dist/templates/tests/tests/wdio.config.ts +33 -0
  32. package/package.json +5 -3
  33. package/scripts/generate-schema.js +50 -0
  34. package/dist/templates/auto-tests/tests/basic.test.js +0 -15
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "tests",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "license": "ISC",
6
+ "author": "",
7
+ "type": "commonjs",
8
+ "main": "basic.test.js",
9
+ "scripts": {
10
+ "test": "npx wdio run ./wdio.config.ts"
11
+ },
12
+ "devDependencies": {
13
+ "@interopio/wdio-iocd-service": "file:./interopio-wdio-iocd-service-0.1.0.tgz",
14
+ "@types/node": "^24.10.0",
15
+ "@wdio/cli": "^8.46.0",
16
+ "@wdio/local-runner": "^8.46.0",
17
+ "@wdio/mocha-framework": "^8.46.0",
18
+ "@wdio/spec-reporter": "^8.43.0",
19
+ "ts-node": "^10.9.2",
20
+ "typescript": "^5.9.3",
21
+ "webdriverio": "^8.46.0"
22
+ }
23
+ }
@@ -0,0 +1,30 @@
1
+ describe('Example usage of @interopio/wdio-iocd-service', () => {
2
+ it('should have access to browser.io()', async () => {
3
+ console.log('test start');
4
+ // A fully working io.Connect Desktop client
5
+ const io = await browser.io();
6
+ console.log('io object ready', io.version);
7
+
8
+ expect(io).toHaveAttribute('appManager');
9
+ expect(io).toHaveAttribute('contexts');
10
+ expect(io).toHaveAttribute('channels');
11
+ });
12
+
13
+ it('should raise a test notifications, and then navigate to notifications panel', async () => {
14
+ const io = await browser.io();
15
+ await io.notifications.configure({ enable: true });
16
+ await io.notifications.raise({
17
+ title: 'Test Notification title',
18
+ body: 'Test Notification body',
19
+ toastExpiry: 999999,
20
+ });
21
+
22
+ await browser.switchToLaunchpad();
23
+
24
+ await browser.$('.launchpad-header-notifications-button button').waitAndClick();
25
+
26
+ await browser.switchToNotificationsPanel();
27
+
28
+ await browser.pause(2000);
29
+ });
30
+ });
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "CommonJS",
5
+ "moduleResolution": "Node",
6
+ "outDir": "dist",
7
+ "esModuleInterop": true,
8
+ "types": ["node", "@wdio/globals/types", "@wdio/mocha-framework"]
9
+ },
10
+ "include": ["wdio.config.ts", "tests/**/*.ts"]
11
+ }
@@ -0,0 +1,33 @@
1
+ import { IocdBaseConfiguration, IocdService } from '@interopio/wdio-iocd-service';
2
+
3
+ export const config: WebdriverIO.Config = {
4
+ ...IocdBaseConfiguration,
5
+
6
+ // Services
7
+ services: IocdService(),
8
+
9
+ // Capabilities
10
+ capabilities: [
11
+ {
12
+ browserName: 'iocd',
13
+ 'wdio:specs': ['./tests/**/*.spec.ts'],
14
+ 'iocd:options': {
15
+ binary: '%BINARY_PATH%',
16
+ },
17
+ },
18
+ ],
19
+
20
+ // WDIO Options
21
+ logLevel: 'info',
22
+ framework: 'mocha',
23
+ reporters: ['spec'],
24
+
25
+ // TypeScript Autocompile
26
+ autoCompileOpts: {
27
+ autoCompile: true,
28
+ tsNodeOpts: {
29
+ transpileOnly: true,
30
+ project: './tsconfig.json',
31
+ },
32
+ },
33
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interopio/iocd-cli",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "CLI tool for setting up, building and packaging io.Connect Desktop platforms",
5
5
  "engines": {
6
6
  "node": ">=18.0.0",
@@ -10,7 +10,8 @@
10
10
  "iocd": "./dist/cli.js"
11
11
  },
12
12
  "scripts": {
13
- "build": "node ./scripts/delete-dist.js && tsc && npm run copy-assets",
13
+ "build": "node ./scripts/delete-dist.js && tsc && npm run generate-schema && npm run copy-assets",
14
+ "generate-schema": "node ./scripts/generate-schema.js",
14
15
  "copy-assets": "node ./scripts/copy-assets.js",
15
16
  "dev": "tsc --watch",
16
17
  "test": "jest",
@@ -73,7 +74,8 @@
73
74
  "jest": "^29.7.0",
74
75
  "prettier": "^3.0.3",
75
76
  "ts-jest": "^29.1.1",
76
- "typescript": "^5.2.2"
77
+ "typescript": "^5.2.2",
78
+ "typescript-json-schema": "^0.65.1"
77
79
  },
78
80
  "peerDependencies": {
79
81
  "@electron-forge/core": "^7.9.0"
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+
7
+ console.log('Generating JSON schema from CliConfig interface...');
8
+
9
+ const schemaDir = path.join(__dirname, '..', 'dist', 'schemas');
10
+ const schemaFile = path.join(schemaDir, 'iocd.cli.config.schema.json');
11
+
12
+ // Ensure the schemas directory exists
13
+ if (!fs.existsSync(schemaDir)) {
14
+ fs.mkdirSync(schemaDir, { recursive: true });
15
+ }
16
+
17
+ try {
18
+ // Generate schema using typescript-json-schema
19
+ // Point directly to the source file to avoid compilation issues
20
+ execSync(
21
+ `npx typescript-json-schema ./src/services/config/cli.config.ts CliConfig --required --noExtraProps --out ${schemaFile}`,
22
+ {
23
+ cwd: path.join(__dirname, '..'),
24
+ stdio: 'inherit'
25
+ }
26
+ );
27
+
28
+ // Read the generated schema
29
+ const schema = JSON.parse(fs.readFileSync(schemaFile, 'utf8'));
30
+
31
+ // Add metadata at the beginning, preserving proper order
32
+ const enhancedSchema = {
33
+ "$schema": "http://json-schema.org/draft-07/schema#",
34
+ "$id": "https://unpkg.com/@interopio/iocd-cli/schemas/iocd.cli.config.schema.json",
35
+ "title": "io.Connect Desktop CLI Configuration",
36
+ "description": "Configuration schema for io.Connect Desktop CLI projects",
37
+ "additionalProperties": schema.additionalProperties,
38
+ "properties": schema.properties,
39
+ "required": schema.required,
40
+ "type": schema.type || "object"
41
+ };
42
+
43
+ // Write back the updated schema
44
+ fs.writeFileSync(schemaFile, JSON.stringify(enhancedSchema, null, 2));
45
+
46
+ console.log('✅ JSON schema generated successfully at:', schemaFile);
47
+ } catch (error) {
48
+ console.error('❌ Error generating JSON schema:', error.message);
49
+ process.exit(1);
50
+ }
@@ -1,15 +0,0 @@
1
- const { test, expect } = require('@playwright/test');
2
-
3
- test.describe('io.Connect Desktop Basic Tests', () => {
4
- test('should launch application', async ({ page }) => {
5
- // TODO: Implement application launch test
6
- // This is a placeholder test structure
7
- expect(true).toBe(true);
8
- });
9
-
10
- test('should handle window operations', async ({ page }) => {
11
- // TODO: Implement window operations test
12
- // This is a placeholder test structure
13
- expect(true).toBe(true);
14
- });
15
- });