@danielszlaski/envguard 0.1.3 → 0.1.5
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/.envguardrc.example.json +1 -0
- package/.envguardrc.json +16 -0
- package/.github/FUNDING.yml +15 -0
- package/LICENSE +1 -1
- package/README.md +285 -10
- package/dist/analyzer/envAnalyzer.d.ts +8 -2
- package/dist/analyzer/envAnalyzer.d.ts.map +1 -1
- package/dist/analyzer/envAnalyzer.js +22 -8
- package/dist/analyzer/envAnalyzer.js.map +1 -1
- package/dist/cli.js +58 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/fix.d.ts.map +1 -1
- package/dist/commands/fix.js +32 -7
- package/dist/commands/fix.js.map +1 -1
- package/dist/commands/install-hook.d.ts +18 -0
- package/dist/commands/install-hook.d.ts.map +1 -0
- package/dist/commands/install-hook.js +148 -0
- package/dist/commands/install-hook.js.map +1 -0
- package/dist/commands/scan.d.ts +1 -0
- package/dist/commands/scan.d.ts.map +1 -1
- package/dist/commands/scan.js +150 -41
- package/dist/commands/scan.js.map +1 -1
- package/dist/config/configLoader.d.ts +6 -0
- package/dist/config/configLoader.d.ts.map +1 -1
- package/dist/config/configLoader.js +1 -0
- package/dist/config/configLoader.js.map +1 -1
- package/dist/scanner/codeScanner.d.ts +5 -2
- package/dist/scanner/codeScanner.d.ts.map +1 -1
- package/dist/scanner/codeScanner.js +72 -25
- package/dist/scanner/codeScanner.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/analyzer/envAnalyzer.ts +27 -10
- package/src/cli.ts +62 -3
- package/src/commands/fix.ts +40 -9
- package/src/commands/install-hook.ts +128 -0
- package/src/commands/scan.ts +168 -47
- package/src/config/configLoader.ts +8 -0
- package/src/scanner/codeScanner.ts +97 -28
- package/src/types.ts +3 -1
- package/test-project/src/lambda2/handler2.js +1 -1
- package/test-project/.envguardrc.json +0 -7
package/.envguardrc.example.json
CHANGED
package/.envguardrc.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft-07/schema",
|
|
3
|
+
"title": "EnvGuard Configuration",
|
|
4
|
+
"description": "Configuration file for EnvGuard - keep your environment variables in sync",
|
|
5
|
+
"ignoreVars": [
|
|
6
|
+
"VAR_NAME"
|
|
7
|
+
],
|
|
8
|
+
"strict": false,
|
|
9
|
+
"detectFallbacks": true,
|
|
10
|
+
"exclude": [
|
|
11
|
+
"**/tmp/**",
|
|
12
|
+
"**/cache/**",
|
|
13
|
+
"**/node_modules/**",
|
|
14
|
+
"**/dist/**"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: szlaskidaniel # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
4
|
+
# patreon: # Replace with a single Patreon username
|
|
5
|
+
# open_collective: # Replace with a single Open Collective username
|
|
6
|
+
# ko_fi: # Replace with a single Ko-fi username
|
|
7
|
+
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
8
|
+
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
# liberapay: # Replace with a single Liberapay username
|
|
10
|
+
# issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
12
|
+
# polar: # Replace with a single Polar username
|
|
13
|
+
# buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
|
14
|
+
# thanks_dev: # Replace with a single thanks.dev username
|
|
15
|
+
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -23,18 +23,64 @@ EnvGuard automatically:
|
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
26
|
+
**Option 1: Install globally**
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install -g @danielszlaski/envguard
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After installation, use the short command:
|
|
26
33
|
```bash
|
|
27
|
-
|
|
34
|
+
envguard scan
|
|
28
35
|
```
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
**Option 2: Use with npx (no installation needed)**
|
|
31
38
|
|
|
32
39
|
```bash
|
|
33
|
-
npx envguard scan
|
|
40
|
+
npx @danielszlaski/envguard scan
|
|
34
41
|
```
|
|
35
42
|
|
|
36
43
|
## Usage
|
|
37
44
|
|
|
45
|
+
> **Note:** The examples below use `envguard` (short form), which works after installation. If using npx without installation, use `npx @danielszlaski/envguard` instead.
|
|
46
|
+
|
|
47
|
+
### Git Hook Integration (Pre-commit/Pre-push)
|
|
48
|
+
|
|
49
|
+
Automatically run envguard before every commit or push to catch environment variable issues early:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Install a pre-commit hook (runs before each commit)
|
|
53
|
+
envguard install-hook
|
|
54
|
+
|
|
55
|
+
# Or install a pre-push hook (runs before each push)
|
|
56
|
+
envguard install-hook --type pre-push
|
|
57
|
+
|
|
58
|
+
# Force overwrite existing hook
|
|
59
|
+
envguard install-hook --force
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Once installed, the hook will automatically run `envguard check` before each commit (or push). If issues are found, the commit/push will be blocked until you fix them.
|
|
63
|
+
|
|
64
|
+
**Bypass the hook** when needed:
|
|
65
|
+
```bash
|
|
66
|
+
git commit --no-verify
|
|
67
|
+
git push --no-verify
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Remove the hook:**
|
|
71
|
+
```bash
|
|
72
|
+
envguard uninstall-hook
|
|
73
|
+
|
|
74
|
+
# Or for pre-push hook
|
|
75
|
+
envguard uninstall-hook --type pre-push
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**How it works:**
|
|
79
|
+
- The hook creates a script in `.git/hooks/pre-commit` (or `pre-push`)
|
|
80
|
+
- Before each commit/push, it runs `envguard check`
|
|
81
|
+
- If issues are found, the operation is blocked
|
|
82
|
+
- Team members need to install the hook individually (it's not tracked in git)
|
|
83
|
+
|
|
38
84
|
### Scan for issues
|
|
39
85
|
|
|
40
86
|
```bash
|
|
@@ -113,19 +159,183 @@ envguard check
|
|
|
113
159
|
|
|
114
160
|
This is equivalent to `envguard scan --ci` and will exit with code 1 if issues are found.
|
|
115
161
|
|
|
116
|
-
|
|
162
|
+
## GitHub Actions Setup
|
|
163
|
+
|
|
164
|
+
EnvGuard integrates seamlessly with GitHub Actions to validate your environment variables on every pull request or push.
|
|
165
|
+
|
|
166
|
+
### Quick Setup (Recommended)
|
|
167
|
+
|
|
168
|
+
Create `.github/workflows/envguard.yml` in your repository:
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
name: Environment Variables Check
|
|
172
|
+
|
|
173
|
+
on:
|
|
174
|
+
pull_request:
|
|
175
|
+
branches: [main]
|
|
176
|
+
push:
|
|
177
|
+
branches: [main, develop]
|
|
178
|
+
|
|
179
|
+
jobs:
|
|
180
|
+
envguard:
|
|
181
|
+
runs-on: ubuntu-latest
|
|
182
|
+
|
|
183
|
+
steps:
|
|
184
|
+
- name: Checkout code
|
|
185
|
+
uses: actions/checkout@v4
|
|
186
|
+
|
|
187
|
+
- name: Setup Node.js
|
|
188
|
+
uses: actions/setup-node@v4
|
|
189
|
+
with:
|
|
190
|
+
node-version: '20.x'
|
|
191
|
+
|
|
192
|
+
- name: Run EnvGuard check
|
|
193
|
+
run: npx @danielszlaski/envguard scan --ci
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**That's it!** No installation needed - `npx` downloads EnvGuard on demand.
|
|
197
|
+
|
|
198
|
+
### Advanced Setup - With PR Comments
|
|
199
|
+
|
|
200
|
+
Get automatic comments on pull requests when issues are found:
|
|
117
201
|
|
|
118
202
|
```yaml
|
|
119
|
-
name:
|
|
120
|
-
|
|
203
|
+
name: Environment Variables Check
|
|
204
|
+
|
|
205
|
+
on:
|
|
206
|
+
pull_request:
|
|
207
|
+
branches: [main]
|
|
121
208
|
|
|
122
209
|
jobs:
|
|
123
210
|
envguard:
|
|
124
211
|
runs-on: ubuntu-latest
|
|
212
|
+
permissions:
|
|
213
|
+
pull-requests: write
|
|
214
|
+
|
|
125
215
|
steps:
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
216
|
+
- name: Checkout code
|
|
217
|
+
uses: actions/checkout@v4
|
|
218
|
+
|
|
219
|
+
- name: Setup Node.js
|
|
220
|
+
uses: actions/setup-node@v4
|
|
221
|
+
with:
|
|
222
|
+
node-version: '20.x'
|
|
223
|
+
|
|
224
|
+
- name: Run EnvGuard scan
|
|
225
|
+
id: envguard
|
|
226
|
+
continue-on-error: true
|
|
227
|
+
run: |
|
|
228
|
+
OUTPUT=$(npx @danielszlaski/envguard scan 2>&1)
|
|
229
|
+
echo "$OUTPUT"
|
|
230
|
+
echo "output<<EOF" >> $GITHUB_OUTPUT
|
|
231
|
+
echo "$OUTPUT" >> $GITHUB_OUTPUT
|
|
232
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
233
|
+
npx @danielszlaski/envguard scan --ci
|
|
234
|
+
|
|
235
|
+
- name: Comment on PR if failed
|
|
236
|
+
if: failure()
|
|
237
|
+
uses: actions/github-script@v7
|
|
238
|
+
with:
|
|
239
|
+
script: |
|
|
240
|
+
github.rest.issues.createComment({
|
|
241
|
+
issue_number: context.issue.number,
|
|
242
|
+
owner: context.repo.owner,
|
|
243
|
+
repo: context.repo.repo,
|
|
244
|
+
body: '## ⚠️ EnvGuard Check Failed\n\n```\n${{ steps.envguard.outputs.output }}\n```\n\nPlease run `npx @danielszlaski/envguard fix` locally to generate `.env.example` files, then commit the changes.'
|
|
245
|
+
})
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Strict Mode in CI
|
|
249
|
+
|
|
250
|
+
Enable strict mode to catch all variables including runtime-provided ones:
|
|
251
|
+
|
|
252
|
+
```yaml
|
|
253
|
+
- name: Run EnvGuard check (strict)
|
|
254
|
+
run: npx @danielszlaski/envguard scan --ci --strict
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Weekly Audit
|
|
258
|
+
|
|
259
|
+
Schedule weekly checks to catch configuration drift:
|
|
260
|
+
|
|
261
|
+
```yaml
|
|
262
|
+
name: Weekly Environment Audit
|
|
263
|
+
|
|
264
|
+
on:
|
|
265
|
+
schedule:
|
|
266
|
+
- cron: '0 9 * * MON' # Every Monday at 9am UTC
|
|
267
|
+
|
|
268
|
+
jobs:
|
|
269
|
+
audit:
|
|
270
|
+
runs-on: ubuntu-latest
|
|
271
|
+
|
|
272
|
+
steps:
|
|
273
|
+
- uses: actions/checkout@v4
|
|
274
|
+
- uses: actions/setup-node@v4
|
|
275
|
+
with:
|
|
276
|
+
node-version: '20.x'
|
|
277
|
+
- run: npx @danielszlaski/envguard scan --ci --strict
|
|
278
|
+
|
|
279
|
+
- name: Create issue if problems found
|
|
280
|
+
if: failure()
|
|
281
|
+
uses: actions/github-script@v7
|
|
282
|
+
with:
|
|
283
|
+
script: |
|
|
284
|
+
github.rest.issues.create({
|
|
285
|
+
owner: context.repo.owner,
|
|
286
|
+
repo: context.repo.repo,
|
|
287
|
+
title: '⚠️ Environment Variables Out of Sync',
|
|
288
|
+
body: 'Weekly EnvGuard audit found issues. Run `npx @danielszlaski/envguard scan` locally for details.',
|
|
289
|
+
labels: ['env-config', 'maintenance']
|
|
290
|
+
})
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Caching for Faster Runs
|
|
294
|
+
|
|
295
|
+
Speed up CI runs by caching npx downloads:
|
|
296
|
+
|
|
297
|
+
```yaml
|
|
298
|
+
- name: Setup Node.js
|
|
299
|
+
uses: actions/setup-node@v4
|
|
300
|
+
with:
|
|
301
|
+
node-version: '20.x'
|
|
302
|
+
cache: 'npm' # Caches npx downloads
|
|
303
|
+
|
|
304
|
+
- name: Run EnvGuard
|
|
305
|
+
run: npx @danielszlaski/envguard scan --ci
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Other CI Platforms
|
|
309
|
+
|
|
310
|
+
**GitLab CI** (`.gitlab-ci.yml`):
|
|
311
|
+
```yaml
|
|
312
|
+
envguard:
|
|
313
|
+
image: node:20
|
|
314
|
+
script:
|
|
315
|
+
- npx @danielszlaski/envguard scan --ci
|
|
316
|
+
only:
|
|
317
|
+
- merge_requests
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**CircleCI** (`.circleci/config.yml`):
|
|
321
|
+
```yaml
|
|
322
|
+
version: 2.1
|
|
323
|
+
jobs:
|
|
324
|
+
envguard:
|
|
325
|
+
docker:
|
|
326
|
+
- image: cimg/node:20.0
|
|
327
|
+
steps:
|
|
328
|
+
- checkout
|
|
329
|
+
- run: npx @danielszlaski/envguard scan --ci
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
**Travis CI** (`.travis.yml`):
|
|
333
|
+
```yaml
|
|
334
|
+
language: node_js
|
|
335
|
+
node_js:
|
|
336
|
+
- '20'
|
|
337
|
+
script:
|
|
338
|
+
- npx @danielszlaski/envguard scan --ci
|
|
129
339
|
```
|
|
130
340
|
|
|
131
341
|
## Supported Languages & Frameworks
|
|
@@ -168,6 +378,7 @@ Create a `.envguardrc.json` file in your project root to customize behavior:
|
|
|
168
378
|
"COMPANY_INTERNAL_VAR"
|
|
169
379
|
],
|
|
170
380
|
"strict": false,
|
|
381
|
+
"detectFallbacks": true,
|
|
171
382
|
"exclude": [
|
|
172
383
|
"**/build/**",
|
|
173
384
|
"**/tmp/**"
|
|
@@ -179,6 +390,7 @@ Create a `.envguardrc.json` file in your project root to customize behavior:
|
|
|
179
390
|
|
|
180
391
|
- `ignoreVars` (string[]): Custom environment variables to ignore in non-strict mode. These will be treated like AWS_REGION and won't trigger warnings.
|
|
181
392
|
- `strict` (boolean): Enable strict mode by default (can be overridden with CLI flag)
|
|
393
|
+
- `detectFallbacks` (boolean): Detect fallback patterns in code and treat them as warnings instead of errors (default: `true`)
|
|
182
394
|
- `exclude` (string[]): Additional file patterns to exclude from scanning
|
|
183
395
|
|
|
184
396
|
**Alternative: package.json**
|
|
@@ -205,6 +417,62 @@ You can also add configuration to your `package.json`:
|
|
|
205
417
|
**GitHub Apps & CI/CD:**
|
|
206
418
|
When using EnvGuard as a GitHub App or in CI/CD pipelines, commit your `.envguardrc.json` to the repository. This ensures consistent behavior across all environments and team members.
|
|
207
419
|
|
|
420
|
+
### Fallback Detection (Smart Severity)
|
|
421
|
+
|
|
422
|
+
EnvGuard automatically detects common defensive patterns in your code and adjusts issue severity accordingly. When a variable is used with a fallback or default value, it's treated as a **WARNING** instead of an **ERROR**.
|
|
423
|
+
|
|
424
|
+
**Detected patterns:**
|
|
425
|
+
|
|
426
|
+
```javascript
|
|
427
|
+
// Default values with || or ??
|
|
428
|
+
const port = process.env.PORT || 3000; // WARNING
|
|
429
|
+
const url = process.env.API_URL ?? 'localhost'; // WARNING
|
|
430
|
+
|
|
431
|
+
// Ternary operators
|
|
432
|
+
const env = process.env.NODE_ENV ? 'set' : 'dev'; // WARNING
|
|
433
|
+
|
|
434
|
+
// Conditional checks
|
|
435
|
+
if (process.env.FEATURE_FLAG) { } // WARNING
|
|
436
|
+
if (!process.env.DEBUG) { } // WARNING
|
|
437
|
+
|
|
438
|
+
// Destructuring with defaults
|
|
439
|
+
const { LOG_LEVEL = 'info' } = process.env; // WARNING
|
|
440
|
+
|
|
441
|
+
// Optional chaining
|
|
442
|
+
const value = process.env?.OPTIONAL_VAR; // WARNING
|
|
443
|
+
|
|
444
|
+
// No fallback - strict requirement
|
|
445
|
+
const apiKey = process.env.API_KEY; // ERROR
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
**Severity levels:**
|
|
449
|
+
|
|
450
|
+
- **ERROR** (✖): Variable used without any safety mechanism - likely to cause runtime errors
|
|
451
|
+
- **WARNING** (⚠): Variable used with fallback/default - code handles missing values
|
|
452
|
+
- **INFO** (ℹ): Unused variables or optional documentation issues
|
|
453
|
+
|
|
454
|
+
**Disable fallback detection:**
|
|
455
|
+
|
|
456
|
+
If you prefer all missing variables to be treated as errors regardless of fallbacks:
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
# CLI flag
|
|
460
|
+
envguard scan --no-detect-fallbacks
|
|
461
|
+
|
|
462
|
+
# Config file
|
|
463
|
+
{
|
|
464
|
+
"detectFallbacks": false
|
|
465
|
+
}
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
**Why this feature exists:**
|
|
469
|
+
|
|
470
|
+
Not all missing environment variables are equal. Variables with defensive fallbacks are less critical than those that will cause `undefined` errors. This feature helps you prioritize what to fix first while still being aware of all env var usage.
|
|
471
|
+
|
|
472
|
+
**Limitations:**
|
|
473
|
+
|
|
474
|
+
Fallback detection uses regex patterns and catches common cases (~80% of real-world usage). Complex patterns like function calls with fallbacks or deeply nested conditionals may not be detected. For strict validation, use `--no-detect-fallbacks` or set `detectFallbacks: false` in your config.
|
|
475
|
+
|
|
208
476
|
### Monorepo Support
|
|
209
477
|
|
|
210
478
|
EnvGuard automatically detects all `.env` files in your project, including subdirectories. When you run `envguard fix`, it creates a `.env.example` file next to each `.env` file it finds.
|
|
@@ -278,9 +546,16 @@ Checking src/lambda/serverless.yml
|
|
|
278
546
|
- `envguard scan` - Scan for issues and display report
|
|
279
547
|
- `envguard scan --ci` - Scan and exit with error code if issues found
|
|
280
548
|
- `envguard scan --strict` - Report all variables including known runtime variables
|
|
549
|
+
- `envguard scan --no-detect-fallbacks` - Treat all missing variables as errors (ignore fallback detection)
|
|
281
550
|
- `envguard fix` - Auto-generate `.env.example`
|
|
282
551
|
- `envguard check` - Alias for `scan --ci`
|
|
283
552
|
- `envguard check --strict` - Check with strict mode enabled
|
|
553
|
+
- `envguard check --no-detect-fallbacks` - Check without fallback detection
|
|
554
|
+
- `envguard install-hook` - Install a Git pre-commit hook to run checks automatically
|
|
555
|
+
- `envguard install-hook --type pre-push` - Install a pre-push hook instead
|
|
556
|
+
- `envguard install-hook --force` - Overwrite existing hook if present
|
|
557
|
+
- `envguard uninstall-hook` - Remove the envguard Git hook
|
|
558
|
+
- `envguard uninstall-hook --type pre-push` - Remove the pre-push hook
|
|
284
559
|
|
|
285
560
|
### Strict Mode
|
|
286
561
|
|
|
@@ -320,4 +595,4 @@ npm start scan
|
|
|
320
595
|
|
|
321
596
|
## License
|
|
322
597
|
|
|
323
|
-
MIT
|
|
598
|
+
MIT 2026 Daniel Szlaski
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { ScanResult } from '../types';
|
|
2
2
|
import { EnvEntry } from '../parser/envParser';
|
|
3
3
|
export declare class EnvAnalyzer {
|
|
4
|
-
analyze(usedVars: Map<string,
|
|
5
|
-
|
|
4
|
+
analyze(usedVars: Map<string, {
|
|
5
|
+
locations: string[];
|
|
6
|
+
hasFallback: boolean;
|
|
7
|
+
}>, definedVars: Map<string, EnvEntry>, exampleVars: Set<string>, detectFallbacks?: boolean): ScanResult;
|
|
8
|
+
generateExampleContent(usedVars: Map<string, {
|
|
9
|
+
locations: string[];
|
|
10
|
+
hasFallback: boolean;
|
|
11
|
+
}>, existingEntries: Map<string, EnvEntry>): string;
|
|
6
12
|
private getFormatHint;
|
|
7
13
|
}
|
|
8
14
|
//# sourceMappingURL=envAnalyzer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envAnalyzer.d.ts","sourceRoot":"","sources":["../../src/analyzer/envAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,qBAAa,WAAW;IACtB,OAAO,CACL,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"envAnalyzer.d.ts","sourceRoot":"","sources":["../../src/analyzer/envAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,qBAAa,WAAW;IACtB,OAAO,CACL,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC,EACpE,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAClC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,eAAe,GAAE,OAAc,GAC9B,UAAU;IA6Db,sBAAsB,CACpB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC,EACpE,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,GACrC,MAAM;IA0CT,OAAO,CAAC,aAAa;CAkCtB"}
|
|
@@ -2,16 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EnvAnalyzer = void 0;
|
|
4
4
|
class EnvAnalyzer {
|
|
5
|
-
analyze(usedVars, definedVars, exampleVars) {
|
|
5
|
+
analyze(usedVars, definedVars, exampleVars, detectFallbacks = true) {
|
|
6
6
|
const issues = [];
|
|
7
7
|
// Issue 1: Variables used in code but missing from .env
|
|
8
|
-
for (const [varName,
|
|
8
|
+
for (const [varName, usage] of usedVars.entries()) {
|
|
9
9
|
if (!definedVars.has(varName)) {
|
|
10
|
+
// If detectFallbacks is enabled and variable has a fallback, it's a WARNING, otherwise ERROR
|
|
11
|
+
const severity = (detectFallbacks && usage.hasFallback) ? 'warning' : 'error';
|
|
12
|
+
const details = (detectFallbacks && usage.hasFallback)
|
|
13
|
+
? `Used in code with fallback/default but not defined in .env`
|
|
14
|
+
: `Used in code but not defined in .env`;
|
|
10
15
|
issues.push({
|
|
11
16
|
type: 'missing',
|
|
17
|
+
severity,
|
|
12
18
|
varName,
|
|
13
|
-
details
|
|
14
|
-
locations,
|
|
19
|
+
details,
|
|
20
|
+
locations: usage.locations,
|
|
15
21
|
});
|
|
16
22
|
}
|
|
17
23
|
}
|
|
@@ -20,19 +26,26 @@ class EnvAnalyzer {
|
|
|
20
26
|
if (!usedVars.has(varName)) {
|
|
21
27
|
issues.push({
|
|
22
28
|
type: 'unused',
|
|
29
|
+
severity: 'info',
|
|
23
30
|
varName,
|
|
24
31
|
details: `Defined in .env but never used in code`,
|
|
25
32
|
});
|
|
26
33
|
}
|
|
27
34
|
}
|
|
28
35
|
// Issue 3: Variables used in code but not in .env.example
|
|
29
|
-
for (const [varName,
|
|
36
|
+
for (const [varName, usage] of usedVars.entries()) {
|
|
30
37
|
if (!exampleVars.has(varName)) {
|
|
38
|
+
// If detectFallbacks is enabled and variable has a fallback, it's less critical for documentation
|
|
39
|
+
const severity = (detectFallbacks && usage.hasFallback) ? 'info' : 'warning';
|
|
40
|
+
const details = (detectFallbacks && usage.hasFallback)
|
|
41
|
+
? `Used in code with fallback but missing from .env.example`
|
|
42
|
+
: `Used in code but missing from .env.example`;
|
|
31
43
|
issues.push({
|
|
32
44
|
type: 'undocumented',
|
|
45
|
+
severity,
|
|
33
46
|
varName,
|
|
34
|
-
details
|
|
35
|
-
locations,
|
|
47
|
+
details,
|
|
48
|
+
locations: usage.locations,
|
|
36
49
|
});
|
|
37
50
|
}
|
|
38
51
|
}
|
|
@@ -48,7 +61,8 @@ class EnvAnalyzer {
|
|
|
48
61
|
content += '# Do not put actual secrets in this file - use .env instead\n\n';
|
|
49
62
|
const sortedVars = Array.from(usedVars.keys()).sort();
|
|
50
63
|
for (const varName of sortedVars) {
|
|
51
|
-
const
|
|
64
|
+
const usage = usedVars.get(varName);
|
|
65
|
+
const locations = usage.locations;
|
|
52
66
|
const existingEntry = existingEntries.get(varName);
|
|
53
67
|
// Add location comments
|
|
54
68
|
content += `# Used in: ${locations.slice(0, 3).join(', ')}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envAnalyzer.js","sourceRoot":"","sources":["../../src/analyzer/envAnalyzer.ts"],"names":[],"mappings":";;;AAGA,MAAa,WAAW;IACtB,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"envAnalyzer.js","sourceRoot":"","sources":["../../src/analyzer/envAnalyzer.ts"],"names":[],"mappings":";;;AAGA,MAAa,WAAW;IACtB,OAAO,CACL,QAAoE,EACpE,WAAkC,EAClC,WAAwB,EACxB,kBAA2B,IAAI;QAE/B,MAAM,MAAM,GAAY,EAAE,CAAC;QAE3B,wDAAwD;QACxD,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;YAClD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC9B,6FAA6F;gBAC7F,MAAM,QAAQ,GAAG,CAAC,eAAe,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;gBAC9E,MAAM,OAAO,GAAG,CAAC,eAAe,IAAI,KAAK,CAAC,WAAW,CAAC;oBACpD,CAAC,CAAC,4DAA4D;oBAC9D,CAAC,CAAC,sCAAsC,CAAC;gBAE3C,MAAM,CAAC,IAAI,CAAC;oBACV,IAAI,EAAE,SAAS;oBACf,QAAQ;oBACR,OAAO;oBACP,OAAO;oBACP,SAAS,EAAE,KAAK,CAAC,SAAS;iBAC3B,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,oDAAoD;QACpD,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC3B,MAAM,CAA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YAC5B,YAAY,EAAE,iBAAiB;YAC/B,SAAS,EAAE,aAAa;YACxB,MAAM,EAAE,iBAAiB;SAC1B,CAAC;QAEF,KAAK,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvD,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC9B,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACzD,OAAO,qBAAqB,CAAC;QAC/B,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1F,OAAO,kBAAkB,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlJD,kCAkJC"}
|
package/dist/cli.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const scan_1 = require("./commands/scan");
|
|
6
6
|
const fix_1 = require("./commands/fix");
|
|
7
|
+
const install_hook_1 = require("./commands/install-hook");
|
|
7
8
|
const logger_1 = require("./utils/logger");
|
|
8
9
|
const program = new commander_1.Command();
|
|
9
10
|
program
|
|
@@ -15,8 +16,20 @@ program
|
|
|
15
16
|
.description('Scan codebase and compare with .env files')
|
|
16
17
|
.option('--ci', 'Exit with error code if issues found (for CI/CD)')
|
|
17
18
|
.option('--strict', 'Report all variables including known runtime variables (AWS_REGION, NODE_ENV, etc.)')
|
|
18
|
-
.
|
|
19
|
+
.option('--no-detect-fallbacks', 'Treat all missing variables as errors, ignoring fallback detection')
|
|
20
|
+
.action(async (cmd, command) => {
|
|
19
21
|
try {
|
|
22
|
+
// Build options object, only including detectFallbacks if the flag was used
|
|
23
|
+
const options = {
|
|
24
|
+
ci: cmd.ci,
|
|
25
|
+
strict: cmd.strict
|
|
26
|
+
};
|
|
27
|
+
// Check if the --no-detect-fallbacks flag was explicitly provided
|
|
28
|
+
// Commander adds it to the command's options when the flag is used
|
|
29
|
+
const flagProvided = command.parent?.rawArgs.some((arg) => arg.includes('detect-fallback'));
|
|
30
|
+
if (flagProvided) {
|
|
31
|
+
options.detectFallbacks = cmd.detectFallbacks;
|
|
32
|
+
}
|
|
20
33
|
await (0, scan_1.scanCommand)(options);
|
|
21
34
|
}
|
|
22
35
|
catch (error) {
|
|
@@ -40,9 +53,51 @@ program
|
|
|
40
53
|
.command('check')
|
|
41
54
|
.description('Check for issues (alias for scan --ci)')
|
|
42
55
|
.option('--strict', 'Report all variables including known runtime variables (AWS_REGION, NODE_ENV, etc.)')
|
|
43
|
-
.
|
|
56
|
+
.option('--no-detect-fallbacks', 'Treat all missing variables as errors, ignoring fallback detection')
|
|
57
|
+
.action(async (cmd, command) => {
|
|
44
58
|
try {
|
|
45
|
-
|
|
59
|
+
const options = {
|
|
60
|
+
ci: true,
|
|
61
|
+
strict: cmd.strict
|
|
62
|
+
};
|
|
63
|
+
// Check if the --no-detect-fallbacks flag was explicitly provided
|
|
64
|
+
const flagProvided = command.parent?.rawArgs.some((arg) => arg.includes('detect-fallback'));
|
|
65
|
+
if (flagProvided) {
|
|
66
|
+
options.detectFallbacks = cmd.detectFallbacks;
|
|
67
|
+
}
|
|
68
|
+
await (0, scan_1.scanCommand)(options);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
logger_1.Logger.error(`${error}`);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
program
|
|
76
|
+
.command('install-hook')
|
|
77
|
+
.description('Install a Git hook to run envguard automatically')
|
|
78
|
+
.option('--type <type>', 'Hook type: pre-commit or pre-push (default: pre-commit)')
|
|
79
|
+
.option('--force', 'Overwrite existing hook if present')
|
|
80
|
+
.action(async (cmd) => {
|
|
81
|
+
try {
|
|
82
|
+
await (0, install_hook_1.installHookCommand)({
|
|
83
|
+
type: cmd.type,
|
|
84
|
+
force: cmd.force
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
logger_1.Logger.error(`${error}`);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
program
|
|
93
|
+
.command('uninstall-hook')
|
|
94
|
+
.description('Remove the envguard Git hook')
|
|
95
|
+
.option('--type <type>', 'Hook type: pre-commit or pre-push (default: pre-commit)')
|
|
96
|
+
.action(async (cmd) => {
|
|
97
|
+
try {
|
|
98
|
+
await (0, install_hook_1.uninstallHookCommand)({
|
|
99
|
+
type: cmd.type
|
|
100
|
+
});
|
|
46
101
|
}
|
|
47
102
|
catch (error) {
|
|
48
103
|
logger_1.Logger.error(`${error}`);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,wCAA4C;AAE5C,2CAAwC;AAExC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,4DAA4D,CAAC;KACzE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,2CAA2C,CAAC;KACxD,MAAM,CAAC,MAAM,EAAE,kDAAkD,CAAC;KAClE,MAAM,CAAC,UAAU,EAAE,qFAAqF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,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,cAAc,CAAC;KACvB,WAAW,CAAC,kDAAkD,CAAC;KAC/D,MAAM,CAAC,eAAe,EAAE,yDAAyD,CAAC;KAClF,MAAM,CAAC,SAAS,EAAE,oCAAoC,CAAC;KACvD,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACpB,IAAI,CAAC;QACH,MAAM,IAAA,iCAAkB,EAAC;YACvB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,KAAK,EAAE,GAAG,CAAC,KAAK;SACjB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,gBAAgB,CAAC;KACzB,WAAW,CAAC,8BAA8B,CAAC;KAC3C,MAAM,CAAC,eAAe,EAAE,yDAAyD,CAAC;KAClF,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACpB,IAAI,CAAC;QACH,MAAM,IAAA,mCAAoB,EAAC;YACzB,IAAI,EAAE,GAAG,CAAC,IAAI;SACf,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix.d.ts","sourceRoot":"","sources":["../../src/commands/fix.ts"],"names":[],"mappings":"AAOA,wBAAsB,UAAU;;
|
|
1
|
+
{"version":3,"file":"fix.d.ts","sourceRoot":"","sources":["../../src/commands/fix.ts"],"names":[],"mappings":"AAOA,wBAAsB,UAAU;;GAiG/B"}
|