baseguard 1.0.0 → 1.0.2
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/.baseguardrc.example.json +64 -0
- package/.eslintrc.json +1 -1
- package/CHANGELOG.md +196 -0
- package/DEPLOYMENT.md +625 -0
- package/DEPLOYMENT_CHECKLIST.md +239 -0
- package/DEPLOYMENT_SUMMARY_v1.0.2.md +202 -0
- package/QUICK_START.md +134 -0
- package/README.md +447 -52
- package/RELEASE_NOTES_v1.0.2.md +434 -0
- package/bin/base.js +155 -36
- package/dist/ai/agentkit-orchestrator.d.ts +116 -0
- package/dist/ai/agentkit-orchestrator.d.ts.map +1 -0
- package/dist/ai/agentkit-orchestrator.js +417 -0
- package/dist/ai/agentkit-orchestrator.js.map +1 -0
- package/dist/ai/gemini-code-fixer.d.ts +85 -0
- package/dist/ai/gemini-code-fixer.d.ts.map +1 -0
- package/dist/ai/gemini-code-fixer.js +452 -0
- package/dist/ai/gemini-code-fixer.js.map +1 -0
- package/dist/ai/jules-implementer.d.ts +5 -4
- package/dist/ai/jules-implementer.d.ts.map +1 -1
- package/dist/ai/jules-implementer.js +6 -5
- package/dist/ai/jules-implementer.js.map +1 -1
- package/dist/ai/unified-code-fixer.d.ts +69 -0
- package/dist/ai/unified-code-fixer.d.ts.map +1 -0
- package/dist/ai/unified-code-fixer.js +289 -0
- package/dist/ai/unified-code-fixer.js.map +1 -0
- package/dist/commands/check.d.ts +3 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +166 -34
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/config.d.ts +4 -0
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +183 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/fix.d.ts.map +1 -1
- package/dist/commands/fix.js +89 -91
- package/dist/commands/fix.js.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +1 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +16 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/status.d.ts +14 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +254 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/core/baseguard.d.ts +47 -5
- package/dist/core/baseguard.d.ts.map +1 -1
- package/dist/core/baseguard.js +506 -52
- package/dist/core/baseguard.js.map +1 -1
- package/dist/core/cache-manager.d.ts.map +1 -1
- package/dist/core/cache-manager.js +3 -1
- package/dist/core/cache-manager.js.map +1 -1
- package/dist/core/configuration-recovery.d.ts +116 -0
- package/dist/core/configuration-recovery.d.ts.map +1 -0
- package/dist/core/configuration-recovery.js +552 -0
- package/dist/core/configuration-recovery.js.map +1 -0
- package/dist/core/configuration.d.ts +4 -0
- package/dist/core/configuration.d.ts.map +1 -1
- package/dist/core/configuration.js +35 -0
- package/dist/core/configuration.js.map +1 -1
- package/dist/core/debug-logger.d.ts +181 -0
- package/dist/core/debug-logger.d.ts.map +1 -0
- package/dist/core/debug-logger.js +479 -0
- package/dist/core/debug-logger.js.map +1 -0
- package/dist/core/file-processor.d.ts.map +1 -1
- package/dist/core/file-processor.js +8 -2
- package/dist/core/file-processor.js.map +1 -1
- package/dist/core/graceful-degradation-manager.d.ts +123 -0
- package/dist/core/graceful-degradation-manager.d.ts.map +1 -0
- package/dist/core/graceful-degradation-manager.js +512 -0
- package/dist/core/graceful-degradation-manager.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/logger.d.ts +1 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +2 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/memory-manager.d.ts +84 -0
- package/dist/core/memory-manager.d.ts.map +1 -1
- package/dist/core/memory-manager.js +236 -1
- package/dist/core/memory-manager.js.map +1 -1
- package/dist/core/startup-optimizer.d.ts +12 -0
- package/dist/core/startup-optimizer.d.ts.map +1 -1
- package/dist/core/startup-optimizer.js +60 -0
- package/dist/core/startup-optimizer.js.map +1 -1
- package/dist/core/system-error-handler.d.ts +65 -0
- package/dist/core/system-error-handler.d.ts.map +1 -0
- package/dist/core/system-error-handler.js +646 -0
- package/dist/core/system-error-handler.js.map +1 -0
- package/dist/git/github-manager.d.ts +5 -16
- package/dist/git/github-manager.d.ts.map +1 -1
- package/dist/git/github-manager.js +6 -61
- package/dist/git/github-manager.js.map +1 -1
- package/dist/parsers/react-parser-optimized.d.ts +16 -0
- package/dist/parsers/react-parser-optimized.d.ts.map +1 -0
- package/dist/parsers/react-parser-optimized.js +147 -0
- package/dist/parsers/react-parser-optimized.js.map +1 -0
- package/dist/parsers/react-parser.d.ts.map +1 -1
- package/dist/parsers/react-parser.js +17 -15
- package/dist/parsers/react-parser.js.map +1 -1
- package/dist/parsers/svelte-parser.d.ts.map +1 -1
- package/dist/parsers/svelte-parser.js +7 -3
- package/dist/parsers/svelte-parser.js.map +1 -1
- package/dist/parsers/vanilla-parser.d.ts.map +1 -1
- package/dist/parsers/vanilla-parser.js +7 -3
- package/dist/parsers/vanilla-parser.js.map +1 -1
- package/dist/parsers/vue-parser.d.ts +18 -0
- package/dist/parsers/vue-parser.d.ts.map +1 -1
- package/dist/parsers/vue-parser.js +387 -1
- package/dist/parsers/vue-parser.js.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/help.js +1 -1
- package/dist/ui/help.js.map +1 -1
- package/dist/ui/prompts.d.ts +7 -4
- package/dist/ui/prompts.d.ts.map +1 -1
- package/dist/ui/prompts.js +48 -55
- package/dist/ui/prompts.js.map +1 -1
- package/package.json +30 -5
- package/src/ai/__tests__/gemini-analyzer.test.ts +2 -2
- package/src/ai/agentkit-orchestrator.ts +534 -0
- package/src/ai/gemini-code-fixer.ts +540 -0
- package/src/ai/jules-implementer.ts +6 -5
- package/src/ai/unified-code-fixer.ts +347 -0
- package/src/commands/config.ts +218 -0
- package/src/commands/fix.ts +98 -94
- package/src/commands/index.ts +2 -1
- package/src/commands/init.ts +16 -2
- package/src/commands/status.ts +307 -0
- package/src/core/baseguard.ts +36 -22
- package/src/core/cache-manager.ts +4 -2
- package/src/core/configuration-recovery.ts +3 -6
- package/src/core/configuration.ts +37 -0
- package/src/core/debug-logger.ts +2 -2
- package/src/core/file-processor.ts +10 -3
- package/src/core/index.ts +5 -1
- package/src/core/memory-manager.ts +4 -3
- package/src/core/startup-optimizer.ts +70 -0
- package/src/core/system-error-handler.ts +9 -5
- package/src/git/github-manager.ts +11 -79
- package/src/parsers/react-parser.ts +2 -2
- package/src/parsers/svelte-parser.ts +13 -9
- package/src/parsers/vanilla-parser.ts +18 -14
- package/src/parsers/vue-parser.ts +20 -14
- package/src/types/index.ts +4 -0
- package/src/ui/help.ts +1 -1
- package/src/ui/prompts.ts +54 -61
- package/test-build.js +41 -0
- package/tests/e2e/git-integration.e2e.test.ts +1 -1
- package/tsconfig.json +0 -1
- package/vitest.config.ts +4 -2
package/DEPLOYMENT.md
ADDED
|
@@ -0,0 +1,625 @@
|
|
|
1
|
+
# BaseGuard Deployment Guide
|
|
2
|
+
|
|
3
|
+
This guide covers deploying BaseGuard in various environments and integrating it into development workflows.
|
|
4
|
+
|
|
5
|
+
## 📦 Installation Methods
|
|
6
|
+
|
|
7
|
+
### Global Installation (Recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Install globally for CLI access
|
|
11
|
+
npm install -g baseguard
|
|
12
|
+
|
|
13
|
+
# Verify installation
|
|
14
|
+
base --version
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Project-specific Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Install as dev dependency
|
|
21
|
+
npm install --save-dev baseguard
|
|
22
|
+
|
|
23
|
+
# Use with npx
|
|
24
|
+
npx base init
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### From Source
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Clone repository
|
|
31
|
+
git clone https://github.com/ebuka1017/baseguard.git
|
|
32
|
+
cd baseguard
|
|
33
|
+
|
|
34
|
+
# Install dependencies
|
|
35
|
+
npm install
|
|
36
|
+
|
|
37
|
+
# Build project
|
|
38
|
+
npm run build
|
|
39
|
+
|
|
40
|
+
# Link globally
|
|
41
|
+
npm link
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 🏗️ CI/CD Integration
|
|
45
|
+
|
|
46
|
+
### GitHub Actions
|
|
47
|
+
|
|
48
|
+
Create `.github/workflows/baseguard.yml`:
|
|
49
|
+
|
|
50
|
+
```yaml
|
|
51
|
+
name: BaseGuard Compatibility Check
|
|
52
|
+
|
|
53
|
+
on:
|
|
54
|
+
push:
|
|
55
|
+
branches: [ main, develop ]
|
|
56
|
+
pull_request:
|
|
57
|
+
branches: [ main ]
|
|
58
|
+
|
|
59
|
+
jobs:
|
|
60
|
+
compatibility-check:
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@v4
|
|
65
|
+
|
|
66
|
+
- name: Setup Node.js
|
|
67
|
+
uses: actions/setup-node@v4
|
|
68
|
+
with:
|
|
69
|
+
node-version: '18'
|
|
70
|
+
cache: 'npm'
|
|
71
|
+
|
|
72
|
+
- name: Install dependencies
|
|
73
|
+
run: npm ci
|
|
74
|
+
|
|
75
|
+
- name: Install BaseGuard
|
|
76
|
+
run: npm install -g baseguard
|
|
77
|
+
|
|
78
|
+
- name: Initialize BaseGuard
|
|
79
|
+
run: |
|
|
80
|
+
base init --preset baseline-widely --skip-hooks --skip-api-keys
|
|
81
|
+
|
|
82
|
+
- name: Check compatibility
|
|
83
|
+
run: base check --strict --format junit > baseguard-results.xml
|
|
84
|
+
|
|
85
|
+
- name: Upload results
|
|
86
|
+
uses: actions/upload-artifact@v3
|
|
87
|
+
if: always()
|
|
88
|
+
with:
|
|
89
|
+
name: baseguard-results
|
|
90
|
+
path: baseguard-results.xml
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### GitLab CI
|
|
94
|
+
|
|
95
|
+
Create `.gitlab-ci.yml`:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
stages:
|
|
99
|
+
- compatibility-check
|
|
100
|
+
|
|
101
|
+
baseguard:
|
|
102
|
+
stage: compatibility-check
|
|
103
|
+
image: node:18
|
|
104
|
+
before_script:
|
|
105
|
+
- npm install -g baseguard
|
|
106
|
+
script:
|
|
107
|
+
- base init --preset baseline-widely --skip-hooks --skip-api-keys
|
|
108
|
+
- base check --strict --format json > baseguard-report.json
|
|
109
|
+
artifacts:
|
|
110
|
+
reports:
|
|
111
|
+
junit: baseguard-report.json
|
|
112
|
+
expire_in: 1 week
|
|
113
|
+
only:
|
|
114
|
+
- merge_requests
|
|
115
|
+
- main
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Jenkins Pipeline
|
|
119
|
+
|
|
120
|
+
Create `Jenkinsfile`:
|
|
121
|
+
|
|
122
|
+
```groovy
|
|
123
|
+
pipeline {
|
|
124
|
+
agent any
|
|
125
|
+
|
|
126
|
+
tools {
|
|
127
|
+
nodejs '18'
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
stages {
|
|
131
|
+
stage('Install BaseGuard') {
|
|
132
|
+
steps {
|
|
133
|
+
sh 'npm install -g baseguard'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
stage('Initialize') {
|
|
138
|
+
steps {
|
|
139
|
+
sh 'base init --preset baseline-widely --skip-hooks --skip-api-keys'
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
stage('Compatibility Check') {
|
|
144
|
+
steps {
|
|
145
|
+
sh 'base check --strict --format junit > baseguard-results.xml'
|
|
146
|
+
}
|
|
147
|
+
post {
|
|
148
|
+
always {
|
|
149
|
+
junit 'baseguard-results.xml'
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Azure DevOps
|
|
158
|
+
|
|
159
|
+
Create `azure-pipelines.yml`:
|
|
160
|
+
|
|
161
|
+
```yaml
|
|
162
|
+
trigger:
|
|
163
|
+
- main
|
|
164
|
+
|
|
165
|
+
pool:
|
|
166
|
+
vmImage: 'ubuntu-latest'
|
|
167
|
+
|
|
168
|
+
steps:
|
|
169
|
+
- task: NodeTool@0
|
|
170
|
+
inputs:
|
|
171
|
+
versionSpec: '18.x'
|
|
172
|
+
displayName: 'Install Node.js'
|
|
173
|
+
|
|
174
|
+
- script: |
|
|
175
|
+
npm install -g baseguard
|
|
176
|
+
base init --preset baseline-widely --skip-hooks --skip-api-keys
|
|
177
|
+
displayName: 'Setup BaseGuard'
|
|
178
|
+
|
|
179
|
+
- script: |
|
|
180
|
+
base check --strict --format junit > $(Agent.TempDirectory)/baseguard-results.xml
|
|
181
|
+
displayName: 'Run Compatibility Check'
|
|
182
|
+
|
|
183
|
+
- task: PublishTestResults@2
|
|
184
|
+
inputs:
|
|
185
|
+
testResultsFormat: 'JUnit'
|
|
186
|
+
testResultsFiles: '$(Agent.TempDirectory)/baseguard-results.xml'
|
|
187
|
+
displayName: 'Publish Results'
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## 🐳 Docker Integration
|
|
191
|
+
|
|
192
|
+
### Dockerfile
|
|
193
|
+
|
|
194
|
+
```dockerfile
|
|
195
|
+
FROM node:18-alpine
|
|
196
|
+
|
|
197
|
+
# Install BaseGuard globally
|
|
198
|
+
RUN npm install -g baseguard
|
|
199
|
+
|
|
200
|
+
# Set working directory
|
|
201
|
+
WORKDIR /app
|
|
202
|
+
|
|
203
|
+
# Copy project files
|
|
204
|
+
COPY . .
|
|
205
|
+
|
|
206
|
+
# Install project dependencies
|
|
207
|
+
RUN npm ci
|
|
208
|
+
|
|
209
|
+
# Initialize BaseGuard
|
|
210
|
+
RUN base init --preset baseline-widely --skip-hooks --skip-api-keys
|
|
211
|
+
|
|
212
|
+
# Run compatibility check
|
|
213
|
+
CMD ["base", "check", "--strict"]
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Docker Compose
|
|
217
|
+
|
|
218
|
+
```yaml
|
|
219
|
+
version: '3.8'
|
|
220
|
+
|
|
221
|
+
services:
|
|
222
|
+
baseguard:
|
|
223
|
+
build: .
|
|
224
|
+
volumes:
|
|
225
|
+
- .:/app
|
|
226
|
+
environment:
|
|
227
|
+
- NODE_ENV=production
|
|
228
|
+
command: base check --strict --format json
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## 🔧 Team Configuration
|
|
232
|
+
|
|
233
|
+
### Shared Configuration
|
|
234
|
+
|
|
235
|
+
Create a shared `.baseguardrc.json` template:
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"version": "1.0.2",
|
|
240
|
+
"targets": [
|
|
241
|
+
"chrome baseline",
|
|
242
|
+
"firefox baseline",
|
|
243
|
+
"safari baseline"
|
|
244
|
+
],
|
|
245
|
+
"codingAgent": {
|
|
246
|
+
"primary": "gemini",
|
|
247
|
+
"fallback": "jules"
|
|
248
|
+
},
|
|
249
|
+
"automation": {
|
|
250
|
+
"enabled": true,
|
|
251
|
+
"trigger": "pre-commit",
|
|
252
|
+
"autoAnalysis": true,
|
|
253
|
+
"autoFix": false
|
|
254
|
+
},
|
|
255
|
+
"files": {
|
|
256
|
+
"include": ["src/**/*.{js,jsx,ts,tsx,vue,svelte,css}"],
|
|
257
|
+
"exclude": ["node_modules/**", "dist/**", "build/**"]
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Team Setup Script
|
|
263
|
+
|
|
264
|
+
Create `scripts/setup-baseguard.sh`:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
#!/bin/bash
|
|
268
|
+
|
|
269
|
+
echo "🛡️ Setting up BaseGuard for the team..."
|
|
270
|
+
|
|
271
|
+
# Install BaseGuard globally
|
|
272
|
+
npm install -g baseguard
|
|
273
|
+
|
|
274
|
+
# Initialize with team configuration
|
|
275
|
+
base init --preset baseline-widely
|
|
276
|
+
|
|
277
|
+
# Enable automation
|
|
278
|
+
base automation enable --trigger pre-commit
|
|
279
|
+
|
|
280
|
+
echo "✅ BaseGuard setup complete!"
|
|
281
|
+
echo "📝 Next steps:"
|
|
282
|
+
echo " 1. Run 'base config set-keys' to configure API keys"
|
|
283
|
+
echo " 2. Run 'base check' to verify setup"
|
|
284
|
+
echo " 3. Run 'base fix' to test AI fixing"
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## 🌐 Environment-specific Configurations
|
|
288
|
+
|
|
289
|
+
### Development Environment
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"targets": ["chrome baseline", "firefox baseline"],
|
|
294
|
+
"automation": {
|
|
295
|
+
"enabled": true,
|
|
296
|
+
"trigger": "pre-commit",
|
|
297
|
+
"autoFix": true
|
|
298
|
+
},
|
|
299
|
+
"debug": true
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Staging Environment
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"targets": ["baseline-widely"],
|
|
308
|
+
"automation": {
|
|
309
|
+
"enabled": true,
|
|
310
|
+
"trigger": "pre-push",
|
|
311
|
+
"autoFix": false
|
|
312
|
+
},
|
|
313
|
+
"strict": true
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Production Environment
|
|
318
|
+
|
|
319
|
+
```json
|
|
320
|
+
{
|
|
321
|
+
"targets": ["chrome 88", "firefox 78", "safari 14"],
|
|
322
|
+
"automation": {
|
|
323
|
+
"enabled": false
|
|
324
|
+
},
|
|
325
|
+
"offline": true
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## 📊 Monitoring & Reporting
|
|
330
|
+
|
|
331
|
+
### Custom Reporting Script
|
|
332
|
+
|
|
333
|
+
Create `scripts/baseguard-report.js`:
|
|
334
|
+
|
|
335
|
+
```javascript
|
|
336
|
+
#!/usr/bin/env node
|
|
337
|
+
|
|
338
|
+
const { execSync } = require('child_process');
|
|
339
|
+
const fs = require('fs');
|
|
340
|
+
|
|
341
|
+
async function generateReport() {
|
|
342
|
+
try {
|
|
343
|
+
// Run BaseGuard check
|
|
344
|
+
const result = execSync('base check --format json', { encoding: 'utf8' });
|
|
345
|
+
const violations = JSON.parse(result);
|
|
346
|
+
|
|
347
|
+
// Generate HTML report
|
|
348
|
+
const html = `
|
|
349
|
+
<!DOCTYPE html>
|
|
350
|
+
<html>
|
|
351
|
+
<head>
|
|
352
|
+
<title>BaseGuard Compatibility Report</title>
|
|
353
|
+
<style>
|
|
354
|
+
body { font-family: Arial, sans-serif; margin: 40px; }
|
|
355
|
+
.violation { border: 1px solid #ddd; margin: 10px 0; padding: 15px; }
|
|
356
|
+
.error { border-color: #ff6b6b; background: #ffe0e0; }
|
|
357
|
+
.warning { border-color: #ffa726; background: #fff3e0; }
|
|
358
|
+
</style>
|
|
359
|
+
</head>
|
|
360
|
+
<body>
|
|
361
|
+
<h1>🛡️ BaseGuard Compatibility Report</h1>
|
|
362
|
+
<p>Generated: ${new Date().toISOString()}</p>
|
|
363
|
+
<p>Total Violations: ${violations.length}</p>
|
|
364
|
+
|
|
365
|
+
${violations.map(v => `
|
|
366
|
+
<div class="violation ${v.severity || 'error'}">
|
|
367
|
+
<h3>${v.feature} in ${v.file}</h3>
|
|
368
|
+
<p><strong>Browser:</strong> ${v.browser}</p>
|
|
369
|
+
<p><strong>Line:</strong> ${v.line}</p>
|
|
370
|
+
<p><strong>Reason:</strong> ${v.reason}</p>
|
|
371
|
+
</div>
|
|
372
|
+
`).join('')}
|
|
373
|
+
</body>
|
|
374
|
+
</html>
|
|
375
|
+
`;
|
|
376
|
+
|
|
377
|
+
fs.writeFileSync('baseguard-report.html', html);
|
|
378
|
+
console.log('📊 Report generated: baseguard-report.html');
|
|
379
|
+
|
|
380
|
+
} catch (error) {
|
|
381
|
+
console.error('❌ Report generation failed:', error.message);
|
|
382
|
+
process.exit(1);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
generateReport();
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Slack Integration
|
|
390
|
+
|
|
391
|
+
Create `scripts/slack-notify.js`:
|
|
392
|
+
|
|
393
|
+
```javascript
|
|
394
|
+
#!/usr/bin/env node
|
|
395
|
+
|
|
396
|
+
const https = require('https');
|
|
397
|
+
const { execSync } = require('child_process');
|
|
398
|
+
|
|
399
|
+
const SLACK_WEBHOOK = process.env.SLACK_WEBHOOK_URL;
|
|
400
|
+
|
|
401
|
+
async function notifySlack() {
|
|
402
|
+
try {
|
|
403
|
+
const result = execSync('base check --format json', { encoding: 'utf8' });
|
|
404
|
+
const violations = JSON.parse(result);
|
|
405
|
+
|
|
406
|
+
const message = {
|
|
407
|
+
text: `🛡️ BaseGuard Report`,
|
|
408
|
+
attachments: [{
|
|
409
|
+
color: violations.length > 0 ? 'danger' : 'good',
|
|
410
|
+
fields: [{
|
|
411
|
+
title: 'Compatibility Check Results',
|
|
412
|
+
value: violations.length > 0
|
|
413
|
+
? `❌ Found ${violations.length} compatibility violations`
|
|
414
|
+
: `✅ No compatibility violations found`,
|
|
415
|
+
short: false
|
|
416
|
+
}]
|
|
417
|
+
}]
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
// Send to Slack
|
|
421
|
+
const data = JSON.stringify(message);
|
|
422
|
+
const options = {
|
|
423
|
+
method: 'POST',
|
|
424
|
+
headers: {
|
|
425
|
+
'Content-Type': 'application/json',
|
|
426
|
+
'Content-Length': data.length
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
const req = https.request(SLACK_WEBHOOK, options);
|
|
431
|
+
req.write(data);
|
|
432
|
+
req.end();
|
|
433
|
+
|
|
434
|
+
console.log('📢 Slack notification sent');
|
|
435
|
+
|
|
436
|
+
} catch (error) {
|
|
437
|
+
console.error('❌ Slack notification failed:', error.message);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (SLACK_WEBHOOK) {
|
|
442
|
+
notifySlack();
|
|
443
|
+
} else {
|
|
444
|
+
console.log('⚠️ SLACK_WEBHOOK_URL not configured');
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
## 🔐 Security Considerations
|
|
449
|
+
|
|
450
|
+
### API Key Management
|
|
451
|
+
|
|
452
|
+
**Environment Variables:**
|
|
453
|
+
```bash
|
|
454
|
+
# Set in CI/CD environment
|
|
455
|
+
export GEMINI_API_KEY="your-gemini-key"
|
|
456
|
+
export JULES_API_KEY="your-jules-key"
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
**Secrets Management:**
|
|
460
|
+
```bash
|
|
461
|
+
# GitHub Actions
|
|
462
|
+
# Add secrets in repository settings
|
|
463
|
+
# Use ${{ secrets.GEMINI_API_KEY }}
|
|
464
|
+
|
|
465
|
+
# GitLab CI
|
|
466
|
+
# Add variables in project settings
|
|
467
|
+
# Use $GEMINI_API_KEY
|
|
468
|
+
|
|
469
|
+
# Jenkins
|
|
470
|
+
# Use credentials plugin
|
|
471
|
+
# Reference as environment variables
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### Configuration Security
|
|
475
|
+
|
|
476
|
+
**Gitignore Rules:**
|
|
477
|
+
```gitignore
|
|
478
|
+
# BaseGuard configuration (contains API keys)
|
|
479
|
+
.baseguardrc.json
|
|
480
|
+
|
|
481
|
+
# BaseGuard logs and cache
|
|
482
|
+
.baseguard/
|
|
483
|
+
|
|
484
|
+
# Environment files
|
|
485
|
+
.env.local
|
|
486
|
+
.env.*.local
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
**Team Configuration:**
|
|
490
|
+
```bash
|
|
491
|
+
# Use template without API keys
|
|
492
|
+
cp .baseguardrc.template.json .baseguardrc.json
|
|
493
|
+
|
|
494
|
+
# Configure API keys separately
|
|
495
|
+
base config set-keys
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
## 🚀 Performance Optimization
|
|
499
|
+
|
|
500
|
+
### Large Codebases
|
|
501
|
+
|
|
502
|
+
```bash
|
|
503
|
+
# Limit file processing
|
|
504
|
+
export BASEGUARD_MAX_FILES=1000
|
|
505
|
+
export BASEGUARD_MAX_WORKERS=4
|
|
506
|
+
|
|
507
|
+
# Use specific file patterns
|
|
508
|
+
base check --files "src/**/*.{ts,tsx}" --files "!src/**/*.test.ts"
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### Memory Optimization
|
|
512
|
+
|
|
513
|
+
```bash
|
|
514
|
+
# Limit Node.js memory usage
|
|
515
|
+
export NODE_OPTIONS="--max-old-space-size=512"
|
|
516
|
+
|
|
517
|
+
# Use streaming for large files
|
|
518
|
+
export BASEGUARD_STREAM_THRESHOLD=10485760 # 10MB
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
### Caching Strategy
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
# Configure cache size
|
|
525
|
+
export BASEGUARD_CACHE_SIZE=1000
|
|
526
|
+
|
|
527
|
+
# Cache directory (optional)
|
|
528
|
+
export BASEGUARD_CACHE_DIR="/tmp/baseguard-cache"
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
## 🔄 Migration Guide
|
|
532
|
+
|
|
533
|
+
### From Version 1.0.1 to 1.0.2
|
|
534
|
+
|
|
535
|
+
1. **Update BaseGuard:**
|
|
536
|
+
```bash
|
|
537
|
+
npm update -g baseguard
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
2. **Update Configuration:**
|
|
541
|
+
```bash
|
|
542
|
+
base config recover --backup
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
3. **Configure Coding Agents:**
|
|
546
|
+
```bash
|
|
547
|
+
base config coding-agent
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
4. **Test New Features:**
|
|
551
|
+
```bash
|
|
552
|
+
base status
|
|
553
|
+
base diagnostics
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
### Configuration Migration
|
|
557
|
+
|
|
558
|
+
The new version automatically migrates old configurations, but you can manually update:
|
|
559
|
+
|
|
560
|
+
```json
|
|
561
|
+
{
|
|
562
|
+
"version": "1.0.2",
|
|
563
|
+
"targets": ["baseline-widely"],
|
|
564
|
+
"codingAgent": {
|
|
565
|
+
"primary": "gemini",
|
|
566
|
+
"fallback": "jules"
|
|
567
|
+
},
|
|
568
|
+
"automation": {
|
|
569
|
+
"enabled": true,
|
|
570
|
+
"trigger": "pre-commit"
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
## 📞 Support & Troubleshooting
|
|
576
|
+
|
|
577
|
+
### Common Deployment Issues
|
|
578
|
+
|
|
579
|
+
**Permission Errors:**
|
|
580
|
+
```bash
|
|
581
|
+
# Fix npm permissions
|
|
582
|
+
sudo chown -R $(whoami) ~/.npm
|
|
583
|
+
npm install -g baseguard
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
**Git Hook Issues:**
|
|
587
|
+
```bash
|
|
588
|
+
# Reinstall hooks
|
|
589
|
+
base automation disable
|
|
590
|
+
base automation enable
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
**API Key Problems:**
|
|
594
|
+
```bash
|
|
595
|
+
# Reconfigure keys
|
|
596
|
+
base config set-keys
|
|
597
|
+
|
|
598
|
+
# Validate configuration
|
|
599
|
+
base config validate
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
### Getting Help
|
|
603
|
+
|
|
604
|
+
```bash
|
|
605
|
+
# System diagnostics
|
|
606
|
+
base diagnostics
|
|
607
|
+
|
|
608
|
+
# Verbose status
|
|
609
|
+
base status --verbose
|
|
610
|
+
|
|
611
|
+
# Debug mode
|
|
612
|
+
base check --debug
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
### Support Channels
|
|
616
|
+
|
|
617
|
+
- **GitHub Issues:** [Report bugs and request features](https://github.com/ebuka1017/baseguard/issues)
|
|
618
|
+
- **Documentation:** [Complete documentation](https://github.com/ebuka1017/baseguard#readme)
|
|
619
|
+
- **Community:** [Discussions and Q&A](https://github.com/ebuka1017/baseguard/discussions)
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
|
|
623
|
+
**Happy Deploying! 🚀**
|
|
624
|
+
|
|
625
|
+
*Never ship incompatible code again with BaseGuard!* 🛡️
|