nest-hex 0.2.0 → 0.3.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.
Files changed (51) hide show
  1. package/README.md +155 -267
  2. package/dist/src/cli/bin.js +2644 -0
  3. package/dist/src/cli/commands/index.d.ts +23 -0
  4. package/dist/src/cli/commands/index.js +2609 -0
  5. package/dist/src/cli/config/defaults.d.ts +74 -0
  6. package/dist/src/cli/config/defaults.js +76 -0
  7. package/dist/src/cli/config/define-config.d.ts +74 -0
  8. package/dist/src/cli/config/define-config.js +62 -0
  9. package/dist/src/cli/config/loader.d.ts +74 -0
  10. package/dist/src/cli/config/loader.js +106 -0
  11. package/dist/src/cli/config/validator.d.ts +81 -0
  12. package/dist/src/cli/config/validator.js +108 -0
  13. package/dist/src/cli/generators/adapter.generator.d.ts +235 -0
  14. package/dist/src/cli/generators/adapter.generator.js +377 -0
  15. package/dist/src/cli/generators/base.generator.d.ts +190 -0
  16. package/dist/src/cli/generators/base.generator.js +312 -0
  17. package/dist/src/cli/generators/index.d.ts +264 -0
  18. package/dist/src/cli/generators/index.js +467 -0
  19. package/dist/src/cli/generators/port.generator.d.ts +211 -0
  20. package/dist/src/cli/generators/port.generator.js +364 -0
  21. package/dist/src/cli/generators/service.generator.d.ts +208 -0
  22. package/dist/src/cli/generators/service.generator.js +340 -0
  23. package/dist/src/cli/index.d.ts +74 -0
  24. package/dist/src/cli/index.js +69 -0
  25. package/dist/src/cli/types/config.types.d.ts +73 -0
  26. package/dist/src/cli/types/config.types.js +56 -0
  27. package/dist/src/cli/types/generator.types.d.ts +46 -0
  28. package/dist/src/cli/types/generator.types.js +56 -0
  29. package/dist/src/cli/types/index.d.ts +121 -0
  30. package/dist/src/cli/types/index.js +56 -0
  31. package/dist/src/cli/types/template.types.d.ts +28 -0
  32. package/dist/src/cli/types/template.types.js +56 -0
  33. package/dist/src/cli/ui/components/index.d.ts +97 -0
  34. package/dist/src/cli/ui/components/index.js +1507 -0
  35. package/dist/src/cli/utils/file-writer.d.ts +17 -0
  36. package/dist/src/cli/utils/file-writer.js +100 -0
  37. package/dist/src/cli/utils/linter-detector.d.ts +12 -0
  38. package/dist/src/cli/utils/linter-detector.js +128 -0
  39. package/dist/src/cli/utils/linter-runner.d.ts +17 -0
  40. package/dist/src/cli/utils/linter-runner.js +101 -0
  41. package/dist/src/cli/utils/name-transformer.d.ts +18 -0
  42. package/dist/src/cli/utils/name-transformer.js +90 -0
  43. package/dist/src/cli/utils/path-resolver.d.ts +5 -0
  44. package/dist/src/cli/utils/path-resolver.js +78 -0
  45. package/dist/src/cli/utils/port-scanner.d.ts +93 -0
  46. package/dist/src/cli/utils/port-scanner.js +104 -0
  47. package/dist/src/cli/utils/template-renderer.d.ts +30 -0
  48. package/dist/src/cli/utils/template-renderer.js +95 -0
  49. package/dist/{index.d.ts → src/index.d.ts} +60 -30
  50. package/dist/{index.js → src/index.js} +45 -13
  51. package/package.json +10 -10
@@ -0,0 +1,1507 @@
1
+ var import_node_module = require("node:module");
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __toESM = (mod, isNodeMode, target) => {
9
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
10
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
+ for (let key of __getOwnPropNames(mod))
12
+ if (!__hasOwnProp.call(to, key))
13
+ __defProp(to, key, {
14
+ get: () => mod[key],
15
+ enumerable: true
16
+ });
17
+ return to;
18
+ };
19
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
20
+ var __toCommonJS = (from) => {
21
+ var entry = __moduleCache.get(from), desc;
22
+ if (entry)
23
+ return entry;
24
+ entry = __defProp({}, "__esModule", { value: true });
25
+ if (from && typeof from === "object" || typeof from === "function")
26
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
27
+ get: () => from[key],
28
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
+ }));
30
+ __moduleCache.set(from, entry);
31
+ return entry;
32
+ };
33
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __export = (target, all) => {
35
+ for (var name in all)
36
+ __defProp(target, name, {
37
+ get: all[name],
38
+ enumerable: true,
39
+ configurable: true,
40
+ set: (newValue) => all[name] = () => newValue
41
+ });
42
+ };
43
+ var __legacyDecorateClassTS = function(decorators, target, key, desc) {
44
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
45
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
46
+ r = Reflect.decorate(decorators, target, key, desc);
47
+ else
48
+ for (var i = decorators.length - 1;i >= 0; i--)
49
+ if (d = decorators[i])
50
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
51
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
52
+ };
53
+
54
+ // node_modules/react/cjs/react-jsx-dev-runtime.development.js
55
+ var require_react_jsx_dev_runtime_development = __commonJS((exports2) => {
56
+ if (true) {
57
+ (function() {
58
+ var React = require("react");
59
+ var REACT_ELEMENT_TYPE = Symbol.for("react.element");
60
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
61
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
62
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
63
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
64
+ var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
65
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
66
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
67
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
68
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
69
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
70
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
71
+ var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
72
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
73
+ var FAUX_ITERATOR_SYMBOL = "@@iterator";
74
+ function getIteratorFn(maybeIterable) {
75
+ if (maybeIterable === null || typeof maybeIterable !== "object") {
76
+ return null;
77
+ }
78
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
79
+ if (typeof maybeIterator === "function") {
80
+ return maybeIterator;
81
+ }
82
+ return null;
83
+ }
84
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
85
+ function error(format) {
86
+ {
87
+ {
88
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++) {
89
+ args[_key2 - 1] = arguments[_key2];
90
+ }
91
+ printWarning("error", format, args);
92
+ }
93
+ }
94
+ }
95
+ function printWarning(level, format, args) {
96
+ {
97
+ var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
98
+ var stack = ReactDebugCurrentFrame2.getStackAddendum();
99
+ if (stack !== "") {
100
+ format += "%s";
101
+ args = args.concat([stack]);
102
+ }
103
+ var argsWithFormat = args.map(function(item) {
104
+ return String(item);
105
+ });
106
+ argsWithFormat.unshift("Warning: " + format);
107
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
108
+ }
109
+ }
110
+ var enableScopeAPI = false;
111
+ var enableCacheElement = false;
112
+ var enableTransitionTracing = false;
113
+ var enableLegacyHidden = false;
114
+ var enableDebugTracing = false;
115
+ var REACT_MODULE_REFERENCE;
116
+ {
117
+ REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
118
+ }
119
+ function isValidElementType(type) {
120
+ if (typeof type === "string" || typeof type === "function") {
121
+ return true;
122
+ }
123
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
124
+ return true;
125
+ }
126
+ if (typeof type === "object" && type !== null) {
127
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
128
+ return true;
129
+ }
130
+ }
131
+ return false;
132
+ }
133
+ function getWrappedName(outerType, innerType, wrapperName) {
134
+ var displayName = outerType.displayName;
135
+ if (displayName) {
136
+ return displayName;
137
+ }
138
+ var functionName = innerType.displayName || innerType.name || "";
139
+ return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
140
+ }
141
+ function getContextName(type) {
142
+ return type.displayName || "Context";
143
+ }
144
+ function getComponentNameFromType(type) {
145
+ if (type == null) {
146
+ return null;
147
+ }
148
+ {
149
+ if (typeof type.tag === "number") {
150
+ error("Received an unexpected object in getComponentNameFromType(). " + "This is likely a bug in React. Please file an issue.");
151
+ }
152
+ }
153
+ if (typeof type === "function") {
154
+ return type.displayName || type.name || null;
155
+ }
156
+ if (typeof type === "string") {
157
+ return type;
158
+ }
159
+ switch (type) {
160
+ case REACT_FRAGMENT_TYPE:
161
+ return "Fragment";
162
+ case REACT_PORTAL_TYPE:
163
+ return "Portal";
164
+ case REACT_PROFILER_TYPE:
165
+ return "Profiler";
166
+ case REACT_STRICT_MODE_TYPE:
167
+ return "StrictMode";
168
+ case REACT_SUSPENSE_TYPE:
169
+ return "Suspense";
170
+ case REACT_SUSPENSE_LIST_TYPE:
171
+ return "SuspenseList";
172
+ }
173
+ if (typeof type === "object") {
174
+ switch (type.$$typeof) {
175
+ case REACT_CONTEXT_TYPE:
176
+ var context = type;
177
+ return getContextName(context) + ".Consumer";
178
+ case REACT_PROVIDER_TYPE:
179
+ var provider = type;
180
+ return getContextName(provider._context) + ".Provider";
181
+ case REACT_FORWARD_REF_TYPE:
182
+ return getWrappedName(type, type.render, "ForwardRef");
183
+ case REACT_MEMO_TYPE:
184
+ var outerName = type.displayName || null;
185
+ if (outerName !== null) {
186
+ return outerName;
187
+ }
188
+ return getComponentNameFromType(type.type) || "Memo";
189
+ case REACT_LAZY_TYPE: {
190
+ var lazyComponent = type;
191
+ var payload = lazyComponent._payload;
192
+ var init = lazyComponent._init;
193
+ try {
194
+ return getComponentNameFromType(init(payload));
195
+ } catch (x) {
196
+ return null;
197
+ }
198
+ }
199
+ }
200
+ }
201
+ return null;
202
+ }
203
+ var assign = Object.assign;
204
+ var disabledDepth = 0;
205
+ var prevLog;
206
+ var prevInfo;
207
+ var prevWarn;
208
+ var prevError;
209
+ var prevGroup;
210
+ var prevGroupCollapsed;
211
+ var prevGroupEnd;
212
+ function disabledLog() {}
213
+ disabledLog.__reactDisabledLog = true;
214
+ function disableLogs() {
215
+ {
216
+ if (disabledDepth === 0) {
217
+ prevLog = console.log;
218
+ prevInfo = console.info;
219
+ prevWarn = console.warn;
220
+ prevError = console.error;
221
+ prevGroup = console.group;
222
+ prevGroupCollapsed = console.groupCollapsed;
223
+ prevGroupEnd = console.groupEnd;
224
+ var props = {
225
+ configurable: true,
226
+ enumerable: true,
227
+ value: disabledLog,
228
+ writable: true
229
+ };
230
+ Object.defineProperties(console, {
231
+ info: props,
232
+ log: props,
233
+ warn: props,
234
+ error: props,
235
+ group: props,
236
+ groupCollapsed: props,
237
+ groupEnd: props
238
+ });
239
+ }
240
+ disabledDepth++;
241
+ }
242
+ }
243
+ function reenableLogs() {
244
+ {
245
+ disabledDepth--;
246
+ if (disabledDepth === 0) {
247
+ var props = {
248
+ configurable: true,
249
+ enumerable: true,
250
+ writable: true
251
+ };
252
+ Object.defineProperties(console, {
253
+ log: assign({}, props, {
254
+ value: prevLog
255
+ }),
256
+ info: assign({}, props, {
257
+ value: prevInfo
258
+ }),
259
+ warn: assign({}, props, {
260
+ value: prevWarn
261
+ }),
262
+ error: assign({}, props, {
263
+ value: prevError
264
+ }),
265
+ group: assign({}, props, {
266
+ value: prevGroup
267
+ }),
268
+ groupCollapsed: assign({}, props, {
269
+ value: prevGroupCollapsed
270
+ }),
271
+ groupEnd: assign({}, props, {
272
+ value: prevGroupEnd
273
+ })
274
+ });
275
+ }
276
+ if (disabledDepth < 0) {
277
+ error("disabledDepth fell below zero. " + "This is a bug in React. Please file an issue.");
278
+ }
279
+ }
280
+ }
281
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
282
+ var prefix;
283
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
284
+ {
285
+ if (prefix === undefined) {
286
+ try {
287
+ throw Error();
288
+ } catch (x) {
289
+ var match = x.stack.trim().match(/\n( *(at )?)/);
290
+ prefix = match && match[1] || "";
291
+ }
292
+ }
293
+ return `
294
+ ` + prefix + name;
295
+ }
296
+ }
297
+ var reentry = false;
298
+ var componentFrameCache;
299
+ {
300
+ var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
301
+ componentFrameCache = new PossiblyWeakMap;
302
+ }
303
+ function describeNativeComponentFrame(fn, construct) {
304
+ if (!fn || reentry) {
305
+ return "";
306
+ }
307
+ {
308
+ var frame = componentFrameCache.get(fn);
309
+ if (frame !== undefined) {
310
+ return frame;
311
+ }
312
+ }
313
+ var control;
314
+ reentry = true;
315
+ var previousPrepareStackTrace = Error.prepareStackTrace;
316
+ Error.prepareStackTrace = undefined;
317
+ var previousDispatcher;
318
+ {
319
+ previousDispatcher = ReactCurrentDispatcher.current;
320
+ ReactCurrentDispatcher.current = null;
321
+ disableLogs();
322
+ }
323
+ try {
324
+ if (construct) {
325
+ var Fake = function() {
326
+ throw Error();
327
+ };
328
+ Object.defineProperty(Fake.prototype, "props", {
329
+ set: function() {
330
+ throw Error();
331
+ }
332
+ });
333
+ if (typeof Reflect === "object" && Reflect.construct) {
334
+ try {
335
+ Reflect.construct(Fake, []);
336
+ } catch (x) {
337
+ control = x;
338
+ }
339
+ Reflect.construct(fn, [], Fake);
340
+ } else {
341
+ try {
342
+ Fake.call();
343
+ } catch (x) {
344
+ control = x;
345
+ }
346
+ fn.call(Fake.prototype);
347
+ }
348
+ } else {
349
+ try {
350
+ throw Error();
351
+ } catch (x) {
352
+ control = x;
353
+ }
354
+ fn();
355
+ }
356
+ } catch (sample) {
357
+ if (sample && control && typeof sample.stack === "string") {
358
+ var sampleLines = sample.stack.split(`
359
+ `);
360
+ var controlLines = control.stack.split(`
361
+ `);
362
+ var s = sampleLines.length - 1;
363
+ var c = controlLines.length - 1;
364
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
365
+ c--;
366
+ }
367
+ for (;s >= 1 && c >= 0; s--, c--) {
368
+ if (sampleLines[s] !== controlLines[c]) {
369
+ if (s !== 1 || c !== 1) {
370
+ do {
371
+ s--;
372
+ c--;
373
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
374
+ var _frame = `
375
+ ` + sampleLines[s].replace(" at new ", " at ");
376
+ if (fn.displayName && _frame.includes("<anonymous>")) {
377
+ _frame = _frame.replace("<anonymous>", fn.displayName);
378
+ }
379
+ {
380
+ if (typeof fn === "function") {
381
+ componentFrameCache.set(fn, _frame);
382
+ }
383
+ }
384
+ return _frame;
385
+ }
386
+ } while (s >= 1 && c >= 0);
387
+ }
388
+ break;
389
+ }
390
+ }
391
+ }
392
+ } finally {
393
+ reentry = false;
394
+ {
395
+ ReactCurrentDispatcher.current = previousDispatcher;
396
+ reenableLogs();
397
+ }
398
+ Error.prepareStackTrace = previousPrepareStackTrace;
399
+ }
400
+ var name = fn ? fn.displayName || fn.name : "";
401
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
402
+ {
403
+ if (typeof fn === "function") {
404
+ componentFrameCache.set(fn, syntheticFrame);
405
+ }
406
+ }
407
+ return syntheticFrame;
408
+ }
409
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
410
+ {
411
+ return describeNativeComponentFrame(fn, false);
412
+ }
413
+ }
414
+ function shouldConstruct(Component) {
415
+ var prototype = Component.prototype;
416
+ return !!(prototype && prototype.isReactComponent);
417
+ }
418
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
419
+ if (type == null) {
420
+ return "";
421
+ }
422
+ if (typeof type === "function") {
423
+ {
424
+ return describeNativeComponentFrame(type, shouldConstruct(type));
425
+ }
426
+ }
427
+ if (typeof type === "string") {
428
+ return describeBuiltInComponentFrame(type);
429
+ }
430
+ switch (type) {
431
+ case REACT_SUSPENSE_TYPE:
432
+ return describeBuiltInComponentFrame("Suspense");
433
+ case REACT_SUSPENSE_LIST_TYPE:
434
+ return describeBuiltInComponentFrame("SuspenseList");
435
+ }
436
+ if (typeof type === "object") {
437
+ switch (type.$$typeof) {
438
+ case REACT_FORWARD_REF_TYPE:
439
+ return describeFunctionComponentFrame(type.render);
440
+ case REACT_MEMO_TYPE:
441
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
442
+ case REACT_LAZY_TYPE: {
443
+ var lazyComponent = type;
444
+ var payload = lazyComponent._payload;
445
+ var init = lazyComponent._init;
446
+ try {
447
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
448
+ } catch (x) {}
449
+ }
450
+ }
451
+ }
452
+ return "";
453
+ }
454
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
455
+ var loggedTypeFailures = {};
456
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
457
+ function setCurrentlyValidatingElement(element) {
458
+ {
459
+ if (element) {
460
+ var owner = element._owner;
461
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
462
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
463
+ } else {
464
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
465
+ }
466
+ }
467
+ }
468
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
469
+ {
470
+ var has = Function.call.bind(hasOwnProperty);
471
+ for (var typeSpecName in typeSpecs) {
472
+ if (has(typeSpecs, typeSpecName)) {
473
+ var error$1 = undefined;
474
+ try {
475
+ if (typeof typeSpecs[typeSpecName] !== "function") {
476
+ var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`." + "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
477
+ err.name = "Invariant Violation";
478
+ throw err;
479
+ }
480
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
481
+ } catch (ex) {
482
+ error$1 = ex;
483
+ }
484
+ if (error$1 && !(error$1 instanceof Error)) {
485
+ setCurrentlyValidatingElement(element);
486
+ error("%s: type specification of %s" + " `%s` is invalid; the type checker " + "function must return `null` or an `Error` but returned a %s. " + "You may have forgotten to pass an argument to the type checker " + "creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and " + "shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
487
+ setCurrentlyValidatingElement(null);
488
+ }
489
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
490
+ loggedTypeFailures[error$1.message] = true;
491
+ setCurrentlyValidatingElement(element);
492
+ error("Failed %s type: %s", location, error$1.message);
493
+ setCurrentlyValidatingElement(null);
494
+ }
495
+ }
496
+ }
497
+ }
498
+ }
499
+ var isArrayImpl = Array.isArray;
500
+ function isArray(a) {
501
+ return isArrayImpl(a);
502
+ }
503
+ function typeName(value) {
504
+ {
505
+ var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
506
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
507
+ return type;
508
+ }
509
+ }
510
+ function willCoercionThrow(value) {
511
+ {
512
+ try {
513
+ testStringCoercion(value);
514
+ return false;
515
+ } catch (e) {
516
+ return true;
517
+ }
518
+ }
519
+ }
520
+ function testStringCoercion(value) {
521
+ return "" + value;
522
+ }
523
+ function checkKeyStringCoercion(value) {
524
+ {
525
+ if (willCoercionThrow(value)) {
526
+ error("The provided key is an unsupported type %s." + " This value must be coerced to a string before before using it here.", typeName(value));
527
+ return testStringCoercion(value);
528
+ }
529
+ }
530
+ }
531
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
532
+ var RESERVED_PROPS = {
533
+ key: true,
534
+ ref: true,
535
+ __self: true,
536
+ __source: true
537
+ };
538
+ var specialPropKeyWarningShown;
539
+ var specialPropRefWarningShown;
540
+ var didWarnAboutStringRefs;
541
+ {
542
+ didWarnAboutStringRefs = {};
543
+ }
544
+ function hasValidRef(config) {
545
+ {
546
+ if (hasOwnProperty.call(config, "ref")) {
547
+ var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
548
+ if (getter && getter.isReactWarning) {
549
+ return false;
550
+ }
551
+ }
552
+ }
553
+ return config.ref !== undefined;
554
+ }
555
+ function hasValidKey(config) {
556
+ {
557
+ if (hasOwnProperty.call(config, "key")) {
558
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
559
+ if (getter && getter.isReactWarning) {
560
+ return false;
561
+ }
562
+ }
563
+ }
564
+ return config.key !== undefined;
565
+ }
566
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
567
+ {
568
+ if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
569
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
570
+ if (!didWarnAboutStringRefs[componentName]) {
571
+ error('Component "%s" contains the string ref "%s". ' + "Support for string refs will be removed in a future major release. " + "This case cannot be automatically converted to an arrow function. " + "We ask you to manually fix this case by using useRef() or createRef() instead. " + "Learn more about using refs safely here: " + "https://reactjs.org/link/strict-mode-string-ref", getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
572
+ didWarnAboutStringRefs[componentName] = true;
573
+ }
574
+ }
575
+ }
576
+ }
577
+ function defineKeyPropWarningGetter(props, displayName) {
578
+ {
579
+ var warnAboutAccessingKey = function() {
580
+ if (!specialPropKeyWarningShown) {
581
+ specialPropKeyWarningShown = true;
582
+ 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://reactjs.org/link/special-props)", displayName);
583
+ }
584
+ };
585
+ warnAboutAccessingKey.isReactWarning = true;
586
+ Object.defineProperty(props, "key", {
587
+ get: warnAboutAccessingKey,
588
+ configurable: true
589
+ });
590
+ }
591
+ }
592
+ function defineRefPropWarningGetter(props, displayName) {
593
+ {
594
+ var warnAboutAccessingRef = function() {
595
+ if (!specialPropRefWarningShown) {
596
+ specialPropRefWarningShown = true;
597
+ error("%s: `ref` 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://reactjs.org/link/special-props)", displayName);
598
+ }
599
+ };
600
+ warnAboutAccessingRef.isReactWarning = true;
601
+ Object.defineProperty(props, "ref", {
602
+ get: warnAboutAccessingRef,
603
+ configurable: true
604
+ });
605
+ }
606
+ }
607
+ var ReactElement = function(type, key, ref, self, source, owner, props) {
608
+ var element = {
609
+ $$typeof: REACT_ELEMENT_TYPE,
610
+ type,
611
+ key,
612
+ ref,
613
+ props,
614
+ _owner: owner
615
+ };
616
+ {
617
+ element._store = {};
618
+ Object.defineProperty(element._store, "validated", {
619
+ configurable: false,
620
+ enumerable: false,
621
+ writable: true,
622
+ value: false
623
+ });
624
+ Object.defineProperty(element, "_self", {
625
+ configurable: false,
626
+ enumerable: false,
627
+ writable: false,
628
+ value: self
629
+ });
630
+ Object.defineProperty(element, "_source", {
631
+ configurable: false,
632
+ enumerable: false,
633
+ writable: false,
634
+ value: source
635
+ });
636
+ if (Object.freeze) {
637
+ Object.freeze(element.props);
638
+ Object.freeze(element);
639
+ }
640
+ }
641
+ return element;
642
+ };
643
+ function jsxDEV(type, config, maybeKey, source, self) {
644
+ {
645
+ var propName;
646
+ var props = {};
647
+ var key = null;
648
+ var ref = null;
649
+ if (maybeKey !== undefined) {
650
+ {
651
+ checkKeyStringCoercion(maybeKey);
652
+ }
653
+ key = "" + maybeKey;
654
+ }
655
+ if (hasValidKey(config)) {
656
+ {
657
+ checkKeyStringCoercion(config.key);
658
+ }
659
+ key = "" + config.key;
660
+ }
661
+ if (hasValidRef(config)) {
662
+ ref = config.ref;
663
+ warnIfStringRefCannotBeAutoConverted(config, self);
664
+ }
665
+ for (propName in config) {
666
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
667
+ props[propName] = config[propName];
668
+ }
669
+ }
670
+ if (type && type.defaultProps) {
671
+ var defaultProps = type.defaultProps;
672
+ for (propName in defaultProps) {
673
+ if (props[propName] === undefined) {
674
+ props[propName] = defaultProps[propName];
675
+ }
676
+ }
677
+ }
678
+ if (key || ref) {
679
+ var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
680
+ if (key) {
681
+ defineKeyPropWarningGetter(props, displayName);
682
+ }
683
+ if (ref) {
684
+ defineRefPropWarningGetter(props, displayName);
685
+ }
686
+ }
687
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
688
+ }
689
+ }
690
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
691
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
692
+ function setCurrentlyValidatingElement$1(element) {
693
+ {
694
+ if (element) {
695
+ var owner = element._owner;
696
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
697
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
698
+ } else {
699
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
700
+ }
701
+ }
702
+ }
703
+ var propTypesMisspellWarningShown;
704
+ {
705
+ propTypesMisspellWarningShown = false;
706
+ }
707
+ function isValidElement(object) {
708
+ {
709
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
710
+ }
711
+ }
712
+ function getDeclarationErrorAddendum() {
713
+ {
714
+ if (ReactCurrentOwner$1.current) {
715
+ var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
716
+ if (name) {
717
+ return `
718
+
719
+ Check the render method of \`` + name + "`.";
720
+ }
721
+ }
722
+ return "";
723
+ }
724
+ }
725
+ function getSourceInfoErrorAddendum(source) {
726
+ {
727
+ if (source !== undefined) {
728
+ var fileName = source.fileName.replace(/^.*[\\\/]/, "");
729
+ var lineNumber = source.lineNumber;
730
+ return `
731
+
732
+ Check your code at ` + fileName + ":" + lineNumber + ".";
733
+ }
734
+ return "";
735
+ }
736
+ }
737
+ var ownerHasKeyUseWarning = {};
738
+ function getCurrentComponentErrorInfo(parentType) {
739
+ {
740
+ var info = getDeclarationErrorAddendum();
741
+ if (!info) {
742
+ var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
743
+ if (parentName) {
744
+ info = `
745
+
746
+ Check the top-level render call using <` + parentName + ">.";
747
+ }
748
+ }
749
+ return info;
750
+ }
751
+ }
752
+ function validateExplicitKey(element, parentType) {
753
+ {
754
+ if (!element._store || element._store.validated || element.key != null) {
755
+ return;
756
+ }
757
+ element._store.validated = true;
758
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
759
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
760
+ return;
761
+ }
762
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
763
+ var childOwner = "";
764
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
765
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
766
+ }
767
+ setCurrentlyValidatingElement$1(element);
768
+ error('Each child in a list should have a unique "key" prop.' + "%s%s See https://reactjs.org/link/warning-keys for more information.", currentComponentErrorInfo, childOwner);
769
+ setCurrentlyValidatingElement$1(null);
770
+ }
771
+ }
772
+ function validateChildKeys(node, parentType) {
773
+ {
774
+ if (typeof node !== "object") {
775
+ return;
776
+ }
777
+ if (isArray(node)) {
778
+ for (var i = 0;i < node.length; i++) {
779
+ var child = node[i];
780
+ if (isValidElement(child)) {
781
+ validateExplicitKey(child, parentType);
782
+ }
783
+ }
784
+ } else if (isValidElement(node)) {
785
+ if (node._store) {
786
+ node._store.validated = true;
787
+ }
788
+ } else if (node) {
789
+ var iteratorFn = getIteratorFn(node);
790
+ if (typeof iteratorFn === "function") {
791
+ if (iteratorFn !== node.entries) {
792
+ var iterator = iteratorFn.call(node);
793
+ var step;
794
+ while (!(step = iterator.next()).done) {
795
+ if (isValidElement(step.value)) {
796
+ validateExplicitKey(step.value, parentType);
797
+ }
798
+ }
799
+ }
800
+ }
801
+ }
802
+ }
803
+ }
804
+ function validatePropTypes(element) {
805
+ {
806
+ var type = element.type;
807
+ if (type === null || type === undefined || typeof type === "string") {
808
+ return;
809
+ }
810
+ var propTypes;
811
+ if (typeof type === "function") {
812
+ propTypes = type.propTypes;
813
+ } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) {
814
+ propTypes = type.propTypes;
815
+ } else {
816
+ return;
817
+ }
818
+ if (propTypes) {
819
+ var name = getComponentNameFromType(type);
820
+ checkPropTypes(propTypes, element.props, "prop", name, element);
821
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
822
+ propTypesMisspellWarningShown = true;
823
+ var _name = getComponentNameFromType(type);
824
+ error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
825
+ }
826
+ if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
827
+ error("getDefaultProps is only used on classic React.createClass " + "definitions. Use a static property named `defaultProps` instead.");
828
+ }
829
+ }
830
+ }
831
+ function validateFragmentProps(fragment) {
832
+ {
833
+ var keys = Object.keys(fragment.props);
834
+ for (var i = 0;i < keys.length; i++) {
835
+ var key = keys[i];
836
+ if (key !== "children" && key !== "key") {
837
+ setCurrentlyValidatingElement$1(fragment);
838
+ error("Invalid prop `%s` supplied to `React.Fragment`. " + "React.Fragment can only have `key` and `children` props.", key);
839
+ setCurrentlyValidatingElement$1(null);
840
+ break;
841
+ }
842
+ }
843
+ if (fragment.ref !== null) {
844
+ setCurrentlyValidatingElement$1(fragment);
845
+ error("Invalid attribute `ref` supplied to `React.Fragment`.");
846
+ setCurrentlyValidatingElement$1(null);
847
+ }
848
+ }
849
+ }
850
+ var didWarnAboutKeySpread = {};
851
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
852
+ {
853
+ var validType = isValidElementType(type);
854
+ if (!validType) {
855
+ var info = "";
856
+ if (type === undefined || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
857
+ info += " You likely forgot to export your component from the file " + "it's defined in, or you might have mixed up default and named imports.";
858
+ }
859
+ var sourceInfo = getSourceInfoErrorAddendum(source);
860
+ if (sourceInfo) {
861
+ info += sourceInfo;
862
+ } else {
863
+ info += getDeclarationErrorAddendum();
864
+ }
865
+ var typeString;
866
+ if (type === null) {
867
+ typeString = "null";
868
+ } else if (isArray(type)) {
869
+ typeString = "array";
870
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
871
+ typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
872
+ info = " Did you accidentally export a JSX literal instead of a component?";
873
+ } else {
874
+ typeString = typeof type;
875
+ }
876
+ error("React.jsx: type is invalid -- expected a string (for " + "built-in components) or a class/function (for composite " + "components) but got: %s.%s", typeString, info);
877
+ }
878
+ var element = jsxDEV(type, props, key, source, self);
879
+ if (element == null) {
880
+ return element;
881
+ }
882
+ if (validType) {
883
+ var children = props.children;
884
+ if (children !== undefined) {
885
+ if (isStaticChildren) {
886
+ if (isArray(children)) {
887
+ for (var i = 0;i < children.length; i++) {
888
+ validateChildKeys(children[i], type);
889
+ }
890
+ if (Object.freeze) {
891
+ Object.freeze(children);
892
+ }
893
+ } else {
894
+ 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.");
895
+ }
896
+ } else {
897
+ validateChildKeys(children, type);
898
+ }
899
+ }
900
+ }
901
+ {
902
+ if (hasOwnProperty.call(props, "key")) {
903
+ var componentName = getComponentNameFromType(type);
904
+ var keys = Object.keys(props).filter(function(k) {
905
+ return k !== "key";
906
+ });
907
+ var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
908
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
909
+ var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
910
+ error(`A props object containing a "key" prop is being spread into JSX:
911
+ ` + ` let props = %s;
912
+ ` + ` <%s {...props} />
913
+ ` + `React keys must be passed directly to JSX without using spread:
914
+ ` + ` let props = %s;
915
+ ` + " <%s key={someKey} {...props} />", beforeExample, componentName, afterExample, componentName);
916
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
917
+ }
918
+ }
919
+ }
920
+ if (type === REACT_FRAGMENT_TYPE) {
921
+ validateFragmentProps(element);
922
+ } else {
923
+ validatePropTypes(element);
924
+ }
925
+ return element;
926
+ }
927
+ }
928
+ var jsxDEV$1 = jsxWithValidation;
929
+ exports2.Fragment = REACT_FRAGMENT_TYPE;
930
+ exports2.jsxDEV = jsxDEV$1;
931
+ })();
932
+ }
933
+ });
934
+
935
+ // node_modules/react/jsx-dev-runtime.js
936
+ var require_jsx_dev_runtime = __commonJS((exports2, module2) => {
937
+ if (false) {} else {
938
+ module2.exports = require_react_jsx_dev_runtime_development();
939
+ }
940
+ });
941
+
942
+ // src/cli/ui/components/index.ts
943
+ var exports_components = {};
944
+ __export(exports_components, {
945
+ TypeSelector: () => TypeSelector,
946
+ Summary: () => Summary,
947
+ ProgressIndicator: () => ProgressIndicator,
948
+ PortSelector: () => PortSelector,
949
+ NameInput: () => NameInput,
950
+ FileProgress: () => FileProgress,
951
+ Confirm: () => Confirm,
952
+ ComponentSelector: () => ComponentSelector
953
+ });
954
+ module.exports = __toCommonJS(exports_components);
955
+
956
+ // src/cli/ui/components/ComponentSelector.tsx
957
+ var import_ui = require("@inkjs/ui");
958
+ var import_ink = require("ink");
959
+ var import_react = require("react");
960
+ var jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
961
+ function ComponentSelector({
962
+ options,
963
+ onSubmit,
964
+ title
965
+ }) {
966
+ const [selected, setSelected] = import_react.useState([]);
967
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_ink.Box, {
968
+ flexDirection: "column",
969
+ children: [
970
+ title && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_ink.Box, {
971
+ marginBottom: 1,
972
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_ink.Text, {
973
+ bold: true,
974
+ children: title
975
+ }, undefined, false, undefined, this)
976
+ }, undefined, false, undefined, this),
977
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_ui.MultiSelect, {
978
+ options: options.map((opt) => ({
979
+ label: opt.label,
980
+ value: opt.value
981
+ })),
982
+ onChange: (values) => setSelected(values),
983
+ onSubmit: () => onSubmit(selected)
984
+ }, undefined, false, undefined, this),
985
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_ink.Box, {
986
+ marginTop: 1,
987
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_ink.Text, {
988
+ dimColor: true,
989
+ children: [
990
+ "Use ",
991
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_ink.Text, {
992
+ bold: true,
993
+ children: "space"
994
+ }, undefined, false, undefined, this),
995
+ " to select, ",
996
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_ink.Text, {
997
+ bold: true,
998
+ children: "enter"
999
+ }, undefined, false, undefined, this),
1000
+ " to confirm"
1001
+ ]
1002
+ }, undefined, true, undefined, this)
1003
+ }, undefined, false, undefined, this)
1004
+ ]
1005
+ }, undefined, true, undefined, this);
1006
+ }
1007
+ // src/cli/ui/components/Confirm.tsx
1008
+ var import_ui2 = require("@inkjs/ui");
1009
+ var import_ink2 = require("ink");
1010
+ var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
1011
+ function Confirm({
1012
+ message,
1013
+ defaultValue = true,
1014
+ onSubmit
1015
+ }) {
1016
+ const options = [
1017
+ { label: "Yes", value: "yes" },
1018
+ { label: "No", value: "no" }
1019
+ ];
1020
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_ink2.Box, {
1021
+ flexDirection: "column",
1022
+ children: [
1023
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_ink2.Box, {
1024
+ marginBottom: 1,
1025
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_ink2.Text, {
1026
+ children: message
1027
+ }, undefined, false, undefined, this)
1028
+ }, undefined, false, undefined, this),
1029
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(import_ui2.Select, {
1030
+ options,
1031
+ defaultValue: defaultValue ? "yes" : "no",
1032
+ onChange: (value) => onSubmit(value === "yes")
1033
+ }, undefined, false, undefined, this)
1034
+ ]
1035
+ }, undefined, true, undefined, this);
1036
+ }
1037
+ // src/cli/ui/components/FileProgress.tsx
1038
+ var import_ink3 = require("ink");
1039
+ var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
1040
+ function FileProgress({
1041
+ fileName,
1042
+ status,
1043
+ error
1044
+ }) {
1045
+ const getStatusIcon = () => {
1046
+ switch (status) {
1047
+ case "completed":
1048
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Text, {
1049
+ color: "green",
1050
+ children: "✓"
1051
+ }, undefined, false, undefined, this);
1052
+ case "failed":
1053
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Text, {
1054
+ color: "red",
1055
+ children: "✗"
1056
+ }, undefined, false, undefined, this);
1057
+ case "skipped":
1058
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Text, {
1059
+ color: "yellow",
1060
+ children: "○"
1061
+ }, undefined, false, undefined, this);
1062
+ case "generating":
1063
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Text, {
1064
+ color: "cyan",
1065
+ children: "●"
1066
+ }, undefined, false, undefined, this);
1067
+ case "pending":
1068
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Text, {
1069
+ dimColor: true,
1070
+ children: "○"
1071
+ }, undefined, false, undefined, this);
1072
+ }
1073
+ };
1074
+ const getStatusColor = () => {
1075
+ switch (status) {
1076
+ case "completed":
1077
+ return "green";
1078
+ case "failed":
1079
+ return "red";
1080
+ case "skipped":
1081
+ return "yellow";
1082
+ case "generating":
1083
+ return "cyan";
1084
+ case "pending":
1085
+ return "gray";
1086
+ }
1087
+ };
1088
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Box, {
1089
+ flexDirection: "column",
1090
+ children: [
1091
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Box, {
1092
+ flexDirection: "row",
1093
+ gap: 1,
1094
+ children: [
1095
+ getStatusIcon(),
1096
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Text, {
1097
+ color: getStatusColor(),
1098
+ children: fileName
1099
+ }, undefined, false, undefined, this)
1100
+ ]
1101
+ }, undefined, true, undefined, this),
1102
+ error && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Box, {
1103
+ marginLeft: 2,
1104
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_ink3.Text, {
1105
+ color: "red",
1106
+ children: [
1107
+ "Error: ",
1108
+ error
1109
+ ]
1110
+ }, undefined, true, undefined, this)
1111
+ }, undefined, false, undefined, this)
1112
+ ]
1113
+ }, undefined, true, undefined, this);
1114
+ }
1115
+ // src/cli/ui/components/NameInput.tsx
1116
+ var import_ui3 = require("@inkjs/ui");
1117
+ var import_ink4 = require("ink");
1118
+ var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
1119
+ function NameInput({
1120
+ type,
1121
+ step,
1122
+ onSubmit
1123
+ }) {
1124
+ if (type === "full") {
1125
+ const currentStep = step || "port";
1126
+ const labels = {
1127
+ port: "Enter the PORT name",
1128
+ adapter: "Enter the ADAPTER name"
1129
+ };
1130
+ const placeholders2 = {
1131
+ port: "e.g., ObjectStorage, CurrencyRates",
1132
+ adapter: "e.g., S3, HttpRates"
1133
+ };
1134
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Box, {
1135
+ flexDirection: "column",
1136
+ padding: 1,
1137
+ children: [
1138
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Box, {
1139
+ marginBottom: 1,
1140
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Text, {
1141
+ bold: true,
1142
+ color: "cyan",
1143
+ children: [
1144
+ labels[currentStep],
1145
+ ":"
1146
+ ]
1147
+ }, undefined, true, undefined, this)
1148
+ }, undefined, false, undefined, this),
1149
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ui3.TextInput, {
1150
+ placeholder: placeholders2[currentStep],
1151
+ onSubmit: (value) => {
1152
+ if (value.trim()) {
1153
+ onSubmit(value.trim());
1154
+ }
1155
+ }
1156
+ }, undefined, false, undefined, this),
1157
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Box, {
1158
+ marginTop: 1,
1159
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Text, {
1160
+ dimColor: true,
1161
+ children: "Press ← to go back"
1162
+ }, undefined, false, undefined, this)
1163
+ }, undefined, false, undefined, this)
1164
+ ]
1165
+ }, undefined, true, undefined, this);
1166
+ }
1167
+ const placeholders = {
1168
+ port: "e.g., ObjectStorage, CurrencyRates",
1169
+ adapter: "e.g., S3, HttpRates",
1170
+ service: "e.g., FileUpload, UserRegistration",
1171
+ full: ""
1172
+ };
1173
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Box, {
1174
+ flexDirection: "column",
1175
+ padding: 1,
1176
+ children: [
1177
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Box, {
1178
+ marginBottom: 1,
1179
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Text, {
1180
+ bold: true,
1181
+ color: "cyan",
1182
+ children: [
1183
+ "Enter the name for your ",
1184
+ type,
1185
+ ":"
1186
+ ]
1187
+ }, undefined, true, undefined, this)
1188
+ }, undefined, false, undefined, this),
1189
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ui3.TextInput, {
1190
+ placeholder: placeholders[type],
1191
+ onSubmit: (value) => {
1192
+ if (value.trim()) {
1193
+ onSubmit(value.trim());
1194
+ }
1195
+ }
1196
+ }, undefined, false, undefined, this),
1197
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Box, {
1198
+ marginTop: 1,
1199
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(import_ink4.Text, {
1200
+ dimColor: true,
1201
+ children: [
1202
+ "Press ← to go back",
1203
+ type === "adapter" && " to port selection"
1204
+ ]
1205
+ }, undefined, true, undefined, this)
1206
+ }, undefined, false, undefined, this)
1207
+ ]
1208
+ }, undefined, true, undefined, this);
1209
+ }
1210
+ // src/cli/ui/components/PortSelector.tsx
1211
+ var import_ui4 = require("@inkjs/ui");
1212
+ var import_ink5 = require("ink");
1213
+ var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1214
+ function PortSelector({
1215
+ ports,
1216
+ onSubmit
1217
+ }) {
1218
+ if (ports.length === 0) {
1219
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Box, {
1220
+ flexDirection: "column",
1221
+ padding: 1,
1222
+ children: [
1223
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Text, {
1224
+ color: "yellow",
1225
+ bold: true,
1226
+ children: "⚠ No ports found"
1227
+ }, undefined, false, undefined, this),
1228
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Box, {
1229
+ marginTop: 1,
1230
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Text, {
1231
+ children: "You must create a port before generating an adapter."
1232
+ }, undefined, false, undefined, this)
1233
+ }, undefined, false, undefined, this),
1234
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Box, {
1235
+ marginTop: 1,
1236
+ children: [
1237
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Text, {
1238
+ dimColor: true,
1239
+ children: "Generate a port first:"
1240
+ }, undefined, false, undefined, this),
1241
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Text, {
1242
+ color: "cyan",
1243
+ children: " nest-hex generate port"
1244
+ }, undefined, false, undefined, this)
1245
+ ]
1246
+ }, undefined, true, undefined, this),
1247
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Box, {
1248
+ marginTop: 1,
1249
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Text, {
1250
+ dimColor: true,
1251
+ children: "Press ← to go back"
1252
+ }, undefined, false, undefined, this)
1253
+ }, undefined, false, undefined, this)
1254
+ ]
1255
+ }, undefined, true, undefined, this);
1256
+ }
1257
+ const options = ports.map((port) => ({
1258
+ label: port.pascalName,
1259
+ value: port.name
1260
+ }));
1261
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Box, {
1262
+ flexDirection: "column",
1263
+ padding: 1,
1264
+ children: [
1265
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Box, {
1266
+ marginBottom: 1,
1267
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Text, {
1268
+ bold: true,
1269
+ children: "Select Port to Implement"
1270
+ }, undefined, false, undefined, this)
1271
+ }, undefined, false, undefined, this),
1272
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ui4.Select, {
1273
+ options,
1274
+ onChange: (selectedValue) => {
1275
+ const selectedPort = ports.find((p) => p.name === selectedValue);
1276
+ if (selectedPort) {
1277
+ onSubmit(selectedPort);
1278
+ }
1279
+ }
1280
+ }, undefined, false, undefined, this),
1281
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Box, {
1282
+ marginTop: 1,
1283
+ flexDirection: "column",
1284
+ children: [
1285
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Text, {
1286
+ dimColor: true,
1287
+ children: "This adapter will implement the selected port interface"
1288
+ }, undefined, false, undefined, this),
1289
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(import_ink5.Text, {
1290
+ dimColor: true,
1291
+ children: "Press ← to go back to type selection"
1292
+ }, undefined, false, undefined, this)
1293
+ ]
1294
+ }, undefined, true, undefined, this)
1295
+ ]
1296
+ }, undefined, true, undefined, this);
1297
+ }
1298
+ // src/cli/ui/components/ProgressIndicator.tsx
1299
+ var import_ui5 = require("@inkjs/ui");
1300
+ var import_ink6 = require("ink");
1301
+ var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1302
+ function ProgressIndicator({
1303
+ steps,
1304
+ title
1305
+ }) {
1306
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ink6.Box, {
1307
+ flexDirection: "column",
1308
+ paddingY: 1,
1309
+ children: [
1310
+ title && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ink6.Box, {
1311
+ marginBottom: 1,
1312
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ink6.Text, {
1313
+ bold: true,
1314
+ children: title
1315
+ }, undefined, false, undefined, this)
1316
+ }, undefined, false, undefined, this),
1317
+ steps.map((step) => /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ink6.Box, {
1318
+ flexDirection: "row",
1319
+ gap: 1,
1320
+ children: [
1321
+ step.status === "in_progress" && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ui5.Spinner, {
1322
+ type: "dots"
1323
+ }, undefined, false, undefined, this),
1324
+ step.status === "completed" && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ink6.Text, {
1325
+ color: "green",
1326
+ children: "✓"
1327
+ }, undefined, false, undefined, this),
1328
+ step.status === "failed" && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ink6.Text, {
1329
+ color: "red",
1330
+ children: "✗"
1331
+ }, undefined, false, undefined, this),
1332
+ step.status === "pending" && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ink6.Text, {
1333
+ dimColor: true,
1334
+ children: "○"
1335
+ }, undefined, false, undefined, this),
1336
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ink6.Text, {
1337
+ color: step.status === "completed" ? "green" : step.status === "failed" ? "red" : step.status === "in_progress" ? "cyan" : "gray",
1338
+ children: step.label
1339
+ }, undefined, false, undefined, this),
1340
+ step.message && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(import_ink6.Text, {
1341
+ dimColor: true,
1342
+ children: [
1343
+ " - ",
1344
+ step.message
1345
+ ]
1346
+ }, undefined, true, undefined, this)
1347
+ ]
1348
+ }, step.id, true, undefined, this))
1349
+ ]
1350
+ }, undefined, true, undefined, this);
1351
+ }
1352
+ // src/cli/ui/components/Summary.tsx
1353
+ var import_node_path = require("node:path");
1354
+ var import_ink7 = require("ink");
1355
+ var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
1356
+ function toFileUrl(absolutePath) {
1357
+ const normalizedPath = absolutePath.replace(/\\/g, "/");
1358
+ if (normalizedPath.match(/^[A-Za-z]:/)) {
1359
+ return `file:///${normalizedPath}`;
1360
+ }
1361
+ return `file://${normalizedPath}`;
1362
+ }
1363
+ function createHyperlink(text, url) {
1364
+ const OSC = "\x1B]";
1365
+ const BEL = "\x07";
1366
+ const SEP = ";";
1367
+ return `${OSC}8${SEP}${SEP}${url}${BEL}${text}${OSC}8${SEP}${SEP}${BEL}`;
1368
+ }
1369
+ function Summary({
1370
+ success,
1371
+ filesGenerated,
1372
+ totalFiles,
1373
+ duration,
1374
+ outputPath,
1375
+ files,
1376
+ tips
1377
+ }) {
1378
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Box, {
1379
+ flexDirection: "column",
1380
+ paddingY: 1,
1381
+ children: [
1382
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Box, {
1383
+ marginBottom: 1,
1384
+ children: success ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Text, {
1385
+ color: "green",
1386
+ bold: true,
1387
+ children: [
1388
+ "✅ Successfully generated ",
1389
+ filesGenerated,
1390
+ "/",
1391
+ totalFiles,
1392
+ " files",
1393
+ duration ? ` in ${(duration / 1000).toFixed(1)}s` : ""
1394
+ ]
1395
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Text, {
1396
+ color: "red",
1397
+ bold: true,
1398
+ children: "❌ Generation failed"
1399
+ }, undefined, false, undefined, this)
1400
+ }, undefined, false, undefined, this),
1401
+ outputPath && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Box, {
1402
+ marginBottom: 1,
1403
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Text, {
1404
+ dimColor: true,
1405
+ children: [
1406
+ "Output: ",
1407
+ outputPath
1408
+ ]
1409
+ }, undefined, true, undefined, this)
1410
+ }, undefined, false, undefined, this),
1411
+ files && files.length > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Box, {
1412
+ flexDirection: "column",
1413
+ marginTop: 1,
1414
+ marginBottom: 1,
1415
+ children: [
1416
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Text, {
1417
+ bold: true,
1418
+ children: "\uD83D\uDCC1 Generated files:"
1419
+ }, undefined, false, undefined, this),
1420
+ files.map((file, index) => {
1421
+ const relativePath = import_node_path.relative(process.cwd(), file);
1422
+ const fileUrl = toFileUrl(file);
1423
+ const linkText = createHyperlink(relativePath, fileUrl);
1424
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Box, {
1425
+ marginLeft: 2,
1426
+ children: [
1427
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Text, {
1428
+ dimColor: true,
1429
+ children: "• "
1430
+ }, undefined, false, undefined, this),
1431
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Text, {
1432
+ color: "cyan",
1433
+ children: linkText
1434
+ }, undefined, false, undefined, this)
1435
+ ]
1436
+ }, index, true, undefined, this);
1437
+ })
1438
+ ]
1439
+ }, undefined, true, undefined, this),
1440
+ tips && tips.length > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Box, {
1441
+ flexDirection: "column",
1442
+ marginTop: 1,
1443
+ children: [
1444
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Text, {
1445
+ bold: true,
1446
+ children: "\uD83D\uDCA1 Next steps:"
1447
+ }, undefined, false, undefined, this),
1448
+ tips.map((tip, index) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Box, {
1449
+ marginLeft: 2,
1450
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_ink7.Text, {
1451
+ children: [
1452
+ "• ",
1453
+ tip
1454
+ ]
1455
+ }, undefined, true, undefined, this)
1456
+ }, index, false, undefined, this))
1457
+ ]
1458
+ }, undefined, true, undefined, this)
1459
+ ]
1460
+ }, undefined, true, undefined, this);
1461
+ }
1462
+ // src/cli/ui/components/TypeSelector.tsx
1463
+ var import_ui6 = require("@inkjs/ui");
1464
+ var import_ink8 = require("ink");
1465
+ var import_react2 = require("react");
1466
+ var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
1467
+ function TypeSelector({ onSubmit }) {
1468
+ const [_selectedType, setSelectedType] = import_react2.useState();
1469
+ const options = [
1470
+ {
1471
+ label: "Port - Create domain capability (token, interface, service, module)",
1472
+ value: "port"
1473
+ },
1474
+ {
1475
+ label: "Adapter - Create infrastructure implementation for a port",
1476
+ value: "adapter"
1477
+ },
1478
+ {
1479
+ label: "Service - Create service with @InjectPort usage",
1480
+ value: "service"
1481
+ },
1482
+ {
1483
+ label: "Full - Generate both port and adapter together",
1484
+ value: "full"
1485
+ }
1486
+ ];
1487
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_ink8.Box, {
1488
+ flexDirection: "column",
1489
+ children: [
1490
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_ink8.Box, {
1491
+ marginBottom: 1,
1492
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_ink8.Text, {
1493
+ bold: true,
1494
+ color: "cyan",
1495
+ children: "What do you want to generate?"
1496
+ }, undefined, false, undefined, this)
1497
+ }, undefined, false, undefined, this),
1498
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_ui6.Select, {
1499
+ options,
1500
+ onChange: (value) => {
1501
+ setSelectedType(value);
1502
+ onSubmit(value);
1503
+ }
1504
+ }, undefined, false, undefined, this)
1505
+ ]
1506
+ }, undefined, true, undefined, this);
1507
+ }