baseguard 1.0.5 → 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 (80) 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/package.json +1 -1
  12. package/src/ai/__tests__/gemini-analyzer.test.ts +0 -181
  13. package/src/ai/agentkit-orchestrator.ts +0 -534
  14. package/src/ai/fix-manager.ts +0 -362
  15. package/src/ai/gemini-analyzer.ts +0 -665
  16. package/src/ai/gemini-code-fixer.ts +0 -539
  17. package/src/ai/index.ts +0 -4
  18. package/src/ai/jules-implementer.ts +0 -504
  19. package/src/ai/unified-code-fixer.ts +0 -347
  20. package/src/commands/automation.ts +0 -344
  21. package/src/commands/check.ts +0 -298
  22. package/src/commands/config.ts +0 -584
  23. package/src/commands/fix.ts +0 -269
  24. package/src/commands/index.ts +0 -7
  25. package/src/commands/init.ts +0 -156
  26. package/src/commands/status.ts +0 -307
  27. package/src/core/api-key-manager.ts +0 -298
  28. package/src/core/baseguard.ts +0 -757
  29. package/src/core/baseline-checker.ts +0 -566
  30. package/src/core/cache-manager.ts +0 -272
  31. package/src/core/configuration-recovery.ts +0 -672
  32. package/src/core/configuration.ts +0 -596
  33. package/src/core/debug-logger.ts +0 -590
  34. package/src/core/directory-filter.ts +0 -421
  35. package/src/core/error-handler.ts +0 -518
  36. package/src/core/file-processor.ts +0 -338
  37. package/src/core/gitignore-manager.ts +0 -169
  38. package/src/core/graceful-degradation-manager.ts +0 -596
  39. package/src/core/index.ts +0 -17
  40. package/src/core/lazy-loader.ts +0 -317
  41. package/src/core/logger.ts +0 -0
  42. package/src/core/memory-manager.ts +0 -290
  43. package/src/core/parser-worker.ts +0 -33
  44. package/src/core/startup-optimizer.ts +0 -246
  45. package/src/core/system-error-handler.ts +0 -755
  46. package/src/git/automation-engine.ts +0 -361
  47. package/src/git/github-manager.ts +0 -190
  48. package/src/git/hook-manager.ts +0 -210
  49. package/src/git/index.ts +0 -4
  50. package/src/index.ts +0 -8
  51. package/src/parsers/feature-validator.ts +0 -559
  52. package/src/parsers/index.ts +0 -8
  53. package/src/parsers/parser-manager.ts +0 -418
  54. package/src/parsers/parser.ts +0 -26
  55. package/src/parsers/react-parser-optimized.ts +0 -161
  56. package/src/parsers/react-parser.ts +0 -359
  57. package/src/parsers/svelte-parser.ts +0 -510
  58. package/src/parsers/vanilla-parser.ts +0 -685
  59. package/src/parsers/vue-parser.ts +0 -476
  60. package/src/types/index.ts +0 -96
  61. package/src/ui/components.ts +0 -567
  62. package/src/ui/help.ts +0 -193
  63. package/src/ui/index.ts +0 -4
  64. package/src/ui/prompts.ts +0 -681
  65. package/src/ui/terminal-header.ts +0 -59
  66. package/tests/e2e/baseguard.e2e.test.ts +0 -516
  67. package/tests/e2e/cross-platform.e2e.test.ts +0 -420
  68. package/tests/e2e/git-integration.e2e.test.ts +0 -487
  69. package/tests/fixtures/react-project/package.json +0 -14
  70. package/tests/fixtures/react-project/src/App.css +0 -76
  71. package/tests/fixtures/react-project/src/App.tsx +0 -77
  72. package/tests/fixtures/svelte-project/package.json +0 -11
  73. package/tests/fixtures/svelte-project/src/App.svelte +0 -369
  74. package/tests/fixtures/vanilla-project/index.html +0 -76
  75. package/tests/fixtures/vanilla-project/script.js +0 -331
  76. package/tests/fixtures/vanilla-project/styles.css +0 -359
  77. package/tests/fixtures/vue-project/package.json +0 -12
  78. package/tests/fixtures/vue-project/src/App.vue +0 -216
  79. package/tmp-smoke/.baseguard/backups/config-2026-02-19T12-04-11-067Z-auto.json +0 -30
  80. package/tmp-smoke/src/bad.css +0 -3
package/src/ui/help.ts DELETED
@@ -1,193 +0,0 @@
1
- import chalk from 'chalk';
2
- import { readFileSync } from 'fs';
3
- import { join, dirname } from 'path';
4
- import { fileURLToPath } from 'url';
5
- import { showTerminalHeader } from './terminal-header.js';
6
-
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = dirname(__filename);
9
-
10
- /**
11
- * Show version information and system details
12
- */
13
- export async function showVersionInfo(options: { checkUpdates?: boolean } = {}): Promise<void> {
14
- try {
15
- // Read package.json for version info
16
- const packagePath = join(__dirname, '../../package.json');
17
- const packageJson = JSON.parse(readFileSync(packagePath, 'utf-8'));
18
-
19
- console.log(chalk.cyan('🛡️ BaseGuard Version Information\n'));
20
-
21
- // BaseGuard version
22
- console.log(chalk.white('BaseGuard:'));
23
- console.log(` Version: ${chalk.green(packageJson.version)}`);
24
- console.log(` License: ${packageJson.license}`);
25
- console.log(` Homepage: ${chalk.blue('https://github.com/baseguard/baseguard')}`);
26
-
27
- // System information
28
- console.log(chalk.white('\nSystem:'));
29
- console.log(` Node.js: ${chalk.green(process.version)}`);
30
- console.log(` Platform: ${process.platform} ${process.arch}`);
31
- console.log(` OS: ${process.platform === 'win32' ? 'Windows' : process.platform === 'darwin' ? 'macOS' : 'Linux'}`);
32
-
33
- // Dependencies
34
- console.log(chalk.white('\nKey Dependencies:'));
35
- const deps = packageJson.dependencies;
36
- console.log(` web-features: ${chalk.green(deps['web-features'])}`);
37
- console.log(` commander: ${chalk.green(deps.commander)}`);
38
- console.log(` chalk: ${chalk.green(deps.chalk)}`);
39
-
40
- // Engine requirements
41
- console.log(chalk.white('\nRequirements:'));
42
- console.log(` Node.js: ${chalk.green(packageJson.engines.node)}`);
43
-
44
- // Check for updates if requested
45
- if (options.checkUpdates) {
46
- console.log(chalk.white('\nChecking for updates...'));
47
- try {
48
- const { default: fetch } = await import('node-fetch');
49
- const response = await fetch('https://registry.npmjs.org/baseguard/latest');
50
- const data = await response.json() as any;
51
- const latestVersion = data.version;
52
-
53
- if (latestVersion !== packageJson.version) {
54
- console.log(chalk.yellow(` 📦 Update available: ${chalk.green(latestVersion)} (current: ${packageJson.version})`));
55
- console.log(chalk.yellow(` Run: ${chalk.white('npm update -g baseguard')}`));
56
- } else {
57
- console.log(chalk.green(' ✅ You have the latest version'));
58
- }
59
- } catch (error) {
60
- console.log(chalk.red(' ❌ Unable to check for updates (network error)'));
61
- }
62
- }
63
-
64
- // Installation info
65
- console.log(chalk.white('\nInstallation:'));
66
- console.log(` Global: ${chalk.white('npm install -g baseguard')}`);
67
- console.log(` Local: ${chalk.white('npm install --save-dev baseguard')}`);
68
-
69
- // Support links
70
- console.log(chalk.white('\nSupport:'));
71
- console.log(` Documentation: ${chalk.blue('https://github.com/baseguard/baseguard#readme')}`);
72
- console.log(` Issues: ${chalk.blue('https://github.com/baseguard/baseguard/issues')}`);
73
- console.log(` Discussions: ${chalk.blue('https://github.com/baseguard/baseguard/discussions')}`);
74
-
75
- } catch (error) {
76
- console.error(chalk.red('❌ Error reading version information:'), error instanceof Error ? error.message : 'Unknown error');
77
- process.exit(1);
78
- }
79
- }
80
-
81
- /**
82
- * Show comprehensive help information
83
- */
84
- export function showGlobalHelp(): void {
85
- showTerminalHeader();
86
-
87
- console.log(chalk.cyan('🛡️ BaseGuard - Never ship incompatible code again\n'));
88
-
89
- console.log(chalk.white('DESCRIPTION:'));
90
- console.log(' BaseGuard is an intelligent browser compatibility enforcement tool that prevents');
91
- console.log(' incompatible code from reaching production. It combines Baseline detection using');
92
- console.log(' the web-features package, Gemini AI analysis, and Jules autonomous fixing.\n');
93
-
94
- console.log(chalk.white('USAGE:'));
95
- console.log(` ${chalk.cyan('base')} ${chalk.white('<command>')} ${chalk.gray('[options]')}\n`);
96
-
97
- console.log(chalk.white('CORE COMMANDS:'));
98
- console.log(` ${chalk.cyan('init')} Initialize BaseGuard in your project`);
99
- console.log(` ${chalk.cyan('check')} Scan for browser compatibility violations`);
100
- console.log(` ${chalk.cyan('fix')} Fix violations with AI assistance`);
101
- console.log(` ${chalk.cyan('config')} Manage configuration and settings`);
102
- console.log(` ${chalk.cyan('automation')} Manage git hooks and automation\n`);
103
-
104
- console.log(chalk.white('QUICK COMMANDS:'));
105
- console.log(` ${chalk.cyan('add')} ${chalk.white('<target>')} Add browser target (e.g., "chrome 100")`);
106
- console.log(` ${chalk.cyan('remove')} ${chalk.white('<target>')} Remove browser target`);
107
- console.log(` ${chalk.cyan('list')} Show configuration summary\n`);
108
-
109
- console.log(chalk.white('UTILITY COMMANDS:'));
110
- console.log(` ${chalk.cyan('version')} Show version and system information`);
111
- console.log(` ${chalk.cyan('help')} ${chalk.white('[command]')} Show help for specific command\n`);
112
-
113
- console.log(chalk.white('GETTING STARTED:'));
114
- console.log(` 1. ${chalk.white('base init')} Set up BaseGuard in your project`);
115
- console.log(` 2. ${chalk.white('base config set-keys')} Configure API keys for AI features`);
116
- console.log(` 3. ${chalk.white('base automation enable')} Enable git hooks for automation`);
117
- console.log(` 4. ${chalk.white('base check')} Check for compatibility issues\n`);
118
-
119
- console.log(chalk.white('COMMON WORKFLOWS:'));
120
- console.log(chalk.yellow(' Basic Compatibility Checking:'));
121
- console.log(` ${chalk.dim('$')} base init`);
122
- console.log(` ${chalk.dim('$')} base check`);
123
- console.log(` ${chalk.dim('$')} base add "chrome 100" ${chalk.gray('# Add specific browser support')}`);
124
-
125
- console.log(chalk.yellow('\n AI-Powered Fixing:'));
126
- console.log(` ${chalk.dim('$')} base config set-keys ${chalk.gray('# Configure Gemini & Jules API keys')}`);
127
- console.log(` ${chalk.dim('$')} base fix ${chalk.gray('# Analyze and fix violations')}`);
128
-
129
- console.log(chalk.yellow('\n Automated Git Integration:'));
130
- console.log(` ${chalk.dim('$')} base automation enable ${chalk.gray('# Install git hooks')}`);
131
- console.log(` ${chalk.dim('$')} git commit ${chalk.gray('# Automatic checking on commit')}`);
132
-
133
- console.log(chalk.white('\nBROWSER TARGETS:'));
134
- console.log(` ${chalk.cyan('Presets:')} baseline-widely, baseline-newly, last-2-years, custom`);
135
- console.log(` ${chalk.cyan('Format:')} "browser version" (e.g., "chrome 100", "safari baseline")`);
136
- console.log(` ${chalk.cyan('Examples:')} "chrome 100", "safari 15", "firefox baseline"\n`);
137
-
138
- console.log(chalk.white('AI SERVICES:'));
139
- console.log(` ${chalk.cyan('Gemini:')} AI analysis of compatibility issues`);
140
- console.log(` Get API key: ${chalk.blue('https://aistudio.google.com')}`);
141
- console.log(` ${chalk.cyan('Jules:')} Autonomous code fixing (requires GitHub repository)`);
142
- console.log(` Get API key: ${chalk.blue('https://jules.google.com')}\n`);
143
-
144
- console.log(chalk.white('SUPPORTED FILES:'));
145
- console.log(' • JavaScript/TypeScript: .js, .jsx, .ts, .tsx');
146
- console.log(' • Framework files: .vue, .svelte');
147
- console.log(' • Stylesheets: .css');
148
- console.log(' • Markup: .html\n');
149
-
150
- console.log(chalk.white('FEATURES DETECTED:'));
151
- console.log(' • CSS properties, selectors, and at-rules');
152
- console.log(' • JavaScript APIs and ECMAScript features');
153
- console.log(' • HTML elements and attributes');
154
- console.log(' • Web platform APIs (Canvas, WebGL, WebRTC, WebAssembly, etc.)');
155
- console.log(' • Framework-aware extraction (React, Vue, Svelte)\n');
156
-
157
- console.log(chalk.white('CONFIGURATION:'));
158
- console.log(` ${chalk.cyan('File:')} .baseguardrc.json (automatically created)`);
159
- console.log(` ${chalk.cyan('Security:')} Automatically added to .gitignore`);
160
- console.log(` ${chalk.cyan('Validation:')} Built-in configuration validation\n`);
161
-
162
- console.log(chalk.white('EXAMPLES:'));
163
- console.log(chalk.gray(' # Quick setup and check'));
164
- console.log(` ${chalk.dim('$')} base init --preset baseline-widely`);
165
- console.log(` ${chalk.dim('$')} base check --strict`);
166
-
167
- console.log(chalk.gray('\n # Configure specific browser support'));
168
- console.log(` ${chalk.dim('$')} base add "chrome 100"`);
169
- console.log(` ${chalk.dim('$')} base add "safari baseline"`);
170
- console.log(` ${chalk.dim('$')} base check --files "src/**/*.ts"`);
171
-
172
- console.log(chalk.gray('\n # Set up AI-powered fixing'));
173
- console.log(` ${chalk.dim('$')} base config set-keys`);
174
- console.log(` ${chalk.dim('$')} base fix --analyze-only`);
175
- console.log(` ${chalk.dim('$')} base fix --auto`);
176
-
177
- console.log(chalk.gray('\n # Enable automation'));
178
- console.log(` ${chalk.dim('$')} base automation enable --trigger pre-commit`);
179
- console.log(` ${chalk.dim('$')} base automation status`);
180
-
181
- console.log(chalk.white('\nGLOBAL OPTIONS:'));
182
- console.log(` ${chalk.cyan('--help, -h')} Show help information`);
183
- console.log(` ${chalk.cyan('--version, -V')} Show version number\n`);
184
-
185
- console.log(chalk.white('DOCUMENTATION:'));
186
- console.log(` ${chalk.blue('https://github.com/baseguard/baseguard#readme')}\n`);
187
-
188
- console.log(chalk.white('SUPPORT:'));
189
- console.log(` Issues: ${chalk.blue('https://github.com/baseguard/baseguard/issues')}`);
190
- console.log(` Discussions: ${chalk.blue('https://github.com/baseguard/baseguard/discussions')}\n`);
191
-
192
- console.log(chalk.gray('For command-specific help, run: base help <command>'));
193
- }
package/src/ui/index.ts DELETED
@@ -1,4 +0,0 @@
1
- export { UIComponents, Colors } from './components.js';
2
- export { Prompts } from './prompts.js';
3
- export { showTerminalHeader, showCompactHeader } from './terminal-header.js';
4
- export { showVersionInfo, showGlobalHelp } from './help.js';