purity-mcp 0.0.0-stage → 2.0.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.
Files changed (66) hide show
  1. package/README.md +252 -2
  2. package/dist/data/component-catalog.d.ts +3 -0
  3. package/dist/data/component-catalog.d.ts.map +1 -0
  4. package/dist/data/component-catalog.js +330 -0
  5. package/dist/data/component-catalog.js.map +1 -0
  6. package/dist/data/documentation.d.ts +10 -0
  7. package/dist/data/documentation.d.ts.map +1 -0
  8. package/dist/data/documentation.js +617 -0
  9. package/dist/data/documentation.js.map +1 -0
  10. package/dist/data/templates.d.ts +11 -0
  11. package/dist/data/templates.d.ts.map +1 -0
  12. package/dist/data/templates.js +633 -0
  13. package/dist/data/templates.js.map +1 -0
  14. package/dist/index.d.ts +7 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +62 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/prompts/index.d.ts +3 -0
  19. package/dist/prompts/index.d.ts.map +1 -0
  20. package/dist/prompts/index.js +153 -0
  21. package/dist/prompts/index.js.map +1 -0
  22. package/dist/resources/index.d.ts +3 -0
  23. package/dist/resources/index.d.ts.map +1 -0
  24. package/dist/resources/index.js +177 -0
  25. package/dist/resources/index.js.map +1 -0
  26. package/dist/server.d.ts +3 -0
  27. package/dist/server.d.ts.map +1 -0
  28. package/dist/server.js +108 -0
  29. package/dist/server.js.map +1 -0
  30. package/dist/tools/components.tool.d.ts +34 -0
  31. package/dist/tools/components.tool.d.ts.map +1 -0
  32. package/dist/tools/components.tool.js +41 -0
  33. package/dist/tools/components.tool.js.map +1 -0
  34. package/dist/tools/docs.tool.d.ts +44 -0
  35. package/dist/tools/docs.tool.d.ts.map +1 -0
  36. package/dist/tools/docs.tool.js +60 -0
  37. package/dist/tools/docs.tool.js.map +1 -0
  38. package/dist/tools/inspect.tool.d.ts +9 -0
  39. package/dist/tools/inspect.tool.d.ts.map +1 -0
  40. package/dist/tools/inspect.tool.js +204 -0
  41. package/dist/tools/inspect.tool.js.map +1 -0
  42. package/dist/tools/scaffold.tool.d.ts +28 -0
  43. package/dist/tools/scaffold.tool.d.ts.map +1 -0
  44. package/dist/tools/scaffold.tool.js +56 -0
  45. package/dist/tools/scaffold.tool.js.map +1 -0
  46. package/dist/tools/transform.tool.d.ts +9 -0
  47. package/dist/tools/transform.tool.d.ts.map +1 -0
  48. package/dist/tools/transform.tool.js +9 -0
  49. package/dist/tools/transform.tool.js.map +1 -0
  50. package/dist/tools/validate.tool.d.ts +13 -0
  51. package/dist/tools/validate.tool.d.ts.map +1 -0
  52. package/dist/tools/validate.tool.js +53 -0
  53. package/dist/tools/validate.tool.js.map +1 -0
  54. package/dist/types.d.ts +105 -0
  55. package/dist/types.d.ts.map +1 -0
  56. package/dist/types.js +5 -0
  57. package/dist/types.js.map +1 -0
  58. package/dist/utils/code-analyzer.d.ts +3 -0
  59. package/dist/utils/code-analyzer.d.ts.map +1 -0
  60. package/dist/utils/code-analyzer.js +282 -0
  61. package/dist/utils/code-analyzer.js.map +1 -0
  62. package/dist/utils/template-converter.d.ts +12 -0
  63. package/dist/utils/template-converter.d.ts.map +1 -0
  64. package/dist/utils/template-converter.js +158 -0
  65. package/dist/utils/template-converter.js.map +1 -0
  66. package/package.json +45 -4
@@ -0,0 +1,633 @@
1
+ export function toPascalCase(str) {
2
+ return str
3
+ .replace(/(?:^|[-_])(\w)/g, (_, c) => (c ? c.toUpperCase() : ''))
4
+ .replace(/[^a-zA-Z0-9]/g, '');
5
+ }
6
+ export function toKebabCase(str) {
7
+ return str
8
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
9
+ .replace(/[\s_]+/g, '-')
10
+ .toLowerCase();
11
+ }
12
+ export function generateScaffoldFiles(type, rawName, options = {}) {
13
+ const kebab = toKebabCase(rawName);
14
+ const pascal = toPascalCase(rawName);
15
+ const selector = options.selector || kebab;
16
+ const description = options.description || `Purity ${type} ${pascal}`;
17
+ const files = [];
18
+ switch (type) {
19
+ case 'component': {
20
+ const compClass = `${pascal}Component`;
21
+ files.push({
22
+ filename: `${kebab}.component.ts`,
23
+ path: `${kebab}/${kebab}.component.ts`,
24
+ description: `Component TypeScript logic for <${selector}>`,
25
+ content: `import { Component, signal } from '@purity/core';
26
+
27
+ /**
28
+ * ${description}
29
+ */
30
+ @Component({
31
+ selector: '${selector}',
32
+ templateUrl: './${kebab}.component.html',
33
+ })
34
+ export class ${compClass} {
35
+ // Reactive state
36
+ readonly title = signal<string>('${pascal}');
37
+ readonly isExpanded = signal<boolean>(false);
38
+
39
+ protected onInit(): void {
40
+ // Lifecycle initialization
41
+ }
42
+
43
+ protected onDestroy(): void {
44
+ // Cleanup subscriptions / behaviors
45
+ }
46
+
47
+ toggle(): void {
48
+ this.isExpanded.update(v => !v);
49
+ }
50
+ }
51
+ `
52
+ });
53
+ files.push({
54
+ filename: `${kebab}.component.html`,
55
+ path: `${kebab}/${kebab}.component.html`,
56
+ description: `HTML template for <${selector}>`,
57
+ content: `<div class="${kebab}-card">
58
+ <div class="card-header" onclick="toggle()">
59
+ <span class="card-title">{{ title() }}</span>
60
+ <span class="card-badge">{{ isExpanded() ? 'Expanded' : 'Collapsed' }}</span>
61
+ </div>
62
+
63
+ <div if="isExpanded()" class="card-body">
64
+ <slot>
65
+ <p>Default content for ${selector}.</p>
66
+ </slot>
67
+ </div>
68
+ </div>
69
+ `
70
+ });
71
+ files.push({
72
+ filename: `${kebab}.component.scss`,
73
+ path: `${kebab}/${kebab}.component.scss`,
74
+ description: `Adwaita SCSS styles for <${selector}>`,
75
+ content: `@use '@styles' as *;
76
+
77
+ .${kebab}-card {
78
+ display: flex;
79
+ flex-direction: column;
80
+ background: var(--gnome-card);
81
+ backdrop-filter: var(--blur-effect);
82
+ border: 1px solid var(--gnome-border);
83
+ border-radius: var(--radius-card);
84
+ padding: 1rem;
85
+ transition: all var(--transition-normal);
86
+ cursor: var(--cursor-default);
87
+
88
+ .card-header {
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: space-between;
92
+ cursor: var(--cursor-pointer);
93
+ user-select: none;
94
+
95
+ .card-title {
96
+ font-weight: 600;
97
+ color: var(--color-foreground);
98
+ }
99
+
100
+ .card-badge {
101
+ font-size: 0.75rem;
102
+ padding: 0.25rem 0.6rem;
103
+ border-radius: var(--radius-pill);
104
+ background: var(--gnome-surface);
105
+ border: 1px solid var(--gnome-border);
106
+ }
107
+ }
108
+
109
+ .card-body {
110
+ margin-top: 0.75rem;
111
+ padding-top: 0.75rem;
112
+ border-top: 1px solid var(--gnome-border);
113
+ color: var(--color-foreground-muted);
114
+ }
115
+ }
116
+ `
117
+ });
118
+ files.push({
119
+ filename: `${kebab}.component.spec.ts`,
120
+ path: `${kebab}/${kebab}.component.spec.ts`,
121
+ description: `Vitest unit test for ${compClass}`,
122
+ content: `import { describe, it, expect, beforeEach, afterEach } from 'vitest';
123
+ import './${kebab}.component';
124
+ import { ${compClass} } from './${kebab}.component';
125
+
126
+ describe('${compClass}', () => {
127
+ let element: HTMLElement;
128
+
129
+ beforeEach(() => {
130
+ element = document.createElement('${selector}');
131
+ document.body.appendChild(element);
132
+ });
133
+
134
+ afterEach(() => {
135
+ element.remove();
136
+ });
137
+
138
+ it('should instantiate and mount in DOM', () => {
139
+ expect(element).toBeDefined();
140
+ const instance = element as unknown as ${compClass};
141
+ expect(instance.title()).toBe('${pascal}');
142
+ });
143
+
144
+ it('should toggle isExpanded signal', () => {
145
+ const instance = element as unknown as ${compClass};
146
+ expect(instance.isExpanded()).toBe(false);
147
+ instance.toggle();
148
+ expect(instance.isExpanded()).toBe(true);
149
+ });
150
+ });
151
+ `
152
+ });
153
+ break;
154
+ }
155
+ case 'service': {
156
+ const serviceClass = `${pascal}Service`;
157
+ files.push({
158
+ filename: `${kebab}.service.ts`,
159
+ path: `${kebab}.service.ts`,
160
+ description: `@Injectable service logic`,
161
+ content: `import { Injectable, signal, computed } from '@purity/core';
162
+
163
+ export interface ${pascal}Item {
164
+ id: string;
165
+ name: string;
166
+ }
167
+
168
+ /**
169
+ * ${description}
170
+ */
171
+ @Injectable('${serviceClass}')
172
+ export class ${serviceClass} {
173
+ readonly items = signal<${pascal}Item[]>([]);
174
+ readonly count = computed(() => this.items().length);
175
+
176
+ addItem(name: string): void {
177
+ const newItem: ${pascal}Item = {
178
+ id: crypto.randomUUID ? crypto.randomUUID() : String(Date.now()),
179
+ name,
180
+ };
181
+ this.items.update(list => [...list, newItem]);
182
+ }
183
+
184
+ removeItem(id: string): void {
185
+ this.items.update(list => list.filter(item => item.id !== id));
186
+ }
187
+
188
+ clear(): void {
189
+ this.items.set([]);
190
+ }
191
+ }
192
+ `
193
+ });
194
+ files.push({
195
+ filename: `${kebab}.service.spec.ts`,
196
+ path: `${kebab}.service.spec.ts`,
197
+ description: `Vitest unit test for ${serviceClass}`,
198
+ content: `import { describe, it, expect, beforeEach } from 'vitest';
199
+ import { ${serviceClass} } from './${kebab}.service';
200
+ import { inject } from '@purity/core';
201
+
202
+ describe('${serviceClass}', () => {
203
+ let service: ${serviceClass};
204
+
205
+ beforeEach(() => {
206
+ service = inject(${serviceClass});
207
+ service.clear();
208
+ });
209
+
210
+ it('should initialize with empty items', () => {
211
+ expect(service.items()).toEqual([]);
212
+ expect(service.count()).toBe(0);
213
+ });
214
+
215
+ it('should add items and compute count reactively', () => {
216
+ service.addItem('Test Item');
217
+ expect(service.count()).toBe(1);
218
+ expect(service.items()[0].name).toBe('Test Item');
219
+ });
220
+
221
+ it('should remove items correctly', () => {
222
+ service.addItem('Item 1');
223
+ const id = service.items()[0].id;
224
+ service.removeItem(id);
225
+ expect(service.count()).toBe(0);
226
+ });
227
+ });
228
+ `
229
+ });
230
+ break;
231
+ }
232
+ case 'pipe': {
233
+ const pipeClass = `${pascal}Pipe`;
234
+ files.push({
235
+ filename: `${kebab}.pipe.ts`,
236
+ path: `${kebab}.pipe.ts`,
237
+ description: `@Pipe transform class`,
238
+ content: `import { Pipe, BasePipe } from '@purity/core';
239
+
240
+ /**
241
+ * ${description}
242
+ * Usage in template: {{ value | ${kebab}: arg1 }}
243
+ */
244
+ @Pipe('${kebab}')
245
+ export class ${pipeClass} extends BasePipe {
246
+ transform(value: unknown, ...args: unknown[]): string {
247
+ if (value === null || value === undefined) return '';
248
+ const str = String(value);
249
+ const suffix = args[0] ? String(args[0]) : '';
250
+ return \`\${str}\${suffix}\`;
251
+ }
252
+ }
253
+ `
254
+ });
255
+ files.push({
256
+ filename: `${kebab}.pipe.spec.ts`,
257
+ path: `${kebab}.pipe.spec.ts`,
258
+ description: `Vitest unit test for ${pipeClass}`,
259
+ content: `import { describe, it, expect } from 'vitest';
260
+ import { ${pipeClass} } from './${kebab}.pipe';
261
+
262
+ describe('${pipeClass}', () => {
263
+ const pipe = new ${pipeClass}();
264
+
265
+ it('should return empty string for null/undefined', () => {
266
+ expect(pipe.transform(null)).toBe('');
267
+ expect(pipe.transform(undefined)).toBe('');
268
+ });
269
+
270
+ it('should transform value with suffix', () => {
271
+ expect(pipe.transform('Hello', ' World')).toBe('Hello World');
272
+ });
273
+ });
274
+ `
275
+ });
276
+ break;
277
+ }
278
+ case 'directive': {
279
+ const dirClass = `${pascal}Directive`;
280
+ files.push({
281
+ filename: `${kebab}.directive.ts`,
282
+ path: `${kebab}.directive.ts`,
283
+ description: `@Directive attribute class`,
284
+ content: `import { Directive, BaseDirective } from '@purity/core';
285
+
286
+ /**
287
+ * ${description}
288
+ * Usage: <div [${kebab}]="options"></div>
289
+ */
290
+ @Directive('[${kebab}]')
291
+ export class ${dirClass} extends BaseDirective {
292
+ protected onInit(): void {
293
+ this.el.classList.add('${kebab}-active');
294
+ }
295
+
296
+ protected onChanges(newValue: unknown, oldValue: unknown): void {
297
+ // React to attribute changes
298
+ }
299
+
300
+ protected onDestroy(): void {
301
+ this.el.classList.remove('${kebab}-active');
302
+ }
303
+ }
304
+ `
305
+ });
306
+ files.push({
307
+ filename: `${kebab}.directive.spec.ts`,
308
+ path: `${kebab}.directive.spec.ts`,
309
+ description: `Vitest unit test for ${dirClass}`,
310
+ content: `import { describe, it, expect, beforeEach, afterEach } from 'vitest';
311
+ import { ${dirClass} } from './${kebab}.directive';
312
+
313
+ describe('${dirClass}', () => {
314
+ let element: HTMLElement;
315
+ let directive: ${dirClass};
316
+
317
+ beforeEach(() => {
318
+ element = document.createElement('div');
319
+ document.body.appendChild(element);
320
+ directive = new ${dirClass}(element);
321
+ directive['onInit']();
322
+ });
323
+
324
+ afterEach(() => {
325
+ directive['onDestroy']();
326
+ element.remove();
327
+ });
328
+
329
+ it('should add active class onInit', () => {
330
+ expect(element.classList.contains('${kebab}-active')).toBe(true);
331
+ });
332
+
333
+ it('should remove active class onDestroy', () => {
334
+ directive['onDestroy']();
335
+ expect(element.classList.contains('${kebab}-active')).toBe(false);
336
+ });
337
+ });
338
+ `
339
+ });
340
+ break;
341
+ }
342
+ case 'validator': {
343
+ const valClass = `${pascal}Validator`;
344
+ files.push({
345
+ filename: `${kebab}.validator.ts`,
346
+ path: `${kebab}.validator.ts`,
347
+ description: `@Validator decoupled validation class`,
348
+ content: `import { Validator, BaseValidator } from '@purity/core';
349
+
350
+ /**
351
+ * ${description}
352
+ */
353
+ @Validator({
354
+ form: '#${kebab}Form',
355
+ fields: {
356
+ title: ['required', 'minLength:3'],
357
+ email: ['required', 'email'],
358
+ },
359
+ })
360
+ export class ${valClass} extends BaseValidator {
361
+ // Custom validation rule for title
362
+ validateTitle(value: string, element?: HTMLElement): boolean {
363
+ if (!value || value.trim().length < 3) {
364
+ this.setFieldError('title', 'Title must be at least 3 characters.');
365
+ return false;
366
+ }
367
+ this.clearFieldError('title');
368
+ return true;
369
+ }
370
+ }
371
+ `
372
+ });
373
+ files.push({
374
+ filename: `${kebab}.validator.spec.ts`,
375
+ path: `${kebab}.validator.spec.ts`,
376
+ description: `Vitest unit test for ${valClass}`,
377
+ content: `import { describe, it, expect } from 'vitest';
378
+ import { ${valClass} } from './${kebab}.validator';
379
+
380
+ describe('${valClass}', () => {
381
+ it('should instantiate and validate field rules', () => {
382
+ const validator = new ${valClass}();
383
+ expect(validator.validateTitle('ab')).toBe(false);
384
+ expect(validator.validateTitle('Valid Title')).toBe(true);
385
+ });
386
+ });
387
+ `
388
+ });
389
+ break;
390
+ }
391
+ case 'interceptor': {
392
+ const interceptorClass = `${pascal}Interceptor`;
393
+ files.push({
394
+ filename: `${kebab}.interceptor.ts`,
395
+ path: `${kebab}.interceptor.ts`,
396
+ description: `Centralized HttpInterceptor class`,
397
+ content: `import { HttpInterceptor, HttpRequest, HttpHandler, HttpResponse } from '@purity/core';
398
+
399
+ /**
400
+ * ${description}
401
+ * Centralized under @interceptors/*
402
+ */
403
+ export class ${interceptorClass} implements HttpInterceptor {
404
+ async intercept(req: HttpRequest, next: HttpHandler): Promise<HttpResponse> {
405
+ const startTime = Date.now();
406
+
407
+ // Transform request (e.g. inject headers)
408
+ const clonedReq = req.clone({
409
+ headers: req.headers.set('X-Custom-Client', 'Purity-Client'),
410
+ });
411
+
412
+ try {
413
+ const response = await next.handle(clonedReq);
414
+ const elapsed = Date.now() - startTime;
415
+ // Handle response telemetry if needed
416
+ return response;
417
+ } catch (error) {
418
+ // Handle normalized error
419
+ throw error;
420
+ }
421
+ }
422
+ }
423
+ `
424
+ });
425
+ files.push({
426
+ filename: `${kebab}.interceptor.spec.ts`,
427
+ path: `${kebab}.interceptor.spec.ts`,
428
+ description: `Vitest unit test for ${interceptorClass}`,
429
+ content: `import { describe, it, expect } from 'vitest';
430
+ import { ${interceptorClass} } from './${kebab}.interceptor';
431
+ import { HttpRequest, HttpResponse, HttpHeaders } from '@purity/core';
432
+
433
+ describe('${interceptorClass}', () => {
434
+ const interceptor = new ${interceptorClass}();
435
+
436
+ it('should attach custom header and pass through', async () => {
437
+ const req = new HttpRequest('GET', '/test', null, new HttpHeaders());
438
+ const mockHandler = {
439
+ handle: async (modifiedReq: HttpRequest) => {
440
+ expect(modifiedReq.headers.get('X-Custom-Client')).toBe('Purity-Client');
441
+ return new HttpResponse(200, { ok: true });
442
+ },
443
+ };
444
+
445
+ const res = await interceptor.intercept(req, mockHandler);
446
+ expect(res.status).toBe(200);
447
+ });
448
+ });
449
+ `
450
+ });
451
+ break;
452
+ }
453
+ case 'behavior': {
454
+ files.push({
455
+ filename: `${kebab}.behavior.ts`,
456
+ path: `${kebab}.behavior.ts`,
457
+ description: `Composable DOM behavior function`,
458
+ content: `export interface ${pascal}Options {
459
+ activeClass?: string;
460
+ onTrigger?: () => void;
461
+ }
462
+
463
+ /**
464
+ * ${description}
465
+ * Composable behavior under @behaviors/*
466
+ */
467
+ export function ${toKebabCase(rawName).replace(/-([a-z])/g, (_, c) => c.toUpperCase())}(
468
+ element: HTMLElement,
469
+ options: ${pascal}Options = {}
470
+ ): { destroy(): void } {
471
+ const activeClass = options.activeClass || 'is-active';
472
+
473
+ const handleClick = () => {
474
+ element.classList.toggle(activeClass);
475
+ options.onTrigger?.();
476
+ };
477
+
478
+ element.addEventListener('click', handleClick);
479
+
480
+ return {
481
+ destroy(): void {
482
+ element.removeEventListener('click', handleClick);
483
+ element.classList.remove(activeClass);
484
+ },
485
+ };
486
+ }
487
+ `
488
+ });
489
+ files.push({
490
+ filename: `${kebab}.behavior.spec.ts`,
491
+ path: `${kebab}.behavior.spec.ts`,
492
+ description: `Vitest unit test for behavior`,
493
+ content: `import { describe, it, expect, beforeEach, afterEach } from 'vitest';
494
+ import { ${toKebabCase(rawName).replace(/-([a-z])/g, (_, c) => c.toUpperCase())} } from './${kebab}.behavior';
495
+
496
+ describe('${kebab} behavior', () => {
497
+ let element: HTMLElement;
498
+
499
+ beforeEach(() => {
500
+ element = document.createElement('div');
501
+ document.body.appendChild(element);
502
+ });
503
+
504
+ afterEach(() => {
505
+ element.remove();
506
+ });
507
+
508
+ it('should toggle class on click and clean up on destroy', () => {
509
+ const cleanup = ${toKebabCase(rawName).replace(/-([a-z])/g, (_, c) => c.toUpperCase())}(element);
510
+ element.click();
511
+ expect(element.classList.contains('is-active')).toBe(true);
512
+
513
+ cleanup.destroy();
514
+ expect(element.classList.contains('is-active')).toBe(false);
515
+ });
516
+ });
517
+ `
518
+ });
519
+ break;
520
+ }
521
+ case 'page': {
522
+ const pageClass = `${pascal}Page`;
523
+ files.push({
524
+ filename: `${kebab}.page.ts`,
525
+ path: `${kebab}/${kebab}.page.ts`,
526
+ description: `Page component with SeoService integration`,
527
+ content: `import { Component, inject } from '@purity/core';
528
+ import { SeoService } from '@purity/core';
529
+
530
+ /**
531
+ * ${description}
532
+ */
533
+ @Component({
534
+ selector: '${selector}-page',
535
+ templateUrl: './${kebab}.page.html',
536
+ })
537
+ export class ${pageClass} {
538
+ private seo = inject(SeoService);
539
+
540
+ protected onInit(): void {
541
+ this.seo.setTitle('${pascal} - Purity');
542
+ this.seo.setDescription('${description}');
543
+ }
544
+ }
545
+ `
546
+ });
547
+ files.push({
548
+ filename: `${kebab}.page.html`,
549
+ path: `${kebab}/${kebab}.page.html`,
550
+ description: `HTML template for page`,
551
+ content: `<div class="page-container">
552
+ <header class="page-header">
553
+ <h1 class="page-title">${pascal}</h1>
554
+ <p class="page-subtitle">${description}</p>
555
+ </header>
556
+
557
+ <main class="page-content">
558
+ <div class="adwaita-card">
559
+ <p>Welcome to ${pascal} page view.</p>
560
+ </div>
561
+ </main>
562
+ </div>
563
+ `
564
+ });
565
+ files.push({
566
+ filename: `${kebab}.page.scss`,
567
+ path: `${kebab}/${kebab}.page.scss`,
568
+ description: `SCSS styles for page`,
569
+ content: `@use '@styles' as *;
570
+
571
+ .page-container {
572
+ display: flex;
573
+ flex-direction: column;
574
+ gap: 1.5rem;
575
+ padding: 2rem;
576
+ max-width: 1200px;
577
+ margin: 0 auto;
578
+
579
+ .page-header {
580
+ .page-title {
581
+ font-size: 2rem;
582
+ font-weight: 700;
583
+ color: var(--color-foreground);
584
+ }
585
+
586
+ .page-subtitle {
587
+ font-size: 1rem;
588
+ color: var(--color-foreground-muted);
589
+ }
590
+ }
591
+
592
+ .adwaita-card {
593
+ background: var(--gnome-card);
594
+ backdrop-filter: var(--blur-effect);
595
+ border: 1px solid var(--gnome-border);
596
+ border-radius: var(--radius-card);
597
+ padding: 1.5rem;
598
+ }
599
+ }
600
+ `
601
+ });
602
+ files.push({
603
+ filename: `${kebab}.page.spec.ts`,
604
+ path: `${kebab}/${kebab}.page.spec.ts`,
605
+ description: `Vitest unit test for page`,
606
+ content: `import { describe, it, expect, beforeEach, afterEach } from 'vitest';
607
+ import './${kebab}.page';
608
+ import { ${pageClass} } from './${kebab}.page';
609
+
610
+ describe('${pageClass}', () => {
611
+ let element: HTMLElement;
612
+
613
+ beforeEach(() => {
614
+ element = document.createElement('${selector}-page');
615
+ document.body.appendChild(element);
616
+ });
617
+
618
+ afterEach(() => {
619
+ element.remove();
620
+ });
621
+
622
+ it('should instantiate page component', () => {
623
+ expect(element).toBeDefined();
624
+ });
625
+ });
626
+ `
627
+ });
628
+ break;
629
+ }
630
+ }
631
+ return { files, selector: type === 'component' ? selector : type === 'page' ? `${selector}-page` : undefined };
632
+ }
633
+ //# sourceMappingURL=templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/data/templates.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,GAAG;SACP,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAChE,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG;SACP,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACtC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,WAAW,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,IAAkB,EAClB,OAAe,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,EAAE;;6BAEY,MAAM;+BACJ,WAAW;;;;;sBAKpB,MAAM;;;;CAI3B;aACM,CAAC,CAAC;YAEH,KAAK,CAAC,IAAI,CAAC;gBACT,QAAQ,EAAE,GAAG,KAAK,YAAY;gBAC9B,IAAI,EAAE,GAAG,KAAK,IAAI,KAAK,YAAY;gBACnC,WAAW,EAAE,sBAAsB;gBACnC,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BhB;aACM,CAAC,CAAC;YAEH,KAAK,CAAC,IAAI,CAAC;gBACT,QAAQ,EAAE,GAAG,KAAK,eAAe;gBACjC,IAAI,EAAE,GAAG,KAAK,IAAI,KAAK,eAAe;gBACtC,WAAW,EAAE,2BAA2B;gBACxC,OAAO,EAAE;YACL,KAAK;WACN,SAAS,cAAc,KAAK;;YAE3B,SAAS;;;;wCAImB,QAAQ;;;;;;;;;;;;CAY/C;aACM,CAAC,CAAC;YACH,MAAM;QACR,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACjH,CAAC"}
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Purity Model Context Protocol (MCP) Server
4
+ * Entry point for CLI and standard stdio communication.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG"}