movehat 0.1.1 → 0.1.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 (71) hide show
  1. package/dist/commands/compile.d.ts +13 -0
  2. package/dist/commands/compile.d.ts.map +1 -1
  3. package/dist/commands/compile.js +31 -11
  4. package/dist/commands/compile.js.map +1 -1
  5. package/dist/commands/fork/create.d.ts +20 -1
  6. package/dist/commands/fork/create.d.ts.map +1 -1
  7. package/dist/commands/fork/create.js +54 -20
  8. package/dist/commands/fork/create.js.map +1 -1
  9. package/dist/commands/fork/list.d.ts +12 -1
  10. package/dist/commands/fork/list.d.ts.map +1 -1
  11. package/dist/commands/fork/list.js +50 -22
  12. package/dist/commands/fork/list.js.map +1 -1
  13. package/dist/commands/init.d.ts +19 -0
  14. package/dist/commands/init.d.ts.map +1 -1
  15. package/dist/commands/init.js +64 -29
  16. package/dist/commands/init.js.map +1 -1
  17. package/dist/commands/update.d.ts +11 -1
  18. package/dist/commands/update.d.ts.map +1 -1
  19. package/dist/commands/update.js +44 -18
  20. package/dist/commands/update.js.map +1 -1
  21. package/dist/helpers/banner.d.ts +17 -0
  22. package/dist/helpers/banner.d.ts.map +1 -1
  23. package/dist/helpers/banner.js +38 -23
  24. package/dist/helpers/banner.js.map +1 -1
  25. package/dist/helpers/version-check.d.ts +12 -1
  26. package/dist/helpers/version-check.d.ts.map +1 -1
  27. package/dist/helpers/version-check.js +17 -7
  28. package/dist/helpers/version-check.js.map +1 -1
  29. package/dist/ui/colors.d.ts +77 -0
  30. package/dist/ui/colors.d.ts.map +1 -0
  31. package/dist/ui/colors.js +121 -0
  32. package/dist/ui/colors.js.map +1 -0
  33. package/dist/ui/formatters.d.ts +171 -0
  34. package/dist/ui/formatters.d.ts.map +1 -0
  35. package/dist/ui/formatters.js +186 -0
  36. package/dist/ui/formatters.js.map +1 -0
  37. package/dist/ui/index.d.ts +58 -0
  38. package/dist/ui/index.d.ts.map +1 -0
  39. package/dist/ui/index.js +60 -0
  40. package/dist/ui/index.js.map +1 -0
  41. package/dist/ui/logger.d.ts +160 -0
  42. package/dist/ui/logger.d.ts.map +1 -0
  43. package/dist/ui/logger.js +206 -0
  44. package/dist/ui/logger.js.map +1 -0
  45. package/dist/ui/spinner.d.ts +106 -0
  46. package/dist/ui/spinner.d.ts.map +1 -0
  47. package/dist/ui/spinner.js +120 -0
  48. package/dist/ui/spinner.js.map +1 -0
  49. package/dist/ui/symbols.d.ts +50 -0
  50. package/dist/ui/symbols.d.ts.map +1 -0
  51. package/dist/ui/symbols.js +64 -0
  52. package/dist/ui/symbols.js.map +1 -0
  53. package/dist/ui/table.d.ts +67 -0
  54. package/dist/ui/table.d.ts.map +1 -0
  55. package/dist/ui/table.js +143 -0
  56. package/dist/ui/table.js.map +1 -0
  57. package/package.json +8 -1
  58. package/src/commands/compile.ts +32 -11
  59. package/src/commands/fork/create.ts +59 -20
  60. package/src/commands/fork/list.ts +52 -22
  61. package/src/commands/init.ts +111 -74
  62. package/src/commands/update.ts +52 -19
  63. package/src/helpers/banner.ts +45 -29
  64. package/src/helpers/version-check.ts +20 -8
  65. package/src/ui/colors.ts +141 -0
  66. package/src/ui/formatters.ts +246 -0
  67. package/src/ui/index.ts +62 -0
  68. package/src/ui/logger.ts +226 -0
  69. package/src/ui/spinner.ts +171 -0
  70. package/src/ui/symbols.ts +74 -0
  71. package/src/ui/table.ts +191 -0
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Border color options for boxes
3
+ */
4
+ export type BorderColor = 'dim' | 'primary' | 'success' | 'error' | 'warning';
5
+ /**
6
+ * Box formatting options
7
+ */
8
+ export interface BoxOptions {
9
+ /** Padding inside the box (default: 1) */
10
+ padding?: number;
11
+ /** Margin outside the box (default: 0) */
12
+ margin?: number;
13
+ /** Border color (default: 'dim') */
14
+ borderColor?: BorderColor;
15
+ }
16
+ /**
17
+ * Create a box around text with Unicode borders
18
+ *
19
+ * @param content - Text content to box (supports multiline)
20
+ * @param options - Box formatting options
21
+ * @returns Formatted box string
22
+ *
23
+ * @example
24
+ * const message = box('Update available: 1.0.0 → 1.1.0');
25
+ * console.log(message);
26
+ * // ┌────────────────────────────────┐
27
+ * // │ Update available: 1.0.0 → 1.1.0│
28
+ * // └────────────────────────────────┘
29
+ *
30
+ * @example
31
+ * const warning = box(
32
+ * 'This feature is deprecated\nUse the new API instead',
33
+ * { borderColor: 'warning', padding: 2 }
34
+ * );
35
+ */
36
+ export declare const box: (content: string, options?: BoxOptions) => string;
37
+ /**
38
+ * List formatting options
39
+ */
40
+ export interface ListOptions {
41
+ /** Number of spaces to indent (default: 0) */
42
+ indent?: number;
43
+ /** Starting number for numbered lists (default: 1) */
44
+ startFrom?: number;
45
+ /** Custom symbol for bullet lists */
46
+ symbol?: string;
47
+ }
48
+ /**
49
+ * Create a numbered list
50
+ *
51
+ * @param items - Array of items to list
52
+ * @param options - List formatting options
53
+ * @returns Formatted numbered list string
54
+ *
55
+ * @example
56
+ * const steps = numberedList([
57
+ * 'cd my-project',
58
+ * 'npm install',
59
+ * 'npm test'
60
+ * ]);
61
+ * console.log(steps);
62
+ * // 1. cd my-project
63
+ * // 2. npm install
64
+ * // 3. npm test
65
+ */
66
+ export declare const numberedList: (items: string[], options?: ListOptions) => string;
67
+ /**
68
+ * Create a bulleted list
69
+ *
70
+ * @param items - Array of items to list
71
+ * @param options - List formatting options
72
+ * @returns Formatted bulleted list string
73
+ *
74
+ * @example
75
+ * const features = bulletList([
76
+ * 'Feature A',
77
+ * 'Feature B',
78
+ * 'Feature C'
79
+ * ]);
80
+ * console.log(features);
81
+ * // • Feature A
82
+ * // • Feature B
83
+ * // • Feature C
84
+ *
85
+ * @example
86
+ * const tasks = bulletList(
87
+ * ['Task 1', 'Task 2'],
88
+ * { indent: 2, symbol: '→' }
89
+ * );
90
+ */
91
+ export declare const bulletList: (items: string[], options?: ListOptions) => string;
92
+ /**
93
+ * Indent text block by a specified number of spaces
94
+ *
95
+ * @param text - Text to indent (supports multiline)
96
+ * @param spaces - Number of spaces to indent
97
+ * @returns Indented text
98
+ *
99
+ * @example
100
+ * const code = 'function test() {\n return true;\n}';
101
+ * console.log(indent(code, 4));
102
+ * // function test() {
103
+ * // return true;
104
+ * // }
105
+ */
106
+ export declare const indent: (text: string, spaces: number) => string;
107
+ /**
108
+ * Create a horizontal divider line
109
+ *
110
+ * @param width - Width of the divider (default: 60)
111
+ * @param char - Character to use (default: symbols.line)
112
+ * @returns Formatted divider string
113
+ *
114
+ * @example
115
+ * console.log(divider());
116
+ * // ────────────────────────────────────────────────────────────
117
+ *
118
+ * @example
119
+ * console.log(divider(40, '='));
120
+ * // ========================================
121
+ */
122
+ export declare const divider: (width?: number, char?: string) => string;
123
+ /**
124
+ * Format file path with dimmed parent directories
125
+ * Highlights the filename while dimming the directory path
126
+ *
127
+ * @param filePath - Full file path
128
+ * @returns Formatted path string
129
+ *
130
+ * @example
131
+ * console.log(formatPath('/Users/name/project/src/file.ts'));
132
+ * // /Users/name/project/src/file.ts
133
+ * // (where the directory is dimmed and filename is bright)
134
+ */
135
+ export declare const formatPath: (filePath: string) => string;
136
+ /**
137
+ * Create a section header with divider
138
+ * Combines a bold title with a horizontal line
139
+ *
140
+ * @param title - Section title
141
+ * @param options - Formatting options
142
+ * @returns Formatted section header
143
+ *
144
+ * @example
145
+ * console.log(sectionHeader('Fork Details'));
146
+ * //
147
+ * // Fork Details
148
+ * // ────────────────────────────────────────────────────────────
149
+ */
150
+ export declare const sectionHeader: (title: string, options?: {
151
+ width?: number;
152
+ char?: string;
153
+ }) => string;
154
+ /**
155
+ * Format a command for display with dimmed prompt
156
+ * Useful for showing example commands to users
157
+ *
158
+ * @param command - Command string
159
+ * @returns Formatted command with $ prompt
160
+ *
161
+ * @example
162
+ * console.log(formatCommand('movehat compile'));
163
+ * // $ movehat compile
164
+ * // (where $ is dimmed)
165
+ *
166
+ * @example
167
+ * console.log(formatCommand('npm install'));
168
+ * // $ npm install
169
+ */
170
+ export declare const formatCommand: (command: string) => string;
171
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/ui/formatters.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,GAAG,GACd,SAAS,MAAM,EACf,UAAS,UAAe,KACvB,MAqBF,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,EAAE,EACf,UAAS,WAAgB,KACxB,MAOF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,MAAM,EAAE,EACf,UAAS,WAAgB,KACxB,MAOF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,MAGrD,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,OAAO,GAClB,QAAO,MAAW,EAClB,OAAM,MAAqB,KAC1B,MAEF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,MAAM,KAAG,MAM7C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,MAAM,EACb,UAAS;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,KAC9C,MAGF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,MAE/C,CAAC"}
@@ -0,0 +1,186 @@
1
+ import { colors } from './colors.js';
2
+ import { symbols } from './symbols.js';
3
+ /**
4
+ * Create a box around text with Unicode borders
5
+ *
6
+ * @param content - Text content to box (supports multiline)
7
+ * @param options - Box formatting options
8
+ * @returns Formatted box string
9
+ *
10
+ * @example
11
+ * const message = box('Update available: 1.0.0 → 1.1.0');
12
+ * console.log(message);
13
+ * // ┌────────────────────────────────┐
14
+ * // │ Update available: 1.0.0 → 1.1.0│
15
+ * // └────────────────────────────────┘
16
+ *
17
+ * @example
18
+ * const warning = box(
19
+ * 'This feature is deprecated\nUse the new API instead',
20
+ * { borderColor: 'warning', padding: 2 }
21
+ * );
22
+ */
23
+ export const box = (content, options = {}) => {
24
+ const { padding = 1, margin = 0, borderColor = 'dim' } = options;
25
+ const lines = content.split('\n');
26
+ const maxWidth = Math.max(...lines.map(l => l.length));
27
+ const innerWidth = maxWidth + padding * 2;
28
+ const marginStr = ' '.repeat(margin);
29
+ const paddingStr = ' '.repeat(padding);
30
+ const colorFn = colors[borderColor] || colors.dim;
31
+ const top = marginStr + colorFn(symbols.boxTopLeft + symbols.boxTop.repeat(innerWidth) + symbols.boxTopRight);
32
+ const bottom = marginStr + colorFn(symbols.boxBottomLeft + symbols.boxBottom.repeat(innerWidth) + symbols.boxBottomRight);
33
+ const middle = lines.map(line => {
34
+ const padded = line.padEnd(maxWidth);
35
+ return marginStr + colorFn(symbols.boxLeft) + paddingStr + padded + paddingStr + colorFn(symbols.boxRight);
36
+ });
37
+ return [top, ...middle, bottom].join('\n');
38
+ };
39
+ /**
40
+ * Create a numbered list
41
+ *
42
+ * @param items - Array of items to list
43
+ * @param options - List formatting options
44
+ * @returns Formatted numbered list string
45
+ *
46
+ * @example
47
+ * const steps = numberedList([
48
+ * 'cd my-project',
49
+ * 'npm install',
50
+ * 'npm test'
51
+ * ]);
52
+ * console.log(steps);
53
+ * // 1. cd my-project
54
+ * // 2. npm install
55
+ * // 3. npm test
56
+ */
57
+ export const numberedList = (items, options = {}) => {
58
+ const { indent = 0, startFrom = 1 } = options;
59
+ const prefix = ' '.repeat(indent);
60
+ return items
61
+ .map((item, idx) => `${prefix}${startFrom + idx}. ${item}`)
62
+ .join('\n');
63
+ };
64
+ /**
65
+ * Create a bulleted list
66
+ *
67
+ * @param items - Array of items to list
68
+ * @param options - List formatting options
69
+ * @returns Formatted bulleted list string
70
+ *
71
+ * @example
72
+ * const features = bulletList([
73
+ * 'Feature A',
74
+ * 'Feature B',
75
+ * 'Feature C'
76
+ * ]);
77
+ * console.log(features);
78
+ * // • Feature A
79
+ * // • Feature B
80
+ * // • Feature C
81
+ *
82
+ * @example
83
+ * const tasks = bulletList(
84
+ * ['Task 1', 'Task 2'],
85
+ * { indent: 2, symbol: '→' }
86
+ * );
87
+ */
88
+ export const bulletList = (items, options = {}) => {
89
+ const { indent = 0, symbol = symbols.bullet } = options;
90
+ const prefix = ' '.repeat(indent);
91
+ return items
92
+ .map(item => `${prefix}${symbol} ${item}`)
93
+ .join('\n');
94
+ };
95
+ /**
96
+ * Indent text block by a specified number of spaces
97
+ *
98
+ * @param text - Text to indent (supports multiline)
99
+ * @param spaces - Number of spaces to indent
100
+ * @returns Indented text
101
+ *
102
+ * @example
103
+ * const code = 'function test() {\n return true;\n}';
104
+ * console.log(indent(code, 4));
105
+ * // function test() {
106
+ * // return true;
107
+ * // }
108
+ */
109
+ export const indent = (text, spaces) => {
110
+ const prefix = ' '.repeat(spaces);
111
+ return text.split('\n').map(line => prefix + line).join('\n');
112
+ };
113
+ /**
114
+ * Create a horizontal divider line
115
+ *
116
+ * @param width - Width of the divider (default: 60)
117
+ * @param char - Character to use (default: symbols.line)
118
+ * @returns Formatted divider string
119
+ *
120
+ * @example
121
+ * console.log(divider());
122
+ * // ────────────────────────────────────────────────────────────
123
+ *
124
+ * @example
125
+ * console.log(divider(40, '='));
126
+ * // ========================================
127
+ */
128
+ export const divider = (width = 60, char = symbols.line) => {
129
+ return colors.dim(char.repeat(width));
130
+ };
131
+ /**
132
+ * Format file path with dimmed parent directories
133
+ * Highlights the filename while dimming the directory path
134
+ *
135
+ * @param filePath - Full file path
136
+ * @returns Formatted path string
137
+ *
138
+ * @example
139
+ * console.log(formatPath('/Users/name/project/src/file.ts'));
140
+ * // /Users/name/project/src/file.ts
141
+ * // (where the directory is dimmed and filename is bright)
142
+ */
143
+ export const formatPath = (filePath) => {
144
+ const parts = filePath.split('/');
145
+ const fileName = parts.pop() || '';
146
+ const dirPath = parts.join('/');
147
+ return colors.dim(dirPath + '/') + fileName;
148
+ };
149
+ /**
150
+ * Create a section header with divider
151
+ * Combines a bold title with a horizontal line
152
+ *
153
+ * @param title - Section title
154
+ * @param options - Formatting options
155
+ * @returns Formatted section header
156
+ *
157
+ * @example
158
+ * console.log(sectionHeader('Fork Details'));
159
+ * //
160
+ * // Fork Details
161
+ * // ────────────────────────────────────────────────────────────
162
+ */
163
+ export const sectionHeader = (title, options = {}) => {
164
+ const { width = 60, char = symbols.line } = options;
165
+ return `\n${colors.brandBright(title)}\n${divider(width, char)}`;
166
+ };
167
+ /**
168
+ * Format a command for display with dimmed prompt
169
+ * Useful for showing example commands to users
170
+ *
171
+ * @param command - Command string
172
+ * @returns Formatted command with $ prompt
173
+ *
174
+ * @example
175
+ * console.log(formatCommand('movehat compile'));
176
+ * // $ movehat compile
177
+ * // (where $ is dimmed)
178
+ *
179
+ * @example
180
+ * console.log(formatCommand('npm install'));
181
+ * // $ npm install
182
+ */
183
+ export const formatCommand = (command) => {
184
+ return `${colors.dim('$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O,CAAC;IACpD,OAAO,KAAK,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;AACnE,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAe,EAAU,EAAE;IACvD,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC;AACzC,CAAC,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Movehat UI Module
3
+ *
4
+ * Provides a comprehensive set of UI utilities for the CLI including:
5
+ * - Colors and gradients (picocolors wrapper)
6
+ * - Cross-platform symbols (figures wrapper)
7
+ * - Structured logging system
8
+ * - Spinners for async operations (ora wrapper)
9
+ * - Table formatting (cli-table3 wrapper)
10
+ * - Text formatting utilities
11
+ *
12
+ * @example
13
+ * // Named imports (recommended)
14
+ * import { logger, spinner, createTable } from './ui/index.js';
15
+ *
16
+ * logger.info('Starting compilation...');
17
+ * const spin = spinner({ text: 'Compiling...' });
18
+ * // ... async work ...
19
+ * spin.succeed('Compilation complete!');
20
+ *
21
+ * @example
22
+ * // Namespace import
23
+ * import { ui } from './ui/index.js';
24
+ *
25
+ * ui.logger.info('Starting...');
26
+ * ui.logger.success('Done!');
27
+ */
28
+ export * from './colors.js';
29
+ export * from './symbols.js';
30
+ export * from './logger.js';
31
+ export * from './spinner.js';
32
+ export * from './table.js';
33
+ export * from './formatters.js';
34
+ import * as _colors from './colors.js';
35
+ import * as _symbols from './symbols.js';
36
+ import * as _logger from './logger.js';
37
+ import * as _spinner from './spinner.js';
38
+ import * as _table from './table.js';
39
+ import * as _formatters from './formatters.js';
40
+ /**
41
+ * Unified UI namespace
42
+ * Provides all UI utilities in a single namespace object
43
+ *
44
+ * @example
45
+ * import { ui } from './ui/index.js';
46
+ *
47
+ * ui.logger.info('Processing...');
48
+ * ui.logger.success('Done!');
49
+ */
50
+ export declare const ui: {
51
+ colors: typeof _colors;
52
+ symbols: typeof _symbols;
53
+ logger: typeof _logger;
54
+ spinner: typeof _spinner;
55
+ table: typeof _table;
56
+ formatters: typeof _formatters;
57
+ };
58
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAGhC,OAAO,KAAK,OAAO,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;GASG;AACH,eAAO,MAAM,EAAE;;;;;;;CAOd,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Movehat UI Module
3
+ *
4
+ * Provides a comprehensive set of UI utilities for the CLI including:
5
+ * - Colors and gradients (picocolors wrapper)
6
+ * - Cross-platform symbols (figures wrapper)
7
+ * - Structured logging system
8
+ * - Spinners for async operations (ora wrapper)
9
+ * - Table formatting (cli-table3 wrapper)
10
+ * - Text formatting utilities
11
+ *
12
+ * @example
13
+ * // Named imports (recommended)
14
+ * import { logger, spinner, createTable } from './ui/index.js';
15
+ *
16
+ * logger.info('Starting compilation...');
17
+ * const spin = spinner({ text: 'Compiling...' });
18
+ * // ... async work ...
19
+ * spin.succeed('Compilation complete!');
20
+ *
21
+ * @example
22
+ * // Namespace import
23
+ * import { ui } from './ui/index.js';
24
+ *
25
+ * ui.logger.info('Starting...');
26
+ * ui.logger.success('Done!');
27
+ */
28
+ // Re-export everything from submodules for named imports
29
+ export * from './colors.js';
30
+ export * from './symbols.js';
31
+ export * from './logger.js';
32
+ export * from './spinner.js';
33
+ export * from './table.js';
34
+ export * from './formatters.js';
35
+ // Also export as namespace for convenience
36
+ import * as _colors from './colors.js';
37
+ import * as _symbols from './symbols.js';
38
+ import * as _logger from './logger.js';
39
+ import * as _spinner from './spinner.js';
40
+ import * as _table from './table.js';
41
+ import * as _formatters from './formatters.js';
42
+ /**
43
+ * Unified UI namespace
44
+ * Provides all UI utilities in a single namespace object
45
+ *
46
+ * @example
47
+ * import { ui } from './ui/index.js';
48
+ *
49
+ * ui.logger.info('Processing...');
50
+ * ui.logger.success('Done!');
51
+ */
52
+ export const ui = {
53
+ colors: _colors,
54
+ symbols: _symbols,
55
+ logger: _logger,
56
+ spinner: _spinner,
57
+ table: _table,
58
+ formatters: _formatters,
59
+ };
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,yDAAyD;AACzD,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAEhC,2CAA2C;AAC3C,OAAO,KAAK,OAAO,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,MAAM;IACb,UAAU,EAAE,WAAW;CACxB,CAAC"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Available log levels
3
+ */
4
+ export type LogLevel = 'info' | 'success' | 'error' | 'warning' | 'debug';
5
+ /**
6
+ * Logger configuration options
7
+ */
8
+ export interface LoggerConfig {
9
+ /** Suppress all output when true */
10
+ silent?: boolean;
11
+ /** Minimum log level to display */
12
+ level?: LogLevel;
13
+ /** Include timestamps in log messages */
14
+ timestamp?: boolean;
15
+ }
16
+ /**
17
+ * Configure logger globally
18
+ *
19
+ * @param newConfig - Partial configuration to merge with current config
20
+ *
21
+ * @example
22
+ * // Silence all logs for testing
23
+ * configureLogger({ silent: true });
24
+ *
25
+ * // Enable timestamps
26
+ * configureLogger({ timestamp: true });
27
+ */
28
+ export declare const configureLogger: (newConfig: Partial<LoggerConfig>) => void;
29
+ /**
30
+ * Info message (cyan)
31
+ * Use for general information and status updates
32
+ *
33
+ * @param message - Message to log
34
+ * @param indent - Number of spaces to indent (default: 0)
35
+ *
36
+ * @example
37
+ * logger.info('Starting compilation...');
38
+ * logger.info('Network: testnet', 2);
39
+ */
40
+ export declare const info: (message: string, indent?: number) => void;
41
+ /**
42
+ * Success message (green)
43
+ * Use for completed operations and positive outcomes
44
+ *
45
+ * @param message - Message to log
46
+ * @param indent - Number of spaces to indent (default: 0)
47
+ *
48
+ * @example
49
+ * logger.success('Compilation finished!');
50
+ * logger.success('All tests passed', 2);
51
+ */
52
+ export declare const success: (message: string, indent?: number) => void;
53
+ /**
54
+ * Error message (red)
55
+ * Use for errors and failures
56
+ *
57
+ * @param message - Message to log
58
+ * @param indent - Number of spaces to indent (default: 0)
59
+ *
60
+ * @example
61
+ * logger.error('Compilation failed');
62
+ * logger.error('File not found: config.ts', 2);
63
+ */
64
+ export declare const error: (message: string, indent?: number) => void;
65
+ /**
66
+ * Warning message (yellow)
67
+ * Use for warnings and deprecated features
68
+ *
69
+ * @param message - Message to log
70
+ * @param indent - Number of spaces to indent (default: 0)
71
+ *
72
+ * @example
73
+ * logger.warning('Deprecated API used');
74
+ * logger.warning('This feature will be removed in v2.0', 2);
75
+ */
76
+ export declare const warning: (message: string, indent?: number) => void;
77
+ /**
78
+ * Plain message without symbol
79
+ * Use for continuation lines or when symbol is not appropriate
80
+ *
81
+ * @param message - Message to log
82
+ *
83
+ * @example
84
+ * logger.info('Fork Details:');
85
+ * logger.plain(' Chain ID: 126');
86
+ * logger.plain(' Network: testnet');
87
+ */
88
+ export declare const plain: (message: string) => void;
89
+ /**
90
+ * Empty line
91
+ * Use for visual spacing between sections
92
+ *
93
+ * @example
94
+ * logger.success('Build complete');
95
+ * logger.newline();
96
+ * logger.info('Next steps:');
97
+ */
98
+ export declare const newline: () => void;
99
+ /**
100
+ * Section header (bold, brand color)
101
+ * Use for major section dividers
102
+ *
103
+ * @param title - Section title
104
+ *
105
+ * @example
106
+ * logger.section('Fork Details');
107
+ * logger.kv('Chain ID', '126', 2);
108
+ * logger.kv('Network', 'testnet', 2);
109
+ */
110
+ export declare const section: (title: string) => void;
111
+ /**
112
+ * Key-value pair
113
+ * Use for displaying structured data
114
+ *
115
+ * @param key - The key/label
116
+ * @param value - The value
117
+ * @param indent - Number of spaces to indent (default: 0)
118
+ *
119
+ * @example
120
+ * logger.kv('Network', 'testnet', 2);
121
+ * logger.kv('Chain ID', '126', 2);
122
+ */
123
+ export declare const kv: (key: string, value: string, indent?: number) => void;
124
+ /**
125
+ * List item with bullet
126
+ * Use for lists and enumerated items
127
+ *
128
+ * @param text - Item text
129
+ * @param indent - Number of spaces to indent (default: 0)
130
+ *
131
+ * @example
132
+ * logger.info('Next steps:');
133
+ * logger.item('cd my-project', 2);
134
+ * logger.item('npm install', 2);
135
+ * logger.item('npm test', 2);
136
+ */
137
+ export declare const item: (text: string, indent?: number) => void;
138
+ /**
139
+ * Logger namespace export
140
+ * Provides all logging functions in a single namespace
141
+ *
142
+ * @example
143
+ * import { logger } from './ui/index.js';
144
+ *
145
+ * logger.info('Starting...');
146
+ * logger.success('Done!');
147
+ */
148
+ export declare const logger: {
149
+ configure: (newConfig: Partial<LoggerConfig>) => void;
150
+ info: (message: string, indent?: number) => void;
151
+ success: (message: string, indent?: number) => void;
152
+ error: (message: string, indent?: number) => void;
153
+ warning: (message: string, indent?: number) => void;
154
+ plain: (message: string) => void;
155
+ newline: () => void;
156
+ section: (title: string) => void;
157
+ kv: (key: string, value: string, indent?: number) => void;
158
+ item: (text: string, indent?: number) => void;
159
+ };
160
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/ui/logger.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,yCAAyC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAWD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,OAAO,CAAC,YAAY,CAAC,KAAG,IAElE,CAAC;AAUF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,GAAI,SAAS,MAAM,EAAE,SAAQ,MAAU,KAAG,IAI1D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,GAAI,SAAS,MAAM,EAAE,SAAQ,MAAU,KAAG,IAI7D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,MAAM,EAAE,SAAQ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