dotenv-diff 2.7.0 → 2.7.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/CHANGELOG.md +50 -32
- package/README.md +21 -12
- package/dist/bin/dotenv-diff.js +0 -0
- package/dist/src/commands/compare.d.ts.map +1 -1
- package/dist/src/commands/compare.js +141 -89
- package/dist/src/commands/compare.js.map +1 -1
- package/dist/src/commands/scanUsage.d.ts.map +1 -1
- package/dist/src/commands/scanUsage.js +7 -5
- package/dist/src/commands/scanUsage.js.map +1 -1
- package/dist/src/config/constants.d.ts +5 -1
- package/dist/src/config/constants.d.ts.map +1 -1
- package/dist/src/config/constants.js +5 -1
- package/dist/src/config/constants.js.map +1 -1
- package/dist/src/config/options.js +1 -1
- package/dist/src/config/options.js.map +1 -1
- package/dist/src/config/types.d.ts +4 -2
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/core/compare/calculateStats.js +1 -1
- package/dist/src/core/compare/calculateStats.js.map +1 -1
- package/dist/src/core/compare/parseAndFilterEnv.d.ts.map +1 -1
- package/dist/src/core/compare/parseAndFilterEnv.js +1 -1
- package/dist/src/core/compare/parseAndFilterEnv.js.map +1 -1
- package/dist/src/core/filterIgnoredKeys.d.ts.map +1 -1
- package/dist/src/core/filterIgnoredKeys.js +3 -1
- package/dist/src/core/filterIgnoredKeys.js.map +1 -1
- package/dist/src/core/frameworks/nextJsRules.js +1 -1
- package/dist/src/core/frameworks/nextJsRules.js.map +1 -1
- package/dist/src/core/frameworks/sveltekitRules.d.ts.map +1 -1
- package/dist/src/core/frameworks/sveltekitRules.js +9 -9
- package/dist/src/core/frameworks/sveltekitRules.js.map +1 -1
- package/dist/src/core/parseEnv.d.ts +3 -3
- package/dist/src/core/parseEnv.d.ts.map +1 -1
- package/dist/src/core/parseEnv.js +6 -21
- package/dist/src/core/parseEnv.js.map +1 -1
- package/dist/src/core/scan/scanFile.js.map +1 -1
- package/dist/src/core/security/exampleSecretDetector.js +1 -1
- package/dist/src/core/security/secretDetectors.d.ts.map +1 -1
- package/dist/src/core/security/secretDetectors.js +18 -6
- package/dist/src/core/security/secretDetectors.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/services/envDiscovery.js +2 -2
- package/dist/src/services/envDiscovery.js.map +1 -1
- package/dist/src/services/parseEnvFile.d.ts +8 -0
- package/dist/src/services/parseEnvFile.d.ts.map +1 -0
- package/dist/src/services/parseEnvFile.js +28 -0
- package/dist/src/services/parseEnvFile.js.map +1 -0
- package/dist/src/services/printScanResult.d.ts.map +1 -1
- package/dist/src/services/printScanResult.js +8 -3
- package/dist/src/services/printScanResult.js.map +1 -1
- package/dist/src/services/processComparisonFile.js +1 -1
- package/dist/src/services/processComparisonFile.js.map +1 -1
- package/dist/src/ui/compare/printErrorNotFound.d.ts.map +1 -1
- package/dist/src/ui/compare/printErrorNotFound.js.map +1 -1
- package/dist/src/ui/compare/printHeader.d.ts.map +1 -1
- package/dist/src/ui/compare/printHeader.js.map +1 -1
- package/dist/src/ui/compare/printIssues.d.ts.map +1 -1
- package/dist/src/ui/compare/printIssues.js.map +1 -1
- package/dist/src/ui/scan/printConsolelogWarning.d.ts.map +1 -1
- package/dist/src/ui/scan/printConsolelogWarning.js +1 -1
- package/dist/src/ui/scan/printConsolelogWarning.js.map +1 -1
- package/dist/src/ui/scan/printExampleWarnings.d.ts.map +1 -1
- package/dist/src/ui/scan/printExampleWarnings.js +3 -1
- package/dist/src/ui/scan/printExampleWarnings.js.map +1 -1
- package/dist/src/ui/scan/printExpireWarnings.d.ts +1 -1
- package/dist/src/ui/scan/printExpireWarnings.d.ts.map +1 -1
- package/dist/src/ui/scan/printExpireWarnings.js +8 -13
- package/dist/src/ui/scan/printExpireWarnings.js.map +1 -1
- package/dist/src/ui/scan/printFrameworkWarnings.d.ts.map +1 -1
- package/dist/src/ui/scan/printFrameworkWarnings.js +1 -1
- package/dist/src/ui/scan/printFrameworkWarnings.js.map +1 -1
- package/dist/src/ui/scan/printHealthScore.d.ts.map +1 -1
- package/dist/src/ui/scan/printHealthScore.js +7 -4
- package/dist/src/ui/scan/printHealthScore.js.map +1 -1
- package/dist/src/ui/scan/printInconsistentNamingWarning.d.ts.map +1 -1
- package/dist/src/ui/scan/printInconsistentNamingWarning.js +3 -2
- package/dist/src/ui/scan/printInconsistentNamingWarning.js.map +1 -1
- package/dist/src/ui/scan/printMissing.d.ts.map +1 -1
- package/dist/src/ui/scan/printMissing.js +1 -1
- package/dist/src/ui/scan/printMissing.js.map +1 -1
- package/dist/src/ui/scan/printMissingExample.d.ts.map +1 -1
- package/dist/src/ui/scan/printMissingExample.js +1 -1
- package/dist/src/ui/scan/printMissingExample.js.map +1 -1
- package/dist/src/ui/scan/printSecrets.d.ts.map +1 -1
- package/dist/src/ui/scan/printSecrets.js +2 -2
- package/dist/src/ui/scan/printSecrets.js.map +1 -1
- package/dist/src/ui/scan/printStats.d.ts.map +1 -1
- package/dist/src/ui/scan/printStats.js.map +1 -1
- package/dist/src/ui/scan/printUnused.d.ts.map +1 -1
- package/dist/src/ui/scan/printUnused.js +2 -2
- package/dist/src/ui/scan/printUnused.js.map +1 -1
- package/dist/src/ui/scan/printUppercaseWarning.d.ts.map +1 -1
- package/dist/src/ui/scan/printUppercaseWarning.js +1 -1
- package/dist/src/ui/scan/printUppercaseWarning.js.map +1 -1
- package/dist/src/ui/shared/printAutoFix.d.ts.map +1 -1
- package/dist/src/ui/shared/printAutoFix.js.map +1 -1
- package/dist/src/ui/shared/printConfigStatus.d.ts.map +1 -1
- package/dist/src/ui/shared/printConfigStatus.js.map +1 -1
- package/dist/src/ui/shared/printDuplicates.d.ts +2 -7
- package/dist/src/ui/shared/printDuplicates.d.ts.map +1 -1
- package/dist/src/ui/shared/printDuplicates.js +0 -1
- package/dist/src/ui/shared/printDuplicates.js.map +1 -1
- package/dist/src/ui/shared/printGitignore.d.ts.map +1 -1
- package/dist/src/ui/shared/printGitignore.js.map +1 -1
- package/dist/src/ui/shared/printOptionErrors.d.ts.map +1 -1
- package/dist/src/ui/shared/printOptionErrors.js.map +1 -1
- package/dist/src/ui/theme.d.ts.map +1 -1
- package/dist/src/ui/theme.js.map +1 -1
- package/package.json +23 -23
- package/docs/assets/demo.gif +0 -0
- package/docs/assets/success.png +0 -0
- package/docs/capabilities.md +0 -85
- package/docs/configuration_and_flags.md +0 -726
- package/docs/expiration_warnings.md +0 -111
- package/docs/frameworks/index.md +0 -24
- package/docs/frameworks/nextjs_warnings.md +0 -56
- package/docs/frameworks/sveltekit_warnings.md +0 -130
- package/docs/git_hooks_ci.md +0 -51
- package/docs/ignore_comments.md +0 -82
- package/docs/index.md +0 -54
- package/docs/monorepo_support.md +0 -63
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 41f8e5c: Updated dependencies and release scripts for all packages.
|
|
8
|
+
- da6fbaf: fixed preserve nested example paths
|
|
9
|
+
|
|
3
10
|
All notable changes to this project will be documented in this file.
|
|
4
11
|
|
|
5
12
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
@@ -9,126 +16,137 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
16
|
|
|
10
17
|
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
|
|
11
18
|
|
|
19
|
+
## [2.7.1](https://github.com/Chrilleweb/dotenv-diff/compare/v2.7.0...v2.7.1) (2026-03-06)
|
|
20
|
+
|
|
21
|
+
### 🐛 Bug Fixes
|
|
22
|
+
|
|
23
|
+
- expire warning ([#299](https://github.com/Chrilleweb/dotenv-diff/issues/299)) ([be0700f](https://github.com/Chrilleweb/dotenv-diff/commit/be0700f4fb27a63da1703f70d2be792e00d84731))
|
|
24
|
+
- minor strict ui bug ([#294](https://github.com/Chrilleweb/dotenv-diff/issues/294)) ([7feb116](https://github.com/Chrilleweb/dotenv-diff/commit/7feb116217a5cacbff095dad2b745bdb2348c924))
|
|
25
|
+
- removed white space ([#295](https://github.com/Chrilleweb/dotenv-diff/issues/295)) ([015afcc](https://github.com/Chrilleweb/dotenv-diff/commit/015afcc7ff593601d9ba7b87e6e162581180c16b))
|
|
26
|
+
- secret detection bug ([#296](https://github.com/Chrilleweb/dotenv-diff/issues/296)) ([be5442b](https://github.com/Chrilleweb/dotenv-diff/commit/be5442b78a6ae99abcfe7eb682c6b1903cdf823f))
|
|
27
|
+
- text for inco naming ([#297](https://github.com/Chrilleweb/dotenv-diff/issues/297)) ([8e2a9be](https://github.com/Chrilleweb/dotenv-diff/commit/8e2a9bebfbd07bcb43c364f8295900ad467a5337))
|
|
28
|
+
- typo in print unused ([#298](https://github.com/Chrilleweb/dotenv-diff/issues/298)) ([fe56942](https://github.com/Chrilleweb/dotenv-diff/commit/fe56942c4caa3efebc0ee53bc313dbf6449f4484))
|
|
29
|
+
|
|
12
30
|
## [2.7.0](https://github.com/Chrilleweb/dotenv-diff/compare/v2.6.4...v2.7.0) (2026-03-04)
|
|
13
31
|
|
|
14
32
|
### ✨ Features
|
|
15
33
|
|
|
16
|
-
|
|
34
|
+
- new UI design ([#293](https://github.com/Chrilleweb/dotenv-diff/issues/293)) ([417b8ef](https://github.com/Chrilleweb/dotenv-diff/commit/417b8ef678bbdf2a8e12b36b030df4bfb8dba8d7))
|
|
17
35
|
|
|
18
36
|
## [2.6.4](https://github.com/Chrilleweb/dotenv-diff/compare/v2.6.3...v2.6.4) (2026-02-28)
|
|
19
37
|
|
|
20
38
|
### 🐛 Bug Fixes
|
|
21
39
|
|
|
22
|
-
|
|
40
|
+
- added support for mts and cts ([#288](https://github.com/Chrilleweb/dotenv-diff/issues/288)) ([93874bf](https://github.com/Chrilleweb/dotenv-diff/commit/93874bfeb67999b43bdcb87814fbc080c650f923))
|
|
23
41
|
|
|
24
42
|
### 📝 Documentation
|
|
25
43
|
|
|
26
|
-
|
|
44
|
+
- updated docs ([#287](https://github.com/Chrilleweb/dotenv-diff/issues/287)) ([d3f36f4](https://github.com/Chrilleweb/dotenv-diff/commit/d3f36f437748218028fe21843aa5b495d31c3639))
|
|
27
45
|
|
|
28
46
|
## [2.6.3](https://github.com/Chrilleweb/dotenv-diff/compare/v2.6.2...v2.6.3) (2026-02-26)
|
|
29
47
|
|
|
30
48
|
### 🐛 Bug Fixes
|
|
31
49
|
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
- skip path ([#281](https://github.com/Chrilleweb/dotenv-diff/issues/281)) ([eec0d13](https://github.com/Chrilleweb/dotenv-diff/commit/eec0d13dddb581072f05a1168ad52e65f41693bf))
|
|
51
|
+
- variables patterns ([#282](https://github.com/Chrilleweb/dotenv-diff/issues/282)) ([67515a0](https://github.com/Chrilleweb/dotenv-diff/commit/67515a04c46e1f373041cfe434c4eca01eb36c81))
|
|
34
52
|
|
|
35
53
|
## [2.6.2](https://github.com/Chrilleweb/dotenv-diff/compare/v2.6.1...v2.6.2) (2026-02-24)
|
|
36
54
|
|
|
37
55
|
### 🐛 Bug Fixes
|
|
38
56
|
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
- emoji health score ([#275](https://github.com/Chrilleweb/dotenv-diff/issues/275)) ([b7d8499](https://github.com/Chrilleweb/dotenv-diff/commit/b7d84997286e44a249461554b6deb55e90d10c8c))
|
|
58
|
+
- updated dependencies ([#278](https://github.com/Chrilleweb/dotenv-diff/issues/278)) ([f172462](https://github.com/Chrilleweb/dotenv-diff/commit/f17246285556769996273e090649bf44c838920f))
|
|
41
59
|
|
|
42
60
|
### 📝 Documentation
|
|
43
61
|
|
|
44
|
-
|
|
45
|
-
|
|
62
|
+
- interface docs ([#276](https://github.com/Chrilleweb/dotenv-diff/issues/276)) ([c6789e7](https://github.com/Chrilleweb/dotenv-diff/commit/c6789e75dfe3eae1801cbce52cc6425555a79ab1))
|
|
63
|
+
- updated docs ([#279](https://github.com/Chrilleweb/dotenv-diff/issues/279)) ([a2bfeea](https://github.com/Chrilleweb/dotenv-diff/commit/a2bfeea14dec18dc927e902bf2f6e4c9b86c729a))
|
|
46
64
|
|
|
47
65
|
## [2.6.1](https://github.com/Chrilleweb/dotenv-diff/compare/v2.6.0...v2.6.1) (2026-02-13)
|
|
48
66
|
|
|
49
67
|
### 🐛 Bug Fixes
|
|
50
68
|
|
|
51
|
-
|
|
52
|
-
|
|
69
|
+
- Expire env warning json ([#267](https://github.com/Chrilleweb/dotenv-diff/issues/267)) ([c029e4c](https://github.com/Chrilleweb/dotenv-diff/commit/c029e4ccbfedfdc630afaf28b7dd37b867aa734f))
|
|
70
|
+
- logged json output ([#268](https://github.com/Chrilleweb/dotenv-diff/issues/268)) ([4a9107a](https://github.com/Chrilleweb/dotenv-diff/commit/4a9107a9167ab086d13ee4be6f91fe8f0015eeee))
|
|
53
71
|
|
|
54
72
|
## [2.6.0](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.9...v2.6.0) (2026-02-06)
|
|
55
73
|
|
|
56
74
|
### ✨ Features
|
|
57
75
|
|
|
58
|
-
|
|
76
|
+
- prompt if no env file is found ([#262](https://github.com/Chrilleweb/dotenv-diff/issues/262)) ([c14adf4](https://github.com/Chrilleweb/dotenv-diff/commit/c14adf4206fc045833d985f1d599b5ac92a2a399))
|
|
59
77
|
|
|
60
78
|
### 🐛 Bug Fixes
|
|
61
79
|
|
|
62
|
-
|
|
80
|
+
- Added more space after prompt ([#263](https://github.com/Chrilleweb/dotenv-diff/issues/263)) ([c5e5770](https://github.com/Chrilleweb/dotenv-diff/commit/c5e57700dabb25ef43635c7a53b7d903244fadc0))
|
|
63
81
|
|
|
64
82
|
### 📝 Documentation
|
|
65
83
|
|
|
66
|
-
|
|
84
|
+
- moved -y flag up ([#261](https://github.com/Chrilleweb/dotenv-diff/issues/261)) ([08d0530](https://github.com/Chrilleweb/dotenv-diff/commit/08d0530a5c4f5aa183540b4b4afd647894f019ca))
|
|
67
85
|
|
|
68
86
|
## [2.5.9](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.8...v2.5.9) (2026-02-02)
|
|
69
87
|
|
|
70
88
|
### 🐛 Bug Fixes
|
|
71
89
|
|
|
72
|
-
|
|
73
|
-
|
|
90
|
+
- removed ci warning on missing - duplicate ([#254](https://github.com/Chrilleweb/dotenv-diff/issues/254)) ([b9e70f0](https://github.com/Chrilleweb/dotenv-diff/commit/b9e70f03eeaa764176ae67d4b2b16e6b58cd5c9c))
|
|
91
|
+
- **scan:** json output order ([#255](https://github.com/Chrilleweb/dotenv-diff/issues/255)) ([db3fd14](https://github.com/Chrilleweb/dotenv-diff/commit/db3fd1469603e33347bb91da83dded90bb0fefb4))
|
|
74
92
|
|
|
75
93
|
### 📝 Documentation
|
|
76
94
|
|
|
77
|
-
|
|
95
|
+
- Config and flags ([#256](https://github.com/Chrilleweb/dotenv-diff/issues/256)) ([996e636](https://github.com/Chrilleweb/dotenv-diff/commit/996e6366bea9a0392d029d1f29835c5779ac2556))
|
|
78
96
|
|
|
79
97
|
## [2.5.8](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.7...v2.5.8) (2026-02-01)
|
|
80
98
|
|
|
81
99
|
### 🐛 Bug Fixes
|
|
82
100
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
101
|
+
- Fixed --allow-duplicates flag in default ([#249](https://github.com/Chrilleweb/dotenv-diff/issues/249)) ([3cccc35](https://github.com/Chrilleweb/dotenv-diff/commit/3cccc3523cb6c54ea48f3a22a895b887dea58098))
|
|
102
|
+
- Fixed bug in --fix for compare mode ([#251](https://github.com/Chrilleweb/dotenv-diff/issues/251)) ([a26d6b5](https://github.com/Chrilleweb/dotenv-diff/commit/a26d6b51f440cede84381c0ea065bc2106979189))
|
|
103
|
+
- removed mismatch from only flag ([#250](https://github.com/Chrilleweb/dotenv-diff/issues/250)) ([a4ee8c2](https://github.com/Chrilleweb/dotenv-diff/commit/a4ee8c27ca62c380f9bee7e0444c2c9488a6b7c9))
|
|
86
104
|
|
|
87
105
|
### 📝 Documentation
|
|
88
106
|
|
|
89
|
-
|
|
107
|
+
- **contribution:** updated PR guidelines ([#248](https://github.com/Chrilleweb/dotenv-diff/issues/248)) ([f3a8209](https://github.com/Chrilleweb/dotenv-diff/commit/f3a8209f22a810b34240250976f18e0c428669e1))
|
|
90
108
|
|
|
91
109
|
## [2.5.7](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.6...v2.5.7) (2026-01-29)
|
|
92
110
|
|
|
93
111
|
### 🐛 Bug Fixes
|
|
94
112
|
|
|
95
|
-
|
|
113
|
+
- Updated inconsistent name text ([#243](https://github.com/Chrilleweb/dotenv-diff/issues/243)) ([c400aac](https://github.com/Chrilleweb/dotenv-diff/commit/c400aac46b434d7525d9ad75a135d374ab737b13))
|
|
96
114
|
|
|
97
115
|
## [2.5.6](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.5...v2.5.6) (2026-01-29)
|
|
98
116
|
|
|
99
117
|
### 🐛 Bug Fixes
|
|
100
118
|
|
|
101
|
-
|
|
119
|
+
- inconsistent naming warning ui ([#241](https://github.com/Chrilleweb/dotenv-diff/issues/241)) ([b672b12](https://github.com/Chrilleweb/dotenv-diff/commit/b672b1206a94b375df1db23a8c0ba4acaa675b84))
|
|
102
120
|
|
|
103
121
|
## [v2.5.5](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.4...v2.5.5) (2026-01-28)
|
|
104
122
|
|
|
105
123
|
### Bug Fixes
|
|
106
124
|
|
|
107
|
-
|
|
125
|
+
- Updated UI for missing env variables ([#238](https://github.com/Chrilleweb/dotenv-diff/issues/238)) ([d87eac0](https://github.com/Chrilleweb/dotenv-diff/commit/d87eac002b6b18dc9962c77d1df3d3941ce73587))
|
|
108
126
|
|
|
109
127
|
## [v2.5.4](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.3...v2.5.4) (2026-01-28)
|
|
110
128
|
|
|
111
129
|
### Bug Fixes
|
|
112
130
|
|
|
113
|
-
|
|
131
|
+
- default exclude keys where not ignored in scan mode ([#236](https://github.com/Chrilleweb/dotenv-diff/issues/236)) ([593e69b](https://github.com/Chrilleweb/dotenv-diff/commit/593e69b3a12273c445fa2b365b683cfbe5af283f))
|
|
114
132
|
|
|
115
133
|
## [v2.5.3](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.2...v2.5.3) (2026-01-27)
|
|
116
134
|
|
|
117
135
|
### Bug Fixes
|
|
118
136
|
|
|
119
|
-
|
|
120
|
-
|
|
137
|
+
- changed color of scanning header to cyan ([ed6cad1](https://github.com/Chrilleweb/dotenv-diff/commit/ed6cad1502a8c340ddcbcb45a63c20d1ba9feb26))
|
|
138
|
+
- Expire warning text ui ([90caa27](https://github.com/Chrilleweb/dotenv-diff/commit/90caa27762cb1e1a7a81ec4fa978e26af8e46a5c))
|
|
121
139
|
|
|
122
140
|
### Documentation
|
|
123
141
|
|
|
124
|
-
|
|
125
|
-
|
|
142
|
+
- docs folder instead of public ([f88ad42](https://github.com/Chrilleweb/dotenv-diff/commit/f88ad422a5119cf50b6e27e2ddb7ffd7489e28d4))
|
|
143
|
+
- updated readme gif links ([c45c2df](https://github.com/Chrilleweb/dotenv-diff/commit/c45c2df166139ad2c7a83af3df56032d4f81b310))
|
|
126
144
|
|
|
127
145
|
## [v2.5.2](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.1...v2.5.2) (2026-01-26)
|
|
128
146
|
|
|
129
147
|
### Bug Fixes
|
|
130
148
|
|
|
131
|
-
|
|
149
|
+
- scanning color magenta ([b90107b](https://github.com/Chrilleweb/dotenv-diff/commit/b90107b0163de3e0ce5def6f235bc40510be71b7))
|
|
132
150
|
|
|
133
151
|
#### [v2.5.1](https://github.com/Chrilleweb/dotenv-diff/compare/v2.5.0...v2.5.1)
|
|
134
152
|
|
|
@@ -235,7 +253,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
235
253
|
- exitresult + type + exit decision [`#160`](https://github.com/Chrilleweb/dotenv-diff/pull/160)
|
|
236
254
|
- interfaces, types and documentation + constants [`#159`](https://github.com/Chrilleweb/dotenv-diff/pull/159)
|
|
237
255
|
- Fixed path normalization issue [`#158`](https://github.com/Chrilleweb/dotenv-diff/pull/158)
|
|
238
|
-
- Added PR template
|
|
256
|
+
- Added PR template [`#156`](https://github.com/Chrilleweb/dotenv-diff/pull/156)
|
|
239
257
|
- moved scanjson output out of types [`e0d80c0`](https://github.com/Chrilleweb/dotenv-diff/commit/e0d80c09c1d6d8d3a62a1e606cad4bf5ae22bd1b)
|
|
240
258
|
- Moved types arround for better readability [`e9d6424`](https://github.com/Chrilleweb/dotenv-diff/commit/e9d6424477a702798182efee46f7634996310471)
|
|
241
259
|
- framework rules cross-platform consistency. [`4939788`](https://github.com/Chrilleweb/dotenv-diff/commit/4939788e120fb17fcb0d807ade599bf9f7af88ad)
|
|
@@ -287,7 +305,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
287
305
|
> 27 December 2025
|
|
288
306
|
|
|
289
307
|
- v2.4.1 [`#140`](https://github.com/Chrilleweb/dotenv-diff/pull/140)
|
|
290
|
-
- T3-env bug fix på false positive in secret detection
|
|
308
|
+
- T3-env bug fix på false positive in secret detection [`#139`](https://github.com/Chrilleweb/dotenv-diff/pull/139)
|
|
291
309
|
- Scan stats [`#138`](https://github.com/Chrilleweb/dotenv-diff/pull/138)
|
|
292
310
|
- fixed t3env mutible bug + secret detection false potitive warning [`01f0c13`](https://github.com/Chrilleweb/dotenv-diff/commit/01f0c1313b8449d33e6f91ddfd738f614df5856d)
|
|
293
311
|
- changed scan stats name [`c821d85`](https://github.com/Chrilleweb/dotenv-diff/commit/c821d8564bfef9c6826c7d00a357022b507cc745)
|
package/README.md
CHANGED
|
@@ -11,10 +11,12 @@ First-class support for SvelteKit and Next.js. Also works well in modern JavaScr
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
### Warnings & errors detection
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+

|
|
15
16
|
|
|
16
17
|
### Clean / successful scan
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+

|
|
18
20
|
|
|
19
21
|
---
|
|
20
22
|
|
|
@@ -30,7 +32,7 @@ First-class support for SvelteKit and Next.js. Also works well in modern JavaScr
|
|
|
30
32
|
|
|
31
33
|
## How It Works
|
|
32
34
|
|
|
33
|
-
→ See [Capabilities Documentation](
|
|
35
|
+
→ See [Capabilities Documentation](../../docs/capabilities.md) for details on what the scanner checks for and how it works.
|
|
34
36
|
|
|
35
37
|
---
|
|
36
38
|
|
|
@@ -42,7 +44,7 @@ Generate a default configuration file:
|
|
|
42
44
|
dotenv-diff --init
|
|
43
45
|
```
|
|
44
46
|
|
|
45
|
-
→ See [Configuration Documentation](
|
|
47
|
+
→ See [Configuration Documentation](../../docs/configuration_and_flags.md#configuration-file) for more details.
|
|
46
48
|
|
|
47
49
|
---
|
|
48
50
|
|
|
@@ -50,7 +52,7 @@ dotenv-diff --init
|
|
|
50
52
|
|
|
51
53
|
Easily integrate dotenv-diff into your Git hooks or CI/CD pipelines to enforce environment variable consistency.
|
|
52
54
|
|
|
53
|
-
→ See [Git Hooks Documentation](
|
|
55
|
+
→ See [Git Hooks Documentation](../../docs/git_hooks_ci.md) for more details.
|
|
54
56
|
|
|
55
57
|
## Framework-Specific Warnings
|
|
56
58
|
|
|
@@ -65,9 +67,9 @@ Framework issues (Sveltekit):
|
|
|
65
67
|
→ Variables accessed through import.meta.env must start with "VITE_"
|
|
66
68
|
```
|
|
67
69
|
|
|
68
|
-
→ See [Framework Documentation](
|
|
70
|
+
→ See [Framework Documentation](../../docs/frameworks/index.md) for more details.
|
|
69
71
|
|
|
70
|
-
## Ignore Comments
|
|
72
|
+
## Ignore Comments
|
|
71
73
|
|
|
72
74
|
You can ignore specific environment variable warnings by adding comments in your code. For example:
|
|
73
75
|
|
|
@@ -77,7 +79,7 @@ const apiKey = process.env.API_KEY; // dotenv-diff-ignore
|
|
|
77
79
|
|
|
78
80
|
This is helpful when you know a specific warning is safe in your source code.
|
|
79
81
|
|
|
80
|
-
→ See [Ignore Comments Documentation](
|
|
82
|
+
→ See [Ignore Comments Documentation](../../docs/ignore_comments.md) for more details.
|
|
81
83
|
|
|
82
84
|
---
|
|
83
85
|
|
|
@@ -90,7 +92,7 @@ Add expiration metadata to your environment variables to get warnings when they
|
|
|
90
92
|
API_TOKEN=
|
|
91
93
|
```
|
|
92
94
|
|
|
93
|
-
→ See [Expiration Documentation](
|
|
95
|
+
→ See [Expiration Documentation](../../docs/expiration_warnings.md) for more details.
|
|
94
96
|
|
|
95
97
|
---
|
|
96
98
|
|
|
@@ -106,9 +108,10 @@ In monorepos with multiple apps and packages, you can include shared folders:
|
|
|
106
108
|
}
|
|
107
109
|
```
|
|
108
110
|
|
|
109
|
-
→ See [Monorepo Documentation](
|
|
111
|
+
→ See [Monorepo Documentation](../../docs/monorepo_support.md) for more details.
|
|
110
112
|
|
|
111
113
|
This will:
|
|
114
|
+
|
|
112
115
|
- Scan the current app
|
|
113
116
|
- Include shared packages
|
|
114
117
|
- Ignore variables used only in specific environments
|
|
@@ -124,14 +127,20 @@ This will:
|
|
|
124
127
|
|
|
125
128
|
## Documentation
|
|
126
129
|
|
|
127
|
-
→ See [dotenv-diff Documentation](
|
|
130
|
+
→ See [dotenv-diff Documentation](../../docs/index.md) for full documentation
|
|
128
131
|
|
|
129
132
|
---
|
|
130
133
|
|
|
131
134
|
## Contributing
|
|
132
135
|
|
|
133
136
|
Issues and pull requests are welcome.
|
|
134
|
-
→ See [CONTRIBUTING](CONTRIBUTING.md) for details.
|
|
137
|
+
→ See [CONTRIBUTING](../../CONTRIBUTING.md) for details.
|
|
138
|
+
|
|
139
|
+
Thanks to these amazing people for contributing to this project:
|
|
140
|
+
|
|
141
|
+
<a href="https://github.com/Chrilleweb/dotenv-diff/graphs/contributors">
|
|
142
|
+
<img src="https://contrib.rocks/image?repo=Chrilleweb/dotenv-diff" />
|
|
143
|
+
</a>
|
|
135
144
|
|
|
136
145
|
---
|
|
137
146
|
|
package/dist/bin/dotenv-diff.js
CHANGED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../src/commands/compare.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,iBAAiB,EACjB,QAAQ,EACR,UAAU,EAGX,MAAM,oBAAoB,CAAC;AAe5B;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,QAAQ,EAAE,EACjB,IAAI,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAChC,OAAO,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../src/commands/compare.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,iBAAiB,EACjB,QAAQ,EACR,UAAU,EAGX,MAAM,oBAAoB,CAAC;AAe5B;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,QAAQ,EAAE,EACjB,IAAI,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAChC,OAAO,CAAC,UAAU,CAAC,CAsBrB"}
|
|
@@ -34,100 +34,152 @@ export async function compareMany(pairs, opts) {
|
|
|
34
34
|
duplicate: 0,
|
|
35
35
|
gitignore: 0,
|
|
36
36
|
};
|
|
37
|
-
for (const
|
|
38
|
-
|
|
39
|
-
// Check if files exist
|
|
40
|
-
const envExists = fs.existsSync(envPath);
|
|
41
|
-
const exampleExists = fs.existsSync(examplePath);
|
|
42
|
-
if (!envExists || !exampleExists) {
|
|
43
|
-
printErrorNotFound(envExists, exampleExists, envPath, examplePath);
|
|
44
|
-
exitWithError = true;
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
printHeader(envName, exampleName, opts.json ?? false);
|
|
48
|
-
// Parse and filter env files
|
|
49
|
-
const { current, example, currentKeys, exampleKeys } = parseAndFilterEnv(envPath, examplePath, opts);
|
|
50
|
-
// Run checks
|
|
51
|
-
const diff = diffEnv(current, example, opts.checkValues);
|
|
52
|
-
// Find empty keys in current env
|
|
53
|
-
const emptyKeys = Object.entries(current)
|
|
54
|
-
.filter(([, v]) => (v ?? '').trim() === '')
|
|
55
|
-
.map(([k]) => k);
|
|
56
|
-
// Find duplicates
|
|
57
|
-
const { dupsEnv, dupsEx } = findDuplicates(envPath, examplePath, opts, run);
|
|
58
|
-
// Check gitignore status
|
|
59
|
-
const gitignoreIssue = run('gitignore')
|
|
60
|
-
? checkGitignoreStatus({ cwd: opts.cwd, envFile: envName })
|
|
61
|
-
: null;
|
|
62
|
-
// Collect filtered results
|
|
63
|
-
const filtered = {
|
|
64
|
-
missing: run('missing') ? diff.missing : [],
|
|
65
|
-
extra: run('extra') ? diff.extra : [],
|
|
66
|
-
empty: run('empty') ? emptyKeys : [],
|
|
67
|
-
mismatches: opts.checkValues ? diff.valueMismatches : [],
|
|
68
|
-
duplicatesEnv: run('duplicate') ? dupsEnv : [],
|
|
69
|
-
duplicatesEx: run('duplicate') ? dupsEx : [],
|
|
70
|
-
gitignoreIssue,
|
|
71
|
-
};
|
|
72
|
-
// Print stats if requested
|
|
73
|
-
if (opts.showStats && !opts.json) {
|
|
74
|
-
const stats = calculateStats(currentKeys, exampleKeys, dupsEnv, dupsEx, filtered, opts.checkValues);
|
|
75
|
-
printStats(envName, exampleName, stats, filtered, opts.json ?? false, opts.showStats ?? true, opts.checkValues ?? false);
|
|
76
|
-
}
|
|
77
|
-
// Check if all is OK
|
|
78
|
-
const allOk = isAllOk(filtered);
|
|
79
|
-
// Print duplicates
|
|
80
|
-
printDuplicates(envName, exampleName, dupsEnv, dupsEx, opts.json ?? false, opts.fix ?? false);
|
|
81
|
-
// Calculate stats for JSON entry
|
|
82
|
-
const stats = calculateStats(currentKeys, exampleKeys, dupsEnv, dupsEx, filtered, opts.checkValues);
|
|
83
|
-
// Build JSON entry with all the data
|
|
84
|
-
const entry = compareJsonOutput({
|
|
85
|
-
envName,
|
|
86
|
-
exampleName,
|
|
87
|
-
dupsEnv,
|
|
88
|
-
dupsEx,
|
|
89
|
-
gitignoreIssue,
|
|
90
|
-
ok: allOk,
|
|
91
|
-
filtered,
|
|
92
|
-
stats,
|
|
93
|
-
});
|
|
94
|
-
// Track errors and update totals
|
|
95
|
-
const shouldExit = updateTotals(filtered, totals, entry);
|
|
96
|
-
if (shouldExit) {
|
|
97
|
-
exitWithError = true;
|
|
98
|
-
}
|
|
99
|
-
// Print all issues
|
|
100
|
-
printIssues(filtered, opts.json ?? false, opts.fix ?? false);
|
|
101
|
-
if (filtered.gitignoreIssue && !opts.json && !opts.fix) {
|
|
102
|
-
printGitignoreWarning({
|
|
103
|
-
envFile: envName,
|
|
104
|
-
reason: filtered.gitignoreIssue.reason,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
const hasGitignoreIssue = filtered.gitignoreIssue !== null;
|
|
108
|
-
printFixTips(filtered, hasGitignoreIssue, opts.json ?? false, opts.fix ?? false);
|
|
109
|
-
// Apply auto-fix if requested
|
|
110
|
-
if (opts.fix) {
|
|
111
|
-
const { changed, result } = applyFixes({
|
|
112
|
-
envPath,
|
|
113
|
-
missingKeys: filtered.missing,
|
|
114
|
-
duplicateKeys: dupsEnv.map((d) => d.key),
|
|
115
|
-
ensureGitignore: hasGitignoreIssue,
|
|
116
|
-
});
|
|
117
|
-
const fixContext = {
|
|
118
|
-
...result,
|
|
119
|
-
fixApplied: changed,
|
|
120
|
-
};
|
|
121
|
-
printAutoFix(fixContext, envName, opts.json ?? false);
|
|
122
|
-
}
|
|
123
|
-
opts.collect?.(entry);
|
|
124
|
-
// In strict mode, any issue (not just errors) causes exit with error
|
|
125
|
-
if (opts.strict && !allOk) {
|
|
37
|
+
for (const pair of pairs) {
|
|
38
|
+
if (processPair(pair, opts, run, totals)) {
|
|
126
39
|
exitWithError = true;
|
|
127
40
|
}
|
|
128
41
|
}
|
|
129
42
|
return { exitWithError };
|
|
130
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Processes a single env/example pair end-to-end.
|
|
46
|
+
* Handles validation, comparison, output, totals update and strict-mode exit logic.
|
|
47
|
+
* @param pair The env/example pair to process.
|
|
48
|
+
* @param opts The comparison options.
|
|
49
|
+
* @param run Category filter function.
|
|
50
|
+
* @param totals Running totals used for final summary.
|
|
51
|
+
* @returns True if this pair should cause exit with error.
|
|
52
|
+
*/
|
|
53
|
+
function processPair(pair, opts, run, totals) {
|
|
54
|
+
const { envName, envPath, examplePath } = pair;
|
|
55
|
+
if (!validatePairFiles(envPath, examplePath)) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
const computation = computePairComparison(pair, opts, run);
|
|
59
|
+
const { exampleName, filtered, dupsEnv, dupsEx, currentKeys, exampleKeys } = computation;
|
|
60
|
+
printHeader(envName, exampleName, opts.json ?? false);
|
|
61
|
+
const stats = calculateStats(currentKeys, exampleKeys, dupsEnv, dupsEx, filtered, opts.checkValues);
|
|
62
|
+
maybePrintStats(envName, exampleName, stats, filtered, opts);
|
|
63
|
+
const allOk = isAllOk(filtered);
|
|
64
|
+
printDuplicates(envName, exampleName, dupsEnv, dupsEx, opts.json ?? false, opts.fix ?? false);
|
|
65
|
+
const entry = compareJsonOutput({
|
|
66
|
+
envName,
|
|
67
|
+
exampleName,
|
|
68
|
+
dupsEnv,
|
|
69
|
+
dupsEx,
|
|
70
|
+
gitignoreIssue: computation.gitignoreIssue,
|
|
71
|
+
ok: allOk,
|
|
72
|
+
filtered,
|
|
73
|
+
stats,
|
|
74
|
+
});
|
|
75
|
+
const shouldExitFromTotals = updateTotals(filtered, totals, entry);
|
|
76
|
+
printPairOutputs(envName, envPath, filtered, dupsEnv, opts);
|
|
77
|
+
opts.collect?.(entry);
|
|
78
|
+
const shouldExitFromStrict = Boolean(opts.strict && !allOk);
|
|
79
|
+
return shouldExitFromTotals || shouldExitFromStrict;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Validates that both input files exist before comparison.
|
|
83
|
+
* Prints a not-found error when either file is missing.
|
|
84
|
+
* @param envPath Path to the env file.
|
|
85
|
+
* @param examplePath Path to the example file.
|
|
86
|
+
* @returns True when both files exist, otherwise false.
|
|
87
|
+
*/
|
|
88
|
+
function validatePairFiles(envPath, examplePath) {
|
|
89
|
+
const envExists = fs.existsSync(envPath);
|
|
90
|
+
const exampleExists = fs.existsSync(examplePath);
|
|
91
|
+
if (!envExists || !exampleExists) {
|
|
92
|
+
printErrorNotFound(envExists, exampleExists, envPath, examplePath);
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Computes all comparison data for a single file pair.
|
|
99
|
+
* Includes parsed keys, diffs, empty keys, duplicates and optional gitignore status.
|
|
100
|
+
* @param pair The env/example pair to compare.
|
|
101
|
+
* @param opts The comparison options.
|
|
102
|
+
* @param run Category filter function.
|
|
103
|
+
* @returns Structured comparison data used by output and summary steps.
|
|
104
|
+
*/
|
|
105
|
+
function computePairComparison(pair, opts, run) {
|
|
106
|
+
const { envName, envPath, examplePath } = pair;
|
|
107
|
+
const exampleName = path.basename(examplePath);
|
|
108
|
+
const { current, example, currentKeys, exampleKeys } = parseAndFilterEnv(envPath, examplePath, opts);
|
|
109
|
+
const diff = diffEnv(current, example, opts.checkValues);
|
|
110
|
+
const emptyKeys = Object.entries(current)
|
|
111
|
+
.filter(([, v]) => (v ?? '').trim() === '')
|
|
112
|
+
.map(([k]) => k);
|
|
113
|
+
const { dupsEnv, dupsEx } = findDuplicates(envPath, examplePath, opts, run);
|
|
114
|
+
const gitignoreIssue = run('gitignore')
|
|
115
|
+
? checkGitignoreStatus({ cwd: opts.cwd, envFile: envName })
|
|
116
|
+
: null;
|
|
117
|
+
const filtered = {
|
|
118
|
+
missing: run('missing') ? diff.missing : [],
|
|
119
|
+
extra: run('extra') ? diff.extra : [],
|
|
120
|
+
empty: run('empty') ? emptyKeys : [],
|
|
121
|
+
mismatches: opts.checkValues ? diff.valueMismatches : [],
|
|
122
|
+
duplicatesEnv: run('duplicate') ? dupsEnv : [],
|
|
123
|
+
duplicatesEx: run('duplicate') ? dupsEx : [],
|
|
124
|
+
gitignoreIssue,
|
|
125
|
+
};
|
|
126
|
+
return {
|
|
127
|
+
exampleName,
|
|
128
|
+
filtered,
|
|
129
|
+
dupsEnv,
|
|
130
|
+
dupsEx,
|
|
131
|
+
currentKeys,
|
|
132
|
+
exampleKeys,
|
|
133
|
+
gitignoreIssue,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Prints stats for a pair when stats output is enabled and JSON output is disabled.
|
|
138
|
+
* @param envName Name of the env file.
|
|
139
|
+
* @param exampleName Name of the example file.
|
|
140
|
+
* @param stats Computed stats for this comparison.
|
|
141
|
+
* @param filtered Filtered result payload for issue counts.
|
|
142
|
+
* @param opts Comparison options controlling output behavior.
|
|
143
|
+
* @returns void
|
|
144
|
+
*/
|
|
145
|
+
function maybePrintStats(envName, exampleName, stats, filtered, opts) {
|
|
146
|
+
if (!opts.showStats || opts.json)
|
|
147
|
+
return;
|
|
148
|
+
printStats(envName, exampleName, stats, filtered, opts.json ?? false, opts.showStats ?? true, opts.checkValues ?? false);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Prints issue/fix related outputs for a pair and optionally runs auto-fix.
|
|
152
|
+
* @param envName Name of the env file.
|
|
153
|
+
* @param envPath Path to the env file.
|
|
154
|
+
* @param filtered Filtered comparison results for this pair.
|
|
155
|
+
* @param dupsEnv Duplicate key entries found in env file.
|
|
156
|
+
* @param opts Comparison options controlling output and fix behavior.
|
|
157
|
+
* @returns void
|
|
158
|
+
*/
|
|
159
|
+
function printPairOutputs(envName, envPath, filtered, dupsEnv, opts) {
|
|
160
|
+
printIssues(filtered, opts.json ?? false, opts.fix ?? false);
|
|
161
|
+
if (filtered.gitignoreIssue && !opts.json && !opts.fix) {
|
|
162
|
+
printGitignoreWarning({
|
|
163
|
+
envFile: envName,
|
|
164
|
+
reason: filtered.gitignoreIssue.reason,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const hasGitignoreIssue = filtered.gitignoreIssue !== null;
|
|
168
|
+
printFixTips(filtered, hasGitignoreIssue, opts.json ?? false, opts.fix ?? false);
|
|
169
|
+
if (!opts.fix)
|
|
170
|
+
return;
|
|
171
|
+
const { changed, result } = applyFixes({
|
|
172
|
+
envPath,
|
|
173
|
+
missingKeys: filtered.missing,
|
|
174
|
+
duplicateKeys: dupsEnv.map((d) => d.key),
|
|
175
|
+
ensureGitignore: hasGitignoreIssue,
|
|
176
|
+
});
|
|
177
|
+
const fixContext = {
|
|
178
|
+
...result,
|
|
179
|
+
fixApplied: changed,
|
|
180
|
+
};
|
|
181
|
+
printAutoFix(fixContext, envName, opts.json ?? false);
|
|
182
|
+
}
|
|
131
183
|
/**
|
|
132
184
|
* Creates a category filter function based on options.
|
|
133
185
|
* fx: onlyFiltering({ only: ['missing', 'extra'] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../../../src/commands/compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAS1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D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AAC,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAC/D,SAAS,CAAC,GAAG,CAAC,CACf,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,MAAM,EAA4B,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,SAAS,OAAO,CAAC,QAAkB;IACjC,OAAO,CACL,QAAQ,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;QAC7B,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC;QACnC,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC;QACnC,QAAQ,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC;QACnC,QAAQ,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAClC,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC;QACxC,CAAC,QAAQ,CAAC,cAAc,CACzB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanUsage.d.ts","sourceRoot":"","sources":["../../../src/commands/scanUsage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAEhB,UAAU,EAGX,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"scanUsage.d.ts","sourceRoot":"","sources":["../../../src/commands/scanUsage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAEhB,UAAU,EAGX,MAAM,oBAAoB,CAAC;AAiB5B;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAmJ3E"}
|
|
@@ -8,7 +8,7 @@ import { printComparisonError } from '../ui/scan/printComparisonError.js';
|
|
|
8
8
|
import { hasIgnoreComment } from '../core/security/secretDetectors.js';
|
|
9
9
|
import { frameworkValidator } from '../core/frameworks/frameworkValidator.js';
|
|
10
10
|
import { detectSecretsInExample } from '../core/security/exampleSecretDetector.js';
|
|
11
|
-
import { DEFAULT_EXAMPLE_FILE } from '../config/constants.js';
|
|
11
|
+
import { DEFAULT_EXAMPLE_FILE, URGENT_EXPIRE_DAYS, EXPIRE_THRESHOLD_DAYS, } from '../config/constants.js';
|
|
12
12
|
import { promptNoEnvScenario } from './prompts/promptNoEnvScenario.js';
|
|
13
13
|
/**
|
|
14
14
|
* Scans the codebase for environment variable usage and compares it with
|
|
@@ -108,11 +108,13 @@ export async function scanUsage(opts) {
|
|
|
108
108
|
const hasHighSeveritySecrets = (scanResult.secrets ?? []).some((s) => s.severity === 'high');
|
|
109
109
|
// Check for high potential secrets in example warnings
|
|
110
110
|
const hasHighSeverityExampleWarnings = (scanResult.exampleWarnings ?? []).some((w) => w.severity === 'high');
|
|
111
|
+
const hasUrgentExpireWarnings = (scanResult.expireWarnings ?? []).some((w) => w.daysLeft <= URGENT_EXPIRE_DAYS);
|
|
111
112
|
return {
|
|
112
113
|
exitWithError: scanResult.missing.length > 0 ||
|
|
113
114
|
hasHighSeveritySecrets ||
|
|
115
|
+
hasUrgentExpireWarnings ||
|
|
114
116
|
hasHighSeverityExampleWarnings ||
|
|
115
|
-
!!(
|
|
117
|
+
!!(opts.strict &&
|
|
116
118
|
(scanResult.unused.length > 0 ||
|
|
117
119
|
(scanResult.duplicates?.env?.length ?? 0) > 0 ||
|
|
118
120
|
(scanResult.duplicates?.example?.length ?? 0) > 0 ||
|
|
@@ -120,9 +122,9 @@ export async function scanUsage(opts) {
|
|
|
120
122
|
(scanResult.frameworkWarnings?.length ?? 0) > 0 ||
|
|
121
123
|
(scanResult.logged?.length ?? 0) > 0 ||
|
|
122
124
|
(scanResult.uppercaseWarnings?.length ?? 0) > 0 ||
|
|
123
|
-
(scanResult.expireWarnings?.length ?? 0) > 0 ||
|
|
124
|
-
(scanResult.inconsistentNamingWarnings?.length ?? 0) > 0
|
|
125
|
-
|
|
125
|
+
(scanResult.expireWarnings?.filter((w) => w.daysLeft <= EXPIRE_THRESHOLD_DAYS).length ?? 0) > 0 ||
|
|
126
|
+
(scanResult.inconsistentNamingWarnings?.length ?? 0) > 0 ||
|
|
127
|
+
(scanResult.exampleWarnings?.length ?? 0) > 0)),
|
|
126
128
|
};
|
|
127
129
|
}
|
|
128
130
|
// Console output
|