baseguard 1.0.4 → 1.0.6

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 (84) hide show
  1. package/dist/ai/gemini-analyzer.d.ts.map +1 -1
  2. package/dist/ai/gemini-analyzer.js +1 -1
  3. package/dist/ai/gemini-analyzer.js.map +1 -1
  4. package/dist/ai/gemini-code-fixer.d.ts.map +1 -1
  5. package/dist/ai/gemini-code-fixer.js +2 -7
  6. package/dist/ai/gemini-code-fixer.js.map +1 -1
  7. package/dist/ai/jules-implementer.d.ts +8 -0
  8. package/dist/ai/jules-implementer.d.ts.map +1 -1
  9. package/dist/ai/jules-implementer.js +115 -17
  10. package/dist/ai/jules-implementer.js.map +1 -1
  11. package/dist/commands/fix.d.ts.map +1 -1
  12. package/dist/commands/fix.js +5 -1
  13. package/dist/commands/fix.js.map +1 -1
  14. package/dist/core/baseline-checker.d.ts.map +1 -1
  15. package/dist/core/baseline-checker.js +6 -4
  16. package/dist/core/baseline-checker.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/ai/__tests__/gemini-analyzer.test.ts +0 -181
  19. package/src/ai/agentkit-orchestrator.ts +0 -534
  20. package/src/ai/fix-manager.ts +0 -362
  21. package/src/ai/gemini-analyzer.ts +0 -665
  22. package/src/ai/gemini-code-fixer.ts +0 -539
  23. package/src/ai/index.ts +0 -4
  24. package/src/ai/jules-implementer.ts +0 -504
  25. package/src/ai/unified-code-fixer.ts +0 -347
  26. package/src/commands/automation.ts +0 -344
  27. package/src/commands/check.ts +0 -298
  28. package/src/commands/config.ts +0 -584
  29. package/src/commands/fix.ts +0 -264
  30. package/src/commands/index.ts +0 -7
  31. package/src/commands/init.ts +0 -156
  32. package/src/commands/status.ts +0 -307
  33. package/src/core/api-key-manager.ts +0 -298
  34. package/src/core/baseguard.ts +0 -757
  35. package/src/core/baseline-checker.ts +0 -564
  36. package/src/core/cache-manager.ts +0 -272
  37. package/src/core/configuration-recovery.ts +0 -672
  38. package/src/core/configuration.ts +0 -596
  39. package/src/core/debug-logger.ts +0 -590
  40. package/src/core/directory-filter.ts +0 -421
  41. package/src/core/error-handler.ts +0 -518
  42. package/src/core/file-processor.ts +0 -338
  43. package/src/core/gitignore-manager.ts +0 -169
  44. package/src/core/graceful-degradation-manager.ts +0 -596
  45. package/src/core/index.ts +0 -17
  46. package/src/core/lazy-loader.ts +0 -317
  47. package/src/core/logger.ts +0 -0
  48. package/src/core/memory-manager.ts +0 -290
  49. package/src/core/parser-worker.ts +0 -33
  50. package/src/core/startup-optimizer.ts +0 -246
  51. package/src/core/system-error-handler.ts +0 -755
  52. package/src/git/automation-engine.ts +0 -361
  53. package/src/git/github-manager.ts +0 -190
  54. package/src/git/hook-manager.ts +0 -210
  55. package/src/git/index.ts +0 -4
  56. package/src/index.ts +0 -8
  57. package/src/parsers/feature-validator.ts +0 -559
  58. package/src/parsers/index.ts +0 -8
  59. package/src/parsers/parser-manager.ts +0 -418
  60. package/src/parsers/parser.ts +0 -26
  61. package/src/parsers/react-parser-optimized.ts +0 -161
  62. package/src/parsers/react-parser.ts +0 -359
  63. package/src/parsers/svelte-parser.ts +0 -510
  64. package/src/parsers/vanilla-parser.ts +0 -685
  65. package/src/parsers/vue-parser.ts +0 -476
  66. package/src/types/index.ts +0 -96
  67. package/src/ui/components.ts +0 -567
  68. package/src/ui/help.ts +0 -193
  69. package/src/ui/index.ts +0 -4
  70. package/src/ui/prompts.ts +0 -681
  71. package/src/ui/terminal-header.ts +0 -59
  72. package/tests/e2e/baseguard.e2e.test.ts +0 -516
  73. package/tests/e2e/cross-platform.e2e.test.ts +0 -420
  74. package/tests/e2e/git-integration.e2e.test.ts +0 -487
  75. package/tests/fixtures/react-project/package.json +0 -14
  76. package/tests/fixtures/react-project/src/App.css +0 -76
  77. package/tests/fixtures/react-project/src/App.tsx +0 -77
  78. package/tests/fixtures/svelte-project/package.json +0 -11
  79. package/tests/fixtures/svelte-project/src/App.svelte +0 -369
  80. package/tests/fixtures/vanilla-project/index.html +0 -76
  81. package/tests/fixtures/vanilla-project/script.js +0 -331
  82. package/tests/fixtures/vanilla-project/styles.css +0 -359
  83. package/tests/fixtures/vue-project/package.json +0 -12
  84. package/tests/fixtures/vue-project/src/App.vue +0 -216
@@ -1,369 +0,0 @@
1
- <script lang="ts">
2
- import { onMount, onDestroy } from 'svelte';
3
-
4
- let dialogOpen = false;
5
- let dialogElement: HTMLDialogElement;
6
- let canvasElement: HTMLCanvasElement;
7
- let resizeObserver: ResizeObserver | null = null;
8
-
9
- onMount(() => {
10
- setupModernAPIs();
11
- setupCanvas();
12
- });
13
-
14
- onDestroy(() => {
15
- if (resizeObserver) {
16
- resizeObserver.disconnect();
17
- }
18
- });
19
-
20
- function setupModernAPIs() {
21
- // ResizeObserver - baseline newly available
22
- resizeObserver = new ResizeObserver((entries) => {
23
- console.log('Svelte: Element resized:', entries);
24
- });
25
-
26
- if (dialogElement) {
27
- resizeObserver.observe(dialogElement);
28
- }
29
-
30
- // structuredClone - baseline newly available
31
- const testData = { svelte: true, reactive: { state: 'awesome' } };
32
- const cloned = structuredClone(testData);
33
- console.log('Svelte: Cloned data:', cloned);
34
-
35
- // Array.at() - baseline newly available
36
- const frameworks = ['svelte', 'vue', 'react', 'angular'];
37
- const firstFramework = frameworks.at(0);
38
- const lastFramework = frameworks.at(-1);
39
- console.log('Svelte: First and last frameworks:', firstFramework, lastFramework);
40
-
41
- // Optional chaining and nullish coalescing - baseline widely available
42
- const config = { api: { endpoint: null } };
43
- const endpoint = config?.api?.endpoint ?? 'https://default-api.com';
44
- console.log('Svelte: API endpoint:', endpoint);
45
- }
46
-
47
- function setupCanvas() {
48
- if (!canvasElement) return;
49
-
50
- const ctx = canvasElement.getContext('2d');
51
- if (ctx) {
52
- // Modern Canvas API - filter property
53
- ctx.filter = 'blur(3px) brightness(1.2)';
54
- ctx.fillStyle = '#ff3e00';
55
- ctx.fillRect(20, 20, 80, 80);
56
- }
57
- }
58
-
59
- function openDialog() {
60
- if (dialogElement) {
61
- // HTMLDialogElement.showModal() - baseline newly available
62
- dialogElement.showModal();
63
- }
64
- dialogOpen = true;
65
- }
66
-
67
- function closeDialog() {
68
- if (dialogElement) {
69
- dialogElement.close();
70
- }
71
- dialogOpen = false;
72
- }
73
-
74
- function testWebAPIs() {
75
- // Test various modern Web APIs
76
-
77
- // AbortController - baseline widely available
78
- const controller = new AbortController();
79
- const { signal } = controller;
80
-
81
- // Fetch with modern options
82
- fetch('https://api.example.com/svelte-data', {
83
- signal,
84
- method: 'POST',
85
- headers: {
86
- 'Content-Type': 'application/json'
87
- },
88
- body: JSON.stringify({ framework: 'svelte' })
89
- })
90
- .then(response => response.json())
91
- .catch(error => {
92
- if (error.name === 'AbortError') {
93
- console.log('Svelte: Fetch aborted');
94
- }
95
- });
96
-
97
- // Abort after 500ms
98
- setTimeout(() => controller.abort(), 500);
99
-
100
- // IntersectionObserver - baseline widely available
101
- const observer = new IntersectionObserver((entries) => {
102
- entries.forEach(entry => {
103
- console.log('Svelte: Element intersection:', entry.isIntersecting);
104
- });
105
- }, {
106
- threshold: [0, 0.5, 1]
107
- });
108
-
109
- if (canvasElement) {
110
- observer.observe(canvasElement);
111
- }
112
-
113
- // Test URLSearchParams - baseline widely available
114
- const params = new URLSearchParams();
115
- params.set('framework', 'svelte');
116
- params.set('version', '4.2');
117
- console.log('Svelte: URL params:', params.toString());
118
- }
119
-
120
- function testAdvancedCanvas() {
121
- if (!canvasElement) return;
122
-
123
- // Test OffscreenCanvas - baseline newly available
124
- if ('OffscreenCanvas' in window) {
125
- const offscreen = new OffscreenCanvas(150, 150);
126
- const ctx = offscreen.getContext('2d');
127
- if (ctx) {
128
- ctx.fillStyle = '#ff3e00';
129
- ctx.fillRect(0, 0, 75, 75);
130
-
131
- // Convert to ImageBitmap - modern API
132
- offscreen.convertToBlob().then(blob => {
133
- console.log('Svelte: OffscreenCanvas blob created:', blob.size);
134
- });
135
- }
136
- }
137
-
138
- // Test WebGL2 - baseline widely available
139
- const gl = canvasElement.getContext('webgl2');
140
- if (gl) {
141
- gl.clearColor(1.0, 0.24, 0.0, 1.0); // Svelte orange
142
- gl.clear(gl.COLOR_BUFFER_BIT);
143
-
144
- // Test WebGL2 specific features
145
- const texture = gl.createTexture();
146
- gl.bindTexture(gl.TEXTURE_2D, texture);
147
- gl.texStorage2D(gl.TEXTURE_2D, 1, gl.RGBA8, 256, 256);
148
- }
149
- }
150
-
151
- function testServiceWorker() {
152
- // Service Worker registration - baseline widely available
153
- if ('serviceWorker' in navigator) {
154
- navigator.serviceWorker.register('/sw.js')
155
- .then(registration => {
156
- console.log('Svelte: SW registered:', registration.scope);
157
- })
158
- .catch(error => {
159
- console.log('Svelte: SW registration failed:', error);
160
- });
161
- }
162
-
163
- // Test Cache API - baseline widely available
164
- if ('caches' in window) {
165
- caches.open('svelte-cache-v1').then(cache => {
166
- cache.add('/api/data');
167
- console.log('Svelte: Cache opened and populated');
168
- });
169
- }
170
- }
171
- </script>
172
-
173
- <div class="svelte-app">
174
- <h1>Svelte Test App</h1>
175
-
176
- <div class="button-group">
177
- <button on:click={openDialog}>Open Dialog</button>
178
- <button on:click={testWebAPIs}>Test Web APIs</button>
179
- <button on:click={testAdvancedCanvas}>Test Canvas</button>
180
- <button on:click={testServiceWorker}>Test Service Worker</button>
181
- </div>
182
-
183
- <dialog bind:this={dialogElement} open={dialogOpen}>
184
- <div class="dialog-content">
185
- <h2>Modern Dialog in Svelte</h2>
186
- <p>This dialog uses the native HTML dialog element with modern CSS styling.</p>
187
- <button on:click={closeDialog}>Close Dialog</button>
188
- </div>
189
- </dialog>
190
-
191
- <div class="container-test">
192
- <h3>Container Query Test</h3>
193
- <p>This container adapts based on its own size, not the viewport.</p>
194
- </div>
195
-
196
- <canvas bind:this={canvasElement} width="300" height="200"></canvas>
197
- </div>
198
-
199
- <style>
200
- /* Modern CSS features in Svelte component */
201
- .svelte-app {
202
- container-type: inline-size;
203
- container-name: svelte-container;
204
-
205
- /* Modern CSS properties */
206
- aspect-ratio: 16/10;
207
- accent-color: #ff3e00;
208
- color-scheme: light dark;
209
-
210
- /* CSS Grid with modern features */
211
- display: grid;
212
- grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
213
- gap: 2rem;
214
-
215
- /* Modern CSS functions */
216
- background: color-mix(in srgb, #ff3e00 20%, white);
217
-
218
- /* Backdrop filter */
219
- backdrop-filter: blur(8px) saturate(1.2);
220
-
221
- padding: 2rem;
222
- border-radius: 12px;
223
- }
224
-
225
- /* Container queries */
226
- @container svelte-container (min-width: 600px) {
227
- .container-test {
228
- font-size: 1.3rem;
229
- grid-column: span 2;
230
- }
231
-
232
- .button-group {
233
- display: flex;
234
- gap: 1rem;
235
- }
236
- }
237
-
238
- @container svelte-container (max-width: 400px) {
239
- .svelte-app {
240
- grid-template-columns: 1fr;
241
- gap: 1rem;
242
- }
243
- }
244
-
245
- /* Modern selectors */
246
- .svelte-app:has(dialog[open]) {
247
- background-color: rgba(255, 62, 0, 0.1);
248
- backdrop-filter: blur(12px);
249
- }
250
-
251
- /* CSS nesting */
252
- .button-group {
253
- display: grid;
254
- gap: 0.5rem;
255
-
256
- button {
257
- background: linear-gradient(135deg, #ff3e00, #ff6b35);
258
- color: white;
259
- border: none;
260
- padding: 0.75rem 1.5rem;
261
- border-radius: 6px;
262
- cursor: pointer;
263
- transition: all 0.2s ease;
264
-
265
- &:hover {
266
- transform: translateY(-2px);
267
- box-shadow: 0 4px 12px rgba(255, 62, 0, 0.3);
268
- }
269
-
270
- &:focus-visible {
271
- outline: 2px solid #ff3e00;
272
- outline-offset: 2px;
273
- }
274
-
275
- &:active {
276
- transform: translateY(0);
277
- }
278
- }
279
- }
280
-
281
- .container-test {
282
- background: linear-gradient(45deg, #ff3e00, transparent);
283
- padding: 1.5rem;
284
- border-radius: 8px;
285
-
286
- /* Modern CSS units and functions */
287
- width: clamp(200px, 100%, 500px);
288
- height: max(120px, 12vh);
289
- margin-block: 1rem;
290
- padding-inline: 2rem;
291
- }
292
-
293
- /* Dialog styling with modern CSS */
294
- dialog {
295
- border: none;
296
- border-radius: 12px;
297
- padding: 0;
298
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
299
- backdrop-filter: blur(10px);
300
-
301
- &::backdrop {
302
- background: color-mix(in srgb, black 50%, transparent);
303
- backdrop-filter: blur(4px);
304
- }
305
- }
306
-
307
- .dialog-content {
308
- padding: 2rem;
309
- background: linear-gradient(135deg, white, #f8f9fa);
310
- border-radius: 12px;
311
-
312
- h2 {
313
- margin-top: 0;
314
- color: #ff3e00;
315
- }
316
-
317
- button {
318
- background: #ff3e00;
319
- color: white;
320
- border: none;
321
- padding: 0.5rem 1rem;
322
- border-radius: 4px;
323
- cursor: pointer;
324
-
325
- &:hover {
326
- background: #e63600;
327
- }
328
- }
329
- }
330
-
331
- canvas {
332
- border: 2px solid #ff3e00;
333
- border-radius: 8px;
334
- background: white;
335
-
336
- &:hover {
337
- box-shadow: 0 4px 16px rgba(255, 62, 0, 0.2);
338
- }
339
- }
340
-
341
- /* CSS custom properties with modern color functions */
342
- :root {
343
- --svelte-primary: oklch(0.6 0.25 25);
344
- --svelte-secondary: color(display-p3 1 0.24 0);
345
- }
346
-
347
- /* Modern pseudo-classes and logical properties */
348
- .svelte-app > * {
349
- margin-block-end: 1rem;
350
- }
351
-
352
- .svelte-app *:is(h1, h2, h3) {
353
- color: var(--svelte-primary);
354
- font-weight: 600;
355
- }
356
-
357
- /* CSS @supports for progressive enhancement */
358
- @supports (container-type: inline-size) {
359
- .svelte-app {
360
- border: 3px solid #ff3e00;
361
- }
362
- }
363
-
364
- @supports (backdrop-filter: blur(10px)) {
365
- dialog {
366
- background: rgba(255, 255, 255, 0.9);
367
- }
368
- }
369
- </style>
@@ -1,76 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Vanilla Test Project</title>
7
- <link rel="stylesheet" href="styles.css">
8
- </head>
9
- <body>
10
- <div class="vanilla-app">
11
- <h1>Vanilla JavaScript Test App</h1>
12
-
13
- <div class="button-group">
14
- <button id="openDialog">Open Dialog</button>
15
- <button id="testAPIs">Test Web APIs</button>
16
- <button id="testCanvas">Test Canvas</button>
17
- <button id="testWebGL">Test WebGL</button>
18
- <button id="testServiceWorker">Test Service Worker</button>
19
- </div>
20
-
21
- <!-- Modern HTML elements -->
22
- <dialog id="testDialog">
23
- <div class="dialog-content">
24
- <h2>Native HTML Dialog</h2>
25
- <p>This is a native HTML dialog element with modern styling.</p>
26
- <form method="dialog">
27
- <button value="cancel">Cancel</button>
28
- <button value="confirm">Confirm</button>
29
- </form>
30
- </div>
31
- </dialog>
32
-
33
- <details class="details-section">
34
- <summary>Modern HTML Details/Summary</summary>
35
- <p>This content is revealed when the summary is clicked. The details/summary elements are part of modern HTML.</p>
36
- <ul>
37
- <li>Baseline widely available</li>
38
- <li>Native browser implementation</li>
39
- <li>Accessible by default</li>
40
- </ul>
41
- </details>
42
-
43
- <div class="container-test">
44
- <h3>Container Query Test</h3>
45
- <p>This container changes layout based on its own size.</p>
46
- <div class="nested-container">
47
- <p>Nested content that responds to container queries.</p>
48
- </div>
49
- </div>
50
-
51
- <div class="grid-container">
52
- <div class="grid-item">Grid Item 1</div>
53
- <div class="grid-item">Grid Item 2</div>
54
- <div class="grid-item">Grid Item 3</div>
55
- <div class="grid-item">Grid Item 4</div>
56
- </div>
57
-
58
- <canvas id="testCanvas" width="400" height="300"></canvas>
59
-
60
- <div class="modern-inputs">
61
- <h3>Modern Input Types</h3>
62
- <input type="date" id="dateInput" />
63
- <input type="color" id="colorInput" value="#ff0000" />
64
- <input type="range" id="rangeInput" min="0" max="100" value="50" />
65
- <input type="search" id="searchInput" placeholder="Search..." />
66
- </div>
67
-
68
- <div class="loading-test">
69
- <h3>Lazy Loading Test</h3>
70
- <img src="https://picsum.photos/400/300" alt="Test image" loading="lazy" />
71
- </div>
72
- </div>
73
-
74
- <script src="script.js"></script>
75
- </body>
76
- </html>