@auto-engineer/server-checks 1.77.0 → 1.79.0
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/CHANGELOG.md +74 -0
- package/dist/src/commands/check-lint.d.ts +4 -0
- package/dist/src/commands/check-lint.d.ts.map +1 -1
- package/dist/src/commands/check-lint.js +29 -185
- package/dist/src/commands/check-lint.js.map +1 -1
- package/dist/src/commands/check-tests.d.ts.map +1 -1
- package/dist/src/commands/check-tests.js +1 -15
- package/dist/src/commands/check-tests.js.map +1 -1
- package/dist/src/commands/check-types.d.ts +4 -0
- package/dist/src/commands/check-types.d.ts.map +1 -1
- package/dist/src/commands/check-types.js +23 -135
- package/dist/src/commands/check-types.js.map +1 -1
- package/dist/src/find-project-root.d.ts +2 -0
- package/dist/src/find-project-root.d.ts.map +1 -0
- package/dist/src/find-project-root.js +16 -0
- package/dist/src/find-project-root.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/run-lint-check.d.ts +18 -0
- package/dist/src/run-lint-check.d.ts.map +1 -0
- package/dist/src/run-lint-check.js +200 -0
- package/dist/src/run-lint-check.js.map +1 -0
- package/dist/src/run-type-check.d.ts +14 -0
- package/dist/src/run-type-check.d.ts.map +1 -0
- package/dist/src/run-type-check.js +70 -0
- package/dist/src/run-type-check.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { access } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
1
|
import { defineCommandHandler } from '@auto-engineer/message-bus';
|
|
4
2
|
import createDebug from 'debug';
|
|
5
|
-
import {
|
|
6
|
-
import fg from 'fast-glob';
|
|
3
|
+
import { runTypeCheck } from '../run-type-check.js';
|
|
7
4
|
const debug = createDebug('auto:server-checks:types');
|
|
8
|
-
const debugHandler = createDebug('auto:server-checks:types:handler');
|
|
9
|
-
const debugProcess = createDebug('auto:server-checks:types:process');
|
|
10
|
-
const debugResult = createDebug('auto:server-checks:types:result');
|
|
11
5
|
export const commandHandler = defineCommandHandler({
|
|
12
6
|
name: 'CheckTypes',
|
|
13
7
|
displayName: 'Check Types',
|
|
@@ -22,7 +16,12 @@ export const commandHandler = defineCommandHandler({
|
|
|
22
16
|
},
|
|
23
17
|
scope: {
|
|
24
18
|
description: 'Check scope: slice (default) or project',
|
|
25
|
-
|
|
19
|
+
},
|
|
20
|
+
project: {
|
|
21
|
+
description: 'tsconfig path (e.g. tsconfig.app.json)',
|
|
22
|
+
},
|
|
23
|
+
files: {
|
|
24
|
+
description: 'Specific file paths to filter errors to',
|
|
26
25
|
},
|
|
27
26
|
},
|
|
28
27
|
examples: [
|
|
@@ -33,103 +32,27 @@ export const commandHandler = defineCommandHandler({
|
|
|
33
32
|
{ name: 'TypeCheckPassed', displayName: 'Type Check Passed' },
|
|
34
33
|
{ name: 'TypeCheckFailed', displayName: 'Type Check Failed' },
|
|
35
34
|
],
|
|
36
|
-
// eslint-disable-next-line complexity
|
|
37
35
|
handle: async (command) => {
|
|
38
36
|
const typedCommand = command;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
debug('Handling CheckTypesCommand');
|
|
42
|
-
debug(' Target directory: %s', targetDirectory);
|
|
43
|
-
debug(' Scope: %s', scope);
|
|
44
|
-
debug(' Request ID: %s', typedCommand.requestId);
|
|
45
|
-
debug(' Correlation ID: %s', typedCommand.correlationId ?? 'none');
|
|
37
|
+
const { targetDirectory, scope, project, files } = typedCommand.data;
|
|
38
|
+
debug('Handling CheckTypesCommand: targetDirectory=%s, scope=%s', targetDirectory, scope);
|
|
46
39
|
try {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
reject: false,
|
|
57
|
-
});
|
|
58
|
-
const output = (result.stdout ?? '') + (result.stderr ?? '');
|
|
59
|
-
if (result.exitCode !== 0 || output.includes('error')) {
|
|
60
|
-
// Filter errors to only those in the target directory if scope is 'slice'
|
|
61
|
-
const failedFiles = extractFailedFiles(output, projectRoot, scope === 'slice' ? targetDir : undefined);
|
|
62
|
-
if (scope === 'slice') {
|
|
63
|
-
// Filter output to only show errors from target directory
|
|
64
|
-
const relativePath = path.relative(projectRoot, targetDir);
|
|
65
|
-
const filteredOutput = output
|
|
66
|
-
.split('\n')
|
|
67
|
-
.filter((line) => {
|
|
68
|
-
const hasError = line.includes('error TS') || line.includes('): error');
|
|
69
|
-
const notNodeModules = !line.includes('node_modules');
|
|
70
|
-
const hasTargetPath = line.includes(relativePath) || line.includes(targetDir);
|
|
71
|
-
return hasError && notNodeModules && hasTargetPath;
|
|
72
|
-
})
|
|
73
|
-
.join('\n');
|
|
74
|
-
if (filteredOutput.trim() === '') {
|
|
75
|
-
// No errors in the target directory specifically
|
|
76
|
-
const files = await fg(['**/*.ts'], { cwd: targetDir });
|
|
77
|
-
debugResult('Type check passed (no errors in target directory)');
|
|
78
|
-
debugResult('Checked files: %d', files.length);
|
|
79
|
-
return {
|
|
80
|
-
type: 'TypeCheckPassed',
|
|
81
|
-
data: {
|
|
82
|
-
targetDirectory,
|
|
83
|
-
checkedFiles: files.length,
|
|
84
|
-
},
|
|
85
|
-
timestamp: new Date(),
|
|
86
|
-
requestId: typedCommand.requestId,
|
|
87
|
-
correlationId: typedCommand.correlationId,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
debugResult('Type check failed');
|
|
91
|
-
debugResult('Failed files: %d', failedFiles.length);
|
|
92
|
-
debugResult('Errors: %s', filteredOutput.substring(0, 500));
|
|
93
|
-
return {
|
|
94
|
-
type: 'TypeCheckFailed',
|
|
95
|
-
data: {
|
|
96
|
-
targetDirectory,
|
|
97
|
-
errors: filteredOutput,
|
|
98
|
-
failedFiles: failedFiles.map((f) => path.relative(targetDir, f)),
|
|
99
|
-
},
|
|
100
|
-
timestamp: new Date(),
|
|
101
|
-
requestId: typedCommand.requestId,
|
|
102
|
-
correlationId: typedCommand.correlationId,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
// Project scope - return all errors
|
|
107
|
-
debugResult('Type check failed (project scope)');
|
|
108
|
-
debugResult('Failed files: %d', failedFiles.length);
|
|
109
|
-
return {
|
|
110
|
-
type: 'TypeCheckFailed',
|
|
111
|
-
data: {
|
|
112
|
-
targetDirectory,
|
|
113
|
-
errors: output,
|
|
114
|
-
failedFiles: failedFiles.map((f) => path.relative(projectRoot, f)),
|
|
115
|
-
},
|
|
116
|
-
timestamp: new Date(),
|
|
117
|
-
requestId: typedCommand.requestId,
|
|
118
|
-
correlationId: typedCommand.correlationId,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
40
|
+
const result = await runTypeCheck({ targetDirectory, scope, project, files });
|
|
41
|
+
if (result.passed) {
|
|
42
|
+
return {
|
|
43
|
+
type: 'TypeCheckPassed',
|
|
44
|
+
data: { targetDirectory, checkedFiles: result.checkedFiles },
|
|
45
|
+
timestamp: new Date(),
|
|
46
|
+
requestId: typedCommand.requestId,
|
|
47
|
+
correlationId: typedCommand.correlationId,
|
|
48
|
+
};
|
|
121
49
|
}
|
|
122
|
-
// Success case
|
|
123
|
-
const files = await fg(['**/*.ts'], {
|
|
124
|
-
cwd: scope === 'slice' ? targetDir : projectRoot,
|
|
125
|
-
});
|
|
126
|
-
debugResult('Type check passed');
|
|
127
|
-
debugResult('Checked files: %d', files.length);
|
|
128
50
|
return {
|
|
129
|
-
type: '
|
|
51
|
+
type: 'TypeCheckFailed',
|
|
130
52
|
data: {
|
|
131
53
|
targetDirectory,
|
|
132
|
-
|
|
54
|
+
errors: result.errors.join('\n'),
|
|
55
|
+
failedFiles: result.failedFiles,
|
|
133
56
|
},
|
|
134
57
|
timestamp: new Date(),
|
|
135
58
|
requestId: typedCommand.requestId,
|
|
@@ -137,13 +60,12 @@ export const commandHandler = defineCommandHandler({
|
|
|
137
60
|
};
|
|
138
61
|
}
|
|
139
62
|
catch (error) {
|
|
140
|
-
debug('ERROR:
|
|
141
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
63
|
+
debug('ERROR: %O', error);
|
|
142
64
|
return {
|
|
143
65
|
type: 'TypeCheckFailed',
|
|
144
66
|
data: {
|
|
145
67
|
targetDirectory,
|
|
146
|
-
errors:
|
|
68
|
+
errors: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
147
69
|
failedFiles: [],
|
|
148
70
|
},
|
|
149
71
|
timestamp: new Date(),
|
|
@@ -153,39 +75,5 @@ export const commandHandler = defineCommandHandler({
|
|
|
153
75
|
}
|
|
154
76
|
},
|
|
155
77
|
});
|
|
156
|
-
async function findProjectRoot(startDir) {
|
|
157
|
-
let dir = startDir;
|
|
158
|
-
while (dir !== path.dirname(dir)) {
|
|
159
|
-
try {
|
|
160
|
-
await access(path.join(dir, 'package.json'));
|
|
161
|
-
await access(path.join(dir, 'tsconfig.json'));
|
|
162
|
-
return dir;
|
|
163
|
-
}
|
|
164
|
-
catch {
|
|
165
|
-
dir = path.dirname(dir);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
throw new Error('Could not find project root (no package.json or tsconfig.json found)');
|
|
169
|
-
}
|
|
170
|
-
function extractFailedFiles(output, rootDir, targetDir) {
|
|
171
|
-
const failedFiles = new Set();
|
|
172
|
-
const patterns = [
|
|
173
|
-
/^([^:]+\.ts)\(\d+,\d+\): error/gm,
|
|
174
|
-
/error TS\d+: .+ '([^']+\.ts)'/gm,
|
|
175
|
-
/^([^:]+\.ts):\d+:\d+ - error/gm,
|
|
176
|
-
];
|
|
177
|
-
for (const pattern of patterns) {
|
|
178
|
-
for (const match of output.matchAll(pattern)) {
|
|
179
|
-
const filePath = match[1] ? path.resolve(rootDir, match[1]) : '';
|
|
180
|
-
const notNodeModules = !filePath.includes('node_modules');
|
|
181
|
-
const inTarget = targetDir === undefined || filePath.startsWith(targetDir);
|
|
182
|
-
if (notNodeModules && inTarget) {
|
|
183
|
-
failedFiles.add(filePath);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return Array.from(failedFiles);
|
|
188
|
-
}
|
|
189
|
-
// Default export for CLI usage - just export the handler
|
|
190
78
|
export default commandHandler;
|
|
191
79
|
//# sourceMappingURL=check-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-types.js","sourceRoot":"","sources":["../../../src/commands/check-types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"check-types.js","sourceRoot":"","sources":["../../../src/commands/check-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,oBAAoB,EAAc,MAAM,4BAA4B,CAAC;AAC5F,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,KAAK,GAAG,WAAW,CAAC,0BAA0B,CAAC,CAAC;AA+BtD,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAGhD;IACA,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,0BAA0B;IACvC,QAAQ,EAAE,OAAO;IACjB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE;QACN,eAAe,EAAE;YACf,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE;YACL,WAAW,EAAE,yCAAyC;SACvD;QACD,OAAO,EAAE;YACP,WAAW,EAAE,wCAAwC;SACtD;QACD,KAAK,EAAE;YACL,WAAW,EAAE,yCAAyC;SACvD;KACF;IACD,QAAQ,EAAE;QACR,gDAAgD;QAChD,gEAAgE;KACjE;IACD,MAAM,EAAE;QACN,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAA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AM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB;oBACzE,WAAW,EAAE,EAAE;iBAChB;gBACD,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,SAAS,EAAE,YAAY,CAAC,SAAS;gBACjC,aAAa,EAAE,YAAY,CAAC,aAAa;aAC1C,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-project-root.d.ts","sourceRoot":"","sources":["../../src/find-project-root.ts"],"names":[],"mappings":"AAGA,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,GAAE,MAAM,EAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBnH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { access } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
export async function findProjectRoot(startDir, requiredFiles = ['package.json']) {
|
|
4
|
+
let dir = startDir;
|
|
5
|
+
while (dir !== path.dirname(dir)) {
|
|
6
|
+
const allExist = await Promise.all(requiredFiles.map((file) => access(path.join(dir, file))
|
|
7
|
+
.then(() => true)
|
|
8
|
+
.catch(() => false)));
|
|
9
|
+
if (allExist.every(Boolean)) {
|
|
10
|
+
return dir;
|
|
11
|
+
}
|
|
12
|
+
dir = path.dirname(dir);
|
|
13
|
+
}
|
|
14
|
+
throw new Error(`Could not find project root (required: ${requiredFiles.join(', ')})`);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=find-project-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-project-root.js","sourceRoot":"","sources":["../../src/find-project-root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,gBAA0B,CAAC,cAAc,CAAC;IAChG,IAAI,GAAG,GAAG,QAAQ,CAAC;IACnB,OAAO,GAAG,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;aACzB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;aAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CACtB,CACF,CAAC;QACF,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,OAAO,GAAG,CAAC;QACb,CAAC;QACD,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,0CAA0C,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzF,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -16,4 +16,7 @@ export { type CheckTestsCommand, type CheckTestsEvents, commandHandler as checkT
|
|
|
16
16
|
export { type CheckTypesCommand, type CheckTypesEvents, commandHandler as checkTypesCommandHandler, type TypeCheckFailedEvent, type TypeCheckPassedEvent, } from './commands/check-types';
|
|
17
17
|
export type AllCheckEvents = CheckTestsEvents | CheckTypesEvents | CheckLintEvents;
|
|
18
18
|
export type AllCheckFailedEvents = TestsCheckFailedEvent | TypeCheckFailedEvent | LintCheckFailedEvent;
|
|
19
|
+
export { findProjectRoot } from './find-project-root';
|
|
20
|
+
export { type LintCheckParams, type LintCheckResult, runLintCheck } from './run-lint-check';
|
|
21
|
+
export { runTypeCheck, type TypeCheckParams, type TypeCheckResult } from './run-type-check';
|
|
19
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGrF,eAAO,MAAM,QAAQ;;;;;;;;;KAA2D,CAAC;AAEjF,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,cAAc,IAAI,uBAAuB,EACzC,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,cAAc,IAAI,wBAAwB,EAC1C,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,cAAc,IAAI,wBAAwB,EAC1C,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AACnF,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG,oBAAoB,GAAG,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGrF,eAAO,MAAM,QAAQ;;;;;;;;;KAA2D,CAAC;AAEjF,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,cAAc,IAAI,uBAAuB,EACzC,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,cAAc,IAAI,wBAAwB,EAC1C,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,cAAc,IAAI,wBAAwB,EAC1C,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AACnF,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAEvG,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -5,4 +5,7 @@ export const COMMANDS = [checkTypesHandler, checkLintHandler, checkTestsHandler]
|
|
|
5
5
|
export { commandHandler as checkLintCommandHandler, } from './commands/check-lint.js';
|
|
6
6
|
export { commandHandler as checkTestsCommandHandler, } from './commands/check-tests.js';
|
|
7
7
|
export { commandHandler as checkTypesCommandHandler, } from './commands/check-types.js';
|
|
8
|
+
export { findProjectRoot } from './find-project-root.js';
|
|
9
|
+
export { runLintCheck } from './run-lint-check.js';
|
|
10
|
+
export { runTypeCheck } from './run-type-check.js';
|
|
8
11
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE7E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;AAEjF,OAAO,EAGL,cAAc,IAAI,uBAAuB,GAG1C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,cAAc,IAAI,wBAAwB,GAG3C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,cAAc,IAAI,wBAAwB,GAG3C,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE7E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;AAEjF,OAAO,EAGL,cAAc,IAAI,uBAAuB,GAG1C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,cAAc,IAAI,wBAAwB,GAG3C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,cAAc,IAAI,wBAAwB,GAG3C,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAA8C,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAA8C,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface LintCheckParams {
|
|
2
|
+
targetDirectory: string;
|
|
3
|
+
scope?: 'slice' | 'project';
|
|
4
|
+
linter?: 'eslint' | 'biome';
|
|
5
|
+
fix?: boolean;
|
|
6
|
+
files?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface LintCheckResult {
|
|
9
|
+
passed: boolean;
|
|
10
|
+
errors: string;
|
|
11
|
+
filesWithIssues: string[];
|
|
12
|
+
errorCount: number;
|
|
13
|
+
warningCount: number;
|
|
14
|
+
filesChecked: number;
|
|
15
|
+
filesFixed?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function runLintCheck(params: LintCheckParams): Promise<LintCheckResult>;
|
|
18
|
+
//# sourceMappingURL=run-lint-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-lint-check.d.ts","sourceRoot":"","sources":["../../src/run-lint-check.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAWpF"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { access } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import createDebug from 'debug';
|
|
4
|
+
import { execa } from 'execa';
|
|
5
|
+
import fg from 'fast-glob';
|
|
6
|
+
import { findProjectRoot } from './find-project-root.js';
|
|
7
|
+
const debug = createDebug('auto:server-checks:run-lint-check');
|
|
8
|
+
export async function runLintCheck(params) {
|
|
9
|
+
const { targetDirectory, scope = 'slice', linter = 'eslint', fix = false, files } = params;
|
|
10
|
+
const targetDir = path.resolve(targetDirectory);
|
|
11
|
+
const projectRoot = await findProjectRoot(targetDir);
|
|
12
|
+
debug('Running lint check: linter=%s, targetDir=%s, scope=%s', linter, targetDir, scope);
|
|
13
|
+
if (linter === 'biome') {
|
|
14
|
+
return runBiome(projectRoot, targetDir, scope, fix, files);
|
|
15
|
+
}
|
|
16
|
+
return runEslint(projectRoot, targetDir, scope, fix, files);
|
|
17
|
+
}
|
|
18
|
+
async function runEslint(projectRoot, targetDir, scope, fix, files) {
|
|
19
|
+
const args = ['eslint'];
|
|
20
|
+
if (files) {
|
|
21
|
+
for (const f of files) {
|
|
22
|
+
args.push(path.relative(projectRoot, f));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else if (scope === 'slice') {
|
|
26
|
+
const relativePath = path.relative(projectRoot, targetDir);
|
|
27
|
+
args.push(`${relativePath}/**/*.ts`);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
args.push('src/**/*.ts');
|
|
31
|
+
}
|
|
32
|
+
args.push('--max-warnings', '0');
|
|
33
|
+
const configPath = path.join(projectRoot, 'eslint.config.ts');
|
|
34
|
+
const hasConfig = await access(configPath)
|
|
35
|
+
.then(() => true)
|
|
36
|
+
.catch(() => false);
|
|
37
|
+
if (hasConfig) {
|
|
38
|
+
args.push('--config', configPath);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
const parentConfig = path.join(projectRoot, '..', '..', 'eslint.config.ts');
|
|
42
|
+
const hasParent = await access(parentConfig)
|
|
43
|
+
.then(() => true)
|
|
44
|
+
.catch(() => false);
|
|
45
|
+
if (hasParent) {
|
|
46
|
+
args.push('--config', parentConfig);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (fix) {
|
|
50
|
+
args.push('--fix');
|
|
51
|
+
}
|
|
52
|
+
const result = await execa('npx', args, { cwd: projectRoot, stdio: 'pipe', reject: false });
|
|
53
|
+
const output = (result.stdout ?? '') + (result.stderr ?? '');
|
|
54
|
+
if (result.exitCode !== 0 && output.includes('error')) {
|
|
55
|
+
const parsed = parseEslintOutput(output);
|
|
56
|
+
return {
|
|
57
|
+
passed: false,
|
|
58
|
+
errors: parsed.formattedErrors || output.substring(0, 1000),
|
|
59
|
+
filesWithIssues: parsed.filesWithIssues,
|
|
60
|
+
errorCount: parsed.errorCount,
|
|
61
|
+
warningCount: parsed.warningCount,
|
|
62
|
+
filesChecked: 0,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const tsFiles = files
|
|
66
|
+
? files
|
|
67
|
+
: await fg(['**/*.ts'], { cwd: scope === 'slice' ? targetDir : projectRoot, absolute: false });
|
|
68
|
+
const successResult = {
|
|
69
|
+
passed: true,
|
|
70
|
+
errors: '',
|
|
71
|
+
filesWithIssues: [],
|
|
72
|
+
errorCount: 0,
|
|
73
|
+
warningCount: 0,
|
|
74
|
+
filesChecked: tsFiles.length,
|
|
75
|
+
};
|
|
76
|
+
if (fix) {
|
|
77
|
+
const fixedMatch = output.match(/(\d+)\s+error[s]?\s+.*potentially fixable/);
|
|
78
|
+
if (fixedMatch) {
|
|
79
|
+
successResult.filesFixed = parseInt(fixedMatch[1], 10);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return successResult;
|
|
83
|
+
}
|
|
84
|
+
async function runBiome(projectRoot, targetDir, scope, fix, files) {
|
|
85
|
+
const args = ['biome', 'lint'];
|
|
86
|
+
if (files) {
|
|
87
|
+
for (const f of files) {
|
|
88
|
+
args.push(path.relative(projectRoot, f));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else if (scope === 'slice') {
|
|
92
|
+
const relativePath = path.relative(projectRoot, targetDir);
|
|
93
|
+
args.push(relativePath);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
args.push('.');
|
|
97
|
+
}
|
|
98
|
+
if (fix) {
|
|
99
|
+
args.push('--write');
|
|
100
|
+
}
|
|
101
|
+
const result = await execa('npx', args, { cwd: projectRoot, stdio: 'pipe', reject: false });
|
|
102
|
+
const output = (result.stdout ?? '') + (result.stderr ?? '');
|
|
103
|
+
if (result.exitCode !== 0) {
|
|
104
|
+
const errors = parseBiomeLintErrors(output);
|
|
105
|
+
return {
|
|
106
|
+
passed: false,
|
|
107
|
+
errors: errors.length > 0 ? errors.join('\n') : output.substring(0, 2000),
|
|
108
|
+
filesWithIssues: extractBiomeFiles(output),
|
|
109
|
+
errorCount: errors.length || 1,
|
|
110
|
+
warningCount: 0,
|
|
111
|
+
filesChecked: 0,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const tsFiles = files
|
|
115
|
+
? files
|
|
116
|
+
: await fg(['**/*.ts'], { cwd: scope === 'slice' ? targetDir : projectRoot, absolute: false });
|
|
117
|
+
return {
|
|
118
|
+
passed: true,
|
|
119
|
+
errors: '',
|
|
120
|
+
filesWithIssues: [],
|
|
121
|
+
errorCount: 0,
|
|
122
|
+
warningCount: 0,
|
|
123
|
+
filesChecked: tsFiles.length,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function parseEslintOutput(output) {
|
|
127
|
+
const filesWithIssues = [];
|
|
128
|
+
const filePattern = /^([^\s].+\.ts)$/gm;
|
|
129
|
+
for (const match of output.matchAll(filePattern)) {
|
|
130
|
+
if (match[1] && !match[1].includes('node_modules')) {
|
|
131
|
+
filesWithIssues.push(match[1]);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const summaryMatch = output.match(/✖\s+(\d+)\s+problem[s]?\s+\((\d+)\s+error[s]?,?\s*(\d+)?\s*warning[s]?\)/);
|
|
135
|
+
let errorCount = 0;
|
|
136
|
+
let warningCount = 0;
|
|
137
|
+
if (summaryMatch) {
|
|
138
|
+
errorCount = parseInt(summaryMatch[2], 10);
|
|
139
|
+
warningCount = summaryMatch[3] ? parseInt(summaryMatch[3], 10) : 0;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
const errorMatches = output.match(/\berror\b/gi);
|
|
143
|
+
const warningMatches = output.match(/\bwarning\b/gi);
|
|
144
|
+
errorCount = errorMatches ? errorMatches.length : 0;
|
|
145
|
+
warningCount = warningMatches ? warningMatches.length : 0;
|
|
146
|
+
}
|
|
147
|
+
const errorLines = [];
|
|
148
|
+
const lines = output.split('\n');
|
|
149
|
+
let inFileSection = false;
|
|
150
|
+
for (const line of lines) {
|
|
151
|
+
if (line.match(/^[^\s].+\.ts$/)) {
|
|
152
|
+
inFileSection = true;
|
|
153
|
+
errorLines.push(line);
|
|
154
|
+
}
|
|
155
|
+
else if (inFileSection && line.match(/^\s+\d+:\d+/)) {
|
|
156
|
+
errorLines.push(line);
|
|
157
|
+
}
|
|
158
|
+
else if (line.trim() === '') {
|
|
159
|
+
inFileSection = false;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
filesWithIssues: [...new Set(filesWithIssues)],
|
|
164
|
+
errorCount,
|
|
165
|
+
warningCount,
|
|
166
|
+
formattedErrors: errorLines.join('\n'),
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function parseBiomeLintErrors(output) {
|
|
170
|
+
const lines = output.split('\n');
|
|
171
|
+
const errors = [];
|
|
172
|
+
let current = '';
|
|
173
|
+
for (const line of lines) {
|
|
174
|
+
if (line.match(/^\s*(×|✖|error|warning)\s/i) || line.match(/^\s*\d+\s*│/)) {
|
|
175
|
+
current += (current ? '\n' : '') + line;
|
|
176
|
+
}
|
|
177
|
+
else if (current && line.trim() === '') {
|
|
178
|
+
errors.push(current.trim());
|
|
179
|
+
current = '';
|
|
180
|
+
}
|
|
181
|
+
else if (current) {
|
|
182
|
+
current += '\n' + line;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (current) {
|
|
186
|
+
errors.push(current.trim());
|
|
187
|
+
}
|
|
188
|
+
return errors.length > 0 ? errors : output.trim().length > 0 ? [output.trim().slice(0, 2000)] : [];
|
|
189
|
+
}
|
|
190
|
+
function extractBiomeFiles(output) {
|
|
191
|
+
const files = new Set();
|
|
192
|
+
const pattern = /([^\s]+\.tsx?)/g;
|
|
193
|
+
for (const match of output.matchAll(pattern)) {
|
|
194
|
+
if (match[1] && !match[1].includes('node_modules')) {
|
|
195
|
+
files.add(match[1]);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return Array.from(files);
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=run-lint-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-lint-check.js","sourceRoot":"","sources":["../../src/run-lint-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,KAAK,GAAG,WAAW,CAAC,mCAAmC,CAAC,CAAC;AAoB/D,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAuB;IACxD,MAA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C,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YACnD,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface TypeCheckParams {
|
|
2
|
+
targetDirectory: string;
|
|
3
|
+
scope?: 'slice' | 'project';
|
|
4
|
+
files?: string[];
|
|
5
|
+
project?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TypeCheckResult {
|
|
8
|
+
passed: boolean;
|
|
9
|
+
errors: string[];
|
|
10
|
+
failedFiles: string[];
|
|
11
|
+
checkedFiles: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function runTypeCheck(params: TypeCheckParams): Promise<TypeCheckResult>;
|
|
14
|
+
//# sourceMappingURL=run-type-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-type-check.d.ts","sourceRoot":"","sources":["../../src/run-type-check.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA4CpF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import createDebug from 'debug';
|
|
3
|
+
import { execa } from 'execa';
|
|
4
|
+
import fg from 'fast-glob';
|
|
5
|
+
import { findProjectRoot } from './find-project-root.js';
|
|
6
|
+
const debug = createDebug('auto:server-checks:run-type-check');
|
|
7
|
+
export async function runTypeCheck(params) {
|
|
8
|
+
const { targetDirectory, scope = 'slice', files, project } = params;
|
|
9
|
+
const targetDir = path.resolve(targetDirectory);
|
|
10
|
+
const projectRoot = await findProjectRoot(targetDir, ['package.json', 'tsconfig.json']);
|
|
11
|
+
debug('Running type check: targetDir=%s, projectRoot=%s, scope=%s', targetDir, projectRoot, scope);
|
|
12
|
+
const args = ['tsc', '--noEmit'];
|
|
13
|
+
if (project) {
|
|
14
|
+
args.push('-p', project);
|
|
15
|
+
}
|
|
16
|
+
const result = await execa('npx', args, {
|
|
17
|
+
cwd: projectRoot,
|
|
18
|
+
stdio: 'pipe',
|
|
19
|
+
reject: false,
|
|
20
|
+
});
|
|
21
|
+
const output = (result.stdout ?? '') + (result.stderr ?? '');
|
|
22
|
+
if (result.exitCode === 0 && !output.includes('error')) {
|
|
23
|
+
const countDir = scope === 'slice' && !files ? targetDir : projectRoot;
|
|
24
|
+
const tsFiles = await fg(['**/*.ts'], { cwd: countDir });
|
|
25
|
+
return { passed: true, errors: [], failedFiles: [], checkedFiles: tsFiles.length };
|
|
26
|
+
}
|
|
27
|
+
const lines = output.split('\n');
|
|
28
|
+
const errorLines = lines.filter((line) => {
|
|
29
|
+
const isError = line.includes('error TS') || line.includes('): error');
|
|
30
|
+
const notNodeModules = !line.includes('node_modules');
|
|
31
|
+
return isError && notNodeModules;
|
|
32
|
+
});
|
|
33
|
+
const filtered = filterErrors(errorLines, projectRoot, targetDir, scope, files);
|
|
34
|
+
if (filtered.length === 0) {
|
|
35
|
+
const countDir = scope === 'slice' && !files ? targetDir : projectRoot;
|
|
36
|
+
const tsFiles = await fg(['**/*.ts'], { cwd: countDir });
|
|
37
|
+
return { passed: true, errors: [], failedFiles: [], checkedFiles: tsFiles.length };
|
|
38
|
+
}
|
|
39
|
+
const failedFiles = extractFailedFiles(filtered, projectRoot, targetDir, files);
|
|
40
|
+
return { passed: false, errors: filtered, failedFiles, checkedFiles: 0 };
|
|
41
|
+
}
|
|
42
|
+
function filterErrors(errorLines, projectRoot, targetDir, scope, files) {
|
|
43
|
+
if (files) {
|
|
44
|
+
const relativePaths = files.map((f) => path.relative(projectRoot, f));
|
|
45
|
+
return errorLines.filter((line) => relativePaths.some((rp) => line.includes(rp)));
|
|
46
|
+
}
|
|
47
|
+
if (scope === 'project') {
|
|
48
|
+
return errorLines;
|
|
49
|
+
}
|
|
50
|
+
const relativePath = path.relative(projectRoot, targetDir);
|
|
51
|
+
return errorLines.filter((line) => line.includes(relativePath) || line.includes(targetDir));
|
|
52
|
+
}
|
|
53
|
+
function extractFailedFiles(errorLines, projectRoot, targetDir, files) {
|
|
54
|
+
const failedFiles = new Set();
|
|
55
|
+
const patterns = [/^([^:(]+\.ts)\(\d+,\d+\): error/gm, /^([^:(]+\.ts):\d+:\d+ - error/gm];
|
|
56
|
+
const combined = errorLines.join('\n');
|
|
57
|
+
for (const pattern of patterns) {
|
|
58
|
+
for (const match of combined.matchAll(pattern)) {
|
|
59
|
+
if (match[1]) {
|
|
60
|
+
failedFiles.add(match[1]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const baseDir = files ? projectRoot : targetDir;
|
|
65
|
+
return Array.from(failedFiles).map((f) => {
|
|
66
|
+
const abs = path.resolve(projectRoot, f);
|
|
67
|
+
return path.relative(baseDir, abs);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=run-type-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-type-check.js","sourceRoot":"","sources":["../../src/run-type-check.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CA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