@vicinae/api 0.20.15 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/alert.js +4 -2
- package/dist/api/components/actions.d.ts +7 -1
- package/dist/api/components/actions.js +18 -34
- package/dist/api/components/form.js +10 -6
- package/dist/api/components/grid.js +4 -2
- package/dist/api/components/list.js +4 -2
- package/dist/api/components/metadata.js +4 -2
- package/dist/api/file-search.d.ts +3 -4
- package/dist/api/file-search.js +3 -4
- package/dist/api/hooks/index.d.ts +1 -0
- package/dist/api/hooks/index.js +1 -0
- package/dist/api/hooks/use-event-counted.d.ts +5 -0
- package/dist/api/hooks/use-event-counted.js +14 -0
- package/dist/api/proto/api.d.ts +4 -4
- package/dist/api/proto/api.js +32 -11
- package/dist/api/window-management.js +15 -5
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +5 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.js +85 -0
- package/dist/commands/build/index.d.ts +3 -11
- package/dist/commands/build/index.js +19 -31
- package/dist/commands/develop/index.d.ts +3 -10
- package/dist/commands/develop/index.js +23 -42
- package/dist/commands/lint/index.d.ts +3 -10
- package/dist/commands/lint/index.js +13 -23
- package/package.json +9 -31
- package/types/jsx.d.ts +12 -8
- package/bin/run.js +0 -9
package/dist/api/alert.js
CHANGED
|
@@ -39,7 +39,8 @@ const styleMap = {
|
|
|
39
39
|
*/
|
|
40
40
|
const confirmAlert = async (options) => {
|
|
41
41
|
return new Promise((resolve) => {
|
|
42
|
-
(0, client_1.getClient)()
|
|
42
|
+
(0, client_1.getClient)()
|
|
43
|
+
.UI.confirmAlert({
|
|
43
44
|
title: options.title,
|
|
44
45
|
description: options.message ?? "Are you sure?",
|
|
45
46
|
//icon: options.icon && serializeProtoImage(options.icon),
|
|
@@ -52,7 +53,8 @@ const confirmAlert = async (options) => {
|
|
|
52
53
|
title: options.dismissAction?.title ?? "Cancel",
|
|
53
54
|
style: styleMap[options.dismissAction?.style ?? Alert.ActionStyle.Cancel],
|
|
54
55
|
},
|
|
55
|
-
})
|
|
56
|
+
})
|
|
57
|
+
.then((confirmed) => {
|
|
56
58
|
if (confirmed) {
|
|
57
59
|
options.primaryAction?.onAction?.();
|
|
58
60
|
}
|
|
@@ -49,6 +49,12 @@ export declare namespace Action {
|
|
|
49
49
|
app?: Application;
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
namespace OpenWith {
|
|
53
|
+
type Props = BaseActionProps & {
|
|
54
|
+
path: string;
|
|
55
|
+
onOpen?: (path: string) => void;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
52
58
|
namespace Trash {
|
|
53
59
|
type PathArg = PathLike | PathLike[];
|
|
54
60
|
export type Props = BaseActionProps & {
|
|
@@ -122,7 +128,7 @@ export declare const Action: React.FC<ActionProps> & {
|
|
|
122
128
|
Paste: React.FC<Action.Paste.Props>;
|
|
123
129
|
SubmitForm: React.FC<Action.SubmitForm.Props>;
|
|
124
130
|
OpenInBrowser: React.FC<Action.OpenInBrowser.Props>;
|
|
125
|
-
OpenWith:
|
|
131
|
+
OpenWith: React.FC<Action.OpenWith.Props>;
|
|
126
132
|
Trash: React.FC<Action.Trash.Props>;
|
|
127
133
|
ShowInFinder: React.FC<Action.ShowInFinderProps.Props>;
|
|
128
134
|
RunInTerminal: React.FC<Action.RunInTerminal.Props>;
|
|
@@ -10,6 +10,8 @@ const image_1 = require("../image");
|
|
|
10
10
|
const utils_1 = require("../utils");
|
|
11
11
|
const icon_1 = require("../icon");
|
|
12
12
|
const controls_1 = require("../controls");
|
|
13
|
+
const action_pannel_1 = require("./action-pannel");
|
|
14
|
+
const toast_1 = require("../toast");
|
|
13
15
|
const ActionRoot = ({ icon, ...props }) => {
|
|
14
16
|
const serializedIcon = icon ? (0, image_1.serializeProtoImage)(icon) : icon;
|
|
15
17
|
const stableIdRef = (0, react_1.useRef)(undefined);
|
|
@@ -37,43 +39,25 @@ const Open = ({ target, app, ...props }) => {
|
|
|
37
39
|
(0, utils_1.open)(target, app);
|
|
38
40
|
} }));
|
|
39
41
|
};
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
/*
|
|
43
|
-
const OpenWith: React.FC<Action.OpenWith.Props> = ({
|
|
44
|
-
path,
|
|
45
|
-
title = "Open with...",
|
|
46
|
-
shortcut,
|
|
47
|
-
icon,
|
|
48
|
-
...props
|
|
49
|
-
}) => {
|
|
50
|
-
const [apps, setApps] = useState<Application[]>([]);
|
|
51
|
-
|
|
42
|
+
const OpenWith = ({ path, title = "Open with...", shortcut, icon, ...props }) => {
|
|
43
|
+
const [apps, setApps] = (0, react_1.useState)([]);
|
|
52
44
|
const fetchApps = () => {
|
|
53
|
-
getApplications(path).then(setApps);
|
|
45
|
+
(0, utils_1.getApplications)(path).then(setApps);
|
|
54
46
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
title={`Open in ${app.name}`}
|
|
69
|
-
icon={app.icon}
|
|
70
|
-
onAction={() => props.onOpen?.(path)}
|
|
71
|
-
/>
|
|
72
|
-
))}
|
|
73
|
-
</ActionPanel.Submenu>
|
|
74
|
-
);
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(action_pannel_1.ActionPanel.Submenu, { title: title, icon: icon, shortcut: shortcut, onOpen: () => {
|
|
48
|
+
fetchApps();
|
|
49
|
+
}, children: apps.map((app) => ((0, jsx_runtime_1.jsx)(exports.Action, { title: `Open in ${app.name}`, icon: app.icon, onAction: () => {
|
|
50
|
+
(0, controls_1.closeMainWindow)();
|
|
51
|
+
(0, utils_1.open)(path, app)
|
|
52
|
+
.then(() => {
|
|
53
|
+
props.onOpen?.(path);
|
|
54
|
+
})
|
|
55
|
+
.catch(async (error) => {
|
|
56
|
+
(0, toast_1.showToast)({ title: `Failed to open app` });
|
|
57
|
+
console.error("Failed to open app", error);
|
|
58
|
+
});
|
|
59
|
+
} }, app.id))) }));
|
|
75
60
|
};
|
|
76
|
-
*/
|
|
77
61
|
const Trash = ({ title, paths, ...props }) => {
|
|
78
62
|
const actionTitle = title ?? `Delete item${Array.isArray(paths) ? "s" : ""}`;
|
|
79
63
|
return ((0, jsx_runtime_1.jsx)(ActionRoot, { title: actionTitle, ...props, onAction: async () => {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Form = exports.DatePickerType = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const use_imperative_form_handle_1 = require("../hooks/use-imperative-form-handle");
|
|
6
|
+
const use_event_counted_1 = require("../hooks/use-event-counted");
|
|
6
7
|
const image_1 = require("../image");
|
|
7
8
|
const dropdown_1 = require("./dropdown");
|
|
8
9
|
const wrapFormItemProps = (props) => {
|
|
@@ -29,13 +30,15 @@ const FormRoot = ({ enableDrafts = false, actions, children, isLoading = false,
|
|
|
29
30
|
//@ts-ignore
|
|
30
31
|
enableDrafts: enableDrafts, isLoading: isLoading, navigationTitle: navigationTitle, children: [searchBarAccessory, children, actions] }));
|
|
31
32
|
};
|
|
32
|
-
const TextField = ({ ref, ...props }) => {
|
|
33
|
+
const TextField = ({ ref, value, onChange, ...props }) => {
|
|
33
34
|
(0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
|
|
34
|
-
|
|
35
|
+
const [countedValue, wrappedOnChange] = (0, use_event_counted_1.useEventCounted)(value, onChange);
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)("text-field", { ...wrapFormItemProps(props), value: countedValue, onChange: wrappedOnChange }));
|
|
35
37
|
};
|
|
36
|
-
const PasswordField = ({ ref, ...props }) => {
|
|
38
|
+
const PasswordField = ({ ref, value, onChange, ...props }) => {
|
|
37
39
|
(0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
|
|
38
|
-
|
|
40
|
+
const [countedValue, wrappedOnChange] = (0, use_event_counted_1.useEventCounted)(value, onChange);
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)("password-field", { ...props, value: countedValue, onChange: wrappedOnChange }));
|
|
39
42
|
};
|
|
40
43
|
var DatePickerType;
|
|
41
44
|
(function (DatePickerType) {
|
|
@@ -88,9 +91,10 @@ const TagPickerItem = ({ icon, ...props }) => {
|
|
|
88
91
|
const TagPicker = Object.assign(TagPickerRoot, {
|
|
89
92
|
Item: TagPickerItem,
|
|
90
93
|
});
|
|
91
|
-
const TextArea = ({ ref, ...props }) => {
|
|
94
|
+
const TextArea = ({ ref, value, onChange, ...props }) => {
|
|
92
95
|
(0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
|
|
93
|
-
|
|
96
|
+
const [countedValue, wrappedOnChange] = (0, use_event_counted_1.useEventCounted)(value, onChange);
|
|
97
|
+
return ((0, jsx_runtime_1.jsx)("text-area-field", { ...wrapFormItemProps(props), value: countedValue, onChange: wrappedOnChange }));
|
|
94
98
|
};
|
|
95
99
|
const FilePicker = ({ ref, ...props }) => {
|
|
96
100
|
(0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
|
|
@@ -8,6 +8,7 @@ const crypto_1 = require("crypto");
|
|
|
8
8
|
const empty_view_1 = require("./empty-view");
|
|
9
9
|
const color_1 = require("../color");
|
|
10
10
|
const dropdown_1 = require("./dropdown");
|
|
11
|
+
const use_event_counted_1 = require("../hooks/use-event-counted");
|
|
11
12
|
var GridInset;
|
|
12
13
|
(function (GridInset) {
|
|
13
14
|
GridInset["Zero"] = "zero";
|
|
@@ -52,7 +53,7 @@ var GridFit;
|
|
|
52
53
|
*/
|
|
53
54
|
GridFit["Fill"] = "fill";
|
|
54
55
|
})(GridFit || (GridFit = {}));
|
|
55
|
-
const GridRoot = ({ searchBarAccessory, children, actions, inset, itemSize, fit = GridFit.Contain, aspectRatio = "1", ...props }) => {
|
|
56
|
+
const GridRoot = ({ searchBarAccessory, children, actions, inset, itemSize, fit = GridFit.Contain, aspectRatio = "1", searchText, onSearchTextChange, ...props }) => {
|
|
56
57
|
if (typeof props.enableFiltering === "boolean" &&
|
|
57
58
|
typeof props.filtering === "undefined") {
|
|
58
59
|
props.filtering = props.enableFiltering;
|
|
@@ -64,7 +65,8 @@ const GridRoot = ({ searchBarAccessory, children, actions, inset, itemSize, fit
|
|
|
64
65
|
[GridItemSize.Large]: 3,
|
|
65
66
|
}[itemSize];
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
const [countedSearchText, wrappedOnSearchTextChange] = (0, use_event_counted_1.useEventCounted)(searchText, onSearchTextChange);
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)("grid", { fit: fit, inset: inset, aspectRatio: aspectRatioMap[aspectRatio], searchText: countedSearchText, onSearchTextChange: wrappedOnSearchTextChange, ...props, children: [searchBarAccessory, children, actions] }));
|
|
68
70
|
};
|
|
69
71
|
const GridItem = ({ detail, actions, content, accessory, ...props }) => {
|
|
70
72
|
const id = (0, react_1.useRef)(props.id ?? (0, crypto_1.randomUUID)());
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.List = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const use_event_counted_1 = require("../hooks/use-event-counted");
|
|
6
7
|
const image_1 = require("../image");
|
|
7
8
|
const node_crypto_1 = require("node:crypto");
|
|
8
9
|
const metadata_1 = require("./metadata");
|
|
@@ -41,12 +42,13 @@ function serializeText(text) {
|
|
|
41
42
|
return { color, value };
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
const ListRoot = ({ searchBarAccessory, children, actions, ...props }) => {
|
|
45
|
+
const ListRoot = ({ searchBarAccessory, children, actions, searchText, onSearchTextChange, ...props }) => {
|
|
45
46
|
if (typeof props.enableFiltering === "boolean" &&
|
|
46
47
|
typeof props.filtering === "undefined") {
|
|
47
48
|
props.filtering = props.enableFiltering;
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
+
const [countedSearchText, wrappedOnSearchTextChange] = (0, use_event_counted_1.useEventCounted)(searchText, onSearchTextChange);
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)("list", { ...props, searchText: countedSearchText, onSearchTextChange: wrappedOnSearchTextChange, children: [searchBarAccessory, children, actions] }));
|
|
50
52
|
};
|
|
51
53
|
const ListItem = ({ detail, actions, icon, accessories, ...props }) => {
|
|
52
54
|
const id = (0, react_1.useRef)(props.id ?? (0, node_crypto_1.randomUUID)());
|
|
@@ -15,7 +15,9 @@ const MetadataLabel = (props) => {
|
|
|
15
15
|
let serializedText;
|
|
16
16
|
if (props.text && typeof props.text === "object") {
|
|
17
17
|
serializedText = {
|
|
18
|
-
color: props.text.color
|
|
18
|
+
color: props.text.color
|
|
19
|
+
? (0, color_1.serializeColorLike)(props.text.color)
|
|
20
|
+
: undefined,
|
|
19
21
|
value: props.text.value,
|
|
20
22
|
};
|
|
21
23
|
}
|
|
@@ -23,7 +25,7 @@ const MetadataLabel = (props) => {
|
|
|
23
25
|
serializedText = props.text;
|
|
24
26
|
}
|
|
25
27
|
const { text, ...restProps } = props;
|
|
26
|
-
return (0, jsx_runtime_1.jsx)("metadata-label", { ...restProps, icon: serializedIcon, text: serializedText });
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)("metadata-label", { ...restProps, icon: serializedIcon, text: serializedText }));
|
|
27
29
|
};
|
|
28
30
|
const MetadataSeparator = () => {
|
|
29
31
|
return (0, jsx_runtime_1.jsx)("metadata-separator", {});
|
|
@@ -31,10 +31,9 @@ export declare namespace FileSearch {
|
|
|
31
31
|
* @returns Promise resolving to array of matching files
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Uses
|
|
35
|
-
* - File: "
|
|
36
|
-
* - Matches: "
|
|
37
|
-
* - No match: "board", "oice" (not prefixes)
|
|
34
|
+
* Uses fuzzy filename matching backed by Vicinae's file index. For example:
|
|
35
|
+
* - File: "example folder"
|
|
36
|
+
* - Matches: "fol exa", "exa fol", "ex fold"
|
|
38
37
|
*
|
|
39
38
|
* @example
|
|
40
39
|
* ```typescript
|
package/dist/api/file-search.js
CHANGED
|
@@ -34,10 +34,9 @@ var FileSearch;
|
|
|
34
34
|
* @returns Promise resolving to array of matching files
|
|
35
35
|
*
|
|
36
36
|
* @remarks
|
|
37
|
-
* Uses
|
|
38
|
-
* - File: "
|
|
39
|
-
* - Matches: "
|
|
40
|
-
* - No match: "board", "oice" (not prefixes)
|
|
37
|
+
* Uses fuzzy filename matching backed by Vicinae's file index. For example:
|
|
38
|
+
* - File: "example folder"
|
|
39
|
+
* - Matches: "fol exa", "exa fol", "ex fold"
|
|
41
40
|
*
|
|
42
41
|
* @example
|
|
43
42
|
* ```typescript
|
package/dist/api/hooks/index.js
CHANGED
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./use-event-counted"), exports);
|
|
17
18
|
__exportStar(require("./use-navigation"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useEventCounted = useEventCounted;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useEventCounted(value, onChange) {
|
|
6
|
+
const ref = (0, react_1.useRef)(0);
|
|
7
|
+
const handler = (0, react_1.useCallback)((...args) => {
|
|
8
|
+
if (typeof args[1] === "number")
|
|
9
|
+
ref.current = args[1];
|
|
10
|
+
onChange?.(args[0]);
|
|
11
|
+
}, [onChange]);
|
|
12
|
+
const counted = value != null ? { value, eventCount: ref.current } : undefined;
|
|
13
|
+
return [counted, onChange ? handler : undefined];
|
|
14
|
+
}
|
package/dist/api/proto/api.d.ts
CHANGED
|
@@ -15,10 +15,10 @@ export declare class RpcTransport {
|
|
|
15
15
|
private requestMap;
|
|
16
16
|
private handlers;
|
|
17
17
|
}
|
|
18
|
-
export type ImageMask =
|
|
19
|
-
export type ToastStyle =
|
|
20
|
-
export type PopToRootType =
|
|
21
|
-
export type ConfirmAlertActionStyle =
|
|
18
|
+
export type ImageMask = "None" | "Circle" | "RoundedRectangle";
|
|
19
|
+
export type ToastStyle = "Success" | "Info" | "Warning" | "Error" | "Dynamic";
|
|
20
|
+
export type PopToRootType = "Default" | "Immediate" | "Suspended";
|
|
21
|
+
export type ConfirmAlertActionStyle = "Default" | "Destructive" | "Cancel";
|
|
22
22
|
export type Application = {
|
|
23
23
|
id: string;
|
|
24
24
|
name: string;
|
package/dist/api/proto/api.js
CHANGED
|
@@ -30,7 +30,7 @@ class RpcTransport {
|
|
|
30
30
|
const promise = new Promise((resolve, reject) => {
|
|
31
31
|
this.requestMap.set(id, { resolve: (msg) => resolve(msg), reject });
|
|
32
32
|
});
|
|
33
|
-
this.sendMessage({ jsonrpc:
|
|
33
|
+
this.sendMessage({ jsonrpc: "2.0", id, method, params });
|
|
34
34
|
return promise;
|
|
35
35
|
}
|
|
36
36
|
subscribe(method, cb) {
|
|
@@ -52,11 +52,10 @@ class RpcTransport {
|
|
|
52
52
|
this.transport.send(JSON.stringify(msg));
|
|
53
53
|
}
|
|
54
54
|
id = 1;
|
|
55
|
-
requestMap = new Map;
|
|
56
|
-
handlers = new Map;
|
|
55
|
+
requestMap = new Map();
|
|
56
|
+
handlers = new Map();
|
|
57
57
|
}
|
|
58
58
|
exports.RpcTransport = RpcTransport;
|
|
59
|
-
;
|
|
60
59
|
class ApplicationService {
|
|
61
60
|
transport;
|
|
62
61
|
constructor(transport) {
|
|
@@ -72,7 +71,10 @@ class ApplicationService {
|
|
|
72
71
|
return this.transport.request("Application/getDefault", { target });
|
|
73
72
|
}
|
|
74
73
|
showInFileBrowser(target, select) {
|
|
75
|
-
return this.transport.request("Application/showInFileBrowser", {
|
|
74
|
+
return this.transport.request("Application/showInFileBrowser", {
|
|
75
|
+
target,
|
|
76
|
+
select,
|
|
77
|
+
});
|
|
76
78
|
}
|
|
77
79
|
runInTerminal(opts) {
|
|
78
80
|
return this.transport.request("Application/runInTerminal", { opts });
|
|
@@ -87,7 +89,12 @@ class UIService {
|
|
|
87
89
|
return this.transport.request("UI/render", { json });
|
|
88
90
|
}
|
|
89
91
|
showToast(id, title, message, style) {
|
|
90
|
-
return this.transport.request("UI/showToast", {
|
|
92
|
+
return this.transport.request("UI/showToast", {
|
|
93
|
+
id,
|
|
94
|
+
title,
|
|
95
|
+
message,
|
|
96
|
+
style,
|
|
97
|
+
});
|
|
91
98
|
}
|
|
92
99
|
updateToast(id, title) {
|
|
93
100
|
return this.transport.request("UI/updateToast", { id, title });
|
|
@@ -96,10 +103,17 @@ class UIService {
|
|
|
96
103
|
return this.transport.request("UI/hideToast", { id });
|
|
97
104
|
}
|
|
98
105
|
showHud(text, clear_root, popToRoot) {
|
|
99
|
-
return this.transport.request("UI/showHud", {
|
|
106
|
+
return this.transport.request("UI/showHud", {
|
|
107
|
+
text,
|
|
108
|
+
clear_root,
|
|
109
|
+
popToRoot,
|
|
110
|
+
});
|
|
100
111
|
}
|
|
101
112
|
closeMainWindow(clearRoot, popToRoot) {
|
|
102
|
-
return this.transport.request("UI/closeMainWindow", {
|
|
113
|
+
return this.transport.request("UI/closeMainWindow", {
|
|
114
|
+
clearRoot,
|
|
115
|
+
popToRoot,
|
|
116
|
+
});
|
|
103
117
|
}
|
|
104
118
|
popToRoot(clearSearchBar) {
|
|
105
119
|
return this.transport.request("UI/popToRoot", { clearSearchBar });
|
|
@@ -141,7 +155,9 @@ class WindowManagementService {
|
|
|
141
155
|
return this.transport.request("WindowManagement/getActiveWorkspace", {});
|
|
142
156
|
}
|
|
143
157
|
getWindows(workspaceId) {
|
|
144
|
-
return this.transport.request("WindowManagement/getWindows", {
|
|
158
|
+
return this.transport.request("WindowManagement/getWindows", {
|
|
159
|
+
workspaceId,
|
|
160
|
+
});
|
|
145
161
|
}
|
|
146
162
|
getScreens() {
|
|
147
163
|
return this.transport.request("WindowManagement/getScreens", {});
|
|
@@ -150,7 +166,10 @@ class WindowManagementService {
|
|
|
150
166
|
return this.transport.request("WindowManagement/getWorkspaces", {});
|
|
151
167
|
}
|
|
152
168
|
setWindowBounds(winId, bounds) {
|
|
153
|
-
return this.transport.request("WindowManagement/setWindowBounds", {
|
|
169
|
+
return this.transport.request("WindowManagement/setWindowBounds", {
|
|
170
|
+
winId,
|
|
171
|
+
bounds,
|
|
172
|
+
});
|
|
154
173
|
}
|
|
155
174
|
}
|
|
156
175
|
class ClipboardService {
|
|
@@ -257,7 +276,9 @@ class Client {
|
|
|
257
276
|
this.OAuth = new OAuthService(this.transport);
|
|
258
277
|
this.EventCore = new EventCoreService(this.transport);
|
|
259
278
|
}
|
|
260
|
-
route(msg) {
|
|
279
|
+
route(msg) {
|
|
280
|
+
this.transport.dispatchMessage(msg);
|
|
281
|
+
}
|
|
261
282
|
Application;
|
|
262
283
|
UI;
|
|
263
284
|
WindowManagement;
|
|
@@ -51,7 +51,9 @@ const transformWindow = (proto) => {
|
|
|
51
51
|
var WindowManagement;
|
|
52
52
|
(function (WindowManagement) {
|
|
53
53
|
async function getWindows(workspaceId) {
|
|
54
|
-
return (0, client_1.getClient)()
|
|
54
|
+
return (0, client_1.getClient)()
|
|
55
|
+
.WindowManagement.getWindows(workspaceId)
|
|
56
|
+
.then((wins) => wins.map(transformWindow));
|
|
55
57
|
}
|
|
56
58
|
WindowManagement.getWindows = getWindows;
|
|
57
59
|
/**
|
|
@@ -76,7 +78,9 @@ var WindowManagement;
|
|
|
76
78
|
* Return the list of screens (physical and virtual) currently attached to the computer.
|
|
77
79
|
*/
|
|
78
80
|
async function getScreens() {
|
|
79
|
-
return (0, client_1.getClient)()
|
|
81
|
+
return (0, client_1.getClient)()
|
|
82
|
+
.WindowManagement.getScreens()
|
|
83
|
+
.then((screens) => screens.map((sc) => ({
|
|
80
84
|
name: sc.name,
|
|
81
85
|
make: sc.make,
|
|
82
86
|
model: sc.model,
|
|
@@ -89,15 +93,21 @@ var WindowManagement;
|
|
|
89
93
|
}
|
|
90
94
|
WindowManagement.getScreens = getScreens;
|
|
91
95
|
async function getActiveWorkspace() {
|
|
92
|
-
return (0, client_1.getClient)()
|
|
96
|
+
return (0, client_1.getClient)()
|
|
97
|
+
.WindowManagement.getActiveWorkspace()
|
|
98
|
+
.then(transformWorkspace);
|
|
93
99
|
}
|
|
94
100
|
WindowManagement.getActiveWorkspace = getActiveWorkspace;
|
|
95
101
|
async function getWorkspaces() {
|
|
96
|
-
return (0, client_1.getClient)()
|
|
102
|
+
return (0, client_1.getClient)()
|
|
103
|
+
.WindowManagement.getWorkspaces()
|
|
104
|
+
.then((workspaces) => workspaces.map(transformWorkspace));
|
|
97
105
|
}
|
|
98
106
|
WindowManagement.getWorkspaces = getWorkspaces;
|
|
99
107
|
async function getWindowsOnActiveWorkspace() {
|
|
100
|
-
return (0, client_1.getClient)()
|
|
108
|
+
return (0, client_1.getClient)()
|
|
109
|
+
.WindowManagement.getActiveWorkspace()
|
|
110
|
+
.then((ws) => getWindows(ws.id));
|
|
101
111
|
}
|
|
102
112
|
WindowManagement.getWindowsOnActiveWorkspace = getWindowsOnActiveWorkspace;
|
|
103
113
|
async function getActiveWindow() {
|
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface FlagDef {
|
|
2
|
+
short?: string;
|
|
3
|
+
description: string;
|
|
4
|
+
default?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CommandDef {
|
|
7
|
+
description: string;
|
|
8
|
+
flags: Record<string, FlagDef>;
|
|
9
|
+
run: (flags: Record<string, string | undefined>) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare function main(): Promise<void>;
|
|
12
|
+
export {};
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.main = main;
|
|
7
|
+
const index_js_1 = __importDefault(require("./commands/build/index.js"));
|
|
8
|
+
const index_js_2 = __importDefault(require("./commands/develop/index.js"));
|
|
9
|
+
const index_js_3 = __importDefault(require("./commands/lint/index.js"));
|
|
10
|
+
function parseFlags(argv, defs) {
|
|
11
|
+
const result = {};
|
|
12
|
+
for (const [name, def] of Object.entries(defs)) {
|
|
13
|
+
if (def.default !== undefined)
|
|
14
|
+
result[name] = def.default;
|
|
15
|
+
}
|
|
16
|
+
const shortToLong = new Map();
|
|
17
|
+
for (const [name, def] of Object.entries(defs)) {
|
|
18
|
+
if (def.short)
|
|
19
|
+
shortToLong.set(def.short, name);
|
|
20
|
+
}
|
|
21
|
+
for (let i = 0; i < argv.length; i++) {
|
|
22
|
+
const arg = argv[i];
|
|
23
|
+
if (arg.startsWith("--")) {
|
|
24
|
+
const eqIdx = arg.indexOf("=");
|
|
25
|
+
if (eqIdx !== -1) {
|
|
26
|
+
result[arg.slice(2, eqIdx)] = arg.slice(eqIdx + 1);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
result[arg.slice(2)] = argv[++i];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else if (arg.startsWith("-") && arg.length === 2) {
|
|
33
|
+
const long = shortToLong.get(arg[1]);
|
|
34
|
+
if (long)
|
|
35
|
+
result[long] = argv[++i];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
function printHelp(commands) {
|
|
41
|
+
console.log("vici - Vicinae extension development CLI\n");
|
|
42
|
+
console.log("USAGE");
|
|
43
|
+
console.log(" $ vici <command> [flags]\n");
|
|
44
|
+
console.log("COMMANDS");
|
|
45
|
+
for (const [name, cmd] of Object.entries(commands)) {
|
|
46
|
+
console.log(` ${name.padEnd(12)} ${cmd.description}`);
|
|
47
|
+
}
|
|
48
|
+
console.log(`\nRun "vici <command> --help" for more information about a command.`);
|
|
49
|
+
}
|
|
50
|
+
function printCommandHelp(name, cmd) {
|
|
51
|
+
console.log(`vici ${name} - ${cmd.description}\n`);
|
|
52
|
+
console.log("USAGE");
|
|
53
|
+
console.log(` $ vici ${name} [flags]\n`);
|
|
54
|
+
const flagEntries = Object.entries(cmd.flags);
|
|
55
|
+
if (flagEntries.length === 0)
|
|
56
|
+
return;
|
|
57
|
+
console.log("FLAGS");
|
|
58
|
+
for (const [flagName, def] of flagEntries) {
|
|
59
|
+
const short = def.short ? `-${def.short}, ` : " ";
|
|
60
|
+
const defaultHint = def.default !== undefined
|
|
61
|
+
? ` (default: ${def.default === process.cwd() ? "cwd" : def.default})`
|
|
62
|
+
: "";
|
|
63
|
+
console.log(` ${short}--${flagName.padEnd(10)} ${def.description}${defaultHint}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function main() {
|
|
67
|
+
const commands = { build: index_js_1.default, develop: index_js_2.default, lint: index_js_3.default };
|
|
68
|
+
const [commandName, ...rest] = process.argv.slice(2);
|
|
69
|
+
if (!commandName || commandName === "--help" || commandName === "-h") {
|
|
70
|
+
printHelp(commands);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const cmd = commands[commandName];
|
|
74
|
+
if (!cmd) {
|
|
75
|
+
console.error(`Unknown command: ${commandName}\n`);
|
|
76
|
+
printHelp(commands);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
if (rest.includes("--help") || rest.includes("-h")) {
|
|
80
|
+
printCommandHelp(commandName, cmd);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const flags = parseFlags(rest, cmd.flags);
|
|
84
|
+
await cmd.run(flags);
|
|
85
|
+
}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
static flags: {
|
|
7
|
-
out: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
src: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
};
|
|
10
|
-
run(): Promise<void>;
|
|
11
|
-
}
|
|
1
|
+
import type { CommandDef } from "../../cli.js";
|
|
2
|
+
declare const build: CommandDef;
|
|
3
|
+
export default build;
|
|
@@ -36,39 +36,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const core_1 = require("@oclif/core");
|
|
40
39
|
const esbuild = __importStar(require("esbuild"));
|
|
41
40
|
const node_child_process_1 = require("node:child_process");
|
|
42
41
|
const node_fs_1 = require("node:fs");
|
|
43
42
|
const node_path_1 = require("node:path");
|
|
43
|
+
const manifest_js_1 = __importDefault(require("../../schemas/manifest.js"));
|
|
44
|
+
const extension_types_js_1 = require("../../utils/extension-types.js");
|
|
44
45
|
const logger_js_1 = require("../../utils/logger.js");
|
|
45
46
|
const utils_js_1 = require("../../utils/utils.js");
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
static examples = [
|
|
52
|
-
`<%= config.bin %> <%= command.id %> --target /path/to/extension`,
|
|
53
|
-
];
|
|
54
|
-
static flags = {
|
|
55
|
-
out: core_1.Flags.string({
|
|
56
|
-
aliases: ["output"],
|
|
57
|
-
char: "o",
|
|
47
|
+
const build = {
|
|
48
|
+
description: "Build an extension for distribution",
|
|
49
|
+
flags: {
|
|
50
|
+
out: {
|
|
51
|
+
short: "o",
|
|
58
52
|
description: "Path to output the compiled extension bundle to. Defaults to Vicinae extension directory.",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
aliases: ["src"],
|
|
63
|
-
char: "s",
|
|
64
|
-
default: process.cwd(),
|
|
65
|
-
defaultHelp: "The current working directory",
|
|
53
|
+
},
|
|
54
|
+
src: {
|
|
55
|
+
short: "s",
|
|
66
56
|
description: "Path to the extension source directory",
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
async run() {
|
|
71
|
-
const { flags } = await this.parse(Build);
|
|
57
|
+
default: process.cwd(),
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
async run(flags) {
|
|
72
61
|
const logger = new logger_js_1.Logger();
|
|
73
62
|
const src = flags.src ?? process.cwd();
|
|
74
63
|
const pkgPath = (0, node_path_1.join)(src, "package.json");
|
|
@@ -84,7 +73,7 @@ class Build extends core_1.Command {
|
|
|
84
73
|
}
|
|
85
74
|
const manifest = e.data;
|
|
86
75
|
const outDir = flags.out ?? (0, node_path_1.join)((0, utils_js_1.extensionDataDir)(), manifest.name);
|
|
87
|
-
const
|
|
76
|
+
const doBuild = async (outDir) => {
|
|
88
77
|
const entryPoints = manifest.commands.map((cmd) => (0, node_path_1.join)("src", `${cmd.name}.tsx`));
|
|
89
78
|
logger.logInfo(`entrypoints [${entryPoints.join(", ")}]`);
|
|
90
79
|
const promises = manifest.commands.map((cmd) => {
|
|
@@ -95,7 +84,6 @@ class Build extends core_1.Command {
|
|
|
95
84
|
if (cmd.mode === "view" && !(0, node_fs_1.existsSync)(tsxSource)) {
|
|
96
85
|
throw new Error(`Unable to find view command ${cmd.name} at ${tsxSource}`);
|
|
97
86
|
}
|
|
98
|
-
// we allow .ts or .tsx for no-view
|
|
99
87
|
if (cmd.mode === "no-view") {
|
|
100
88
|
if (!(0, node_fs_1.existsSync)(tsxSource)) {
|
|
101
89
|
source = tsSource;
|
|
@@ -138,8 +126,8 @@ class Build extends core_1.Command {
|
|
|
138
126
|
process.exit(1);
|
|
139
127
|
}
|
|
140
128
|
(0, node_fs_1.mkdirSync)(outDir, { recursive: true });
|
|
141
|
-
await
|
|
129
|
+
await doBuild(outDir);
|
|
142
130
|
logger.logReady(`built extension successfully - output at ${outDir}`);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
exports.default =
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
exports.default = build;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
static flags: {
|
|
7
|
-
target: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
};
|
|
9
|
-
run(): Promise<void>;
|
|
10
|
-
}
|
|
1
|
+
import type { CommandDef } from "../../cli.js";
|
|
2
|
+
declare const develop: CommandDef;
|
|
3
|
+
export default develop;
|
|
@@ -36,39 +36,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const core_1 = require("@oclif/core");
|
|
40
39
|
const chokidar = __importStar(require("chokidar"));
|
|
41
40
|
const esbuild = __importStar(require("esbuild"));
|
|
42
41
|
const node_child_process_1 = require("node:child_process");
|
|
43
42
|
const fs = __importStar(require("node:fs"));
|
|
44
43
|
const fsp = __importStar(require("node:fs/promises"));
|
|
45
44
|
const path = __importStar(require("node:path"));
|
|
45
|
+
const manifest_js_1 = __importDefault(require("../../schemas/manifest.js"));
|
|
46
|
+
const extension_types_js_1 = require("../../utils/extension-types.js");
|
|
46
47
|
const logger_js_1 = require("../../utils/logger.js");
|
|
48
|
+
const tail_js_1 = require("../../utils/tail.js");
|
|
47
49
|
const utils_js_1 = require("../../utils/utils.js");
|
|
48
|
-
const extension_types_js_1 = require("../../utils/extension-types.js");
|
|
49
50
|
const vicinae_js_1 = require("../../utils/vicinae.js");
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
static examples = [
|
|
56
|
-
`<%= config.bin %> <%= command.id %> --target /path/to/extension`,
|
|
57
|
-
];
|
|
58
|
-
static flags = {
|
|
59
|
-
target: core_1.Flags.string({
|
|
60
|
-
aliases: ["input"],
|
|
61
|
-
char: "i",
|
|
62
|
-
default: process.cwd(),
|
|
63
|
-
defaultHelp: "The current working directory",
|
|
51
|
+
const develop = {
|
|
52
|
+
description: "Start an extension development session",
|
|
53
|
+
flags: {
|
|
54
|
+
target: {
|
|
55
|
+
short: "i",
|
|
64
56
|
description: "Path to the extension directory",
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
async run() {
|
|
69
|
-
const { flags } = await this.parse(Develop);
|
|
57
|
+
default: process.cwd(),
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
async run(flags) {
|
|
70
61
|
const logger = new logger_js_1.Logger();
|
|
71
|
-
const
|
|
62
|
+
const target = flags.target ?? process.cwd();
|
|
63
|
+
const pkgPath = path.join(target, "package.json");
|
|
72
64
|
const parseManifest = () => {
|
|
73
65
|
if (!fs.existsSync(pkgPath)) {
|
|
74
66
|
logger.logError(`No package.json found at ${pkgPath}. Does this location point to a valid extension repository?`);
|
|
@@ -85,7 +77,7 @@ class Develop extends core_1.Command {
|
|
|
85
77
|
let manifest = parseManifest();
|
|
86
78
|
const vicinae = new vicinae_js_1.VicinaeClient();
|
|
87
79
|
logger.logInfo("Generating extension types...");
|
|
88
|
-
(0, extension_types_js_1.updateExtensionTypes)(manifest,
|
|
80
|
+
(0, extension_types_js_1.updateExtensionTypes)(manifest, target);
|
|
89
81
|
const typeCheck = async () => {
|
|
90
82
|
const spawned = (0, node_child_process_1.spawn)("npx", ["tsc", "--noEmit"]);
|
|
91
83
|
let stderr = Buffer.from("");
|
|
@@ -97,16 +89,6 @@ class Develop extends core_1.Command {
|
|
|
97
89
|
});
|
|
98
90
|
};
|
|
99
91
|
const build = async (outDir) => {
|
|
100
|
-
/*
|
|
101
|
-
logger.logInfo("Started type checking in background thread");
|
|
102
|
-
typeCheck().then(({ error, ok }) => {
|
|
103
|
-
if (!ok) {
|
|
104
|
-
logger.logInfo(`Type checking error: ${error}`);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
logger.logInfo("Done type checking");
|
|
108
|
-
});
|
|
109
|
-
*/
|
|
110
92
|
const entryPoints = manifest.commands
|
|
111
93
|
.map((cmd) => path.join("src", `${cmd.name}.tsx`))
|
|
112
94
|
.filter(fs.existsSync);
|
|
@@ -119,7 +101,6 @@ class Develop extends core_1.Command {
|
|
|
119
101
|
if (cmd.mode === "view" && !fs.existsSync(tsxSource)) {
|
|
120
102
|
throw new Error(`could not find entrypoint src/${cmd.name}.tsx for command ${cmd.name}.`);
|
|
121
103
|
}
|
|
122
|
-
// we allow .ts or .tsx for no-view
|
|
123
104
|
if (cmd.mode === "no-view") {
|
|
124
105
|
if (!fs.existsSync(tsxSource)) {
|
|
125
106
|
source = tsSource;
|
|
@@ -173,7 +154,7 @@ class Develop extends core_1.Command {
|
|
|
173
154
|
}
|
|
174
155
|
}
|
|
175
156
|
};
|
|
176
|
-
process.chdir(
|
|
157
|
+
process.chdir(target);
|
|
177
158
|
const dataDir = (0, utils_js_1.extensionDataDir)();
|
|
178
159
|
const id = `${manifest.name}`;
|
|
179
160
|
const extensionDir = path.join(dataDir, id);
|
|
@@ -209,15 +190,15 @@ class Develop extends core_1.Command {
|
|
|
209
190
|
awaitWriteFinish: { pollInterval: 100, stabilityThreshold: 100 },
|
|
210
191
|
ignoreInitial: true,
|
|
211
192
|
})
|
|
212
|
-
.on("all", async (_,
|
|
213
|
-
if (
|
|
193
|
+
.on("all", async (_, filePath) => {
|
|
194
|
+
if (filePath.endsWith("package.json")) {
|
|
214
195
|
manifest = parseManifest();
|
|
215
196
|
logger.logInfo("Generating extension types...");
|
|
216
|
-
(0, extension_types_js_1.updateExtensionTypes)(manifest,
|
|
197
|
+
(0, extension_types_js_1.updateExtensionTypes)(manifest, target);
|
|
217
198
|
}
|
|
218
|
-
logger.logEvent(`changed file ${
|
|
199
|
+
logger.logEvent(`changed file ${filePath}`);
|
|
219
200
|
await safeBuild(extensionDir);
|
|
220
201
|
});
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
exports.default =
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
exports.default = develop;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
static flags: {
|
|
7
|
-
src: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
};
|
|
9
|
-
run(): Promise<void>;
|
|
10
|
-
}
|
|
1
|
+
import type { CommandDef } from "../../cli.js";
|
|
2
|
+
declare const lint: CommandDef;
|
|
3
|
+
export default lint;
|
|
@@ -3,30 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const core_1 = require("@oclif/core");
|
|
7
6
|
const node_fs_1 = require("node:fs");
|
|
8
7
|
const node_path_1 = require("node:path");
|
|
9
|
-
const logger_js_1 = require("../../utils/logger.js");
|
|
10
8
|
const manifest_js_1 = __importDefault(require("../../schemas/manifest.js"));
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
];
|
|
18
|
-
static flags = {
|
|
19
|
-
src: core_1.Flags.string({
|
|
20
|
-
aliases: ["src"],
|
|
21
|
-
char: "s",
|
|
22
|
-
default: process.cwd(),
|
|
23
|
-
defaultHelp: "The current working directory",
|
|
9
|
+
const logger_js_1 = require("../../utils/logger.js");
|
|
10
|
+
const lint = {
|
|
11
|
+
description: "Validate the extension manifest (package.json)",
|
|
12
|
+
flags: {
|
|
13
|
+
src: {
|
|
14
|
+
short: "s",
|
|
24
15
|
description: "Path to the extension source directory",
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
async run() {
|
|
29
|
-
const { flags } = await this.parse(Lint);
|
|
16
|
+
default: process.cwd(),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
async run(flags) {
|
|
30
20
|
const logger = new logger_js_1.Logger();
|
|
31
21
|
const src = flags.src ?? process.cwd();
|
|
32
22
|
const pkgPath = (0, node_path_1.join)(src, "package.json");
|
|
@@ -41,6 +31,6 @@ class Lint extends core_1.Command {
|
|
|
41
31
|
process.exit(1);
|
|
42
32
|
}
|
|
43
33
|
logger.logReady(`Manifest is valid`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.default =
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
exports.default = lint;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vicinae/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "TypeScript SDK to build Vicinae extensions",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"format": "biome format --write"
|
|
11
11
|
},
|
|
12
12
|
"bin": {
|
|
13
|
-
"vici": "./bin
|
|
13
|
+
"vici": "./dist/bin.js"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
@@ -27,15 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"main": "dist/index.js",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@jgoz/esbuild-plugin-typecheck": "^4.0.3",
|
|
31
|
-
"@oclif/core": "^4",
|
|
32
|
-
"@oclif/plugin-help": "^6",
|
|
33
|
-
"@oclif/plugin-plugins": "^5",
|
|
34
|
-
"@types/node": ">=18",
|
|
35
|
-
"@types/react": "19.0.10",
|
|
36
30
|
"chokidar": "^4.0.3",
|
|
37
31
|
"esbuild": "^0.25.2",
|
|
38
|
-
"react": "19.0.0",
|
|
32
|
+
"react": "^19.0.0",
|
|
39
33
|
"zod": "^4.0.17"
|
|
40
34
|
},
|
|
41
35
|
"peerDependencies": {
|
|
@@ -44,28 +38,12 @@
|
|
|
44
38
|
},
|
|
45
39
|
"devDependencies": {
|
|
46
40
|
"@biomejs/biome": "2.3.2",
|
|
47
|
-
"@
|
|
48
|
-
"@types/
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"shx": "^0.3.3",
|
|
54
|
-
"ts-node": "^10",
|
|
55
|
-
"typedoc": "^0.28.13",
|
|
56
|
-
"typedoc-github-theme": "^0.3.1",
|
|
57
|
-
"typedoc-plugin-markdown": "^4.8.1",
|
|
58
|
-
"typescript": "^5"
|
|
59
|
-
},
|
|
60
|
-
"oclif": {
|
|
61
|
-
"bin": "vici",
|
|
62
|
-
"dirname": "vici",
|
|
63
|
-
"commands": "./dist/commands",
|
|
64
|
-
"plugins": [
|
|
65
|
-
"@oclif/plugin-help"
|
|
66
|
-
],
|
|
67
|
-
"topicSeparator": " ",
|
|
68
|
-
"topics": {}
|
|
41
|
+
"@types/node": "24.3.0",
|
|
42
|
+
"@types/react": "19.0.10",
|
|
43
|
+
"typedoc": "0.28.13",
|
|
44
|
+
"typedoc-github-theme": "0.3.1",
|
|
45
|
+
"typedoc-plugin-markdown": "4.8.1",
|
|
46
|
+
"typescript": "5.9.2"
|
|
69
47
|
},
|
|
70
48
|
"repository": "vicinaehq/vicinae"
|
|
71
49
|
}
|
package/types/jsx.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
2
|
import type {
|
|
3
3
|
DatePickerType,
|
|
4
|
+
EventCounted,
|
|
4
5
|
Grid,
|
|
5
6
|
Keyboard,
|
|
6
7
|
List,
|
|
@@ -13,6 +14,7 @@ type BaseFormField = {
|
|
|
13
14
|
onBlur?: Function;
|
|
14
15
|
onFocus?: Function;
|
|
15
16
|
onChange?: Function;
|
|
17
|
+
value?: any;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
declare module "react" {
|
|
@@ -30,9 +32,10 @@ declare module "react" {
|
|
|
30
32
|
filtering?: boolean;
|
|
31
33
|
isLoading?: boolean;
|
|
32
34
|
isShowingDetail?: boolean;
|
|
35
|
+
searchText?: EventCounted<string>;
|
|
33
36
|
searchBarPlaceholder?: string;
|
|
34
37
|
navigationTitle?: string;
|
|
35
|
-
onSearchTextChange?: (
|
|
38
|
+
onSearchTextChange?: (...args: any[]) => void;
|
|
36
39
|
onSelectionChange?: (selectedItemId: string) => void;
|
|
37
40
|
};
|
|
38
41
|
"list-section": {
|
|
@@ -45,11 +48,11 @@ declare module "react" {
|
|
|
45
48
|
id?: string;
|
|
46
49
|
subtitle?: string;
|
|
47
50
|
icon?:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
| SerializedImageLike
|
|
52
|
+
| {
|
|
53
|
+
value?: SerializedImageLike | null;
|
|
54
|
+
tooltip: string;
|
|
55
|
+
};
|
|
53
56
|
keywords?: string[];
|
|
54
57
|
accessories?: List.Item.SerializedAccessory[];
|
|
55
58
|
children?: React.ReactNode;
|
|
@@ -67,9 +70,10 @@ declare module "react" {
|
|
|
67
70
|
filtering?: boolean;
|
|
68
71
|
isLoading?: boolean;
|
|
69
72
|
isShowingDetail?: boolean;
|
|
73
|
+
searchText?: EventCounted<string>;
|
|
70
74
|
searchBarPlaceholder?: string;
|
|
71
75
|
navigationTitle?: string;
|
|
72
|
-
onSearchTextChange?: (
|
|
76
|
+
onSearchTextChange?: (...args: any[]) => void;
|
|
73
77
|
onSelectionChange?: (selectedItemId: string) => void;
|
|
74
78
|
};
|
|
75
79
|
"grid-section": {
|
|
@@ -193,7 +197,7 @@ declare module "react" {
|
|
|
193
197
|
type?: DatePickerType;
|
|
194
198
|
};
|
|
195
199
|
"checkbox-field": BaseFormField & {};
|
|
196
|
-
"password-field": {};
|
|
200
|
+
"password-field": BaseFormField & {};
|
|
197
201
|
"textarea-field": {};
|
|
198
202
|
|
|
199
203
|
dropdown: {
|