@auto-engineer/server-checks 0.1.4 → 0.8.1
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 +11 -0
- package/dist/commands/check-lint.d.ts +13 -18
- package/dist/commands/check-lint.d.ts.map +1 -1
- package/dist/commands/check-lint.js +92 -83
- package/dist/commands/check-lint.js.map +1 -1
- package/dist/commands/check-tests.d.ts +12 -18
- package/dist/commands/check-tests.d.ts.map +1 -1
- package/dist/commands/check-tests.js +61 -51
- package/dist/commands/check-tests.js.map +1 -1
- package/dist/commands/check-types.d.ts +12 -18
- package/dist/commands/check-types.d.ts.map +1 -1
- package/dist/commands/check-types.js +54 -44
- package/dist/commands/check-types.js.map +1 -1
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/dist/cli-manifest.d.ts +0 -3
- package/dist/cli-manifest.d.ts.map +0 -1
- package/dist/cli-manifest.js +0 -39
- package/dist/cli-manifest.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const checkLintManifest: {
|
|
3
|
-
handler: () => Promise<typeof import("./check-lint")>;
|
|
4
|
-
description: string;
|
|
5
|
-
usage: string;
|
|
6
|
-
examples: string[];
|
|
7
|
-
args: {
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
required: boolean;
|
|
11
|
-
}[];
|
|
12
|
-
options: {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
1
|
+
import { type Command, type Event } from '@auto-engineer/message-bus';
|
|
17
2
|
export type CheckLintCommand = Command<'CheckLint', {
|
|
18
3
|
targetDirectory: string;
|
|
19
4
|
scope?: 'slice' | 'project';
|
|
@@ -31,6 +16,16 @@ export type LintCheckFailedEvent = Event<'LintCheckFailed', {
|
|
|
31
16
|
errorCount: number;
|
|
32
17
|
warningCount: number;
|
|
33
18
|
}>;
|
|
34
|
-
export declare const
|
|
35
|
-
|
|
19
|
+
export declare const commandHandler: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
20
|
+
type: "CheckLint";
|
|
21
|
+
data: Readonly<{
|
|
22
|
+
targetDirectory: string;
|
|
23
|
+
scope?: "slice" | "project";
|
|
24
|
+
fix?: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
timestamp?: Date;
|
|
27
|
+
requestId?: string;
|
|
28
|
+
correlationId?: string;
|
|
29
|
+
}>>;
|
|
30
|
+
export default commandHandler;
|
|
36
31
|
//# sourceMappingURL=check-lint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-lint.d.ts","sourceRoot":"","sources":["../../src/commands/check-lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"check-lint.d.ts","sourceRoot":"","sources":["../../src/commands/check-lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAwB,MAAM,4BAA4B,CAAC;AAY5F,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACpC,WAAW,EACX;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CACF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,KAAK,CACtC,iBAAiB,EACjB;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CACF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,KAAK,CACtC,iBAAiB,EACjB;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CACF,CAAC;AAEF,eAAO,MAAM,cAAc;;;yBA1BN,MAAM;gBACf,OAAO,GAAG,SAAS;cACrB,OAAO;;;;;GAmNf,CAAC;AAiFH,eAAe,cAAc,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineCommandHandler } from '@auto-engineer/message-bus';
|
|
1
2
|
import path from 'path';
|
|
2
3
|
import { execa } from 'execa';
|
|
3
4
|
import fg from 'fast-glob';
|
|
@@ -7,88 +8,27 @@ const debug = createDebug('server-checks:lint');
|
|
|
7
8
|
const debugHandler = createDebug('server-checks:lint:handler');
|
|
8
9
|
const debugProcess = createDebug('server-checks:lint:process');
|
|
9
10
|
const debugResult = createDebug('server-checks:lint:result');
|
|
10
|
-
export const
|
|
11
|
-
handler: () => import('./check-lint.js'),
|
|
12
|
-
description: 'ESLint with optional auto-fix',
|
|
13
|
-
usage: 'check:lint <directory> [--fix]',
|
|
14
|
-
examples: ['$ auto check:lint ./server', '$ auto check:lint ./server --fix'],
|
|
15
|
-
args: [{ name: 'directory', description: 'Directory to lint', required: true }],
|
|
16
|
-
options: [
|
|
17
|
-
{ name: '--fix', description: 'Automatically fix linting issues' },
|
|
18
|
-
{ name: '--scope <scope>', description: 'Lint scope: slice (default) or project' },
|
|
19
|
-
],
|
|
20
|
-
};
|
|
21
|
-
async function findProjectRoot(startDir) {
|
|
22
|
-
let dir = startDir;
|
|
23
|
-
while (dir !== path.dirname(dir)) {
|
|
24
|
-
try {
|
|
25
|
-
await access(path.join(dir, 'package.json'));
|
|
26
|
-
return dir;
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
dir = path.dirname(dir);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
throw new Error('Could not find project root (no package.json found)');
|
|
33
|
-
}
|
|
34
|
-
function parseFilesWithIssues(output) {
|
|
35
|
-
const filesWithIssues = [];
|
|
36
|
-
const filePattern = /^([^\s].+\.ts)$/gm;
|
|
37
|
-
for (const match of output.matchAll(filePattern)) {
|
|
38
|
-
const filePath = match[1];
|
|
39
|
-
if (!filePath.includes('node_modules')) {
|
|
40
|
-
filesWithIssues.push(filePath);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return [...new Set(filesWithIssues)]; // Remove duplicates
|
|
44
|
-
}
|
|
45
|
-
function parseErrorCounts(output) {
|
|
46
|
-
const summaryMatch = output.match(/✖\s+(\d+)\s+problem[s]?\s+\((\d+)\s+error[s]?,?\s*(\d+)?\s*warning[s]?\)/);
|
|
47
|
-
if (summaryMatch) {
|
|
48
|
-
return {
|
|
49
|
-
errorCount: parseInt(summaryMatch[2], 10),
|
|
50
|
-
warningCount: summaryMatch[3] ? parseInt(summaryMatch[3], 10) : 0,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
// Fallback: count individual errors and warnings
|
|
54
|
-
const errorMatches = output.match(/\berror\b/gi);
|
|
55
|
-
const warningMatches = output.match(/\bwarning\b/gi);
|
|
56
|
-
return {
|
|
57
|
-
errorCount: errorMatches ? errorMatches.length : 0,
|
|
58
|
-
warningCount: warningMatches ? warningMatches.length : 0,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function extractFormattedErrors(output) {
|
|
62
|
-
const errorLines = [];
|
|
63
|
-
const lines = output.split('\n');
|
|
64
|
-
let inFileSection = false;
|
|
65
|
-
for (const line of lines) {
|
|
66
|
-
if (line.match(/^[^\s].+\.ts$/)) {
|
|
67
|
-
inFileSection = true;
|
|
68
|
-
errorLines.push(line);
|
|
69
|
-
}
|
|
70
|
-
else if (inFileSection && line.match(/^\s+\d+:\d+/)) {
|
|
71
|
-
errorLines.push(line);
|
|
72
|
-
}
|
|
73
|
-
else if (line.trim() === '') {
|
|
74
|
-
inFileSection = false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return errorLines.join('\n');
|
|
78
|
-
}
|
|
79
|
-
function parseEslintOutput(output) {
|
|
80
|
-
const filesWithIssues = parseFilesWithIssues(output);
|
|
81
|
-
const { errorCount, warningCount } = parseErrorCounts(output);
|
|
82
|
-
const formattedErrors = extractFormattedErrors(output);
|
|
83
|
-
return {
|
|
84
|
-
filesWithIssues,
|
|
85
|
-
errorCount,
|
|
86
|
-
warningCount,
|
|
87
|
-
formattedErrors,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
export const checkLintCommandHandler = {
|
|
11
|
+
export const commandHandler = defineCommandHandler({
|
|
91
12
|
name: 'CheckLint',
|
|
13
|
+
alias: 'check:lint',
|
|
14
|
+
description: 'ESLint with optional auto-fix',
|
|
15
|
+
category: 'check',
|
|
16
|
+
fields: {
|
|
17
|
+
targetDirectory: {
|
|
18
|
+
description: 'Directory to lint',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
scope: {
|
|
22
|
+
description: 'Lint scope: slice (default) or project',
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
fix: {
|
|
26
|
+
description: 'Automatically fix linting issues',
|
|
27
|
+
required: false,
|
|
28
|
+
flag: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
examples: ['$ auto check:lint --target-directory=./server', '$ auto check:lint --target-directory=./server --fix'],
|
|
92
32
|
// eslint-disable-next-line complexity
|
|
93
33
|
handle: async (command) => {
|
|
94
34
|
debug('CommandHandler executing for CheckLint');
|
|
@@ -226,6 +166,75 @@ export const checkLintCommandHandler = {
|
|
|
226
166
|
};
|
|
227
167
|
}
|
|
228
168
|
},
|
|
229
|
-
};
|
|
230
|
-
|
|
169
|
+
});
|
|
170
|
+
async function findProjectRoot(startDir) {
|
|
171
|
+
let dir = startDir;
|
|
172
|
+
while (dir !== path.dirname(dir)) {
|
|
173
|
+
try {
|
|
174
|
+
await access(path.join(dir, 'package.json'));
|
|
175
|
+
return dir;
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
dir = path.dirname(dir);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
throw new Error('Could not find project root (no package.json found)');
|
|
182
|
+
}
|
|
183
|
+
function parseFilesWithIssues(output) {
|
|
184
|
+
const filesWithIssues = [];
|
|
185
|
+
const filePattern = /^([^\s].+\.ts)$/gm;
|
|
186
|
+
for (const match of output.matchAll(filePattern)) {
|
|
187
|
+
const filePath = match[1];
|
|
188
|
+
if (!filePath.includes('node_modules')) {
|
|
189
|
+
filesWithIssues.push(filePath);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return [...new Set(filesWithIssues)]; // Remove duplicates
|
|
193
|
+
}
|
|
194
|
+
function parseErrorCounts(output) {
|
|
195
|
+
const summaryMatch = output.match(/✖\s+(\d+)\s+problem[s]?\s+\((\d+)\s+error[s]?,?\s*(\d+)?\s*warning[s]?\)/);
|
|
196
|
+
if (summaryMatch) {
|
|
197
|
+
return {
|
|
198
|
+
errorCount: parseInt(summaryMatch[2], 10),
|
|
199
|
+
warningCount: summaryMatch[3] ? parseInt(summaryMatch[3], 10) : 0,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
// Fallback: count individual errors and warnings
|
|
203
|
+
const errorMatches = output.match(/\berror\b/gi);
|
|
204
|
+
const warningMatches = output.match(/\bwarning\b/gi);
|
|
205
|
+
return {
|
|
206
|
+
errorCount: errorMatches ? errorMatches.length : 0,
|
|
207
|
+
warningCount: warningMatches ? warningMatches.length : 0,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function extractFormattedErrors(output) {
|
|
211
|
+
const errorLines = [];
|
|
212
|
+
const lines = output.split('\n');
|
|
213
|
+
let inFileSection = false;
|
|
214
|
+
for (const line of lines) {
|
|
215
|
+
if (line.match(/^[^\s].+\.ts$/)) {
|
|
216
|
+
inFileSection = true;
|
|
217
|
+
errorLines.push(line);
|
|
218
|
+
}
|
|
219
|
+
else if (inFileSection && line.match(/^\s+\d+:\d+/)) {
|
|
220
|
+
errorLines.push(line);
|
|
221
|
+
}
|
|
222
|
+
else if (line.trim() === '') {
|
|
223
|
+
inFileSection = false;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return errorLines.join('\n');
|
|
227
|
+
}
|
|
228
|
+
function parseEslintOutput(output) {
|
|
229
|
+
const filesWithIssues = parseFilesWithIssues(output);
|
|
230
|
+
const { errorCount, warningCount } = parseErrorCounts(output);
|
|
231
|
+
const formattedErrors = extractFormattedErrors(output);
|
|
232
|
+
return {
|
|
233
|
+
filesWithIssues,
|
|
234
|
+
errorCount,
|
|
235
|
+
warningCount,
|
|
236
|
+
formattedErrors,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
export default commandHandler;
|
|
231
240
|
//# sourceMappingURL=check-lint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-lint.js","sourceRoot":"","sources":["../../src/commands/check-lint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-lint.js","sourceRoot":"","sources":["../../src/commands/check-lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAChD,MAAM,YAAY,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC;AAC/D,MAAM,YAAY,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC;AAC/D,MAAM,WAAW,GAAG,WAAW,CAAC,2BAA2B,CAAC,CAAC;AA+B7D,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAmB;IACnE,IAAI,EAAE,W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AC;IAE1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;YAChC,aAAa,GAAG,IAAI,CAAC;YACrB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;aAAM,IAAI,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;YACtD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC9B,aAAa,GAAG,KAAK,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IAMvC,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC9D,MAAM,eAAe,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAEvD,OAAO;QACL,eAAe;QACf,UAAU;QACV,YAAY;QACZ,eAAe;KAChB,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const checkTestsManifest: {
|
|
3
|
-
handler: () => Promise<typeof import("./check-tests")>;
|
|
4
|
-
description: string;
|
|
5
|
-
usage: string;
|
|
6
|
-
examples: string[];
|
|
7
|
-
args: {
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
required: boolean;
|
|
11
|
-
}[];
|
|
12
|
-
options: {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
1
|
+
import { type Command, type Event } from '@auto-engineer/message-bus';
|
|
17
2
|
export type CheckTestsCommand = Command<'CheckTests', {
|
|
18
3
|
targetDirectory: string;
|
|
19
4
|
scope?: 'slice' | 'project';
|
|
@@ -30,6 +15,15 @@ export type TestsCheckFailedEvent = Event<'TestsCheckFailed', {
|
|
|
30
15
|
testsRun: number;
|
|
31
16
|
testsFailed: number;
|
|
32
17
|
}>;
|
|
33
|
-
export declare const
|
|
34
|
-
|
|
18
|
+
export declare const commandHandler: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
19
|
+
type: "CheckTests";
|
|
20
|
+
data: Readonly<{
|
|
21
|
+
targetDirectory: string;
|
|
22
|
+
scope?: "slice" | "project";
|
|
23
|
+
}>;
|
|
24
|
+
timestamp?: Date;
|
|
25
|
+
requestId?: string;
|
|
26
|
+
correlationId?: string;
|
|
27
|
+
}>>;
|
|
28
|
+
export default commandHandler;
|
|
35
29
|
//# sourceMappingURL=check-tests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-tests.d.ts","sourceRoot":"","sources":["../../src/commands/check-tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"check-tests.d.ts","sourceRoot":"","sources":["../../src/commands/check-tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAwB,MAAM,4BAA4B,CAAC;AAY5F,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACrC,YAAY,EACZ;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CACF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,KAAK,CACvC,kBAAkB,EAClB;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CACF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,KAAK,CACvC,kBAAkB,EAClB;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CACF,CAAC;AAEF,eAAO,MAAM,cAAc;;;yBAzBN,MAAM;gBACf,OAAO,GAAG,SAAS;;;;;GAiL7B,CAAC;AAoDH,eAAe,cAAc,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineCommandHandler } from '@auto-engineer/message-bus';
|
|
1
2
|
import path from 'path';
|
|
2
3
|
import { execa } from 'execa';
|
|
3
4
|
import fg from 'fast-glob';
|
|
@@ -7,56 +8,25 @@ const debug = createDebug('bacserverkend-checks:tests');
|
|
|
7
8
|
const debugHandler = createDebug('server-checks:tests:handler');
|
|
8
9
|
const debugProcess = createDebug('server-checks:tests:process');
|
|
9
10
|
const debugResult = createDebug('server-checks:tests:result');
|
|
10
|
-
export const
|
|
11
|
-
handler: () => import('./check-tests.js'),
|
|
12
|
-
description: 'Run Vitest test suites',
|
|
13
|
-
usage: 'check:tests <directory>',
|
|
14
|
-
examples: ['$ auto check:tests ./server', '$ auto check:tests ./server --scope project'],
|
|
15
|
-
args: [{ name: 'directory', description: 'Directory containing tests', required: true }],
|
|
16
|
-
options: [{ name: '--scope <scope>', description: 'Test scope: slice (default) or project' }],
|
|
17
|
-
};
|
|
18
|
-
async function findProjectRoot(startDir) {
|
|
19
|
-
let dir = startDir;
|
|
20
|
-
while (dir !== path.dirname(dir)) {
|
|
21
|
-
try {
|
|
22
|
-
await access(path.join(dir, 'package.json'));
|
|
23
|
-
return dir;
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
dir = path.dirname(dir);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
throw new Error('Could not find project root (no package.json found)');
|
|
30
|
-
}
|
|
31
|
-
function parseVitestOutput(output) {
|
|
32
|
-
const failedTests = [];
|
|
33
|
-
let testsRun = 0;
|
|
34
|
-
let testsPassed = 0;
|
|
35
|
-
let testsFailed = 0;
|
|
36
|
-
// Parse test results from output
|
|
37
|
-
const failPattern = /FAIL\s+(.+\.specs?\.ts)/g;
|
|
38
|
-
for (const match of output.matchAll(failPattern)) {
|
|
39
|
-
failedTests.push(match[1]);
|
|
40
|
-
}
|
|
41
|
-
// Try to extract test counts from summary
|
|
42
|
-
const summaryMatch = output.match(/Tests\s+(\d+)\s+passed(?:\s+\|\s+(\d+)\s+failed)?/);
|
|
43
|
-
if (summaryMatch) {
|
|
44
|
-
testsPassed = parseInt(summaryMatch[1], 10);
|
|
45
|
-
testsFailed = summaryMatch[2] ? parseInt(summaryMatch[2], 10) : 0;
|
|
46
|
-
testsRun = testsPassed + testsFailed;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// Fallback: count PASS and FAIL lines
|
|
50
|
-
const passMatches = output.match(/PASS/g);
|
|
51
|
-
const failMatches = output.match(/FAIL/g);
|
|
52
|
-
testsPassed = passMatches ? passMatches.length : 0;
|
|
53
|
-
testsFailed = failMatches ? failMatches.length : 0;
|
|
54
|
-
testsRun = testsPassed + testsFailed;
|
|
55
|
-
}
|
|
56
|
-
return { failedTests, testsRun, testsPassed, testsFailed };
|
|
57
|
-
}
|
|
58
|
-
export const checkTestsCommandHandler = {
|
|
11
|
+
export const commandHandler = defineCommandHandler({
|
|
59
12
|
name: 'CheckTests',
|
|
13
|
+
alias: 'check:tests',
|
|
14
|
+
description: 'Run Vitest test suites',
|
|
15
|
+
category: 'check',
|
|
16
|
+
fields: {
|
|
17
|
+
targetDirectory: {
|
|
18
|
+
description: 'Directory containing tests',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
scope: {
|
|
22
|
+
description: 'Test scope: slice (default) or project',
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
examples: [
|
|
27
|
+
'$ auto check:tests --target-directory=./server',
|
|
28
|
+
'$ auto check:tests --target-directory=./server --scope=project',
|
|
29
|
+
],
|
|
60
30
|
// eslint-disable-next-line complexity
|
|
61
31
|
handle: async (command) => {
|
|
62
32
|
debug('CommandHandler executing for CheckTests');
|
|
@@ -172,7 +142,47 @@ export const checkTestsCommandHandler = {
|
|
|
172
142
|
};
|
|
173
143
|
}
|
|
174
144
|
},
|
|
175
|
-
};
|
|
145
|
+
});
|
|
146
|
+
async function findProjectRoot(startDir) {
|
|
147
|
+
let dir = startDir;
|
|
148
|
+
while (dir !== path.dirname(dir)) {
|
|
149
|
+
try {
|
|
150
|
+
await access(path.join(dir, 'package.json'));
|
|
151
|
+
return dir;
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
dir = path.dirname(dir);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
throw new Error('Could not find project root (no package.json found)');
|
|
158
|
+
}
|
|
159
|
+
function parseVitestOutput(output) {
|
|
160
|
+
const failedTests = [];
|
|
161
|
+
let testsRun = 0;
|
|
162
|
+
let testsPassed = 0;
|
|
163
|
+
let testsFailed = 0;
|
|
164
|
+
// Parse test results from output
|
|
165
|
+
const failPattern = /FAIL\s+(.+\.specs?\.ts)/g;
|
|
166
|
+
for (const match of output.matchAll(failPattern)) {
|
|
167
|
+
failedTests.push(match[1]);
|
|
168
|
+
}
|
|
169
|
+
// Try to extract test counts from summary
|
|
170
|
+
const summaryMatch = output.match(/Tests\s+(\d+)\s+passed(?:\s+\|\s+(\d+)\s+failed)?/);
|
|
171
|
+
if (summaryMatch) {
|
|
172
|
+
testsPassed = parseInt(summaryMatch[1], 10);
|
|
173
|
+
testsFailed = summaryMatch[2] ? parseInt(summaryMatch[2], 10) : 0;
|
|
174
|
+
testsRun = testsPassed + testsFailed;
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
// Fallback: count PASS and FAIL lines
|
|
178
|
+
const passMatches = output.match(/PASS/g);
|
|
179
|
+
const failMatches = output.match(/FAIL/g);
|
|
180
|
+
testsPassed = passMatches ? passMatches.length : 0;
|
|
181
|
+
testsFailed = failMatches ? failMatches.length : 0;
|
|
182
|
+
testsRun = testsPassed + testsFailed;
|
|
183
|
+
}
|
|
184
|
+
return { failedTests, testsRun, testsPassed, testsFailed };
|
|
185
|
+
}
|
|
176
186
|
// Default export for CLI usage - just export the handler
|
|
177
|
-
export default
|
|
187
|
+
export default commandHandler;
|
|
178
188
|
//# sourceMappingURL=check-tests.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-tests.js","sourceRoot":"","sources":["../../src/commands/check-tests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-tests.js","sourceRoot":"","sources":["../../src/commands/check-tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC;AACxD,MAAM,YAAY,GAAG,WAAW,CAAC,6BAA6B,CAAC,CAAC;AAChE,MAAM,YAAY,GAAG,WAAW,CAAC,6BAA6B,CAAC,CAAC;AAChE,MAAM,WAAW,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC;AA8B9D,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAoB;IACpE,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,wBAAwB;IACrC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,eAAe,EAAE;YACf,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,IAAI;SACf;QACD,KA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AAyD;AACzD,eAAe,cAAc,CAAC"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const checkTypesManifest: {
|
|
3
|
-
handler: () => Promise<typeof import("./check-types")>;
|
|
4
|
-
description: string;
|
|
5
|
-
usage: string;
|
|
6
|
-
examples: string[];
|
|
7
|
-
args: {
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
required: boolean;
|
|
11
|
-
}[];
|
|
12
|
-
options: {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
1
|
+
import { type Command, type Event } from '@auto-engineer/message-bus';
|
|
17
2
|
export type CheckTypesCommand = Command<'CheckTypes', {
|
|
18
3
|
targetDirectory: string;
|
|
19
4
|
scope?: 'slice' | 'project';
|
|
@@ -27,6 +12,15 @@ export type TypeCheckFailedEvent = Event<'TypeCheckFailed', {
|
|
|
27
12
|
errors: string;
|
|
28
13
|
failedFiles: string[];
|
|
29
14
|
}>;
|
|
30
|
-
export declare const
|
|
31
|
-
|
|
15
|
+
export declare const commandHandler: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
16
|
+
type: "CheckTypes";
|
|
17
|
+
data: Readonly<{
|
|
18
|
+
targetDirectory: string;
|
|
19
|
+
scope?: "slice" | "project";
|
|
20
|
+
}>;
|
|
21
|
+
timestamp?: Date;
|
|
22
|
+
requestId?: string;
|
|
23
|
+
correlationId?: string;
|
|
24
|
+
}>>;
|
|
25
|
+
export default commandHandler;
|
|
32
26
|
//# sourceMappingURL=check-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-types.d.ts","sourceRoot":"","sources":["../../src/commands/check-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"check-types.d.ts","sourceRoot":"","sources":["../../src/commands/check-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAwB,MAAM,4BAA4B,CAAC;AAY5F,MAAM,MAAM,iBAAiB,GAAG,OAAO,CACrC,YAAY,EACZ;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CACF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,KAAK,CACtC,iBAAiB,EACjB;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB,CACF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,KAAK,CACtC,iBAAiB,EACjB;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CACF,CAAC;AAEF,eAAO,MAAM,cAAc;;;yBAtBN,MAAM;gBACf,OAAO,GAAG,SAAS;;;;;GA8K7B,CAAC;AA0CH,eAAe,cAAc,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineCommandHandler } from '@auto-engineer/message-bus';
|
|
1
2
|
import path from 'path';
|
|
2
3
|
import { execa } from 'execa';
|
|
3
4
|
import fg from 'fast-glob';
|
|
@@ -7,49 +8,25 @@ const debug = createDebug('server-checks:types');
|
|
|
7
8
|
const debugHandler = createDebug('server-checks:types:handler');
|
|
8
9
|
const debugProcess = createDebug('server-checks:types:process');
|
|
9
10
|
const debugResult = createDebug('server-checks:types:result');
|
|
10
|
-
export const
|
|
11
|
-
handler: () => import('./check-types.js'),
|
|
12
|
-
description: 'TypeScript type checking',
|
|
13
|
-
usage: 'check:types <directory>',
|
|
14
|
-
examples: ['$ auto check:types ./server', '$ auto check:types ./server --scope project'],
|
|
15
|
-
args: [{ name: 'directory', description: 'Directory to check', required: true }],
|
|
16
|
-
options: [{ name: '--scope <scope>', description: 'Check scope: slice (default) or project' }],
|
|
17
|
-
};
|
|
18
|
-
async function findProjectRoot(startDir) {
|
|
19
|
-
let dir = startDir;
|
|
20
|
-
while (dir !== path.dirname(dir)) {
|
|
21
|
-
try {
|
|
22
|
-
await access(path.join(dir, 'package.json'));
|
|
23
|
-
await access(path.join(dir, 'tsconfig.json'));
|
|
24
|
-
return dir;
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
dir = path.dirname(dir);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
throw new Error('Could not find project root (no package.json or tsconfig.json found)');
|
|
31
|
-
}
|
|
32
|
-
function extractFailedFiles(output, rootDir, targetDir) {
|
|
33
|
-
const failedFiles = new Set();
|
|
34
|
-
const patterns = [
|
|
35
|
-
/^([^:]+\.ts)\(\d+,\d+\): error/gm,
|
|
36
|
-
/error TS\d+: .+ '([^']+\.ts)'/gm,
|
|
37
|
-
/^([^:]+\.ts):\d+:\d+ - error/gm,
|
|
38
|
-
];
|
|
39
|
-
for (const pattern of patterns) {
|
|
40
|
-
for (const match of output.matchAll(pattern)) {
|
|
41
|
-
const filePath = match[1] ? path.resolve(rootDir, match[1]) : '';
|
|
42
|
-
const notNodeModules = !filePath.includes('node_modules');
|
|
43
|
-
const inTarget = targetDir === undefined || filePath.startsWith(targetDir);
|
|
44
|
-
if (notNodeModules && inTarget) {
|
|
45
|
-
failedFiles.add(filePath);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return Array.from(failedFiles);
|
|
50
|
-
}
|
|
51
|
-
export const checkTypesCommandHandler = {
|
|
11
|
+
export const commandHandler = defineCommandHandler({
|
|
52
12
|
name: 'CheckTypes',
|
|
13
|
+
alias: 'check:types',
|
|
14
|
+
description: 'TypeScript type checking',
|
|
15
|
+
category: 'check',
|
|
16
|
+
fields: {
|
|
17
|
+
targetDirectory: {
|
|
18
|
+
description: 'Directory to check',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
scope: {
|
|
22
|
+
description: 'Check scope: slice (default) or project',
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
examples: [
|
|
27
|
+
'$ auto check:types --target-directory=./server',
|
|
28
|
+
'$ auto check:types --target-directory=./server --scope=project',
|
|
29
|
+
],
|
|
53
30
|
// eslint-disable-next-line complexity
|
|
54
31
|
handle: async (command) => {
|
|
55
32
|
debug('CommandHandler executing for CheckTypes');
|
|
@@ -168,7 +145,40 @@ export const checkTypesCommandHandler = {
|
|
|
168
145
|
};
|
|
169
146
|
}
|
|
170
147
|
},
|
|
171
|
-
};
|
|
148
|
+
});
|
|
149
|
+
async function findProjectRoot(startDir) {
|
|
150
|
+
let dir = startDir;
|
|
151
|
+
while (dir !== path.dirname(dir)) {
|
|
152
|
+
try {
|
|
153
|
+
await access(path.join(dir, 'package.json'));
|
|
154
|
+
await access(path.join(dir, 'tsconfig.json'));
|
|
155
|
+
return dir;
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
dir = path.dirname(dir);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
throw new Error('Could not find project root (no package.json or tsconfig.json found)');
|
|
162
|
+
}
|
|
163
|
+
function extractFailedFiles(output, rootDir, targetDir) {
|
|
164
|
+
const failedFiles = new Set();
|
|
165
|
+
const patterns = [
|
|
166
|
+
/^([^:]+\.ts)\(\d+,\d+\): error/gm,
|
|
167
|
+
/error TS\d+: .+ '([^']+\.ts)'/gm,
|
|
168
|
+
/^([^:]+\.ts):\d+:\d+ - error/gm,
|
|
169
|
+
];
|
|
170
|
+
for (const pattern of patterns) {
|
|
171
|
+
for (const match of output.matchAll(pattern)) {
|
|
172
|
+
const filePath = match[1] ? path.resolve(rootDir, match[1]) : '';
|
|
173
|
+
const notNodeModules = !filePath.includes('node_modules');
|
|
174
|
+
const inTarget = targetDir === undefined || filePath.startsWith(targetDir);
|
|
175
|
+
if (notNodeModules && inTarget) {
|
|
176
|
+
failedFiles.add(filePath);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return Array.from(failedFiles);
|
|
181
|
+
}
|
|
172
182
|
// Default export for CLI usage - just export the handler
|
|
173
|
-
export default
|
|
183
|
+
export default commandHandler;
|
|
174
184
|
//# sourceMappingURL=check-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-types.js","sourceRoot":"","sources":["../../src/commands/check-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-types.js","sourceRoot":"","sources":["../../src/commands/check-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;AACjD,MAAM,YAAY,GAAG,WAAW,CAAC,6BAA6B,CAAC,CAAC;AAChE,MAAM,YAAY,GAAG,WAAW,CAAC,6BAA6B,CAAC,CAAC;AAChE,MAAM,WAAW,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC;AA2B9D,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAoB;IACpE,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,0BAA0B;IACvC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,eAAe,EAAE;YACf,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE;YACL,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,QAAQ,EAAE;QACR,gDAAgD;QAChD,gEAAgE;KACjE;IACD,sCAAsC;IACtC,MAAM,EAAE,KAAK,EAAE,OAA0B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ifiedCommandHandler<Readonly<{
|
|
2
|
+
type: "CheckTypes";
|
|
3
|
+
data: Readonly<{
|
|
4
|
+
targetDirectory: string;
|
|
5
|
+
scope?: "slice" | "project";
|
|
6
|
+
}>;
|
|
7
|
+
timestamp?: Date;
|
|
8
|
+
requestId?: string;
|
|
9
|
+
correlationId?: string;
|
|
10
|
+
}>>[];
|
|
11
|
+
export { commandHandler as checkTypesCommandHandler, type CheckTypesCommand, type TypeCheckPassedEvent, type TypeCheckFailedEvent, } from './commands/check-types';
|
|
12
|
+
export { commandHandler as checkTestsCommandHandler, type CheckTestsCommand, type TestsCheckPassedEvent, type TestsCheckFailedEvent, } from './commands/check-tests';
|
|
13
|
+
export { commandHandler as checkLintCommandHandler, type CheckLintCommand, type LintCheckPassedEvent, type LintCheckFailedEvent, } from './commands/check-lint';
|
|
5
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ;;;;;;;;;KAA2D,CAAC;AACjF,OAAO,EACL,cAAc,IAAI,wBAAwB,EAC1C,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,IAAI,wBAAwB,EAC1C,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,IAAI,uBAAuB,EACzC,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
import { commandHandler as checkTypesHandler } from './commands/check-types.js';
|
|
2
|
+
import { commandHandler as checkLintHandler } from './commands/check-lint.js';
|
|
3
|
+
import { commandHandler as checkTestsHandler } from './commands/check-tests.js';
|
|
4
|
+
export const COMMANDS = [checkTypesHandler, checkLintHandler, checkTestsHandler];
|
|
5
|
+
export { commandHandler as checkTypesCommandHandler, } from './commands/check-types.js';
|
|
6
|
+
export { commandHandler as checkTestsCommandHandler, } from './commands/check-tests.js';
|
|
7
|
+
export { commandHandler as checkLintCommandHandler, } from './commands/check-lint.js';
|
|
5
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,cAAc,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE7E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;AACjF,OAAO,EACL,cAAc,IAAI,wBAAwB,GAI3C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,IAAI,wBAAwB,GAI3C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,IAAI,uBAAuB,GAI1C,MAAM,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auto-engineer/server-checks",
|
|
3
|
-
"version": "0.1.4",
|
|
4
3
|
"type": "module",
|
|
5
4
|
"main": "./dist/index.js",
|
|
6
5
|
"types": "./dist/index.d.ts",
|
|
@@ -16,25 +15,26 @@
|
|
|
16
15
|
"CHANGELOG.md"
|
|
17
16
|
],
|
|
18
17
|
"dependencies": {
|
|
19
|
-
"@auto-engineer/message-bus": "^0.5.5",
|
|
20
18
|
"debug": "^4.4.1",
|
|
21
19
|
"execa": "^9.5.2",
|
|
22
|
-
"fast-glob": "^3.3.2"
|
|
20
|
+
"fast-glob": "^3.3.2",
|
|
21
|
+
"@auto-engineer/message-bus": "0.8.1"
|
|
23
22
|
},
|
|
24
23
|
"publishConfig": {
|
|
25
24
|
"access": "public"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@auto-engineer/cli": "
|
|
27
|
+
"@auto-engineer/cli": "0.8.1"
|
|
29
28
|
},
|
|
29
|
+
"version": "0.8.1",
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "tsc && tsx ../../scripts/fix-esm-imports.ts",
|
|
32
32
|
"dev": "tsc --watch",
|
|
33
|
-
"test": "vitest run",
|
|
33
|
+
"test": "vitest run --reporter=dot",
|
|
34
34
|
"lint": "eslint 'src/**/*.ts' --max-warnings 0 --config ../../eslint.config.ts",
|
|
35
35
|
"type-check": "tsc --noEmit",
|
|
36
|
-
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore",
|
|
36
|
+
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
37
37
|
"lint:fix": "eslint 'src/**/*.ts' --fix --config ../../eslint.config.ts",
|
|
38
|
-
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore"
|
|
38
|
+
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn"
|
|
39
39
|
}
|
|
40
40
|
}
|
package/dist/cli-manifest.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-manifest.d.ts","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AA6BrE,eAAO,MAAM,YAAY,EAAE,WAQ1B,CAAC"}
|
package/dist/cli-manifest.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import { checkTypesManifest } from './commands/check-types.js';
|
|
5
|
-
import { checkLintManifest } from './commands/check-lint.js';
|
|
6
|
-
import { checkTestsManifest } from './commands/check-tests.js';
|
|
7
|
-
// Get version from package.json
|
|
8
|
-
const getVersion = () => {
|
|
9
|
-
try {
|
|
10
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
-
const __dirname = path.dirname(__filename);
|
|
12
|
-
// In dev: src/cli-manifest.ts -> ../../package.json
|
|
13
|
-
// In dist: dist/cli-manifest.js -> ../package.json
|
|
14
|
-
const possiblePaths = [
|
|
15
|
-
path.join(__dirname, '..', 'package.json'), // dist build
|
|
16
|
-
path.join(__dirname, '..', '..', 'package.json'), // dev/src
|
|
17
|
-
];
|
|
18
|
-
for (const packageJsonPath of possiblePaths) {
|
|
19
|
-
if (fs.existsSync(packageJsonPath)) {
|
|
20
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
21
|
-
return packageJson.version;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
// Fall through
|
|
27
|
-
}
|
|
28
|
-
return 'unknown';
|
|
29
|
-
};
|
|
30
|
-
export const CLI_MANIFEST = {
|
|
31
|
-
category: '@auto-engineer/server-checks',
|
|
32
|
-
version: getVersion(),
|
|
33
|
-
commands: {
|
|
34
|
-
'check:types': checkTypesManifest,
|
|
35
|
-
'check:lint': checkLintManifest,
|
|
36
|
-
'check:tests': checkTestsManifest,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=cli-manifest.js.map
|
package/dist/cli-manifest.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-manifest.js","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,gCAAgC;AAChC,MAAM,UAAU,GAAG,GAAW,EAAE;IAC9B,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,oDAAoD;QACpD,mDAAmD;QACnD,MAAM,aAAa,GAAG;YACpB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,aAAa;YACzD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,UAAU;SAC7D,CAAC;QAEF,KAAK,MAAM,eAAe,IAAI,aAAa,EAAE,CAAC;YAC5C,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;gBACnC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAwB,CAAC;gBACjG,OAAO,WAAW,CAAC,OAA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