dotenv-diff 2.3.10 → 2.3.12

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 (59) hide show
  1. package/CHANGELOG.md +142 -5
  2. package/README.md +112 -205
  3. package/dist/src/cli/run.js +6 -2
  4. package/dist/src/cli/run.js.map +1 -1
  5. package/dist/src/commands/compare.d.ts +1 -1
  6. package/dist/src/commands/compare.d.ts.map +1 -1
  7. package/dist/src/commands/compare.js.map +1 -1
  8. package/dist/src/commands/scanUsage.js +15 -2
  9. package/dist/src/commands/scanUsage.js.map +1 -1
  10. package/dist/src/config/types.d.ts +3 -1
  11. package/dist/src/config/types.d.ts.map +1 -1
  12. package/dist/src/core/determineComparisonFile.d.ts +7 -5
  13. package/dist/src/core/determineComparisonFile.d.ts.map +1 -1
  14. package/dist/src/core/determineComparisonFile.js +8 -3
  15. package/dist/src/core/determineComparisonFile.js.map +1 -1
  16. package/dist/src/core/envPairing.d.ts +9 -0
  17. package/dist/src/core/envPairing.d.ts.map +1 -0
  18. package/dist/src/core/envPairing.js +33 -0
  19. package/dist/src/core/envPairing.js.map +1 -0
  20. package/dist/src/core/helpers/resolveFromCwd.d.ts +11 -4
  21. package/dist/src/core/helpers/resolveFromCwd.d.ts.map +1 -1
  22. package/dist/src/core/helpers/resolveFromCwd.js +11 -4
  23. package/dist/src/core/helpers/resolveFromCwd.js.map +1 -1
  24. package/dist/src/core/scanJsonOutput.d.ts.map +1 -1
  25. package/dist/src/core/scanJsonOutput.js +1 -11
  26. package/dist/src/core/scanJsonOutput.js.map +1 -1
  27. package/dist/src/core/secretDetectors.d.ts.map +1 -1
  28. package/dist/src/core/secretDetectors.js +5 -0
  29. package/dist/src/core/secretDetectors.js.map +1 -1
  30. package/dist/src/index.js +5 -5
  31. package/dist/src/index.js.map +1 -1
  32. package/dist/src/services/codeBaseScanner.d.ts.map +1 -1
  33. package/dist/src/services/codeBaseScanner.js +2 -1
  34. package/dist/src/services/codeBaseScanner.js.map +1 -1
  35. package/dist/src/services/duplicates.d.ts +2 -4
  36. package/dist/src/services/duplicates.d.ts.map +1 -1
  37. package/dist/src/services/duplicates.js.map +1 -1
  38. package/dist/src/services/fileWalker.d.ts +7 -5
  39. package/dist/src/services/fileWalker.d.ts.map +1 -1
  40. package/dist/src/services/fileWalker.js +2 -2
  41. package/dist/src/services/fileWalker.js.map +1 -1
  42. package/dist/src/services/scanOutputToConsole.d.ts +8 -6
  43. package/dist/src/services/scanOutputToConsole.d.ts.map +1 -1
  44. package/dist/src/services/scanOutputToConsole.js +3 -11
  45. package/dist/src/services/scanOutputToConsole.js.map +1 -1
  46. package/dist/src/ui/scan/printHeader.d.ts.map +1 -1
  47. package/dist/src/ui/scan/printHeader.js +0 -3
  48. package/dist/src/ui/scan/printHeader.js.map +1 -1
  49. package/dist/src/ui/scan/printStats.d.ts +1 -0
  50. package/dist/src/ui/scan/printStats.d.ts.map +1 -1
  51. package/dist/src/ui/scan/printStats.js +2 -0
  52. package/dist/src/ui/scan/printStats.js.map +1 -1
  53. package/dist/src/ui/shared/printAutoFix.js +1 -1
  54. package/dist/src/ui/shared/printAutoFix.js.map +1 -1
  55. package/dist/src/ui/shared/printConfigStatus.d.ts +2 -2
  56. package/dist/src/ui/shared/printConfigStatus.d.ts.map +1 -1
  57. package/dist/src/ui/shared/printConfigStatus.js +5 -3
  58. package/dist/src/ui/shared/printConfigStatus.js.map +1 -1
  59. package/package.json +18 -12
package/CHANGELOG.md CHANGED
@@ -1,104 +1,168 @@
1
1
  # Changelog
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
  This project follows [Keep a Changelog](https://keepachangelog.com/) and [Semantic Versioning](https://semver.org/).
4
5
 
5
6
  ## [Unreleased]
7
+
8
+ ### Added
9
+
10
+ -
11
+
12
+ ### Changed
13
+
14
+ -
15
+
16
+ ### Fixed
17
+
18
+ -
19
+
20
+ ## [2.3.12] - 2025-12-18
21
+
6
22
  ### Added
7
- -
23
+
24
+ - Added warnings count to scan usage stats.
8
25
 
9
26
  ### Changed
10
- -
27
+
28
+ - Updated dependencies to latest versions.
29
+ - Moved `healthScore` further down on the console output for better visibility of issues.
30
+ - Removed used variables output from scan usage to reduce noise.
31
+ - Removed header output from scan usage to reduce noise.
32
+ - Shortened config file path in CLI output to show only the filename.
33
+ - Updated README documentation for better clarity.
11
34
 
12
35
  ### Fixed
13
- -
36
+
37
+ - Fixed false positive secret detection for certain harmless attribute keys in codebase scanner.
38
+ - Fixed print fix bug
39
+
40
+ ## [2.3.11] - 2025-12-13
41
+
42
+ ### Changed
43
+
44
+ - Removed low severity secrets from codebase scanner results, because it made too much noise.
14
45
 
15
46
  ## [2.3.10] - 2025-12-11
47
+
16
48
  ### Added
49
+
17
50
  - More jsDocs for better code documentation.
18
51
  - t3-env integration to validate environment variable usage against T3 stack schema.
19
52
 
20
53
  ### Fixed
54
+
21
55
  - Removed unused code for old --no-compare option.
22
56
 
23
57
  ## [2.3.9] - 2025-12-09
58
+
24
59
  ### Added
60
+
25
61
  - Added expiration date warnings for environment variables in codebase scanner.
26
62
  - Added inconsistent naming warnings for environment variables in codebase scanner.
27
63
 
28
64
  ### Changed
65
+
29
66
  - Changed health score calculation weights for better accuracy.
30
67
  - Removed CSP detection from codebase scanner, as it was causing false positives in some cases for backend frameworks.
31
68
 
32
69
  ## [2.3.8] - 2025-12-08
70
+
33
71
  ### Added
72
+
34
73
  - Added variables not using uppercase letters warning to codebase scanner.
35
74
  - Added health score feature to codebase scanner.
36
75
 
37
76
  ### Changed
77
+
38
78
  - Removed --no-compare option from CLI and config file.
39
79
  - Updated dependencies to latest versions.
40
80
 
41
81
  ### Fixed
82
+
42
83
  - Fixed issue where show-stats and show-unused options were not working as expected in config file.
43
84
 
44
85
  ## [2.3.7] - 2025-12-03
86
+
45
87
  ### Added
88
+
46
89
  - Added warning for environment variables logged to console in codebase scanner.
47
90
 
48
91
  ### Changed
92
+
49
93
  - Updated dependencies to latest versions.
50
94
 
51
95
  ### Fixed
96
+
52
97
  - Updated jsDocs for better code documentation.
53
98
  - Updated some functions for better type safety.
54
99
 
55
100
  ## [2.3.6] - 2025-12-02
101
+
56
102
  ### Added
103
+
57
104
  - Added strict mode handling for framework specific warnings.
58
105
  - Added Next.js specific warnings to framework validator.
59
106
 
60
107
  ### Fixed
108
+
61
109
  - Nameing convention fix in frameworkValidator.ts
62
110
 
63
111
  ## [2.3.5] - 2025-12-01
112
+
64
113
  ### Added
114
+
65
115
  - Added more sveltekit specific warnings to codebase scanner.
66
116
  - Added warning for potential secrets in .env.example file.
67
117
 
68
118
  ### Fixed
119
+
69
120
  - Duration refactored for better code maintainability.
70
121
 
71
122
  ## [2.3.4] - 2025-11-05
123
+
72
124
  ### Fixed
125
+
73
126
  - Fixed issue where CSP detection was not working as expected in some file types.
74
127
 
75
128
  ## [2.3.3] - 2025-11-30
129
+
76
130
  ### Added
131
+
77
132
  - Added Content-Security-Policy (CSP) detection to codebase scanner.
78
133
  - Warns if no CSP is found in HTML/JS/TS files.
79
134
 
80
135
  ### Changed
136
+
81
137
  - No breaking changes.
82
138
 
83
139
  ## [2.3.2] - 2025-11-01
140
+
84
141
  ### Added
142
+
85
143
  - Added duration output to scan statistics.
86
144
  - Severity levels for secret findings: high, medium, low.
87
145
 
88
146
  ### Changed
147
+
89
148
  - Updated dependencies to latest versions.
90
149
  - Improved README documentation for clarity.
91
150
  - No breaking changes.
92
151
 
93
152
  ## [2.3.1] - 2025-10-08
153
+
94
154
  ### Fixed
155
+
95
156
  - Fixed dotenv-diff.config.json not found in monorepo root when running from apps.
96
157
 
97
158
  ## [2.3.0] - 2025-10-07
159
+
98
160
  ### Fixed
161
+
99
162
  - Fixed issue where .env.example would be ignored by git when using --fix flag.
100
163
 
101
164
  ### Added
165
+
102
166
  - HTML comments to ignore secret detection in HTML lines (e.g. `<!-- dotenv-diff-ignore -->`).
103
167
  - Also ignore html sections with `<!-- dotenv-diff-ignore-start -->` and `<!-- dotenv-diff-ignore-end -->`.
104
168
  - Added option to have a dotenv-diff.config.json file for configuration.
@@ -107,203 +171,276 @@ This project follows [Keep a Changelog](https://keepachangelog.com/) and [Semant
107
171
  - --no-compare flag to disable comparison mode in scan usage. and noCompare option in config file.
108
172
 
109
173
  ## [2.2.8] - 2025-09-30
174
+
110
175
  ### Added
176
+
111
177
  - Fix .env is not ignored by git when using --fix flag.
112
178
 
113
179
  ### Changed
180
+
114
181
  - No breaking changes.
115
182
 
116
183
  ### Fixed
184
+
117
185
  - Refactored codebase for better maintainability.
118
186
 
119
187
  ## [2.2.7] - 2025-09-28
188
+
120
189
  ### Added
190
+
121
191
  - Added warning on .env not ignored by .gitignore on default.
122
192
  - added `dotenv-diff-ignore` comment to ignore lines from secret detection.
123
193
 
124
194
  ### Fixed
195
+
125
196
  - Fixed `--strict` error output to console when no warnings are found.
126
197
 
127
198
  ### Changed
199
+
128
200
  - No breaking changes.
129
201
  - Updated dependencies to latest versions.
130
202
 
131
203
  ## [2.2.6] - 2025-09-25
204
+
132
205
  ### Added
206
+
133
207
  - Added `placeholder`, `127.0.0.1`, and `example` to `looksHarmless` secret detection rule.
134
208
  - Added `HTTP URL detected` message to potential secrets output.
135
209
 
136
210
  ### Fixed
211
+
137
212
  - Removed `All used environment variables are defined in {.env}` when there are no used variables found.
138
213
 
139
214
  ### Changed
215
+
140
216
  - No breaking changes.
141
217
 
142
218
  ## [2.2.5] - 2025-09-18
219
+
143
220
  ### Added
221
+
144
222
  - Updated README with `--strict` flag documentation.
145
223
 
146
224
  ### Fixed
225
+
147
226
  - Fixed false positives for HTTPS URLs in SVG files and SVG namespace URLs.
148
227
 
149
228
  ### Changed
229
+
150
230
  - No breaking changes.
151
231
 
152
232
  ## [2.2.4] - 2025-09-13
233
+
153
234
  ### Fixed
235
+
154
236
  - Fixed found variable count did not show when there were missing variables in .env
155
237
  - Will now not says "Found 2 unique environment variables in use" if there are found in commented out code.
156
238
  - Fixed bug where it would say "no unused variables" if there where no found variables at all.
157
239
 
158
240
  ### Changed
241
+
159
242
  - No breaking changes.
160
243
 
161
244
  ## [2.2.3] - 2025-09-08
245
+
162
246
  ### Added
247
+
163
248
  - Warning for HTTPS URLs detected in codebase.
164
249
  - Added duplicate key detection to codebase scanner.
165
250
  - added `--strict` flag to enable strict mode (treat warnings as errors).
166
251
  - duplicate key detection for `.env.example` files.
167
252
 
168
253
  ### Fixed
254
+
169
255
  - Fixed issue with false warnings on secrets in certain edge cases.
170
256
  - Updated README
171
257
 
172
258
  ### Changed
259
+
173
260
  - No breaking changes.
174
261
  - `--compare` feature coloring improved for better readability.
175
262
  - added `duplicate` warnings to scan results.
176
263
 
177
264
  ## [2.2.2] - 2025-09-07
265
+
178
266
  ### Fixed
267
+
179
268
  - Fixed issue where it would give a false warning on secrets with process.env
180
269
  - Code cleanup.
181
270
  - exclude `.svelte-kit` from codebase scan by default.
182
271
  - Updated README
183
272
 
184
273
  ### Changed
274
+
185
275
  - No breaking changes.
186
276
 
187
277
  ## [2.2.1] - 2025-09-06
278
+
188
279
  ### Changed
280
+
189
281
  - tsconfig updates for improved type checking.
190
282
  - Updated codebase for new tsconfig rules
191
283
  - No breaking changes.
192
284
 
193
285
  ### Added
286
+
194
287
  - Improved jsDocs for better code documentation.
195
288
 
196
289
  ## [2.2.0] - 2025-08-30
290
+
197
291
  ### Added
292
+
198
293
  - `--compare` flag to enable comparison mode.
199
294
  - `dotenv-diff` will now detect potential secrets in your codebase.
200
295
 
201
296
  ### Changed
297
+
202
298
  - Default behavior is now **scan-usage** (you no longer need `--scan-usage`), but you can still use it for clarity.
203
299
  - `--compare` flag is now required for all comparison operations.
204
300
 
205
-
206
301
  ## [2.1.7] - 2025-08-28
302
+
207
303
  ### Added
304
+
208
305
  - gif to README file.
209
306
 
210
307
  ### Changed
308
+
211
309
  - No breaking changes. Existing functionality remains intact.
212
310
 
213
311
  ## [2.1.6] - 2025-08-26
312
+
214
313
  ### fixed
314
+
215
315
  - Fixed issue where prompts were disabled when using `--env` and `--example` flags.
216
316
 
217
317
  ## Changed
318
+
218
319
  - No breaking changes. Existing functionality remains intact.
219
320
 
220
321
  ## [2.1.5] - 2025-08-25
322
+
221
323
  ### Added
324
+
222
325
  - Added `--no-color` option to disable colored output.
223
326
 
224
327
  ### Changed
328
+
225
329
  - No breaking changes. Existing functionality remains intact.
226
330
 
227
331
  ## [2.1.4] - 2025-08-19
332
+
228
333
  ### Added
334
+
229
335
  - the `--fix` flag to automatically fix common issues:
230
336
  - Remove duplicate keys (keeping the last occurrence).
231
337
  - Add missing keys from the example file with empty values.
232
338
 
233
339
  ### Changed
340
+
234
341
  - No breaking changes. Existing functionality remains intact.
235
342
 
236
343
  ## [2.1.3] - 2025-08-19
344
+
237
345
  ### Added
346
+
238
347
  - Added `.sveltekit` and `_actions` to default exclude patterns in codebase scanner.
239
348
 
240
349
  ### Changed
350
+
241
351
  - No breaking changes. Existing functionality remains intact.
242
352
 
243
353
  ### Fixed
354
+
244
355
  - Fixed issue where `--include-files` and `--exclude-files` were not properly documented in README.
245
356
 
246
357
  ## [2.1.2] - 2025-08-16
358
+
247
359
  ### Changed
360
+
248
361
  - Updated README with Turborepo usage example.
249
362
 
250
363
  ## [2.1.1] - 2025-08-16
364
+
251
365
  ### Added
366
+
252
367
  - `--files` option to **completely override** the default file patterns.
253
368
  Useful for including files that are normally excluded (e.g. `*.test.js`).
254
369
 
255
370
  ### Changed
256
- - Clarified behavior of `--include-files`: now explicitly extends the default patterns instead of replacing them.
371
+
372
+ - Clarified behavior of `--include-files`: now explicitly extends the default patterns instead of replacing them.
257
373
  - Updated README with usage examples for `--files`, `--include-files`, and `--exclude-files`.
258
374
 
259
375
  ## [2.1.0] - 2025-08-15
376
+
260
377
  ### Added
378
+
261
379
  - `--ci` option for non-interactive mode in CI environments.
262
380
 
263
381
  ### Changed
382
+
264
383
  - No breaking changes. Existing functionality remains intact.
265
384
 
266
385
  ## [2.0.0] - 2025-08-14
386
+
267
387
  ### Added
388
+
268
389
  - `--scan-usage` option to scan codebase for environment variable usage.
269
390
  - `--include-files` and `--exclude-files` options to specify which files to include or exclude from the scan.
270
391
  - `--show-unused` option to display variables defined in `.env` but not used in code.
271
392
  - `--show-stats` option to display scan statistics.
272
393
 
273
394
  ### Changed
395
+
274
396
  - No breaking changes. Existing functionality remains intact.
275
397
 
276
398
  ## [1.6.5] - 2025-08-13
399
+
277
400
  ### Added
401
+
278
402
  - `--only` flag to restrict output to specific categories (e.g., `missing`, `extra`, `empty`, `mismatches`, `duplicates`, `gitignore`).
279
403
 
280
404
  ## [1.6.4] - 2025-08-12
405
+
281
406
  ### Added
407
+
282
408
  - `--ignore` and `--ignore-regex` options to specify files or directories to ignore during comparison.
283
409
 
284
410
  ## [1.6.3] - 2025-08-11
411
+
285
412
  ### Added
413
+
286
414
  - `--json` option to output results in JSON format. (Non-breaking)
287
415
 
288
416
  ## [1.6.2] - 2025-08-10
417
+
289
418
  ### Added
419
+
290
420
  - Duplicate key detection for `.env*` files.
291
421
  - Prints warnings listing duplicate keys (last occurrence wins).
292
422
  - Suppress via `--allow-duplicates`.
293
423
 
294
424
  ### Changed
425
+
295
426
  - No breaking changes. Exit codes and diff behavior unchanged.
296
427
 
297
428
  ## [1.6.1] - 2025-08-09
429
+
298
430
  ### Build
431
+
299
432
  - Updated TypeScript configuration to include `bin` directory.
300
433
  - Switched CLI path to `bin/dotenv-diff.js` for consistency.
301
434
  - Refactored folder structure for better organization.
302
435
 
303
436
  ## [1.6.0] - 2025-08-08
437
+
304
438
  ### Added
439
+
305
440
  - `--env` and `--example` for direct file comparison; autoscan overridden when both are provided.
306
441
 
307
442
  ## [1.5.0] - 2025-08-07
443
+
308
444
  ### Added
445
+
309
446
  - Non-interactive modes: `--ci` and `--yes`.