@auto-engineer/frontend-checks 0.4.8 → 0.6.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 +22 -0
- package/README.md +371 -0
- package/dist/cli-manifest.d.ts +3 -0
- package/dist/cli-manifest.d.ts.map +1 -0
- package/dist/cli-manifest.js +8 -0
- package/dist/cli-manifest.js.map +1 -0
- package/dist/commands/check-client.d.ts +26 -1
- package/dist/commands/check-client.d.ts.map +1 -1
- package/dist/commands/check-client.js +29 -28
- package/dist/commands/check-client.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -6
- package/dist/cli/check-client.d.ts +0 -3
- package/dist/cli/check-client.d.ts.map +0 -1
- package/dist/cli/check-client.js +0 -42
- package/dist/cli/check-client.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @auto-engineer/frontend-checks
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Major overhaul of the plugin system
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @auto-engineer/message-bus@0.5.0
|
|
13
|
+
|
|
14
|
+
## 0.5.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- • All cli commands now use commands and emit events on the bus
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @auto-engineer/message-bus@0.4.0
|
|
24
|
+
|
|
3
25
|
## 0.4.8
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
# @auto-engineer/frontend-checks
|
|
2
|
+
|
|
3
|
+
Frontend validation and quality assurance plugin for the Auto Engineer CLI. This plugin provides testing and validation for React applications, ensuring code quality, performance, and user experience standards are met.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
This is a plugin for the Auto Engineer CLI. Install both the CLI and this plugin:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @auto-engineer/cli
|
|
11
|
+
npm install @auto-engineer/frontend-checks
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Configuration
|
|
15
|
+
|
|
16
|
+
Add this plugin to your `auto.config.ts`:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
export default {
|
|
20
|
+
plugins: [
|
|
21
|
+
'@auto-engineer/frontend-checks',
|
|
22
|
+
// ... other plugins
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
|
|
29
|
+
This plugin provides the following commands:
|
|
30
|
+
|
|
31
|
+
- `check:client` - Check the client code for issues
|
|
32
|
+
|
|
33
|
+
## What does this plugin do?
|
|
34
|
+
|
|
35
|
+
The Frontend Checks plugin performs validation of React applications, including unit testing, integration testing, accessibility auditing, performance analysis, and code quality checks. It ensures that frontend applications meet standards.
|
|
36
|
+
|
|
37
|
+
## Key Features
|
|
38
|
+
|
|
39
|
+
### Testing
|
|
40
|
+
|
|
41
|
+
- Unit Testing: Component-level testing with React Testing Library
|
|
42
|
+
- Integration Testing: Page and feature-level testing
|
|
43
|
+
- End-to-End Testing: User workflow validation with Playwright
|
|
44
|
+
- Visual Regression Testing: UI consistency checks across changes
|
|
45
|
+
|
|
46
|
+
### Code Quality Assurance
|
|
47
|
+
|
|
48
|
+
- TypeScript Validation: Type safety and compilation checks
|
|
49
|
+
- ESLint Analysis: Code style and best practice enforcement
|
|
50
|
+
- Bundle Analysis: Performance and size optimization checks
|
|
51
|
+
- Accessibility Auditing: WCAG compliance and a11y best practices
|
|
52
|
+
|
|
53
|
+
### Performance Monitoring
|
|
54
|
+
|
|
55
|
+
- Lighthouse Audits: Performance, accessibility, and SEO scoring
|
|
56
|
+
- Core Web Vitals: Loading, interactivity, and visual stability metrics
|
|
57
|
+
- Bundle Size Analysis: JavaScript and CSS optimization recommendations
|
|
58
|
+
- Runtime Performance: Memory usage and rendering optimization
|
|
59
|
+
|
|
60
|
+
### User Experience Validation
|
|
61
|
+
|
|
62
|
+
- Responsive Design Testing: Multi-device and screen size compatibility
|
|
63
|
+
- Cross-Browser Testing: Compatibility across different browsers
|
|
64
|
+
- Accessibility Testing: Screen reader and keyboard navigation support
|
|
65
|
+
- Usability Heuristics: User interface and interaction pattern validation
|
|
66
|
+
|
|
67
|
+
## Testing Infrastructure
|
|
68
|
+
|
|
69
|
+
### Unit and Component Testing
|
|
70
|
+
|
|
71
|
+
Validates individual components and hooks:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
// Example test that would be run by the checker
|
|
75
|
+
describe('ProductCard Component', () => {
|
|
76
|
+
it('renders product information correctly', () => {
|
|
77
|
+
const mockProduct = {
|
|
78
|
+
id: '1',
|
|
79
|
+
name: 'Test Product',
|
|
80
|
+
price: 29.99,
|
|
81
|
+
imageUrl: '/test-image.jpg'
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
render(<ProductCard product={mockProduct} />);
|
|
85
|
+
|
|
86
|
+
expect(screen.getByText('Test Product')).toBeInTheDocument();
|
|
87
|
+
expect(screen.getByText('$29.99')).toBeInTheDocument();
|
|
88
|
+
expect(screen.getByRole('img')).toHaveAttribute('src', '/test-image.jpg');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('handles add to cart interaction', async () => {
|
|
92
|
+
const mockOnAddToCart = vi.fn();
|
|
93
|
+
const mockProduct = createMockProduct();
|
|
94
|
+
|
|
95
|
+
render(<ProductCard product={mockProduct} onAddToCart={mockOnAddToCart} />);
|
|
96
|
+
|
|
97
|
+
const addButton = screen.getByRole('button', { name: /add to cart/i });
|
|
98
|
+
await user.click(addButton);
|
|
99
|
+
|
|
100
|
+
expect(mockOnAddToCart).toHaveBeenCalledWith(mockProduct.id);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Integration Testing
|
|
106
|
+
|
|
107
|
+
Tests complete user workflows:
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// Example integration test
|
|
111
|
+
describe('Product Purchase Flow', () => {
|
|
112
|
+
it('allows user to complete a purchase', async () => {
|
|
113
|
+
// Mock GraphQL responses
|
|
114
|
+
const mocks = [
|
|
115
|
+
createProductListMock(),
|
|
116
|
+
createAddToCartMock(),
|
|
117
|
+
createCheckoutMock()
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
render(
|
|
121
|
+
<MockedProvider mocks={mocks}>
|
|
122
|
+
<App />
|
|
123
|
+
</MockedProvider>
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
// Navigate to products
|
|
127
|
+
await user.click(screen.getByText('Products'));
|
|
128
|
+
|
|
129
|
+
// Add product to cart
|
|
130
|
+
const addButton = await screen.findByText('Add to Cart');
|
|
131
|
+
await user.click(addButton);
|
|
132
|
+
|
|
133
|
+
// Proceed to checkout
|
|
134
|
+
await user.click(screen.getByText('Checkout'));
|
|
135
|
+
|
|
136
|
+
// Complete purchase
|
|
137
|
+
await user.click(screen.getByText('Complete Order'));
|
|
138
|
+
|
|
139
|
+
// Verify success
|
|
140
|
+
expect(await screen.findByText('Order Confirmed')).toBeInTheDocument();
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### End-to-End Testing
|
|
146
|
+
|
|
147
|
+
Full application testing with Playwright:
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
// Example E2E test
|
|
151
|
+
test('complete user registration and login flow', async ({ page }) => {
|
|
152
|
+
await page.goto('/register');
|
|
153
|
+
|
|
154
|
+
// Fill registration form
|
|
155
|
+
await page.fill('[data-testid=name-input]', 'John Doe');
|
|
156
|
+
await page.fill('[data-testid=email-input]', 'john@example.com');
|
|
157
|
+
await page.fill('[data-testid=password-input]', 'securepassword');
|
|
158
|
+
|
|
159
|
+
// Submit registration
|
|
160
|
+
await page.click('[data-testid=register-button]');
|
|
161
|
+
|
|
162
|
+
// Verify redirect to dashboard
|
|
163
|
+
await expect(page).toHaveURL('/dashboard');
|
|
164
|
+
|
|
165
|
+
// Verify welcome message
|
|
166
|
+
await expect(page.locator('[data-testid=welcome-message]')).toContainText('Welcome, John');
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Quality Checks
|
|
171
|
+
|
|
172
|
+
### Accessibility Auditing
|
|
173
|
+
|
|
174
|
+
A11y validation:
|
|
175
|
+
|
|
176
|
+
- ARIA Compliance: ARIA labels, roles, and properties
|
|
177
|
+
- Keyboard Navigation: Tab order and keyboard accessibility
|
|
178
|
+
- Screen Reader Support: Semantic HTML and assistive technology compatibility
|
|
179
|
+
- Color Contrast: WCAG AA/AAA contrast ratio compliance
|
|
180
|
+
- Focus Management: Focus indicators and logical focus flow
|
|
181
|
+
|
|
182
|
+
### Performance Analysis
|
|
183
|
+
|
|
184
|
+
Performance metrics:
|
|
185
|
+
|
|
186
|
+
- Core Web Vitals:
|
|
187
|
+
- Largest Contentful Paint (LCP) < 2.5s
|
|
188
|
+
- First Input Delay (FID) < 100ms
|
|
189
|
+
- Cumulative Layout Shift (CLS) < 0.1
|
|
190
|
+
- Bundle Size: JavaScript and CSS optimization recommendations
|
|
191
|
+
- Runtime Performance: Component re-render optimization
|
|
192
|
+
- Network Efficiency: Resource loading and caching strategies
|
|
193
|
+
|
|
194
|
+
### Code Quality Standards
|
|
195
|
+
|
|
196
|
+
Best practices:
|
|
197
|
+
|
|
198
|
+
- TypeScript: Type checking and compilation
|
|
199
|
+
- ESLint: Code style, React hooks rules, accessibility rules
|
|
200
|
+
- Prettier: Code formatting
|
|
201
|
+
- Import Organization: Import structure and unused import detection
|
|
202
|
+
- Component Architecture: Props validation and component composition patterns
|
|
203
|
+
|
|
204
|
+
## Configuration Options
|
|
205
|
+
|
|
206
|
+
Customize checking behavior:
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
// auto.config.ts
|
|
210
|
+
export default {
|
|
211
|
+
plugins: [
|
|
212
|
+
[
|
|
213
|
+
'@auto-engineer/frontend-checks',
|
|
214
|
+
{
|
|
215
|
+
// Testing configuration
|
|
216
|
+
testTimeout: 10000,
|
|
217
|
+
testCoverage: 80,
|
|
218
|
+
runE2ETests: true,
|
|
219
|
+
|
|
220
|
+
// Performance thresholds
|
|
221
|
+
performanceThresholds: {
|
|
222
|
+
lcp: 2500,
|
|
223
|
+
fid: 100,
|
|
224
|
+
cls: 0.1,
|
|
225
|
+
bundleSize: 1024 * 1024, // 1MB
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
// Accessibility standards
|
|
229
|
+
accessibilityLevel: 'WCAG_AA',
|
|
230
|
+
|
|
231
|
+
// Browser testing
|
|
232
|
+
browsers: ['chromium', 'firefox', 'safari'],
|
|
233
|
+
|
|
234
|
+
// Device testing
|
|
235
|
+
devices: ['Desktop', 'Mobile Chrome', 'Mobile Safari'],
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
],
|
|
239
|
+
};
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Check Results and Reporting
|
|
243
|
+
|
|
244
|
+
### Test Results
|
|
245
|
+
|
|
246
|
+
Test reporting:
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
Frontend Checks Results
|
|
250
|
+
=======================
|
|
251
|
+
|
|
252
|
+
✅ Unit Tests: 45/45 passed (100%)
|
|
253
|
+
✅ Integration Tests: 12/12 passed (100%)
|
|
254
|
+
✅ E2E Tests: 8/8 passed (100%)
|
|
255
|
+
|
|
256
|
+
✅ TypeScript: No errors
|
|
257
|
+
✅ ESLint: No issues found
|
|
258
|
+
⚠️ Bundle Size: 1.2MB (exceeds 1MB threshold)
|
|
259
|
+
|
|
260
|
+
✅ Accessibility: WCAG AA compliant
|
|
261
|
+
✅ Performance: All Core Web Vitals passed
|
|
262
|
+
- LCP: 1.8s ✅
|
|
263
|
+
- FID: 45ms ✅
|
|
264
|
+
- CLS: 0.05 ✅
|
|
265
|
+
|
|
266
|
+
Cross-Browser Results:
|
|
267
|
+
✅ Chrome: All tests passed
|
|
268
|
+
✅ Firefox: All tests passed
|
|
269
|
+
✅ Safari: All tests passed
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Detailed Reports
|
|
273
|
+
|
|
274
|
+
Generate reports:
|
|
275
|
+
|
|
276
|
+
- HTML Test Reports: Interactive test results with screenshots
|
|
277
|
+
- Coverage Reports: Line-by-line code coverage analysis
|
|
278
|
+
- Performance Reports: Lighthouse audit results and recommendations
|
|
279
|
+
- Accessibility Reports: A11y violation reports with remediation guidance
|
|
280
|
+
- Bundle Analysis: Visual bundle composition and optimization suggestions
|
|
281
|
+
|
|
282
|
+
## Integration with CI/CD
|
|
283
|
+
|
|
284
|
+
The frontend checks integrate with continuous integration:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# Run all frontend checks
|
|
288
|
+
auto check:client
|
|
289
|
+
|
|
290
|
+
# Exit codes:
|
|
291
|
+
# 0 - All checks passed
|
|
292
|
+
# 1 - Some checks failed
|
|
293
|
+
# 2 - Critical failures (build errors, etc.)
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### GitHub Actions Integration
|
|
297
|
+
|
|
298
|
+
```yaml
|
|
299
|
+
name: Frontend Quality Checks
|
|
300
|
+
on: [push, pull_request]
|
|
301
|
+
|
|
302
|
+
jobs:
|
|
303
|
+
frontend-checks:
|
|
304
|
+
runs-on: ubuntu-latest
|
|
305
|
+
steps:
|
|
306
|
+
- uses: actions/checkout@v3
|
|
307
|
+
- uses: actions/setup-node@v3
|
|
308
|
+
with:
|
|
309
|
+
node-version: '18'
|
|
310
|
+
|
|
311
|
+
- name: Install dependencies
|
|
312
|
+
run: npm ci
|
|
313
|
+
|
|
314
|
+
- name: Run frontend checks
|
|
315
|
+
run: auto check:client
|
|
316
|
+
|
|
317
|
+
- name: Upload test reports
|
|
318
|
+
if: always()
|
|
319
|
+
uses: actions/upload-artifact@v3
|
|
320
|
+
with:
|
|
321
|
+
name: test-reports
|
|
322
|
+
path: reports/
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## Integration with Other Plugins
|
|
326
|
+
|
|
327
|
+
Works with the Auto Engineer ecosystem:
|
|
328
|
+
|
|
329
|
+
- @auto-engineer/react-graphql-generator: Validates generated React applications
|
|
330
|
+
- @auto-engineer/frontend-implementation: Checks AI-implemented code quality
|
|
331
|
+
- @auto-engineer/design-system-importer: Validates design system usage consistency
|
|
332
|
+
- @auto-engineer/information-architect: Validates implementation against IA specifications
|
|
333
|
+
|
|
334
|
+
## Advanced Features
|
|
335
|
+
|
|
336
|
+
### Custom Test Patterns
|
|
337
|
+
|
|
338
|
+
Define project-specific testing patterns:
|
|
339
|
+
|
|
340
|
+
```typescript
|
|
341
|
+
// Custom test utilities
|
|
342
|
+
export const createTestUtils = () => ({
|
|
343
|
+
renderWithProviders: (component: React.ReactElement) => {
|
|
344
|
+
return render(
|
|
345
|
+
<MockedProvider>
|
|
346
|
+
<BrowserRouter>
|
|
347
|
+
<ThemeProvider>
|
|
348
|
+
{component}
|
|
349
|
+
</ThemeProvider>
|
|
350
|
+
</BrowserRouter>
|
|
351
|
+
</MockedProvider>
|
|
352
|
+
);
|
|
353
|
+
},
|
|
354
|
+
|
|
355
|
+
mockGraphQLOperation: (operation: string, variables: any, result: any) => ({
|
|
356
|
+
request: { query: operation, variables },
|
|
357
|
+
result: { data: result }
|
|
358
|
+
})
|
|
359
|
+
});
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Visual Regression Testing
|
|
363
|
+
|
|
364
|
+
Automated UI consistency validation:
|
|
365
|
+
|
|
366
|
+
- Screenshot Comparison: UI change detection
|
|
367
|
+
- Component Visual Tests: Component appearance validation
|
|
368
|
+
- Cross-Browser Visual Consistency: UI consistency across browsers
|
|
369
|
+
- Responsive Design Validation: Layout consistency across screen sizes
|
|
370
|
+
|
|
371
|
+
The Frontend Checks plugin ensures that React applications meet standards of quality, performance, accessibility, and user experience, providing confidence in production deployments.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-manifest.d.ts","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAGrE,eAAO,MAAM,YAAY,EAAE,WAK1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-manifest.js","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,QAAQ,EAAE,gCAAgC;IAC1C,QAAQ,EAAE;QACR,cAAc,EAAE,mBAAmB;KACpC;CACF,CAAC"}
|
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import { type CommandHandler, type Command, type Event } from '@auto-engineer/message-bus';
|
|
2
|
+
export declare const checkClientManifest: {
|
|
3
|
+
handler: () => Promise<{
|
|
4
|
+
default: CommandHandler<Readonly<{
|
|
5
|
+
type: "CheckClient";
|
|
6
|
+
data: Readonly<{
|
|
7
|
+
clientDirectory: string;
|
|
8
|
+
skipBrowserChecks?: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
timestamp?: Date;
|
|
11
|
+
requestId?: string;
|
|
12
|
+
correlationId?: string;
|
|
13
|
+
}>>;
|
|
14
|
+
}>;
|
|
15
|
+
description: string;
|
|
16
|
+
usage: string;
|
|
17
|
+
examples: string[];
|
|
18
|
+
args: {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
required: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
3
24
|
export type CheckClientCommand = Command<'CheckClient', {
|
|
4
25
|
clientDirectory: string;
|
|
5
26
|
skipBrowserChecks?: boolean;
|
|
@@ -10,6 +31,9 @@ export type ClientCheckedEvent = Event<'ClientChecked', {
|
|
|
10
31
|
buildErrors: number;
|
|
11
32
|
consoleErrors: number;
|
|
12
33
|
allChecksPassed: boolean;
|
|
34
|
+
tsErrorDetails?: string[];
|
|
35
|
+
buildErrorDetails?: string[];
|
|
36
|
+
consoleErrorDetails?: string[];
|
|
13
37
|
}>;
|
|
14
38
|
export type ClientCheckFailedEvent = Event<'ClientCheckFailed', {
|
|
15
39
|
clientDirectory: string;
|
|
@@ -17,4 +41,5 @@ export type ClientCheckFailedEvent = Event<'ClientCheckFailed', {
|
|
|
17
41
|
}>;
|
|
18
42
|
export declare function handleCheckClientCommand(command: CheckClientCommand): Promise<ClientCheckedEvent | ClientCheckFailedEvent>;
|
|
19
43
|
export declare const checkClientCommandHandler: CommandHandler<CheckClientCommand>;
|
|
44
|
+
export default checkClientCommandHandler;
|
|
20
45
|
//# sourceMappingURL=check-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-client.d.ts","sourceRoot":"","sources":["../../src/commands/check-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-client.d.ts","sourceRoot":"","sources":["../../src/commands/check-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAa3F,eAAO,MAAM,mBAAmB;;;;;iCAWX,MAAM;oCACH,OAAO;;;;;;;;;;;;;;;CAN9B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACtC,aAAa,EACb;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CACF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,KAAK,CACpC,eAAe,EACf;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC,CACF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CACxC,mBAAmB,EACnB;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CACF,CAAC;AA8IF,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,GAAG,sBAAsB,CAAC,CAqEtD;AAED,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAC,kBAAkB,CAuBxE,CAAC;AAGF,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import path from 'path';
|
|
3
2
|
import { existsSync } from 'fs';
|
|
4
3
|
import { getTsErrors, getBuildErrors, getConsoleErrors, closeBrowser } from '../index.js';
|
|
@@ -9,6 +8,13 @@ const debugHandler = createDebug('frontend-checks:command:handler');
|
|
|
9
8
|
const debugServer = createDebug('frontend-checks:command:server');
|
|
10
9
|
const debugChecks = createDebug('frontend-checks:command:checks');
|
|
11
10
|
const debugResult = createDebug('frontend-checks:command:result');
|
|
11
|
+
export const checkClientManifest = {
|
|
12
|
+
handler: () => Promise.resolve({ default: checkClientCommandHandler }),
|
|
13
|
+
description: 'Full frontend validation suite',
|
|
14
|
+
usage: 'check:client <client-dir>',
|
|
15
|
+
examples: ['$ auto check:client ./client'],
|
|
16
|
+
args: [{ name: 'client-dir', description: 'Client directory to check', required: true }],
|
|
17
|
+
};
|
|
12
18
|
async function startDevServer(clientDir) {
|
|
13
19
|
debugServer('Starting dev server in: %s', clientDir);
|
|
14
20
|
return new Promise((resolve, reject) => {
|
|
@@ -43,12 +49,12 @@ async function startDevServer(clientDir) {
|
|
|
43
49
|
});
|
|
44
50
|
});
|
|
45
51
|
}
|
|
46
|
-
function createSuccessEvent(clientDirectory, tsErrors, buildErrors,
|
|
47
|
-
const allChecksPassed = tsErrors.length === 0 && buildErrors.length === 0 &&
|
|
52
|
+
function createSuccessEvent(clientDirectory, tsErrors, buildErrors, consoleErrors, command) {
|
|
53
|
+
const allChecksPassed = tsErrors.length === 0 && buildErrors.length === 0 && consoleErrors.length === 0;
|
|
48
54
|
debugResult('Checks completed:');
|
|
49
55
|
debugResult(' TypeScript errors: %d', tsErrors.length);
|
|
50
56
|
debugResult(' Build errors: %d', buildErrors.length);
|
|
51
|
-
debugResult(' Console errors: %d',
|
|
57
|
+
debugResult(' Console errors: %d', consoleErrors.length);
|
|
52
58
|
debugResult(' All checks passed: %s', allChecksPassed);
|
|
53
59
|
return {
|
|
54
60
|
type: 'ClientChecked',
|
|
@@ -56,8 +62,11 @@ function createSuccessEvent(clientDirectory, tsErrors, buildErrors, consoleError
|
|
|
56
62
|
clientDirectory,
|
|
57
63
|
tsErrors: tsErrors.length,
|
|
58
64
|
buildErrors: buildErrors.length,
|
|
59
|
-
consoleErrors:
|
|
65
|
+
consoleErrors: consoleErrors.length,
|
|
60
66
|
allChecksPassed,
|
|
67
|
+
tsErrorDetails: tsErrors.length > 0 ? tsErrors : undefined,
|
|
68
|
+
buildErrorDetails: buildErrors.length > 0 ? buildErrors : undefined,
|
|
69
|
+
consoleErrorDetails: consoleErrors.length > 0 ? consoleErrors : undefined,
|
|
61
70
|
},
|
|
62
71
|
timestamp: new Date(),
|
|
63
72
|
requestId: command.requestId,
|
|
@@ -84,8 +93,7 @@ async function runTypeScriptChecks(clientRoot) {
|
|
|
84
93
|
const tsErrors = await getTsErrors(clientRoot);
|
|
85
94
|
debugChecks('TypeScript errors found: %d', tsErrors.length);
|
|
86
95
|
if (tsErrors.length > 0) {
|
|
87
|
-
|
|
88
|
-
tsErrors.forEach((error) => console.log(' ', error));
|
|
96
|
+
tsErrors.forEach((error) => debugChecks(' TS Error: %s', error));
|
|
89
97
|
}
|
|
90
98
|
return tsErrors;
|
|
91
99
|
}
|
|
@@ -94,8 +102,7 @@ async function runBuildChecks(clientRoot) {
|
|
|
94
102
|
const buildErrors = await getBuildErrors(clientRoot);
|
|
95
103
|
debugChecks('Build errors found: %d', buildErrors.length);
|
|
96
104
|
if (buildErrors.length > 0) {
|
|
97
|
-
|
|
98
|
-
buildErrors.forEach((error) => console.log(' ', error));
|
|
105
|
+
buildErrors.forEach((error) => debugChecks(' Build Error: %s', error));
|
|
99
106
|
}
|
|
100
107
|
return buildErrors;
|
|
101
108
|
}
|
|
@@ -111,15 +118,14 @@ async function runBrowserChecks(clientRoot) {
|
|
|
111
118
|
const consoleErrorCount = consoleErrors.length;
|
|
112
119
|
debugChecks('Console errors found: %d', consoleErrorCount);
|
|
113
120
|
if (consoleErrors.length > 0) {
|
|
114
|
-
|
|
115
|
-
consoleErrors.forEach((error) => console.log(' ', error));
|
|
121
|
+
consoleErrors.forEach((error) => debugChecks(' Console Error: %s', error));
|
|
116
122
|
}
|
|
117
|
-
return {
|
|
123
|
+
return { consoleErrors, devServer: server };
|
|
118
124
|
}
|
|
119
125
|
catch (error) {
|
|
120
126
|
debugChecks('Failed to run browser checks: %O', error);
|
|
121
|
-
|
|
122
|
-
return {
|
|
127
|
+
debugChecks('Warning: Could not run browser checks: %O', error);
|
|
128
|
+
return { consoleErrors: [], devServer: null };
|
|
123
129
|
}
|
|
124
130
|
}
|
|
125
131
|
export async function handleCheckClientCommand(command) {
|
|
@@ -149,16 +155,16 @@ export async function handleCheckClientCommand(command) {
|
|
|
149
155
|
// Run checks
|
|
150
156
|
const tsErrors = await runTypeScriptChecks(clientRoot);
|
|
151
157
|
const buildErrors = await runBuildChecks(clientRoot);
|
|
152
|
-
let
|
|
158
|
+
let consoleErrors = [];
|
|
153
159
|
if (!skipBrowserChecks) {
|
|
154
160
|
const browserResult = await runBrowserChecks(clientRoot);
|
|
155
|
-
|
|
161
|
+
consoleErrors = browserResult.consoleErrors;
|
|
156
162
|
devServer = browserResult.devServer;
|
|
157
163
|
}
|
|
158
164
|
else {
|
|
159
165
|
debugChecks('Skipping browser checks as requested');
|
|
160
166
|
}
|
|
161
|
-
const successEvent = createSuccessEvent(clientDirectory, tsErrors, buildErrors,
|
|
167
|
+
const successEvent = createSuccessEvent(clientDirectory, tsErrors, buildErrors, consoleErrors, command);
|
|
162
168
|
debugResult('Returning event: ClientChecked');
|
|
163
169
|
return successEvent;
|
|
164
170
|
}
|
|
@@ -195,25 +201,20 @@ export const checkClientCommandHandler = {
|
|
|
195
201
|
const { tsErrors, buildErrors, consoleErrors, allChecksPassed } = result.data;
|
|
196
202
|
if (allChecksPassed) {
|
|
197
203
|
debug('Command handler completed: all checks passed');
|
|
198
|
-
console.log('✅ All frontend checks passed successfully');
|
|
199
204
|
}
|
|
200
205
|
else {
|
|
201
206
|
debug('Command handler completed: some checks failed');
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (buildErrors > 0)
|
|
206
|
-
console.log(` - ${buildErrors} build errors`);
|
|
207
|
-
if (consoleErrors > 0)
|
|
208
|
-
console.log(` - ${consoleErrors} console errors`);
|
|
209
|
-
process.exit(1);
|
|
207
|
+
debug('TypeScript errors: %d', tsErrors);
|
|
208
|
+
debug('Build errors: %d', buildErrors);
|
|
209
|
+
debug('Console errors: %d', consoleErrors);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
else {
|
|
213
213
|
debug('Command handler completed: failure - %s', result.data.error);
|
|
214
|
-
console.error(`❌ Frontend checks failed: ${result.data.error}`);
|
|
215
|
-
process.exit(1);
|
|
216
214
|
}
|
|
215
|
+
return result;
|
|
217
216
|
},
|
|
218
217
|
};
|
|
218
|
+
// Default export is the command handler
|
|
219
|
+
export default checkClientCommandHandler;
|
|
219
220
|
//# sourceMappingURL=check-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-client.js","sourceRoot":"","sources":["../../src/commands/check-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check-client.js","sourceRoot":"","sources":["../../src/commands/check-client.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvF,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACpD,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC;AACrD,MAAM,YAAY,GAAG,WAAW,CAAC,iCAAiC,CAAC,CAAC;AACpE,MAAM,WAAW,GAAG,WAAW,CAAC,gCAAgC,CAAC,CAAC;AAClE,MAAM,WAAW,GAAG,WAAW,CAAC,gCAAgC,CAAC,CAAC;AAClE,MAAM,WAAW,GAAG,WAAW,CAAC,gCAAgC,CAAC,CAAC;AAElE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;IACtE,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE,2BAA2B;IAClC,QAAQ,EAAE,CAAC,8BAA8B,CAAC;IAC1C,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CACzF,CAAC;AAgCF,KAAK,UAAU,cAA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,MAAM,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;YACpC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;YAE9E,IAAI,eAAe,EAAE,CAAC;gBACpB,KAAK,CAAC,8CAA8C,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,+CAA+C,CAAC,CAAC;gBACvD,KAAK,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;gBACzC,KAAK,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;gBACvC,KAAK,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,yCAAyC,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtE,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC;AAEF,wCAAwC;AACxC,eAAe,yBAAyB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export declare function closeBrowser(): Promise<void>;
|
|
|
3
3
|
export declare function getTsErrors(projectPath: string): Promise<string[]>;
|
|
4
4
|
export declare function getBuildErrors(projectPath: string): Promise<string[]>;
|
|
5
5
|
export declare function getPageScreenshot(url: string): Promise<string>;
|
|
6
|
+
export { CLI_MANIFEST } from './cli-manifest';
|
|
6
7
|
export { checkClientCommandHandler, handleCheckClientCommand, type CheckClientCommand, type ClientCheckedEvent, type ClientCheckFailedEvent, } from './commands/check-client';
|
|
7
8
|
//# 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":"AAoGA,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoBrE;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAIlD;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAqBlE;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBrE;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBpE;AAGD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,GAC5B,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { chromium } from 'playwright';
|
|
2
1
|
import { exec, execSync } from 'child_process';
|
|
3
2
|
import createDebug from 'debug';
|
|
4
3
|
const debug = createDebug('frontend-checks:browser');
|
|
@@ -9,6 +8,7 @@ class BrowserManager {
|
|
|
9
8
|
constructor() {
|
|
10
9
|
this.browser = null;
|
|
11
10
|
this.browserInstalled = false;
|
|
11
|
+
this.chromium = null;
|
|
12
12
|
}
|
|
13
13
|
static getInstance() {
|
|
14
14
|
if (BrowserManager.instance === null) {
|
|
@@ -17,6 +17,15 @@ class BrowserManager {
|
|
|
17
17
|
}
|
|
18
18
|
return BrowserManager.instance;
|
|
19
19
|
}
|
|
20
|
+
async getChromium() {
|
|
21
|
+
if (!this.chromium) {
|
|
22
|
+
debug('Dynamically importing playwright...');
|
|
23
|
+
const playwright = await import('playwright');
|
|
24
|
+
this.chromium = playwright.chromium;
|
|
25
|
+
debug('Playwright imported successfully');
|
|
26
|
+
}
|
|
27
|
+
return this.chromium;
|
|
28
|
+
}
|
|
20
29
|
async ensureBrowserInstalled() {
|
|
21
30
|
if (this.browserInstalled) {
|
|
22
31
|
debugInstall('Browser already marked as installed');
|
|
@@ -25,6 +34,7 @@ class BrowserManager {
|
|
|
25
34
|
try {
|
|
26
35
|
// Try to launch to see if browser is already installed
|
|
27
36
|
debugInstall('Testing if Chromium is already installed...');
|
|
37
|
+
const chromium = await this.getChromium();
|
|
28
38
|
const testBrowser = await chromium.launch();
|
|
29
39
|
await testBrowser.close();
|
|
30
40
|
this.browserInstalled = true;
|
|
@@ -58,6 +68,7 @@ class BrowserManager {
|
|
|
58
68
|
debug('Browser not initialized, ensuring installation and launching');
|
|
59
69
|
await this.ensureBrowserInstalled();
|
|
60
70
|
debug('Launching Chromium browser');
|
|
71
|
+
const chromium = await this.getChromium();
|
|
61
72
|
this.browser = await chromium.launch();
|
|
62
73
|
debug('Browser launched successfully');
|
|
63
74
|
}
|
|
@@ -156,6 +167,8 @@ export async function getPageScreenshot(url) {
|
|
|
156
167
|
debugScreenshot('Page closed');
|
|
157
168
|
return buffer.toString('base64');
|
|
158
169
|
}
|
|
170
|
+
// Export CLI manifest
|
|
171
|
+
export { CLI_MANIFEST } from './cli-manifest.js';
|
|
159
172
|
// Export command handler
|
|
160
173
|
export { checkClientCommandHandler, handleCheckClientCommand, } from './commands/check-client.js';
|
|
161
174
|
//# 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,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,WAAW,MAAM,OAAO,CAAC;AAKhC,MAAM,KAAK,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC;AACrD,MAAM,YA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,EAAE,CAAC;IACvC,eAAe,CAAC,qCAAqC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAEtE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACnB,eAAe,CAAC,aAAa,CAAC,CAAC;IAE/B,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,sBAAsB;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,yBAAyB;AACzB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GAIzB,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auto-engineer/frontend-checks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
9
12
|
},
|
|
10
13
|
"files": [
|
|
11
14
|
"dist",
|
|
@@ -13,7 +16,7 @@
|
|
|
13
16
|
"CHANGELOG.md"
|
|
14
17
|
],
|
|
15
18
|
"dependencies": {
|
|
16
|
-
"@auto-engineer/message-bus": "^0.
|
|
19
|
+
"@auto-engineer/message-bus": "^0.5.0",
|
|
17
20
|
"debug": "^4.4.1",
|
|
18
21
|
"dotenv": "^16.6.1",
|
|
19
22
|
"playwright": "^1.54.1",
|
|
@@ -22,9 +25,11 @@
|
|
|
22
25
|
"publishConfig": {
|
|
23
26
|
"access": "public"
|
|
24
27
|
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@auto-engineer/cli": "^0.7.0"
|
|
30
|
+
},
|
|
25
31
|
"scripts": {
|
|
26
|
-
"
|
|
27
|
-
"build": "tsc && tsx ../../scripts/fix-esm-imports.ts && chmod +x dist/cli/check-client.js",
|
|
32
|
+
"build": "tsc && tsx ../../scripts/fix-esm-imports.ts",
|
|
28
33
|
"dev": "tsc --watch",
|
|
29
34
|
"test": "vitest run",
|
|
30
35
|
"lint": "eslint 'src/**/*.ts' --max-warnings 0 --config ../../eslint.config.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-client.d.ts","sourceRoot":"","sources":["../../src/cli/check-client.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC"}
|
package/dist/cli/check-client.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import 'dotenv/config';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import { checkClientCommandHandler } from '../commands/check-client.js';
|
|
5
|
-
import createDebug from 'debug';
|
|
6
|
-
const debug = createDebug('frontend-checks:cli:check');
|
|
7
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
-
const isMain = process.argv[1] === __filename;
|
|
9
|
-
if (isMain) {
|
|
10
|
-
debug('CLI started with args: %o', process.argv.slice(2));
|
|
11
|
-
const clientDirectory = process.argv[2];
|
|
12
|
-
if (!clientDirectory) {
|
|
13
|
-
debug('ERROR: No client directory provided');
|
|
14
|
-
console.error('Usage: check:client <client-directory> [--skip-browser]');
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
const skipBrowserChecks = process.argv.includes('--skip-browser');
|
|
18
|
-
debug('Client directory argument: %s', clientDirectory);
|
|
19
|
-
debug('Skip browser checks: %s', skipBrowserChecks);
|
|
20
|
-
// Create command and execute handler
|
|
21
|
-
const command = {
|
|
22
|
-
type: 'CheckClient',
|
|
23
|
-
data: {
|
|
24
|
-
clientDirectory,
|
|
25
|
-
skipBrowserChecks,
|
|
26
|
-
},
|
|
27
|
-
timestamp: new Date(),
|
|
28
|
-
requestId: `cli-${Date.now()}`,
|
|
29
|
-
};
|
|
30
|
-
debug('Executing command handler');
|
|
31
|
-
void checkClientCommandHandler
|
|
32
|
-
.handle(command)
|
|
33
|
-
.then(() => {
|
|
34
|
-
debug('Command completed successfully');
|
|
35
|
-
})
|
|
36
|
-
.catch((error) => {
|
|
37
|
-
debug('Command failed: %O', error);
|
|
38
|
-
console.error('Failed to execute command:', error);
|
|
39
|
-
process.exit(1);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=check-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-client.js","sourceRoot":"","sources":["../../src/cli/check-client.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,2BAA2B,CAAC,CAAC;AAEvD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAElD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC;AAE9C,IAAI,MAAM,EAAE,CAAC;IACX,KAAK,CAAC,2BAA2B,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1D,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxC,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,g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