@poetora/cli 0.1.9 → 0.1.11
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/bin/cli-builder.js +32 -18
- package/bin/services/link.service.js +0 -11
- package/bin/services/version.service.d.ts +1 -1
- package/bin/services/version.service.js +12 -10
- package/bin/utils/index.d.ts +1 -0
- package/bin/utils/index.js +1 -0
- package/bin/utils/terminate.d.ts +1 -0
- package/bin/utils/terminate.js +4 -0
- package/package.json +5 -1
- package/.turbo/turbo-build.log +0 -4
- package/src/accessibility.ts +0 -180
- package/src/cli-builder.ts +0 -274
- package/src/cli.ts +0 -22
- package/src/commands/__tests__/base.command.test.ts +0 -139
- package/src/commands/__tests__/dev.command.test.ts +0 -241
- package/src/commands/__tests__/init.command.test.ts +0 -281
- package/src/commands/__tests__/utils.ts +0 -20
- package/src/commands/base.command.ts +0 -97
- package/src/commands/check.command.ts +0 -40
- package/src/commands/dev.command.ts +0 -63
- package/src/commands/index.ts +0 -6
- package/src/commands/init.command.ts +0 -125
- package/src/commands/link.command.ts +0 -39
- package/src/commands/update.command.ts +0 -23
- package/src/constants.ts +0 -4
- package/src/errors/cli-error.ts +0 -83
- package/src/errors/index.ts +0 -1
- package/src/index.ts +0 -110
- package/src/mdxAccessibility.ts +0 -132
- package/src/middlewares.ts +0 -73
- package/src/services/__tests__/port.service.test.ts +0 -83
- package/src/services/__tests__/template.service.test.ts +0 -234
- package/src/services/__tests__/version.service.test.ts +0 -165
- package/src/services/accessibility-check.service.ts +0 -226
- package/src/services/index.ts +0 -7
- package/src/services/link.service.ts +0 -65
- package/src/services/openapi-check.service.ts +0 -68
- package/src/services/port.service.ts +0 -47
- package/src/services/template.service.ts +0 -203
- package/src/services/update.service.ts +0 -76
- package/src/services/version.service.ts +0 -161
- package/src/start.ts +0 -6
- package/src/types/common.ts +0 -53
- package/src/types/index.ts +0 -2
- package/src/types/options.ts +0 -42
- package/src/utils/console-logger.ts +0 -123
- package/src/utils/index.ts +0 -2
- package/src/utils/logger.interface.ts +0 -70
- package/tsconfig.build.json +0 -17
- package/tsconfig.json +0 -21
- package/vitest.config.ts +0 -8
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addLog,
|
|
3
|
-
EmptyLineLog,
|
|
4
|
-
ErrorLog,
|
|
5
|
-
InfoLog,
|
|
6
|
-
SpinnerLog,
|
|
7
|
-
SuccessLog,
|
|
8
|
-
WarningLog,
|
|
9
|
-
} from '@poetora/previewing';
|
|
10
|
-
import chalk from 'chalk';
|
|
11
|
-
import { Text } from 'ink';
|
|
12
|
-
import React from 'react';
|
|
13
|
-
|
|
14
|
-
import type { LoggerSpinner } from '../types/index.js';
|
|
15
|
-
|
|
16
|
-
import type { ILogger } from './logger.interface.js';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Logger implementation using ink and addLog from @poetora/previewing
|
|
20
|
-
* Provides consistent output with the preview server's logging system
|
|
21
|
-
*/
|
|
22
|
-
export class ConsoleLogger implements ILogger {
|
|
23
|
-
info(message: string): void {
|
|
24
|
-
addLog(React.createElement(InfoLog, { message }));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
success(message: string): void {
|
|
28
|
-
addLog(React.createElement(SuccessLog, { message }));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
error(message: string): void {
|
|
32
|
-
addLog(React.createElement(ErrorLog, { message }));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
warn(message: string): void {
|
|
36
|
-
addLog(React.createElement(WarningLog, { message }));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
spinner(message: string): LoggerSpinner {
|
|
40
|
-
// Immediately add spinner log
|
|
41
|
-
addLog(React.createElement(SpinnerLog, { message }));
|
|
42
|
-
return new InkSpinner();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
log(message: string): void {
|
|
46
|
-
addLog(React.createElement(Text, {}, message));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Log with custom color
|
|
51
|
-
*/
|
|
52
|
-
logColor(
|
|
53
|
-
message: string,
|
|
54
|
-
color: 'green' | 'red' | 'yellow' | 'blue' | 'cyan' | 'magenta' | 'gray'
|
|
55
|
-
): void {
|
|
56
|
-
addLog(React.createElement(Text, { color }, message));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Log bold text
|
|
61
|
-
*/
|
|
62
|
-
logBold(message: string, color?: 'green' | 'red' | 'yellow' | 'blue' | 'cyan' | 'magenta'): void {
|
|
63
|
-
addLog(React.createElement(Text, { bold: true, color }, message));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Log a separator line
|
|
68
|
-
*/
|
|
69
|
-
logSeparator(): void {
|
|
70
|
-
addLog(React.createElement(Text, { color: 'gray' }, '─'.repeat(50)));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Log an empty line
|
|
75
|
-
*/
|
|
76
|
-
logNewLine(): void {
|
|
77
|
-
addLog(React.createElement(EmptyLineLog));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Log a section header
|
|
82
|
-
*/
|
|
83
|
-
logHeader(message: string): void {
|
|
84
|
-
this.logNewLine();
|
|
85
|
-
addLog(React.createElement(Text, { bold: true, color: 'cyan' }, message));
|
|
86
|
-
this.logNewLine();
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Highlight text (typically numbers) with yellow color
|
|
91
|
-
* Note: Returns styled text string for embedding in messages
|
|
92
|
-
*/
|
|
93
|
-
highlight(text: string): string {
|
|
94
|
-
return chalk.yellow(text);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Spinner implementation for ink-based logging
|
|
100
|
-
* Note: In ink/React rendering model, spinners are added as logs
|
|
101
|
-
* and don't need explicit start/stop/succeed/fail methods
|
|
102
|
-
*/
|
|
103
|
-
class InkSpinner implements LoggerSpinner {
|
|
104
|
-
start(): void {
|
|
105
|
-
// No-op: spinner already added to log stream
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
stop(): void {
|
|
109
|
-
// No-op: will be replaced by next log
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
succeed(message?: string): void {
|
|
113
|
-
if (message) {
|
|
114
|
-
addLog(React.createElement(SuccessLog, { message }));
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
fail(message?: string): void {
|
|
119
|
-
if (message) {
|
|
120
|
-
addLog(React.createElement(ErrorLog, { message }));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
package/src/utils/index.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { LoggerSpinner } from '../types/index.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Logger interface for CLI output
|
|
5
|
-
* Provides rich colored output capabilities
|
|
6
|
-
*/
|
|
7
|
-
export interface ILogger {
|
|
8
|
-
/**
|
|
9
|
-
* Log info message (blue with ℹ icon)
|
|
10
|
-
*/
|
|
11
|
-
info(message: string): void;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Log success message (green with ✓ icon)
|
|
15
|
-
*/
|
|
16
|
-
success(message: string): void;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Log error message (red with ✗ icon)
|
|
20
|
-
*/
|
|
21
|
-
error(message: string): void;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Log warning message (yellow with ⚠ icon)
|
|
25
|
-
*/
|
|
26
|
-
warn(message: string): void;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Create a spinner for long-running operations
|
|
30
|
-
*/
|
|
31
|
-
spinner(message: string): LoggerSpinner;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Log plain message without formatting
|
|
35
|
-
*/
|
|
36
|
-
log(message: string): void;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Log with custom color
|
|
40
|
-
*/
|
|
41
|
-
logColor(
|
|
42
|
-
message: string,
|
|
43
|
-
color: 'green' | 'red' | 'yellow' | 'blue' | 'cyan' | 'magenta' | 'gray'
|
|
44
|
-
): void;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Log bold text
|
|
48
|
-
*/
|
|
49
|
-
logBold(message: string, color?: 'green' | 'red' | 'yellow' | 'blue' | 'cyan' | 'magenta'): void;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Log a separator line
|
|
53
|
-
*/
|
|
54
|
-
logSeparator(): void;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Log an empty line
|
|
58
|
-
*/
|
|
59
|
-
logNewLine(): void;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Log a section header
|
|
63
|
-
*/
|
|
64
|
-
logHeader(message: string): void;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Highlight text (typically numbers) in a different color
|
|
68
|
-
*/
|
|
69
|
-
highlight?(text: string): string;
|
|
70
|
-
}
|
package/tsconfig.build.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"include": ["src/**/*"],
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"noEmit": false,
|
|
6
|
-
"outDir": "./bin",
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"noUnusedLocals": false,
|
|
9
|
-
"noUnusedParameters": false,
|
|
10
|
-
"sourceMap": false,
|
|
11
|
-
"inlineSourceMap": false,
|
|
12
|
-
"declaration": true,
|
|
13
|
-
"declarationMap": false,
|
|
14
|
-
"inlineSources": false
|
|
15
|
-
},
|
|
16
|
-
"exclude": ["__tests__", "**/__tests__", "**/*.test.ts", "**/*.spec.ts"]
|
|
17
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./bin",
|
|
5
|
-
"baseUrl": "./src",
|
|
6
|
-
"paths": {
|
|
7
|
-
"@/*": ["*"]
|
|
8
|
-
},
|
|
9
|
-
"sourceMap": false,
|
|
10
|
-
"removeComments": true,
|
|
11
|
-
"preserveConstEnums": true,
|
|
12
|
-
"types": ["vitest/globals"],
|
|
13
|
-
"jsx": "react-jsx",
|
|
14
|
-
"jsxImportSource": "react",
|
|
15
|
-
"allowJs": true,
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"verbatimModuleSyntax": false,
|
|
18
|
-
"noImplicitReturns": false
|
|
19
|
-
},
|
|
20
|
-
"include": ["src/**/*.ts", "src/**/*.tsx", "__tests__/**/*.ts"]
|
|
21
|
-
}
|