@interopio/iocd-cli 1.0.2 → 1.1.0
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.
- package/README.md +28 -2
- package/changelog.md +16 -0
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/apps.command.js +83 -0
- package/dist/commands/apps.command.js.map +1 -1
- package/dist/commands/index.js +3 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/skills.command.js +56 -0
- package/dist/commands/skills.command.js.map +1 -0
- package/dist/services/dev.service.js +5 -1
- package/dist/services/dev.service.js.map +1 -1
- package/dist/services/skills.service.js +178 -0
- package/dist/services/skills.service.js.map +1 -0
- package/dist/services/template.service.js +141 -9
- package/dist/services/template.service.js.map +1 -1
- package/dist/services/test-infrastructure.service.js +7 -17
- package/dist/services/test-infrastructure.service.js.map +1 -1
- package/dist/services/test.service.js +21 -8
- package/dist/services/test.service.js.map +1 -1
- package/dist/templates/ioconnect-desktop/README.md +28 -2
- package/dist/templates/launchpad/apps/launchpad/.gitignore.template +23 -1
- package/dist/templates/launchpad/apps/launchpad/.prettierignore +3 -0
- package/dist/templates/launchpad/apps/launchpad/.prettierrc +6 -0
- package/dist/templates/launchpad/apps/launchpad/README.md +220 -0
- package/dist/templates/launchpad/apps/launchpad/config/iocd.app.def.dev.json +1 -1
- package/dist/templates/launchpad/apps/launchpad/index.html +13 -14
- package/dist/templates/launchpad/apps/launchpad/package.json +17 -9
- package/dist/templates/launchpad/apps/launchpad/src/app/app.tsx +31 -37
- package/dist/templates/launchpad/apps/launchpad/src/components/launchpad.tsx +37 -0
- package/dist/templates/launchpad/apps/launchpad/src/{app → constants}/constants.ts +2 -1
- package/dist/templates/launchpad/apps/launchpad/src/main.tsx +1 -3
- package/dist/templates/launchpad/apps/launchpad/src/styles.css +2 -17
- package/dist/templates/launchpad/apps/launchpad/tsconfig.json +10 -8
- package/dist/templates/launchpad/apps/launchpad/vite-env.d.ts +1 -0
- package/dist/templates/launchpad/apps/launchpad/vite.config.ts +8 -3
- package/dist/templates/tests/.agents/skills/iocd-wdio-testing/references/configuration.md +3 -2
- package/dist/templates/tests/.agents/skills/iocd-wdio-testing/references/models.md +1 -1
- package/dist/templates/tests/.agents/skills/iocd-wdio-testing/references/troubleshooting.md +8 -9
- package/dist/templates/tests/tests/package.json +1 -1
- package/dist/utils/template-update.js +6 -0
- package/dist/utils/template-update.js.map +1 -0
- package/package.json +3 -1
- package/dist/templates/launchpad/apps/launchpad/package-lock.json +0 -2778
- package/dist/templates/launchpad/apps/launchpad/src/components/logo.tsx +0 -11
- package/dist/templates/launchpad/apps/launchpad/src/components/main-context-menu.tsx +0 -212
- package/dist/templates/launchpad/apps/launchpad/src/components/notifications-button.tsx +0 -51
- package/dist/templates/tests/tests/package-lock.json +0 -8441
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { useCallback, useContext, useMemo } from "react";
|
|
2
|
-
import { IOConnectDesktop } from "@interopio/desktop";
|
|
3
|
-
import { IOConnectContext } from "@interopio/react-hooks";
|
|
4
|
-
import {
|
|
5
|
-
Dropdown,
|
|
6
|
-
Icon,
|
|
7
|
-
IconProps,
|
|
8
|
-
Separator,
|
|
9
|
-
} from "@interopio/components-react";
|
|
10
|
-
|
|
11
|
-
const PLATFORM_UTILITY_PAGES = {
|
|
12
|
-
ABOUT: "about",
|
|
13
|
-
HOTKEYS: "hotkeys",
|
|
14
|
-
FEEDBACK: "feedback",
|
|
15
|
-
} as const;
|
|
16
|
-
|
|
17
|
-
const PLATFORM_APPS = {
|
|
18
|
-
DOWNLOAD_MANAGER: "io-connect-download-manager",
|
|
19
|
-
} as const;
|
|
20
|
-
|
|
21
|
-
type PageKey = keyof typeof PLATFORM_UTILITY_PAGES;
|
|
22
|
-
type PageName = (typeof PLATFORM_UTILITY_PAGES)[PageKey];
|
|
23
|
-
type AppKey = keyof typeof PLATFORM_APPS;
|
|
24
|
-
type AppName = (typeof PLATFORM_APPS)[AppKey];
|
|
25
|
-
|
|
26
|
-
function MainContextMenu() {
|
|
27
|
-
const io = useContext(IOConnectContext) as IOConnectDesktop.API;
|
|
28
|
-
|
|
29
|
-
const startPage = useCallback(
|
|
30
|
-
async (pageName: PageName) => {
|
|
31
|
-
if (!io) {
|
|
32
|
-
console.warn("IOConnectContext not available");
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
await io.interop.invoke("T42.GD.Execute", {
|
|
38
|
-
command: "open-utility-page",
|
|
39
|
-
args: { name: pageName },
|
|
40
|
-
});
|
|
41
|
-
} catch (error) {
|
|
42
|
-
console.warn("Failed to open utility page", pageName, error);
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
[io]
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
const startApp = useCallback(
|
|
49
|
-
async (appName: AppName) => {
|
|
50
|
-
if (!io) {
|
|
51
|
-
console.warn("IOConnectContext not available");
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
try {
|
|
56
|
-
const app = io.appManager.application(appName);
|
|
57
|
-
if (!app) {
|
|
58
|
-
throw new Error(`Cannot find app with name "${appName}"`);
|
|
59
|
-
}
|
|
60
|
-
await app.start();
|
|
61
|
-
} catch (error) {
|
|
62
|
-
console.warn("Failed to start app", appName, error);
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
[io]
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
const openDownloads = useCallback(() => {
|
|
69
|
-
startApp(PLATFORM_APPS.DOWNLOAD_MANAGER);
|
|
70
|
-
}, [startApp]);
|
|
71
|
-
|
|
72
|
-
const openFeedback = useCallback(() => {
|
|
73
|
-
startPage(PLATFORM_UTILITY_PAGES.FEEDBACK);
|
|
74
|
-
}, [startPage]);
|
|
75
|
-
|
|
76
|
-
const openHotkeys = useCallback(() => {
|
|
77
|
-
startPage(PLATFORM_UTILITY_PAGES.HOTKEYS);
|
|
78
|
-
}, [startPage]);
|
|
79
|
-
|
|
80
|
-
const handleMinimize = useCallback(async () => {
|
|
81
|
-
if (!io) {
|
|
82
|
-
console.warn("IOConnectContext not available");
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const myWindow = io.windows.my();
|
|
87
|
-
|
|
88
|
-
if (!myWindow) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
try {
|
|
93
|
-
await myWindow.minimize();
|
|
94
|
-
} catch (error) {
|
|
95
|
-
console.error("Failed to minimize window", error);
|
|
96
|
-
}
|
|
97
|
-
}, [io]);
|
|
98
|
-
|
|
99
|
-
const handleRestart = useCallback(async () => {
|
|
100
|
-
if (!io) {
|
|
101
|
-
console.warn("IOConnectContext not available");
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
try {
|
|
106
|
-
await io.appManager.restart({
|
|
107
|
-
autoSave: true,
|
|
108
|
-
showDialog: true,
|
|
109
|
-
});
|
|
110
|
-
} catch (error) {
|
|
111
|
-
console.error("Failed to restart io.Connect Desktop", error);
|
|
112
|
-
}
|
|
113
|
-
}, [io]);
|
|
114
|
-
|
|
115
|
-
const handleShutdown = useCallback(async () => {
|
|
116
|
-
if (!io) {
|
|
117
|
-
console.warn("IOConnectContext not available");
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
try {
|
|
122
|
-
await io.appManager.exit({
|
|
123
|
-
autoSave: true,
|
|
124
|
-
showDialog: true,
|
|
125
|
-
});
|
|
126
|
-
} catch (error) {
|
|
127
|
-
console.error("Failed to shutdown io.Connect Desktop", error);
|
|
128
|
-
}
|
|
129
|
-
}, [io]);
|
|
130
|
-
|
|
131
|
-
const menuItems = useMemo(
|
|
132
|
-
() => [
|
|
133
|
-
{
|
|
134
|
-
label: "Pin Launchpad",
|
|
135
|
-
icon: "pin",
|
|
136
|
-
onClick: () => null,
|
|
137
|
-
disabled: true,
|
|
138
|
-
},
|
|
139
|
-
{ label: "Dock Launchpad", onClick: () => null, disabled: true },
|
|
140
|
-
{ separator: true },
|
|
141
|
-
{
|
|
142
|
-
label: "Platform Preferences",
|
|
143
|
-
icon: "cog",
|
|
144
|
-
onClick: () => null,
|
|
145
|
-
disabled: true,
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
label: "Notification Settings",
|
|
149
|
-
icon: "bell",
|
|
150
|
-
onClick: () => null,
|
|
151
|
-
disabled: true,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
label: "Intent Resolver Settings",
|
|
155
|
-
icon: "list-ul",
|
|
156
|
-
onClick: () => null,
|
|
157
|
-
disabled: true,
|
|
158
|
-
},
|
|
159
|
-
{ separator: true },
|
|
160
|
-
{ label: "Profile", icon: "user", onClick: () => null, disabled: true },
|
|
161
|
-
{ separator: true },
|
|
162
|
-
{ label: "Downloads", onClick: openDownloads },
|
|
163
|
-
{ separator: true },
|
|
164
|
-
{ label: "Feedback", icon: "feedback", onClick: openFeedback },
|
|
165
|
-
{ label: "Keyboard Shortcuts", icon: "keyboard", onClick: openHotkeys },
|
|
166
|
-
{ separator: true },
|
|
167
|
-
{ label: "Minimize", icon: "minimize-down", onClick: handleMinimize },
|
|
168
|
-
{ label: "Restart", icon: "rotate-right", onClick: handleRestart },
|
|
169
|
-
{ label: "Shut Down", icon: "power-off", onClick: handleShutdown },
|
|
170
|
-
],
|
|
171
|
-
[
|
|
172
|
-
openDownloads,
|
|
173
|
-
openFeedback,
|
|
174
|
-
openHotkeys,
|
|
175
|
-
handleMinimize,
|
|
176
|
-
handleRestart,
|
|
177
|
-
handleShutdown,
|
|
178
|
-
]
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
return (
|
|
182
|
-
<div className="launchpad-header-actions">
|
|
183
|
-
<Dropdown>
|
|
184
|
-
<Dropdown.ButtonIcon
|
|
185
|
-
variant="circle"
|
|
186
|
-
icon="ellipsis-vertical"
|
|
187
|
-
title="More"
|
|
188
|
-
/>
|
|
189
|
-
<Dropdown.Content>
|
|
190
|
-
<Dropdown.List>
|
|
191
|
-
{menuItems.map((item, idx) =>
|
|
192
|
-
item.separator ? (
|
|
193
|
-
<Separator key={`sep-${idx}`} />
|
|
194
|
-
) : (
|
|
195
|
-
<Dropdown.Item
|
|
196
|
-
key={item.label}
|
|
197
|
-
prepend={<Icon variant={item.icon as IconProps["variant"]} />}
|
|
198
|
-
onClick={item.onClick}
|
|
199
|
-
disabled={item.disabled}
|
|
200
|
-
>
|
|
201
|
-
{item.label}
|
|
202
|
-
</Dropdown.Item>
|
|
203
|
-
)
|
|
204
|
-
)}
|
|
205
|
-
</Dropdown.List>
|
|
206
|
-
</Dropdown.Content>
|
|
207
|
-
</Dropdown>
|
|
208
|
-
</div>
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export default MainContextMenu;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { useEffect, useContext, useCallback, useState } from "react";
|
|
2
|
-
import { IOConnectDesktop } from "@interopio/desktop";
|
|
3
|
-
import { IOConnectContext } from "@interopio/react-hooks";
|
|
4
|
-
import { Badge, ButtonIcon } from "@interopio/components-react";
|
|
5
|
-
|
|
6
|
-
function NotificationsButton() {
|
|
7
|
-
const io = useContext(IOConnectContext) as IOConnectDesktop.API;
|
|
8
|
-
const [notificationsCount, setNotificationsCount] = useState(0);
|
|
9
|
-
|
|
10
|
-
const openNotificationPanel = useCallback(async () => {
|
|
11
|
-
const isPanelVisible = await io.notifications.panel.isVisible();
|
|
12
|
-
|
|
13
|
-
if (isPanelVisible) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
await io.notifications.panel.show();
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.error("Failed to open notifications panel.", error);
|
|
21
|
-
}
|
|
22
|
-
}, []);
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const unCounterChanged = io.notifications.onCounterChanged(info =>
|
|
26
|
-
setNotificationsCount(info.count)
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
return () => {
|
|
30
|
-
unCounterChanged();
|
|
31
|
-
};
|
|
32
|
-
}, [io]);
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<div className="launchpad-header-notifications-button">
|
|
36
|
-
{notificationsCount > 0 && (
|
|
37
|
-
<Badge variant="primary">
|
|
38
|
-
{notificationsCount > 99 ? "99+" : notificationsCount}
|
|
39
|
-
</Badge>
|
|
40
|
-
)}
|
|
41
|
-
<ButtonIcon
|
|
42
|
-
variant="circle"
|
|
43
|
-
icon="bell"
|
|
44
|
-
size="32"
|
|
45
|
-
onClick={openNotificationPanel}
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default NotificationsButton;
|