@nemo-cli/ui 0.0.1-beta.4

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 ADDED
@@ -0,0 +1,9 @@
1
+ # `@nemo-cli/shared`
2
+
3
+ > nemo-cli tools
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ import {log, createStore, createSelect} from '@nemo-cli/shared'
9
+ ```
@@ -0,0 +1,67 @@
1
+ import * as ink3 from "ink";
2
+ import { Box } from "ink";
3
+ import Gradient from "ink-gradient";
4
+ import { ComponentProps } from "react";
5
+ import { PromptOptions } from "@nemo-cli/shared";
6
+
7
+ //#region src/components/big-text.d.ts
8
+ declare const BigText: ({
9
+ text
10
+ }: {
11
+ text: string;
12
+ }) => ink3.Instance;
13
+ //#endregion
14
+ //#region src/components/list.d.ts
15
+ interface ListProps<T extends string | number | boolean | symbol = string> {
16
+ items: PromptOptions<T>[];
17
+ }
18
+ declare const renderList: (items: ListProps["items"]) => ink3.Instance;
19
+ //#endregion
20
+ //#region src/components/message.d.ts
21
+ declare const MessageVariant: {
22
+ success: {
23
+ name: "cristal";
24
+ };
25
+ error: {
26
+ colors: string[];
27
+ };
28
+ warning: {
29
+ name: "fruit";
30
+ };
31
+ info: {
32
+ name: "vice";
33
+ };
34
+ };
35
+ type MessageProps = {
36
+ text: string;
37
+ type?: keyof typeof MessageVariant;
38
+ } & Omit<ComponentProps<typeof Gradient>, 'children'> & ComponentProps<typeof Box>;
39
+ declare const Message: ({
40
+ text,
41
+ colors,
42
+ name,
43
+ type,
44
+ ...props
45
+ }: MessageProps) => ink3.Instance;
46
+ declare const ErrorMessage: ({
47
+ text,
48
+ colors,
49
+ ...props
50
+ }: MessageProps) => ink3.Instance;
51
+ //#endregion
52
+ //#region src/components/process-message.d.ts
53
+ type ProcessMessageProps = {
54
+ command: string;
55
+ commandArgs?: string[];
56
+ onSuccess?: () => void;
57
+ onError?: (error: string) => void;
58
+ };
59
+ declare const ProcessMessage: ({
60
+ command,
61
+ commandArgs,
62
+ onSuccess,
63
+ onError
64
+ }: ProcessMessageProps) => ink3.Instance;
65
+ //#endregion
66
+ export { BigText, ErrorMessage, Message, ProcessMessage, renderList };
67
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/big-text.tsx","../src/components/list.tsx","../src/components/message.tsx","../src/components/process-message.tsx"],"mappings":";;;;;;;cAIa,OAAA;EAAA;AAAA;EAAA,IAAA;AAAA,MAAW,IAAA,CAA0B,QAAA;;;UCAxC,SAAA;EAAA,KAAA,EACD,aAAA,CAAc,CAAA;AAAA;AAAA,cAgBV,UAAA,GAAA,KAAA,EAAqB,SAAA,cAAS,IAAA,CAAS,QAAA;;;cCjB9C,cAAA;EAAA,OAAA;IAAA,IAAA;EAAA;EAAA,KAAA;IAAA,MAAA;EAAA;EAAA,OAAA;IAAA,IAAA;EAAA;EAAA,IAAA;IAAA,IAAA;EAAA;AAAA;AAAA,KAOD,YAAA;EAAA,IAAA;EAAA,IAAA,gBAEiB,cAAA;AAAA,IAClB,IAAA,CAAK,cAAA,QAAsB,QAAA,iBAC7B,cAAA,QAAsB,GAAA;AAAA,cAEX,OAAA;EAAA,IAAA;EAAA,MAAA;EAAA,IAAA;EAAA,IAAA;EAAA,GAAA;AAAA,GAA+D,YAAA,KAAY,IAAA,CAAA,QAAA;AAAA,cAa3E,YAAA;EAAA,IAAA;EAAA,MAAA;EAAA,GAAA;AAAA,GAA4C,YAAA,KAAY,IAAA,CAAA,QAAA;;;KCvBhE,mBAAA;EAAA,OAAA;EAAA,WAAA;EAAA,SAAA;EAAA,OAAA,IAAA,KAAA;AAAA;AAAA,cAkDQ,cAAA;EAAA,OAAA;EAAA,WAAA;EAAA,SAAA;EAAA;AAAA,GAAgE,mBAAA,KAAmB,IAAA,CAAA,QAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,419 @@
1
+ import { createRequire } from "node:module";
2
+ import { Box, Static, Text, render, useApp } from "ink";
3
+ import InkBigText from "ink-big-text";
4
+ import Gradient from "ink-gradient";
5
+ import { useCallback, useEffect, useState } from "react";
6
+ import { ProgressBar, Spinner, ThemeProvider, defaultTheme, extendTheme } from "@inkjs/ui";
7
+ import { x } from "@nemo-cli/shared";
8
+
9
+ //#region rolldown:runtime
10
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
11
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
12
+
13
+ //#endregion
14
+ //#region ../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js
15
+ /**
16
+ * @license React
17
+ * react-jsx-runtime.production.js
18
+ *
19
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
20
+ *
21
+ * This source code is licensed under the MIT license found in the
22
+ * LICENSE file in the root directory of this source tree.
23
+ */
24
+ var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((exports) => {
25
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
26
+ function jsxProd(type, config, maybeKey) {
27
+ var key = null;
28
+ void 0 !== maybeKey && (key = "" + maybeKey);
29
+ void 0 !== config.key && (key = "" + config.key);
30
+ if ("key" in config) {
31
+ maybeKey = {};
32
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
33
+ } else maybeKey = config;
34
+ config = maybeKey.ref;
35
+ return {
36
+ $$typeof: REACT_ELEMENT_TYPE,
37
+ type,
38
+ key,
39
+ ref: void 0 !== config ? config : null,
40
+ props: maybeKey
41
+ };
42
+ }
43
+ exports.jsx = jsxProd;
44
+ exports.jsxs = jsxProd;
45
+ }));
46
+
47
+ //#endregion
48
+ //#region ../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.development.js
49
+ /**
50
+ * @license React
51
+ * react-jsx-runtime.development.js
52
+ *
53
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ */
58
+ var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJSMin(((exports) => {
59
+ "production" !== process.env.NODE_ENV && (function() {
60
+ function getComponentNameFromType(type) {
61
+ if (null == type) return null;
62
+ if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
63
+ if ("string" === typeof type) return type;
64
+ switch (type) {
65
+ case REACT_FRAGMENT_TYPE: return "Fragment";
66
+ case REACT_PROFILER_TYPE: return "Profiler";
67
+ case REACT_STRICT_MODE_TYPE: return "StrictMode";
68
+ case REACT_SUSPENSE_TYPE: return "Suspense";
69
+ case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
70
+ case REACT_ACTIVITY_TYPE: return "Activity";
71
+ }
72
+ if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
73
+ case REACT_PORTAL_TYPE: return "Portal";
74
+ case REACT_CONTEXT_TYPE: return type.displayName || "Context";
75
+ case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
76
+ case REACT_FORWARD_REF_TYPE:
77
+ var innerType = type.render;
78
+ type = type.displayName;
79
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
80
+ return type;
81
+ case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
82
+ case REACT_LAZY_TYPE:
83
+ innerType = type._payload;
84
+ type = type._init;
85
+ try {
86
+ return getComponentNameFromType(type(innerType));
87
+ } catch (x$1) {}
88
+ }
89
+ return null;
90
+ }
91
+ function testStringCoercion(value) {
92
+ return "" + value;
93
+ }
94
+ function checkKeyStringCoercion(value) {
95
+ try {
96
+ testStringCoercion(value);
97
+ var JSCompiler_inline_result = !1;
98
+ } catch (e) {
99
+ JSCompiler_inline_result = !0;
100
+ }
101
+ if (JSCompiler_inline_result) {
102
+ JSCompiler_inline_result = console;
103
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
104
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
105
+ JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
106
+ return testStringCoercion(value);
107
+ }
108
+ }
109
+ function getTaskName(type) {
110
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
111
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
112
+ try {
113
+ var name = getComponentNameFromType(type);
114
+ return name ? "<" + name + ">" : "<...>";
115
+ } catch (x$1) {
116
+ return "<...>";
117
+ }
118
+ }
119
+ function getOwner() {
120
+ var dispatcher = ReactSharedInternals.A;
121
+ return null === dispatcher ? null : dispatcher.getOwner();
122
+ }
123
+ function UnknownOwner() {
124
+ return Error("react-stack-top-frame");
125
+ }
126
+ function hasValidKey(config) {
127
+ if (hasOwnProperty.call(config, "key")) {
128
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
129
+ if (getter && getter.isReactWarning) return !1;
130
+ }
131
+ return void 0 !== config.key;
132
+ }
133
+ function defineKeyPropWarningGetter(props, displayName) {
134
+ function warnAboutAccessingKey() {
135
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
136
+ }
137
+ warnAboutAccessingKey.isReactWarning = !0;
138
+ Object.defineProperty(props, "key", {
139
+ get: warnAboutAccessingKey,
140
+ configurable: !0
141
+ });
142
+ }
143
+ function elementRefGetterWithDeprecationWarning() {
144
+ var componentName = getComponentNameFromType(this.type);
145
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
146
+ componentName = this.props.ref;
147
+ return void 0 !== componentName ? componentName : null;
148
+ }
149
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
150
+ var refProp = props.ref;
151
+ type = {
152
+ $$typeof: REACT_ELEMENT_TYPE,
153
+ type,
154
+ key,
155
+ props,
156
+ _owner: owner
157
+ };
158
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
159
+ enumerable: !1,
160
+ get: elementRefGetterWithDeprecationWarning
161
+ }) : Object.defineProperty(type, "ref", {
162
+ enumerable: !1,
163
+ value: null
164
+ });
165
+ type._store = {};
166
+ Object.defineProperty(type._store, "validated", {
167
+ configurable: !1,
168
+ enumerable: !1,
169
+ writable: !0,
170
+ value: 0
171
+ });
172
+ Object.defineProperty(type, "_debugInfo", {
173
+ configurable: !1,
174
+ enumerable: !1,
175
+ writable: !0,
176
+ value: null
177
+ });
178
+ Object.defineProperty(type, "_debugStack", {
179
+ configurable: !1,
180
+ enumerable: !1,
181
+ writable: !0,
182
+ value: debugStack
183
+ });
184
+ Object.defineProperty(type, "_debugTask", {
185
+ configurable: !1,
186
+ enumerable: !1,
187
+ writable: !0,
188
+ value: debugTask
189
+ });
190
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
191
+ return type;
192
+ }
193
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
194
+ var children = config.children;
195
+ if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
196
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
197
+ Object.freeze && Object.freeze(children);
198
+ } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
199
+ else validateChildKeys(children);
200
+ if (hasOwnProperty.call(config, "key")) {
201
+ children = getComponentNameFromType(type);
202
+ var keys = Object.keys(config).filter(function(k) {
203
+ return "key" !== k;
204
+ });
205
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
206
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
207
+ }
208
+ children = null;
209
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
210
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
211
+ if ("key" in config) {
212
+ maybeKey = {};
213
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
214
+ } else maybeKey = config;
215
+ children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
216
+ return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
217
+ }
218
+ function validateChildKeys(node) {
219
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
220
+ }
221
+ function isValidElement(object) {
222
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
223
+ }
224
+ var React = __require("react"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
225
+ return null;
226
+ };
227
+ React = { react_stack_bottom_frame: function(callStackForError) {
228
+ return callStackForError();
229
+ } };
230
+ var specialPropKeyWarningShown;
231
+ var didWarnAboutElementRef = {};
232
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
233
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
234
+ var didWarnAboutKeySpread = {};
235
+ exports.Fragment = REACT_FRAGMENT_TYPE;
236
+ exports.jsx = function(type, config, maybeKey) {
237
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
238
+ return jsxDEVImpl(type, config, maybeKey, !1, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
239
+ };
240
+ exports.jsxs = function(type, config, maybeKey) {
241
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
242
+ return jsxDEVImpl(type, config, maybeKey, !0, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
243
+ };
244
+ })();
245
+ }));
246
+
247
+ //#endregion
248
+ //#region ../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js
249
+ var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
250
+ if (process.env.NODE_ENV === "production") module.exports = require_react_jsx_runtime_production();
251
+ else module.exports = require_react_jsx_runtime_development();
252
+ }));
253
+
254
+ //#endregion
255
+ //#region src/components/big-text.tsx
256
+ var import_jsx_runtime = require_jsx_runtime();
257
+ const BigText = ({ text }) => render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Gradient, {
258
+ name: "passion",
259
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InkBigText, { text })
260
+ }));
261
+
262
+ //#endregion
263
+ //#region src/components/list.tsx
264
+ const List = ({ items }) => {
265
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
266
+ borderColor: "blue",
267
+ borderStyle: "single",
268
+ flexDirection: "column",
269
+ marginBottom: 1,
270
+ marginTop: 1,
271
+ children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
272
+ marginBottom: index < items.length - 1 ? 1 : 0,
273
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
274
+ color: "blue",
275
+ children: "•"
276
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: item.label })]
277
+ }, item.value))
278
+ });
279
+ };
280
+ const renderList = (items) => render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(List, { items }));
281
+
282
+ //#endregion
283
+ //#region src/components/message.tsx
284
+ const MessageVariant = {
285
+ success: { name: "cristal" },
286
+ error: { colors: ["#dc2626", "#7e22ce"] },
287
+ warning: { name: "fruit" },
288
+ info: { name: "vice" }
289
+ };
290
+ const Message = ({ text, colors, name, type = "success", ...props }) => {
291
+ const variant = MessageVariant[type];
292
+ return render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
293
+ width: "60%",
294
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
295
+ borderColor: "gray",
296
+ borderStyle: "round",
297
+ flexGrow: 0,
298
+ paddingX: 1,
299
+ ...props,
300
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Gradient, {
301
+ colors,
302
+ name,
303
+ ...variant,
304
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
305
+ bold: true,
306
+ children: text
307
+ })
308
+ })
309
+ })
310
+ }));
311
+ };
312
+ const ErrorMessage = ({ text, colors, ...props }) => {
313
+ return render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
314
+ width: "60%",
315
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
316
+ borderColor: "#dc2626",
317
+ borderStyle: "round",
318
+ flexGrow: 0,
319
+ paddingX: 1,
320
+ ...props,
321
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Gradient, {
322
+ ...MessageVariant.error,
323
+ children: text
324
+ })
325
+ })
326
+ }));
327
+ };
328
+
329
+ //#endregion
330
+ //#region src/components/provider/index.tsx
331
+ const customTheme = extendTheme(defaultTheme, { components: {
332
+ ProgressBar: { styles: {
333
+ completed: () => ({ color: "green" }),
334
+ remaining: () => ({ backgroundColor: "#fff" })
335
+ } },
336
+ Spinner: { styles: { frame: () => ({ color: "#fff" }) } }
337
+ } });
338
+ const Provider = ({ children }) => {
339
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeProvider, {
340
+ theme: customTheme,
341
+ children
342
+ });
343
+ };
344
+ var provider_default = Provider;
345
+
346
+ //#endregion
347
+ //#region src/components/process-message.tsx
348
+ const ProcessMessageUI = ({ command, commandArgs, onSuccess, onError }) => {
349
+ const [messages, setMessages] = useState([]);
350
+ const [progress, setProgress] = useState(0);
351
+ const { exit } = useApp();
352
+ const executeCommand = useCallback(async () => {
353
+ try {
354
+ const process = x(command.trim(), commandArgs);
355
+ for await (const line of process) {
356
+ setProgress((prev) => prev + 1);
357
+ setMessages((prev) => [...prev, line]);
358
+ }
359
+ onSuccess?.();
360
+ } catch (err) {
361
+ onError?.(err);
362
+ } finally {
363
+ exit();
364
+ }
365
+ }, [
366
+ command,
367
+ commandArgs,
368
+ onSuccess,
369
+ onError,
370
+ exit
371
+ ]);
372
+ useEffect(() => {
373
+ executeCommand();
374
+ }, []);
375
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(provider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
376
+ flexDirection: "column",
377
+ children: [
378
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
379
+ flexDirection: "column",
380
+ gap: 1,
381
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Static, {
382
+ items: messages,
383
+ children: (message) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: message }, message)
384
+ })
385
+ }),
386
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressBar, { value: progress }),
387
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
388
+ alignItems: "center",
389
+ borderStyle: "round",
390
+ flexDirection: "row",
391
+ gap: 1,
392
+ paddingX: 1,
393
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
394
+ color: "green",
395
+ children: [
396
+ command,
397
+ " ",
398
+ commandArgs?.join(" ")
399
+ ]
400
+ })]
401
+ })
402
+ ]
403
+ }) });
404
+ };
405
+ const ProcessMessage = ({ command, commandArgs, onSuccess, onError }) => {
406
+ return render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
407
+ width: "100%",
408
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProcessMessageUI, {
409
+ command,
410
+ commandArgs,
411
+ onError,
412
+ onSuccess
413
+ })
414
+ }));
415
+ };
416
+
417
+ //#endregion
418
+ export { BigText, ErrorMessage, Message, ProcessMessage, renderList };
419
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["x","Provider"],"sources":["../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js","../src/components/big-text.tsx","../src/components/list.tsx","../src/components/message.tsx","../src/components/provider/index.tsx","../src/components/process-message.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { render } from 'ink'\nimport InkBigText from 'ink-big-text'\nimport Gradient from 'ink-gradient'\n\nexport const BigText = ({ text }: { text: string }) =>\n render(\n <Gradient name=\"passion\">\n <InkBigText text={text} />\n </Gradient>\n )\n","import type { FC } from 'react'\nimport type { PromptOptions } from '@nemo-cli/shared'\nimport { Box, render, Text } from 'ink'\n\ninterface ListProps<T extends string | number | boolean | symbol = string> {\n items: PromptOptions<T>[]\n}\n\nexport const List: FC<ListProps> = ({ items }) => {\n return (\n <Box borderColor=\"blue\" borderStyle=\"single\" flexDirection=\"column\" marginBottom={1} marginTop={1}>\n {items.map((item, index) => (\n <Box key={item.value} marginBottom={index < items.length - 1 ? 1 : 0}>\n <Text color=\"blue\">•</Text>\n <Text>{item.label}</Text>\n </Box>\n ))}\n </Box>\n )\n}\n\nexport const renderList = (items: ListProps['items']) => render(<List items={items} />)\n","import type { ComponentProps } from 'react'\nimport { Box, render, Text } from 'ink'\nimport Gradient from 'ink-gradient'\n\nconst MessageVariant = {\n success: { name: 'cristal' },\n error: { colors: ['#dc2626', '#7e22ce'] },\n warning: { name: 'fruit' },\n info: { name: 'vice' },\n} satisfies Record<string, Omit<ComponentProps<typeof Gradient>, 'children'>>\n\ntype MessageProps = {\n text: string\n type?: keyof typeof MessageVariant\n} & Omit<ComponentProps<typeof Gradient>, 'children'> &\n ComponentProps<typeof Box>\n\nexport const Message = ({ text, colors, name, type = 'success', ...props }: MessageProps) => {\n const variant = MessageVariant[type]\n return render(\n <Box width=\"60%\">\n <Box borderColor=\"gray\" borderStyle=\"round\" flexGrow={0} paddingX={1} {...props}>\n <Gradient colors={colors} name={name} {...variant}>\n <Text bold>{text}</Text>\n </Gradient>\n </Box>\n </Box>\n )\n}\n\nexport const ErrorMessage = ({ text, colors, ...props }: MessageProps) => {\n return render(\n <Box width=\"60%\">\n <Box borderColor=\"#dc2626\" borderStyle=\"round\" flexGrow={0} paddingX={1} {...props}>\n <Gradient {...MessageVariant.error}>{text}</Gradient>\n </Box>\n </Box>\n )\n}\n","import { type ComponentTheme, defaultTheme, extendTheme, ThemeProvider } from '@inkjs/ui'\nimport type { TextProps } from 'ink'\n\nconst ProgressBar = {\n styles: {\n completed: (): TextProps => ({\n color: 'green',\n }),\n remaining: (): TextProps => ({\n backgroundColor: '#fff',\n }),\n },\n} satisfies ComponentTheme\nexport type ProgressBarTheme = typeof ProgressBar\n\nconst Spinner = {\n styles: {\n frame: (): TextProps => ({\n color: '#fff',\n }),\n },\n} satisfies ComponentTheme\nexport type SpinnerTheme = typeof Spinner\n\nconst customTheme = extendTheme(defaultTheme, {\n components: {\n ProgressBar,\n Spinner,\n },\n})\n\nconst Provider = ({ children }: { children: React.ReactNode }) => {\n return <ThemeProvider theme={customTheme}>{children}</ThemeProvider>\n}\n\nexport default Provider\n","import { useCallback, useEffect, useState } from 'react'\nimport { ProgressBar, Spinner } from '@inkjs/ui'\nimport { x } from '@nemo-cli/shared'\nimport { Box, render, Static, Text, useApp } from 'ink'\n\nimport Provider from './provider'\n\ntype ProcessMessageProps = {\n command: string\n commandArgs?: string[]\n onSuccess?: () => void\n onError?: (error: string) => void\n}\n\nconst ProcessMessageUI = ({ command, commandArgs, onSuccess, onError }: ProcessMessageProps) => {\n const [messages, setMessages] = useState<string[]>([])\n const [progress, setProgress] = useState(0)\n\n const { exit } = useApp()\n const executeCommand = useCallback(async () => {\n try {\n const process = x(command.trim(), commandArgs)\n for await (const line of process) {\n setProgress((prev) => prev + 1)\n setMessages((prev) => [...prev, line])\n }\n onSuccess?.()\n } catch (err) {\n onError?.(err as string)\n } finally {\n exit()\n }\n }, [command, commandArgs, onSuccess, onError, exit])\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: unMounted\n useEffect(() => {\n executeCommand()\n }, [])\n\n return (\n <Provider>\n <Box flexDirection=\"column\">\n <Box flexDirection=\"column\" gap={1}>\n <Static items={messages}>{(message) => <Text key={message}>{message}</Text>}</Static>\n </Box>\n <ProgressBar value={progress} />\n <Box alignItems=\"center\" borderStyle=\"round\" flexDirection=\"row\" gap={1} paddingX={1}>\n <Spinner />\n <Text color=\"green\">\n {command} {commandArgs?.join(' ')}\n </Text>\n </Box>\n </Box>\n </Provider>\n )\n}\n\nexport const ProcessMessage = ({ command, commandArgs, onSuccess, onError }: ProcessMessageProps) => {\n return render(\n <Box width=\"100%\">\n <ProcessMessageUI command={command} commandArgs={commandArgs} onError={onError} onSuccess={onSuccess} />\n </Box>\n )\n}\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAWA,IAAI,qBA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AI,YAAW;IAAS,aAAY;IAAQ,eAAc;IAAM,KAAK;IAAG,UAAU;eACjF,4CAAC,YAAU,EACX,6CAAC;KAAK,OAAM;;MACT;MAAQ;MAAE,aAAa,KAAK,IAAI;;MAC5B;KACH;;GACF,GACG;;AAIf,MAAa,kBAAkB,EAAE,SAAS,aAAa,WAAW,cAAmC;AACnG,QAAO,OACL,4CAAC;EAAI,OAAM;YACT,4CAAC;GAA0B;GAAsB;GAAsB;GAAoB;IAAa;GACpG,CACP"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@nemo-cli/ui",
3
+ "version": "0.0.1-beta.4",
4
+ "description": "React TUI Components",
5
+ "author": "gaozimeng <gaozimeng0425@gmail.com>",
6
+ "homepage": "",
7
+ "license": "ISC",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "directories": {
16
+ "lib": "dist",
17
+ "test": "__tests__"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "scripts": {
26
+ "dev": "rolldown --watch -c ./rolldown.config.ts",
27
+ "build": "rolldown -c ./rolldown.config.ts",
28
+ "build-dts": "rolldown -c ./rolldown.config.ts",
29
+ "test": "vitest",
30
+ "coverage": "vitest run --coverage",
31
+ "check": "tsc --incremental --noEmit",
32
+ "prepublish": "npm run build",
33
+ "prepack": "rolldown"
34
+ },
35
+ "dependencies": {
36
+ "@inkjs/ui": "^2.0.0",
37
+ "@nemo-cli/shared": "workspace:*",
38
+ "cfonts": "^3.3.1",
39
+ "chalk": "^5.6.2",
40
+ "cli-table3": "^0.6.5",
41
+ "figlet": "^1.9.4",
42
+ "figures": "^6.1.0",
43
+ "ink": "^6.6.0",
44
+ "ink-big-text": "^2.0.0",
45
+ "ink-gradient": "^3.0.0",
46
+ "ink-markdown": "^1.0.4",
47
+ "ink-table": "^3.1.0",
48
+ "marked": "^17.0.1",
49
+ "react": "catalog:"
50
+ },
51
+ "devDependencies": {
52
+ "@types/react": "catalog:"
53
+ }
54
+ }