dotenv-diff 2.5.0 → 2.5.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 +341 -536
- package/dist/bin/dotenv-diff.js +0 -0
- package/package.json +5 -1
- package/dist/cli.d.ts +0 -9
- package/dist/cli.js +0 -294
- package/dist/diffEnv.d.ts +0 -5
- package/dist/diffEnv.js +0 -7
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/lib/checkGitignore.d.ts +0 -23
- package/dist/lib/checkGitignore.js +0 -73
- package/dist/lib/diffEnv.d.ts +0 -18
- package/dist/lib/diffEnv.js +0 -29
- package/dist/lib/parseEnv.d.ts +0 -10
- package/dist/lib/parseEnv.js +0 -25
- package/dist/parseEnv.d.ts +0 -1
- package/dist/parseEnv.js +0 -16
- package/dist/src/core/compareScan.d.ts +0 -10
- package/dist/src/core/compareScan.d.ts.map +0 -1
- package/dist/src/core/compareScan.js +0 -19
- package/dist/src/core/compareScan.js.map +0 -1
- package/dist/src/core/computeHealthScore.d.ts +0 -8
- package/dist/src/core/computeHealthScore.d.ts.map +0 -1
- package/dist/src/core/computeHealthScore.js +0 -35
- package/dist/src/core/computeHealthScore.js.map +0 -1
- package/dist/src/core/cspDetector.d.ts +0 -7
- package/dist/src/core/cspDetector.d.ts.map +0 -1
- package/dist/src/core/cspDetector.js +0 -38
- package/dist/src/core/cspDetector.js.map +0 -1
- package/dist/src/core/defaultExcludeKeys.d.ts +0 -7
- package/dist/src/core/defaultExcludeKeys.d.ts.map +0 -1
- package/dist/src/core/detectClientExposure.d.ts +0 -12
- package/dist/src/core/detectClientExposure.d.ts.map +0 -1
- package/dist/src/core/detectClientExposure.js +0 -62
- package/dist/src/core/detectClientExposure.js.map +0 -1
- package/dist/src/core/detectExpirations.d.ts +0 -14
- package/dist/src/core/detectExpirations.d.ts.map +0 -1
- package/dist/src/core/detectExpirations.js +0 -44
- package/dist/src/core/detectExpirations.js.map +0 -1
- package/dist/src/core/detectUppercaseKeys.d.ts +0 -9
- package/dist/src/core/detectUppercaseKeys.d.ts.map +0 -1
- package/dist/src/core/detectUppercaseKeys.js +0 -28
- package/dist/src/core/detectUppercaseKeys.js.map +0 -1
- package/dist/src/core/determineComparisonFile.d.ts +0 -13
- package/dist/src/core/determineComparisonFile.d.ts.map +0 -1
- package/dist/src/core/determineComparisonFile.js +0 -33
- package/dist/src/core/determineComparisonFile.js.map +0 -1
- package/dist/src/core/entropy.d.ts +0 -8
- package/dist/src/core/entropy.d.ts.map +0 -1
- package/dist/src/core/entropy.js +0 -23
- package/dist/src/core/entropy.js.map +0 -1
- package/dist/src/core/envDiscovery.d.ts +0 -19
- package/dist/src/core/envDiscovery.d.ts.map +0 -1
- package/dist/src/core/envDiscovery.js +0 -81
- package/dist/src/core/envDiscovery.js.map +0 -1
- package/dist/src/core/envPairing.d.ts +0 -8
- package/dist/src/core/envPairing.d.ts.map +0 -1
- package/dist/src/core/envPairing.js +0 -36
- package/dist/src/core/envPairing.js.map +0 -1
- package/dist/src/core/envValidator.d.ts +0 -9
- package/dist/src/core/envValidator.d.ts.map +0 -1
- package/dist/src/core/envValidator.js +0 -103
- package/dist/src/core/envValidator.js.map +0 -1
- package/dist/src/core/exampleSecretDetector.d.ts +0 -13
- package/dist/src/core/exampleSecretDetector.d.ts.map +0 -1
- package/dist/src/core/exampleSecretDetector.js +0 -61
- package/dist/src/core/exampleSecretDetector.js.map +0 -1
- package/dist/src/core/frameworkDetector.d.ts +0 -14
- package/dist/src/core/frameworkDetector.d.ts.map +0 -1
- package/dist/src/core/frameworkDetector.js +0 -40
- package/dist/src/core/frameworkDetector.js.map +0 -1
- package/dist/src/core/frameworkValidator.d.ts +0 -10
- package/dist/src/core/frameworkValidator.d.ts.map +0 -1
- package/dist/src/core/frameworkValidator.js +0 -21
- package/dist/src/core/frameworkValidator.js.map +0 -1
- package/dist/src/core/frameworks/angularRules.d.ts +0 -4
- package/dist/src/core/frameworks/angularRules.d.ts.map +0 -1
- package/dist/src/core/helpers/isAllOk.d.ts +0 -9
- package/dist/src/core/helpers/isAllOk.d.ts.map +0 -1
- package/dist/src/core/helpers/isAllOk.js +0 -16
- package/dist/src/core/helpers/isAllOk.js.map +0 -1
- package/dist/src/core/helpers/updateTotals.d.ts +0 -19
- package/dist/src/core/helpers/updateTotals.d.ts.map +0 -1
- package/dist/src/core/helpers/updateTotals.js +0 -37
- package/dist/src/core/helpers/updateTotals.js.map +0 -1
- package/dist/src/core/parseAndFilterEnv.d.ts +0 -20
- package/dist/src/core/parseAndFilterEnv.d.ts.map +0 -1
- package/dist/src/core/parseAndFilterEnv.js +0 -22
- package/dist/src/core/parseAndFilterEnv.js.map +0 -1
- package/dist/src/core/processComparisonFile.d.ts +0 -43
- package/dist/src/core/processComparisonFile.d.ts.map +0 -1
- package/dist/src/core/processComparisonFile.js +0 -170
- package/dist/src/core/processComparisonFile.js.map +0 -1
- package/dist/src/core/scan/scanJsonOutput.d.ts +0 -85
- package/dist/src/core/scan/scanJsonOutput.d.ts.map +0 -1
- package/dist/src/core/scan/scanJsonOutput.js +0 -97
- package/dist/src/core/scan/scanJsonOutput.js.map +0 -1
- package/dist/src/core/scan/secretDetectors.d.ts +0 -28
- package/dist/src/core/scan/secretDetectors.d.ts.map +0 -1
- package/dist/src/core/scan/secretDetectors.js +0 -272
- package/dist/src/core/scan/secretDetectors.js.map +0 -1
- package/dist/src/core/scanFile.d.ts +0 -10
- package/dist/src/core/scanFile.d.ts.map +0 -1
- package/dist/src/core/scanFile.js +0 -65
- package/dist/src/core/scanFile.js.map +0 -1
- package/dist/src/core/scanJsonOutput.d.ts +0 -85
- package/dist/src/core/scanJsonOutput.d.ts.map +0 -1
- package/dist/src/core/scanJsonOutput.js +0 -97
- package/dist/src/core/scanJsonOutput.js.map +0 -1
- package/dist/src/core/secretDetectors.d.ts +0 -28
- package/dist/src/core/secretDetectors.d.ts.map +0 -1
- package/dist/src/core/secretDetectors.js +0 -272
- package/dist/src/core/secretDetectors.js.map +0 -1
- package/dist/src/core/t3env/detectT3Env.d.ts +0 -12
- package/dist/src/core/t3env/detectT3Env.d.ts.map +0 -1
- package/dist/src/core/t3env/detectT3Env.js +0 -113
- package/dist/src/core/t3env/detectT3Env.js.map +0 -1
- package/dist/src/core/t3env/t3EnvRules.d.ts +0 -10
- package/dist/src/core/t3env/t3EnvRules.d.ts.map +0 -1
- package/dist/src/core/t3env/t3EnvRules.js +0 -61
- package/dist/src/core/t3env/t3EnvRules.js.map +0 -1
- package/dist/src/core/t3env/t3EnvValidator.d.ts +0 -9
- package/dist/src/core/t3env/t3EnvValidator.d.ts.map +0 -1
- package/dist/src/core/t3env/t3EnvValidator.js +0 -32
- package/dist/src/core/t3env/t3EnvValidator.js.map +0 -1
- package/dist/src/lib/diffEnv.d.ts +0 -19
- package/dist/src/lib/diffEnv.d.ts.map +0 -1
- package/dist/src/lib/diffEnv.js +0 -31
- package/dist/src/lib/diffEnv.js.map +0 -1
- package/dist/src/lib/parseEnv.d.ts +0 -11
- package/dist/src/lib/parseEnv.d.ts.map +0 -1
- package/dist/src/lib/parseEnv.js +0 -26
- package/dist/src/lib/parseEnv.js.map +0 -1
- package/dist/src/services/codeBaseScanner.d.ts +0 -8
- package/dist/src/services/codeBaseScanner.d.ts.map +0 -1
- package/dist/src/services/codeBaseScanner.js +0 -110
- package/dist/src/services/codeBaseScanner.js.map +0 -1
- package/dist/src/services/duplicates.d.ts +0 -12
- package/dist/src/services/duplicates.d.ts.map +0 -1
- package/dist/src/services/duplicates.js +0 -36
- package/dist/src/services/duplicates.js.map +0 -1
- package/dist/src/services/ensureFilesOrPrompt.d.ts +0 -22
- package/dist/src/services/ensureFilesOrPrompt.d.ts.map +0 -1
- package/dist/src/services/ensureFilesOrPrompt.js +0 -76
- package/dist/src/services/ensureFilesOrPrompt.js.map +0 -1
- package/dist/src/services/scanOutputToConsole.d.ts +0 -17
- package/dist/src/services/scanOutputToConsole.d.ts.map +0 -1
- package/dist/src/services/scanOutputToConsole.js +0 -127
- package/dist/src/services/scanOutputToConsole.js.map +0 -1
- package/dist/src/ui/compare/printAutoFix.d.ts +0 -16
- package/dist/src/ui/compare/printAutoFix.d.ts.map +0 -1
- package/dist/src/ui/compare/printAutoFix.js +0 -34
- package/dist/src/ui/compare/printAutoFix.js.map +0 -1
- package/dist/src/ui/compare/printAutoFixApplied.d.ts +0 -7
- package/dist/src/ui/compare/printAutoFixApplied.d.ts.map +0 -1
- package/dist/src/ui/compare/printAutoFixApplied.js +0 -22
- package/dist/src/ui/compare/printAutoFixApplied.js.map +0 -1
- package/dist/src/ui/compare/printDuplicates.d.ts +0 -17
- package/dist/src/ui/compare/printDuplicates.d.ts.map +0 -1
- package/dist/src/ui/compare/printDuplicates.js +0 -25
- package/dist/src/ui/compare/printDuplicates.js.map +0 -1
- package/dist/src/ui/compare/printFixTips.d.ts +0 -11
- package/dist/src/ui/compare/printFixTips.d.ts.map +0 -1
- package/dist/src/ui/compare/printFixTips.js +0 -46
- package/dist/src/ui/compare/printFixTips.js.map +0 -1
- package/dist/src/ui/compare/printSuccess.d.ts +0 -11
- package/dist/src/ui/compare/printSuccess.d.ts.map +0 -1
- package/dist/src/ui/compare/printSuccess.js +0 -27
- package/dist/src/ui/compare/printSuccess.js.map +0 -1
- package/dist/src/ui/scan/printCspWarning.d.ts +0 -9
- package/dist/src/ui/scan/printCspWarning.d.ts.map +0 -1
- package/dist/src/ui/scan/printCspWarning.js +0 -20
- package/dist/src/ui/scan/printCspWarning.js.map +0 -1
- package/dist/src/ui/scan/printEnvWarnings.d.ts +0 -8
- package/dist/src/ui/scan/printEnvWarnings.d.ts.map +0 -1
- package/dist/src/ui/scan/printEnvWarnings.js +0 -20
- package/dist/src/ui/scan/printEnvWarnings.js.map +0 -1
- package/dist/src/ui/scan/printExposedVars.d.ts +0 -8
- package/dist/src/ui/scan/printExposedVars.d.ts.map +0 -1
- package/dist/src/ui/scan/printExposedVars.js +0 -24
- package/dist/src/ui/scan/printExposedVars.js.map +0 -1
- package/dist/src/ui/scan/printT3EnvWarnings.d.ts +0 -8
- package/dist/src/ui/scan/printT3EnvWarnings.d.ts.map +0 -1
- package/dist/src/ui/scan/printT3EnvWarnings.js +0 -20
- package/dist/src/ui/scan/printT3EnvWarnings.js.map +0 -1
- package/dist/src/ui/scan/printUniqueVariables.d.ts +0 -7
- package/dist/src/ui/scan/printUniqueVariables.d.ts.map +0 -1
- package/dist/src/ui/scan/printUniqueVariables.js +0 -14
- package/dist/src/ui/scan/printUniqueVariables.js.map +0 -1
- package/dist/src/ui/scan/printVariables.d.ts +0 -10
- package/dist/src/ui/scan/printVariables.d.ts.map +0 -1
- package/dist/src/ui/scan/printVariables.js +0 -37
- package/dist/src/ui/scan/printVariables.js.map +0 -1
- package/dist/src/ui/shared/printProgress.d.ts +0 -24
- package/dist/src/ui/shared/printProgress.d.ts.map +0 -1
- package/dist/src/ui/shared/printProgress.js +0 -43
- package/dist/src/ui/shared/printProgress.js.map +0 -1
- package/dist/types/scanUsage.d.ts +0 -43
- package/dist/types/scanUsage.d.ts.map +0 -1
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Prints duplicate keys found in the environment and example files.
|
|
4
|
-
* @param envName The name of the environment file.
|
|
5
|
-
* @param exampleName The name of the example file.
|
|
6
|
-
* @param dEnv Array of duplicate keys in the environment file with their counts.
|
|
7
|
-
* @param dEx Array of duplicate keys in the example file with their counts.
|
|
8
|
-
* @param json Whether to output in JSON format.
|
|
9
|
-
* @returns void
|
|
10
|
-
*/
|
|
11
|
-
export function printDuplicates(envName, exampleName, dEnv, dEx, json) {
|
|
12
|
-
if (json)
|
|
13
|
-
return;
|
|
14
|
-
if (dEnv.length) {
|
|
15
|
-
console.log(chalk.yellow(`⚠️ Duplicate keys in ${envName} (last occurrence wins):`));
|
|
16
|
-
dEnv.forEach(({ key, count }) => console.log(chalk.yellow(` - ${key} (${count} occurrences)`)));
|
|
17
|
-
console.log();
|
|
18
|
-
}
|
|
19
|
-
if (dEx.length) {
|
|
20
|
-
console.log(chalk.yellow(`⚠️ Duplicate keys in ${exampleName} (last occurrence wins):`));
|
|
21
|
-
dEx.forEach(({ key, count }) => console.log(chalk.yellow(` - ${key} (${count} occurrences)`)));
|
|
22
|
-
console.log();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=printDuplicates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printDuplicates.js","sourceRoot":"","sources":["../../../../src/ui/compare/printDuplicates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,WAAmB,EACnB,IAA2C,EAC3C,GAA0C,EAC1C,IAAa;IAEb,IAAI,IAAI;QAAE,OAAO;IACjB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CAAC,yBAAyB,OAAO,0BAA0B,CAAC,CACzE,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,KAAK,KAAK,eAAe,CAAC,CAAC,CACjE,CAAC;QACF,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;IACD,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CACV,yBAAyB,WAAW,0BAA0B,CAC/D,CACF,CAAC;QACF,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAC7B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,KAAK,KAAK,eAAe,CAAC,CAAC,CAChE,CAAC;QACF,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type Filtered } from '../../config/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Prints tips for fixing issues found during the comparison.
|
|
4
|
-
* @param filtered The filtered comparison results.
|
|
5
|
-
* @param envNotIgnored Whether the .env file is not ignored by git.
|
|
6
|
-
* @param json Whether to output in JSON format.
|
|
7
|
-
* @param fix Whether to apply fixes.
|
|
8
|
-
* @returns void
|
|
9
|
-
*/
|
|
10
|
-
export declare function printFixTips(filtered: Filtered, envNotIgnored: boolean, json: boolean, fix: boolean): void;
|
|
11
|
-
//# sourceMappingURL=printFixTips.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printFixTips.d.ts","sourceRoot":"","sources":["../../../../src/ui/compare/printFixTips.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,OAAO,EACtB,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,OAAO,QA+Bb"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import {} from '../../config/types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Prints tips for fixing issues found during the comparison.
|
|
5
|
-
* @param filtered The filtered comparison results.
|
|
6
|
-
* @param envNotIgnored Whether the .env file is not ignored by git.
|
|
7
|
-
* @param json Whether to output in JSON format.
|
|
8
|
-
* @param fix Whether to apply fixes.
|
|
9
|
-
* @returns void
|
|
10
|
-
*/
|
|
11
|
-
export function printFixTips(filtered, envNotIgnored, json, fix) {
|
|
12
|
-
if (json || fix)
|
|
13
|
-
return;
|
|
14
|
-
const hasMissing = filtered.missing.length > 0;
|
|
15
|
-
const hasDupEnv = filtered.duplicatesEnv.length > 0;
|
|
16
|
-
let tip = null;
|
|
17
|
-
if (hasMissing && hasDupEnv && envNotIgnored) {
|
|
18
|
-
tip =
|
|
19
|
-
'💡 Tip: Run with `--fix` to add missing keys, remove duplicates and add .env to .gitignore';
|
|
20
|
-
}
|
|
21
|
-
else if (hasMissing && hasDupEnv) {
|
|
22
|
-
tip = '💡 Tip: Run with `--fix` to add missing keys and remove duplicates';
|
|
23
|
-
}
|
|
24
|
-
else if (hasDupEnv && envNotIgnored) {
|
|
25
|
-
tip =
|
|
26
|
-
'💡 Tip: Run with `--fix` to remove duplicate keys and add .env to .gitignore';
|
|
27
|
-
}
|
|
28
|
-
else if (hasMissing && envNotIgnored) {
|
|
29
|
-
tip =
|
|
30
|
-
'💡 Tip: Run with `--fix` to add missing keys and add .env to .gitignore';
|
|
31
|
-
}
|
|
32
|
-
else if (hasMissing) {
|
|
33
|
-
tip = '💡 Tip: Run with `--fix` to add missing keys';
|
|
34
|
-
}
|
|
35
|
-
else if (hasDupEnv) {
|
|
36
|
-
tip = '💡 Tip: Run with `--fix` to remove duplicate keys';
|
|
37
|
-
}
|
|
38
|
-
else if (envNotIgnored) {
|
|
39
|
-
tip = '💡 Tip: Run with `--fix` to ensure .env is added to .gitignore';
|
|
40
|
-
}
|
|
41
|
-
if (tip) {
|
|
42
|
-
console.log(chalk.gray(tip));
|
|
43
|
-
console.log();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=printFixTips.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printFixTips.js","sourceRoot":"","sources":["../../../../src/ui/compare/printFixTips.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,QAAkB,EAClB,aAAsB,EACtB,IAAa,EACb,GAAY;IAEZ,IAAI,IAAI,IAAI,GAAG;QAAE,OAAO;IAExB,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAEpD,IAAI,GAAG,GAAkB,IAAI,CAAC;IAC9B,IAAI,UAAU,IAAI,SAAS,IAAI,aAAa,EAAE,CAAC;QAC7C,GAAG;YACD,4FAA4F,CAAC;IACjG,CAAC;SAAM,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;QACnC,GAAG,GAAG,oEAAoE,CAAC;IAC7E,CAAC;SAAM,IAAI,SAAS,IAAI,aAAa,EAAE,CAAC;QACtC,GAAG;YACD,8EAA8E,CAAC;IACnF,CAAC;SAAM,IAAI,UAAU,IAAI,aAAa,EAAE,CAAC;QACvC,GAAG;YACD,yEAAyE,CAAC;IAC9E,CAAC;SAAM,IAAI,UAAU,EAAE,CAAC;QACtB,GAAG,GAAG,8CAA8C,CAAC;IACvD,CAAC;SAAM,IAAI,SAAS,EAAE,CAAC;QACrB,GAAG,GAAG,mDAAmD,CAAC;IAC5D,CAAC;SAAM,IAAI,aAAa,EAAE,CAAC;QACzB,GAAG,GAAG,gEAAgE,CAAC;IACzE,CAAC;IAED,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prints success messages when everything is OK.
|
|
3
|
-
*
|
|
4
|
-
* @param json - Whether to output in JSON format.
|
|
5
|
-
* @param mode - "compare" or "scan" mode.
|
|
6
|
-
* @param comparedAgainst - Name of env/example file (optional).
|
|
7
|
-
* @param unused - List of unused variables (optional, only for scan).
|
|
8
|
-
* @param showUnused - Whether to print unused success info.
|
|
9
|
-
*/
|
|
10
|
-
export declare function printSuccess(json: boolean, mode?: 'compare' | 'scan', comparedAgainst?: string, unused?: string[], showUnused?: boolean): void;
|
|
11
|
-
//# sourceMappingURL=printSuccess.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printSuccess.d.ts","sourceRoot":"","sources":["../../../../src/ui/compare/printSuccess.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,OAAO,EACb,IAAI,GAAE,SAAS,GAAG,MAAkB,EACpC,eAAe,CAAC,EAAE,MAAM,EACxB,MAAM,GAAE,MAAM,EAAO,EACrB,UAAU,UAAQ,GACjB,IAAI,CAqBN"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Prints success messages when everything is OK.
|
|
4
|
-
*
|
|
5
|
-
* @param json - Whether to output in JSON format.
|
|
6
|
-
* @param mode - "compare" or "scan" mode.
|
|
7
|
-
* @param comparedAgainst - Name of env/example file (optional).
|
|
8
|
-
* @param unused - List of unused variables (optional, only for scan).
|
|
9
|
-
* @param showUnused - Whether to print unused success info.
|
|
10
|
-
*/
|
|
11
|
-
export function printSuccess(json, mode = 'compare', comparedAgainst, unused = [], showUnused = false) {
|
|
12
|
-
if (json)
|
|
13
|
-
return;
|
|
14
|
-
if (mode === 'compare') {
|
|
15
|
-
console.log(chalk.green('✅ All keys match.'));
|
|
16
|
-
console.log();
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (mode === 'scan' && comparedAgainst) {
|
|
20
|
-
console.log(chalk.green(`✅ All used environment variables are defined in ${comparedAgainst}`));
|
|
21
|
-
if (showUnused && unused.length === 0) {
|
|
22
|
-
console.log(chalk.green('✅ No unused environment variables found'));
|
|
23
|
-
}
|
|
24
|
-
console.log();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=printSuccess.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printSuccess.js","sourceRoot":"","sources":["../../../../src/ui/compare/printSuccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAa,EACb,OAA2B,SAAS,EACpC,eAAwB,EACxB,SAAmB,EAAE,EACrB,UAAU,GAAG,KAAK;IAElB,IAAI,IAAI;QAAE,OAAO;IAEjB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO;IACT,CAAC;IAED,IAAI,IAAI,KAAK,MAAM,IAAI,eAAe,EAAE,CAAC;QACvC,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CACT,mDAAmD,eAAe,EAAE,CACrE,CACF,CAAC;QAEF,IAAI,UAAU,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prints a warning if no CSP was detected.
|
|
3
|
-
* Does NOT affect exit code – soft security warning only.
|
|
4
|
-
* @param hasCsp Whether a Content-Security-Policy was detected (boolean or undefined)
|
|
5
|
-
* @param json Whether to output in JSON format
|
|
6
|
-
* @returns void
|
|
7
|
-
*/
|
|
8
|
-
export declare function printCspWarning(hasCsp: boolean | undefined, json: boolean): void;
|
|
9
|
-
//# sourceMappingURL=printCspWarning.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printCspWarning.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printCspWarning.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,IAAI,EAAE,OAAO,GACZ,IAAI,CAYN"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Prints a warning if no CSP was detected.
|
|
4
|
-
* Does NOT affect exit code – soft security warning only.
|
|
5
|
-
* @param hasCsp Whether a Content-Security-Policy was detected (boolean or undefined)
|
|
6
|
-
* @param json Whether to output in JSON format
|
|
7
|
-
* @returns void
|
|
8
|
-
*/
|
|
9
|
-
export function printCspWarning(hasCsp, json) {
|
|
10
|
-
// JSON mode: no pretty printing
|
|
11
|
-
if (json)
|
|
12
|
-
return;
|
|
13
|
-
// If CSP exists, remain silent to avoid noise
|
|
14
|
-
if (hasCsp)
|
|
15
|
-
return;
|
|
16
|
-
console.log(chalk.yellow('⚠️ CSP is missing'));
|
|
17
|
-
console.log(chalk.yellow.dim(' No Content-Security-Policy detected in your project.'));
|
|
18
|
-
console.log();
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=printCspWarning.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printCspWarning.js","sourceRoot":"","sources":["../../../../src/ui/scan/printCspWarning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,MAA2B,EAC3B,IAAa;IAEb,gCAAgC;IAChC,IAAI,IAAI;QAAE,OAAO;IAEjB,8CAA8C;IAC9C,IAAI,MAAM;QAAE,OAAO;IAEnB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAC5E,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { EnvWarning } from '../../core/envValidator.js';
|
|
2
|
-
/**
|
|
3
|
-
* Prints environment variable usage warnings to the console.
|
|
4
|
-
* @param warnings - List of environment variable warnings
|
|
5
|
-
* @param json - Whether to output in JSON format
|
|
6
|
-
*/
|
|
7
|
-
export declare function printEnvWarnings(warnings: EnvWarning[], json: boolean): void;
|
|
8
|
-
//# sourceMappingURL=printEnvWarnings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printEnvWarnings.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printEnvWarnings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,QAiBrE"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Prints environment variable usage warnings to the console.
|
|
4
|
-
* @param warnings - List of environment variable warnings
|
|
5
|
-
* @param json - Whether to output in JSON format
|
|
6
|
-
*/
|
|
7
|
-
export function printEnvWarnings(warnings, json) {
|
|
8
|
-
if (!warnings || warnings.length === 0)
|
|
9
|
-
return;
|
|
10
|
-
if (json) {
|
|
11
|
-
console.log(JSON.stringify({ envWarnings: warnings }, null, 2));
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
console.log(chalk.yellow('⚠️ Environment variable usage issues:'));
|
|
15
|
-
for (const w of warnings) {
|
|
16
|
-
console.log(chalk.yellow(` - ${w.variable} (${w.file}:${w.line}) → ${w.reason}`));
|
|
17
|
-
}
|
|
18
|
-
console.log();
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=printEnvWarnings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printEnvWarnings.js","sourceRoot":"","sources":["../../../../src/ui/scan/printEnvWarnings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAsB,EAAE,IAAa;IACpE,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/C,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAChE,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAC,CAAC;IAEpE,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CACvE,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prints a list of client-exposed environment variables for Next.js and SvelteKit projects
|
|
3
|
-
* @param exposedVars Set of variable names that are exposed to the client
|
|
4
|
-
* @param framework The detected framework
|
|
5
|
-
* @param json Whether to output in JSON format
|
|
6
|
-
*/
|
|
7
|
-
export declare function printExposedVars(exposedVars: Set<string>, framework: string, json: boolean): void;
|
|
8
|
-
//# sourceMappingURL=printExposedVars.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printExposedVars.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printExposedVars.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,OAAO,GACZ,IAAI,CA8BN"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Prints a list of client-exposed environment variables for Next.js and SvelteKit projects
|
|
4
|
-
* @param exposedVars Set of variable names that are exposed to the client
|
|
5
|
-
* @param framework The detected framework
|
|
6
|
-
* @param json Whether to output in JSON format
|
|
7
|
-
*/
|
|
8
|
-
export function printExposedVars(exposedVars, framework, json) {
|
|
9
|
-
if (json || exposedVars.size === 0)
|
|
10
|
-
return;
|
|
11
|
-
console.log();
|
|
12
|
-
console.log(chalk.cyan.bold('🔓 Client-Exposed Variables:'));
|
|
13
|
-
console.log(chalk.cyan.dim(` The following ${exposedVars.size} variable(s) are accessible in the browser:`));
|
|
14
|
-
console.log();
|
|
15
|
-
const sortedVars = Array.from(exposedVars).sort();
|
|
16
|
-
for (const variable of sortedVars) {
|
|
17
|
-
console.log(chalk.cyan(` • ${variable}`));
|
|
18
|
-
}
|
|
19
|
-
console.log();
|
|
20
|
-
console.log(chalk.yellow.dim(` ⚠️ These variables are bundled in client-side code and visible to users.`));
|
|
21
|
-
console.log(chalk.yellow.dim(` ⚠️ Never expose secrets, API keys, or sensitive data!`));
|
|
22
|
-
console.log();
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=printExposedVars.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printExposedVars.js","sourceRoot":"","sources":["../../../../src/ui/scan/printExposedVars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,WAAwB,EACxB,SAAiB,EACjB,IAAa;IAEb,IAAI,IAAI,IAAI,WAAW,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO;IAE3C,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,IAAI,CAAC,GAAG,CACZ,oBAAoB,WAAW,CAAC,IAAI,6CAA6C,CAClF,CACF,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;IAElD,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CAAC,GAAG,CACd,8EAA8E,CAC/E,CACF,CAAC;IACF,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CAAC,GAAG,CACd,2DAA2D,CAC5D,CACF,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { T3EnvWarning } from '../../config/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Prints t3-env validation warnings to the console.
|
|
4
|
-
* @param warnings - List of t3-env validation warnings
|
|
5
|
-
* @param json - Whether to output in JSON format
|
|
6
|
-
*/
|
|
7
|
-
export declare function printT3EnvWarnings(warnings: T3EnvWarning[], json: boolean): void;
|
|
8
|
-
//# sourceMappingURL=printT3EnvWarnings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printT3EnvWarnings.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printT3EnvWarnings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,EAAE,EACxB,IAAI,EAAE,OAAO,GACZ,IAAI,CAiBN"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Prints t3-env validation warnings to the console.
|
|
4
|
-
* @param warnings - List of t3-env validation warnings
|
|
5
|
-
* @param json - Whether to output in JSON format
|
|
6
|
-
*/
|
|
7
|
-
export function printT3EnvWarnings(warnings, json) {
|
|
8
|
-
if (!warnings || warnings.length === 0)
|
|
9
|
-
return;
|
|
10
|
-
if (json) {
|
|
11
|
-
console.log(JSON.stringify({ t3EnvWarnings: warnings }, null, 2));
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
console.log(chalk.yellow('⚠️ T3-env validation issues:'));
|
|
15
|
-
for (const w of warnings) {
|
|
16
|
-
console.log(chalk.yellow(` - ${w.variable} (${w.file}:${w.line}) → ${w.reason}`));
|
|
17
|
-
}
|
|
18
|
-
console.log();
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=printT3EnvWarnings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printT3EnvWarnings.js","sourceRoot":"","sources":["../../../../src/ui/scan/printT3EnvWarnings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAAwB,EACxB,IAAa;IAEb,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/C,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAClE,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAE3D,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CACvE,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prints the unique environment variables found in the codebase.
|
|
3
|
-
* @param variables Array of unique environment variable names
|
|
4
|
-
* @returns void
|
|
5
|
-
*/
|
|
6
|
-
export declare function printUniqueVariables(variables: number): void;
|
|
7
|
-
//# sourceMappingURL=printUniqueVariables.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printUniqueVariables.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printUniqueVariables.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAS5D"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Prints the unique environment variables found in the codebase.
|
|
4
|
-
* @param variables Array of unique environment variable names
|
|
5
|
-
* @returns void
|
|
6
|
-
*/
|
|
7
|
-
export function printUniqueVariables(variables) {
|
|
8
|
-
if (variables === 0) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
console.log(chalk.blue(`🌐 Found ${variables} unique environment variables in use`));
|
|
12
|
-
console.log();
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=printUniqueVariables.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printUniqueVariables.js","sourceRoot":"","sources":["../../../../src/ui/scan/printUniqueVariables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,IAAI,CAAC,YAAY,SAAS,sCAAsC,CAAC,CACxE,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EnvUsage } from '../../config/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Print all unique variables and their usage locations.
|
|
4
|
-
*
|
|
5
|
-
* @param usages - Array of environment variable usages
|
|
6
|
-
* @param showStats - Whether to show usage details (files/lines)
|
|
7
|
-
* @param json - Whether to output in JSON format
|
|
8
|
-
*/
|
|
9
|
-
export declare function printVariables(usages: EnvUsage[], showStats: boolean, json: boolean): void;
|
|
10
|
-
//# sourceMappingURL=printVariables.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printVariables.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printVariables.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAkB,MAAM,uBAAuB,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,QAAQ,EAAE,EAClB,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,OAAO,GACZ,IAAI,CAyCN"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Print all unique variables and their usage locations.
|
|
4
|
-
*
|
|
5
|
-
* @param usages - Array of environment variable usages
|
|
6
|
-
* @param showStats - Whether to show usage details (files/lines)
|
|
7
|
-
* @param json - Whether to output in JSON format
|
|
8
|
-
*/
|
|
9
|
-
export function printVariables(usages, showStats, json) {
|
|
10
|
-
if (json)
|
|
11
|
-
return;
|
|
12
|
-
if (usages.length === 0)
|
|
13
|
-
return;
|
|
14
|
-
// Group by variable
|
|
15
|
-
const variableUsages = usages.reduce((acc, usage) => {
|
|
16
|
-
if (!acc[usage.variable]) {
|
|
17
|
-
acc[usage.variable] = [];
|
|
18
|
-
}
|
|
19
|
-
acc[usage.variable].push(usage);
|
|
20
|
-
return acc;
|
|
21
|
-
}, {});
|
|
22
|
-
// Display each unique variable
|
|
23
|
-
for (const [variable, variableUsageList] of Object.entries(variableUsages)) {
|
|
24
|
-
console.log(chalk.blue(` ${variable}`));
|
|
25
|
-
if (showStats) {
|
|
26
|
-
const displayUsages = variableUsageList.slice(0, 2);
|
|
27
|
-
displayUsages.forEach((usage) => {
|
|
28
|
-
console.log(chalk.blue.dim(` Used in: ${usage.file}:${usage.line} (${usage.pattern})`));
|
|
29
|
-
});
|
|
30
|
-
if (variableUsageList.length > 2) {
|
|
31
|
-
console.log(chalk.gray(` ... and ${variableUsageList.length - 2} more locations`));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
console.log();
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=printVariables.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printVariables.js","sourceRoot":"","sources":["../../../../src/ui/scan/printVariables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAkB,EAClB,SAAkB,EAClB,IAAa;IAEb,IAAI,IAAI;QAAE,OAAO;IACjB,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEhC,oBAAoB;IACpB,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAClC,CAAC,GAAmB,EAAE,KAAe,EAAE,EAAE;QACvC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzB,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QAC3B,CAAC;QACD,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,CACH,CAAC;IAEF,+BAA+B;IAC/B,KAAK,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QAC3E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,QAAQ,EAAE,CAAC,CAAC,CAAC;QAE1C,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,aAAa,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAEpD,aAAa,CAAC,OAAO,CAAC,CAAC,KAAe,EAAE,EAAE;gBACxC,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,IAAI,CAAC,GAAG,CACZ,iBAAiB,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,GAAG,CAC/D,CACF,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACjC,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,IAAI,CACR,gBAAgB,iBAAiB,CAAC,MAAM,GAAG,CAAC,iBAAiB,CAC9D,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
interface ProgressOptions {
|
|
2
|
-
current: number;
|
|
3
|
-
total: number;
|
|
4
|
-
label?: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Prints a progress bar to stdout.
|
|
8
|
-
* Overwrites the same line using carriage return.
|
|
9
|
-
*/
|
|
10
|
-
export declare function printProgress(options: ProgressOptions): void;
|
|
11
|
-
/**
|
|
12
|
-
* Clears the current progress line.
|
|
13
|
-
*/
|
|
14
|
-
export declare function clearProgress(): void;
|
|
15
|
-
/**
|
|
16
|
-
* Prints initial scan message.
|
|
17
|
-
*/
|
|
18
|
-
export declare function printScanStart(totalFiles: number): void;
|
|
19
|
-
/**
|
|
20
|
-
* Prints scan completion message.
|
|
21
|
-
*/
|
|
22
|
-
export declare function printScanComplete(filesScanned: number, duration: number): void;
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=printProgress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printProgress.d.ts","sourceRoot":"","sources":["../../../../src/ui/shared/printProgress.ts"],"names":[],"mappings":"AAEA,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CA0B5D;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAMvD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,IAAI,CAQN"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Prints a progress bar to stdout.
|
|
4
|
-
* Overwrites the same line using carriage return.
|
|
5
|
-
*/
|
|
6
|
-
export function printProgress(options) {
|
|
7
|
-
const { current, total, label = 'Scanning' } = options;
|
|
8
|
-
if (total <= 0)
|
|
9
|
-
return;
|
|
10
|
-
const clampedCurrent = Math.min(current, total);
|
|
11
|
-
const ratio = clampedCurrent / total;
|
|
12
|
-
const percentage = Math.floor(ratio * 100);
|
|
13
|
-
const barLength = 30;
|
|
14
|
-
const filledLength = Math.round(ratio * barLength);
|
|
15
|
-
const filledBar = chalk.gray('█'.repeat(filledLength));
|
|
16
|
-
const emptyBar = chalk.gray('░'.repeat(barLength - filledLength));
|
|
17
|
-
const bar = filledBar + emptyBar;
|
|
18
|
-
const percentLabel = chalk.cyan(`${percentage.toString().padStart(3, ' ')}%`);
|
|
19
|
-
const countLabel = chalk.dim(`(${clampedCurrent}/${total} files)`);
|
|
20
|
-
process.stdout.write(`\r${chalk.bold(label)} ${chalk.dim('▸')} [${bar}] ${percentLabel} ${countLabel}`);
|
|
21
|
-
if (clampedCurrent === total) {
|
|
22
|
-
process.stdout.write('\n');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Clears the current progress line.
|
|
27
|
-
*/
|
|
28
|
-
export function clearProgress() {
|
|
29
|
-
process.stdout.write('\r' + ' '.repeat(process.stdout.columns ?? 80) + '\r');
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Prints initial scan message.
|
|
33
|
-
*/
|
|
34
|
-
export function printScanStart(totalFiles) {
|
|
35
|
-
console.log(`${chalk.blue('📂')} ${chalk.bold('Scanning')} ${chalk.cyan(totalFiles.toString())} files...`);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Prints scan completion message.
|
|
39
|
-
*/
|
|
40
|
-
export function printScanComplete(filesScanned, duration) {
|
|
41
|
-
console.log(chalk.green(`✓ Scan complete! Processed ${filesScanned} files in ${duration.toFixed(2)}s`));
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=printProgress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printProgress.js","sourceRoot":"","sources":["../../../../src/ui/shared/printProgress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAwB;IACpD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvD,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO;IAEvB,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,cAAc,GAAG,KAAK,CAAC;IACrC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;IAE3C,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IAEnD,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC;IAClE,MAAM,GAAG,GAAG,SAAS,GAAG,QAAQ,CAAC;IAEjC,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9E,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,cAAc,IAAI,KAAK,SAAS,CAAC,CAAC;IAEnE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,YAAY,IAAI,UAAU,EAAE,CAClF,CAAC;IAEF,IAAI,cAAc,KAAK,KAAK,EAAE,CAAC;QAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AAC/E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,IAAI,CACzD,UAAU,CAAC,QAAQ,EAAE,CACtB,WAAW,CACb,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,YAAoB,EACpB,QAAgB;IAEhB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CACT,8BAA8B,YAAY,aAAa,QAAQ,CAAC,OAAO,CACrE,CAAC,CACF,GAAG,CACL,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { type SecretFinding } from '../src/core/secretDetectors';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a single usage of an environment variable in the codebase.
|
|
4
|
-
*/
|
|
5
|
-
export interface EnvUsage {
|
|
6
|
-
variable: string;
|
|
7
|
-
file: string;
|
|
8
|
-
line: number;
|
|
9
|
-
column: number;
|
|
10
|
-
pattern: 'process.env' | 'import.meta.env' | 'sveltekit' | 'deno' | 'next' | 'nuxt' | 'php';
|
|
11
|
-
context: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ScanOptions {
|
|
14
|
-
cwd: string;
|
|
15
|
-
include: string[];
|
|
16
|
-
exclude: string[];
|
|
17
|
-
ignore: string[];
|
|
18
|
-
ignoreRegex: RegExp[];
|
|
19
|
-
files?: string[];
|
|
20
|
-
secrets?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface ScanResult {
|
|
23
|
-
used: EnvUsage[];
|
|
24
|
-
missing: string[];
|
|
25
|
-
unused: string[];
|
|
26
|
-
stats: {
|
|
27
|
-
filesScanned: number;
|
|
28
|
-
totalUsages: number;
|
|
29
|
-
uniqueVariables: number;
|
|
30
|
-
};
|
|
31
|
-
secrets: SecretFinding[];
|
|
32
|
-
duplicates: {
|
|
33
|
-
env?: Array<{
|
|
34
|
-
key: string;
|
|
35
|
-
count: number;
|
|
36
|
-
}>;
|
|
37
|
-
example?: Array<{
|
|
38
|
-
key: string;
|
|
39
|
-
count: number;
|
|
40
|
-
}>;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=scanUsage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scanUsage.d.ts","sourceRoot":"","sources":["../../types/scanUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EACH,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,MAAM,GACN,MAAM,GACN,MAAM,GACN,KAAK,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,UAAU,EAAE;QACV,GAAG,CAAC,EAAE,KAAK,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,EAAE,KAAK,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACjD,CAAC;CACH"}
|