@vicinae/api 0.19.0 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import React, { type ReactNode } from "react";
2
+ import type { RunInTerminalOptions } from "../utils";
2
3
  import type { PathLike } from "node:fs";
3
4
  import { Clipboard } from "../clipboard";
4
5
  import { type ImageLike } from "../image";
@@ -86,6 +87,15 @@ export declare namespace Action {
86
87
  namespace PickDate {
87
88
  type Props = BaseActionProps & {};
88
89
  }
90
+ /**
91
+ * Simple action wrapper around {@link runInTerminal}
92
+ */
93
+ namespace RunInTerminal {
94
+ type Props = BaseActionProps & {
95
+ args: string[];
96
+ options?: RunInTerminalOptions;
97
+ };
98
+ }
89
99
  }
90
100
  export type Quicklink = {
91
101
  name?: string;
@@ -104,6 +114,7 @@ export declare const Action: React.FC<ActionProps> & {
104
114
  SubmitForm: React.FC<Action.SubmitForm.Props>;
105
115
  OpenInBrowser: React.FC<Action.OpenInBrowser.Props>;
106
116
  ShowInFinder: React.FC<Action.ShowInFinderProps.Props>;
117
+ RunInTerminal: React.FC<Action.RunInTerminal.Props>;
107
118
  CreateQuicklink: React.FC<Action.CreateQuicklink.Props>;
108
119
  PickDate: React.FC<BaseActionProps> & {
109
120
  isFullDay: () => false;
@@ -95,6 +95,11 @@ const CreateQuicklink = ({ title = "Create Quicklink", quicklink, ...props }) =>
95
95
  };
96
96
  return (0, jsx_runtime_1.jsx)("action", { ...nativeProps });
97
97
  };
98
+ const RunInTerminal = ({ args, options, icon = icon_1.Icon.Terminal, ...props }) => {
99
+ return ((0, jsx_runtime_1.jsx)(ActionRoot, { ...props, icon: icon, onAction: () => {
100
+ (0, utils_1.runInTerminal)(args, options);
101
+ } }));
102
+ };
98
103
  /**
99
104
  * @category Actions
100
105
  */
@@ -106,10 +111,11 @@ exports.Action = Object.assign(ActionRoot, {
106
111
  SubmitForm,
107
112
  OpenInBrowser,
108
113
  ShowInFinder,
114
+ RunInTerminal,
109
115
  CreateQuicklink,
110
116
  PickDate: Object.assign(PickDate, {
111
117
  // TODO: to implement too
112
- isFullDay: () => false
118
+ isFullDay: () => false,
113
119
  }),
114
120
  Style: {
115
121
  Regular: "regular",
@@ -45,7 +45,7 @@ export type RunInTerminalOptions = {
45
45
  * ```typescript
46
46
  * await runInTerminal(['journalctl', '--user', '-u', '-f', 'vicinae']);
47
47
  * // or, inside a shell:
48
- * await runInTerminal(['/bin/bash', 'echo "dis is my home: $HOME"'], { hold: true });
48
+ * await runInTerminal(['/bin/bash', '-c', 'echo "dis is my home: $HOME"'], { hold: true });
49
49
  * ```
50
50
  *
51
51
  * @category System
package/dist/api/utils.js CHANGED
@@ -23,7 +23,7 @@ exports.trash = trash;
23
23
  * ```typescript
24
24
  * await runInTerminal(['journalctl', '--user', '-u', '-f', 'vicinae']);
25
25
  * // or, inside a shell:
26
- * await runInTerminal(['/bin/bash', 'echo "dis is my home: $HOME"'], { hold: true });
26
+ * await runInTerminal(['/bin/bash', '-c', 'echo "dis is my home: $HOME"'], { hold: true });
27
27
  * ```
28
28
  *
29
29
  * @category System
@@ -109,9 +109,12 @@ class Build extends core_1.Command {
109
109
  entryPoints: [source],
110
110
  external: ["react", "@vicinae/api", "@raycast/api"],
111
111
  format: "cjs",
112
- outfile: (0, node_path_1.join)(outDir, `${cmd.name}.js`),
112
+ outdir: outDir,
113
113
  platform: "node",
114
114
  minify: true,
115
+ loader: {
116
+ ".node": "file",
117
+ },
115
118
  });
116
119
  });
117
120
  await Promise.all(promises);
@@ -133,8 +133,11 @@ class Develop extends core_1.Command {
133
133
  entryPoints: [source],
134
134
  external: ["react", "@vicinae/api", "@raycast/api"],
135
135
  format: "cjs",
136
- outfile: path.join(outDir, `${cmd.name}.js`),
136
+ outdir: outDir,
137
137
  platform: "node",
138
+ loader: {
139
+ ".node": "file",
140
+ },
138
141
  });
139
142
  });
140
143
  await Promise.all(promises);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vicinae/api",
3
- "version": "0.19.0",
3
+ "version": "0.19.2",
4
4
  "description": "TypeScript SDK to build Vicinae extensions",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",