dotenv-diff 2.6.4 → 2.7.0
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 +6 -0
- package/README.md +2 -2
- package/dist/src/commands/compare.d.ts.map +1 -1
- package/dist/src/commands/compare.js +0 -4
- 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 +3 -1
- package/dist/src/commands/scanUsage.js.map +1 -1
- package/dist/src/config/constants.d.ts +4 -0
- package/dist/src/config/constants.d.ts.map +1 -1
- package/dist/src/config/constants.js +4 -0
- package/dist/src/config/constants.js.map +1 -1
- package/dist/src/core/security/exampleSecretDetector.js +2 -2
- package/dist/src/core/security/exampleSecretDetector.js.map +1 -1
- package/dist/src/services/printScanResult.d.ts.map +1 -1
- package/dist/src/services/printScanResult.js +21 -32
- package/dist/src/services/printScanResult.js.map +1 -1
- package/dist/src/services/scanCodebase.d.ts.map +1 -1
- package/dist/src/services/scanCodebase.js +0 -16
- package/dist/src/services/scanCodebase.js.map +1 -1
- package/dist/src/ui/compare/printErrorNotFound.d.ts.map +1 -1
- package/dist/src/ui/compare/printErrorNotFound.js +10 -6
- package/dist/src/ui/compare/printErrorNotFound.js.map +1 -1
- package/dist/src/ui/compare/printHeader.d.ts +0 -1
- package/dist/src/ui/compare/printHeader.d.ts.map +1 -1
- package/dist/src/ui/compare/printHeader.js +3 -4
- 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 +25 -10
- package/dist/src/ui/compare/printIssues.js.map +1 -1
- package/dist/src/ui/compare/printPrompt.d.ts +1 -1
- package/dist/src/ui/compare/printPrompt.d.ts.map +1 -1
- package/dist/src/ui/compare/printPrompt.js +24 -7
- package/dist/src/ui/compare/printPrompt.js.map +1 -1
- package/dist/src/ui/compare/printStats.d.ts.map +1 -1
- package/dist/src/ui/compare/printStats.js +14 -11
- package/dist/src/ui/compare/printStats.js.map +1 -1
- package/dist/src/ui/scan/printComparisonError.js +11 -10
- package/dist/src/ui/scan/printComparisonError.js.map +1 -1
- package/dist/src/ui/scan/printConsolelogWarning.d.ts +2 -1
- package/dist/src/ui/scan/printConsolelogWarning.d.ts.map +1 -1
- package/dist/src/ui/scan/printConsolelogWarning.js +11 -9
- package/dist/src/ui/scan/printConsolelogWarning.js.map +1 -1
- package/dist/src/ui/scan/printExampleWarnings.d.ts +2 -1
- package/dist/src/ui/scan/printExampleWarnings.d.ts.map +1 -1
- package/dist/src/ui/scan/printExampleWarnings.js +10 -5
- 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 +23 -21
- package/dist/src/ui/scan/printExpireWarnings.js.map +1 -1
- package/dist/src/ui/scan/printFrameworkWarnings.d.ts +2 -1
- package/dist/src/ui/scan/printFrameworkWarnings.d.ts.map +1 -1
- package/dist/src/ui/scan/printFrameworkWarnings.js +27 -7
- package/dist/src/ui/scan/printFrameworkWarnings.js.map +1 -1
- package/dist/src/ui/scan/printHeader.d.ts.map +1 -1
- package/dist/src/ui/scan/printHeader.js +8 -5
- package/dist/src/ui/scan/printHeader.js.map +1 -1
- package/dist/src/ui/scan/printHealthScore.d.ts.map +1 -1
- package/dist/src/ui/scan/printHealthScore.js +12 -21
- package/dist/src/ui/scan/printHealthScore.js.map +1 -1
- package/dist/src/ui/scan/printInconsistentNamingWarning.d.ts +2 -1
- package/dist/src/ui/scan/printInconsistentNamingWarning.d.ts.map +1 -1
- package/dist/src/ui/scan/printInconsistentNamingWarning.js +11 -8
- 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 +6 -9
- 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 +7 -10
- package/dist/src/ui/scan/printMissingExample.js.map +1 -1
- package/dist/src/ui/scan/printSecrets.d.ts +2 -1
- package/dist/src/ui/scan/printSecrets.d.ts.map +1 -1
- package/dist/src/ui/scan/printSecrets.js +15 -24
- package/dist/src/ui/scan/printSecrets.js.map +1 -1
- package/dist/src/ui/scan/printStats.d.ts +0 -1
- package/dist/src/ui/scan/printStats.d.ts.map +1 -1
- package/dist/src/ui/scan/printStats.js +10 -9
- package/dist/src/ui/scan/printStats.js.map +1 -1
- package/dist/src/ui/scan/printUnused.d.ts +3 -3
- package/dist/src/ui/scan/printUnused.d.ts.map +1 -1
- package/dist/src/ui/scan/printUnused.js +12 -8
- package/dist/src/ui/scan/printUnused.js.map +1 -1
- package/dist/src/ui/scan/printUppercaseWarning.d.ts +2 -1
- package/dist/src/ui/scan/printUppercaseWarning.d.ts.map +1 -1
- package/dist/src/ui/scan/printUppercaseWarning.js +11 -7
- 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 +12 -10
- package/dist/src/ui/shared/printAutoFix.js.map +1 -1
- package/dist/src/ui/shared/printConfigStatus.d.ts +1 -1
- package/dist/src/ui/shared/printConfigStatus.d.ts.map +1 -1
- package/dist/src/ui/shared/printConfigStatus.js +13 -10
- package/dist/src/ui/shared/printConfigStatus.js.map +1 -1
- package/dist/src/ui/shared/printDuplicates.d.ts +2 -1
- package/dist/src/ui/shared/printDuplicates.d.ts.map +1 -1
- package/dist/src/ui/shared/printDuplicates.js +17 -6
- package/dist/src/ui/shared/printDuplicates.js.map +1 -1
- package/dist/src/ui/shared/printFixTips.js +7 -7
- package/dist/src/ui/shared/printFixTips.js.map +1 -1
- package/dist/src/ui/shared/printGitignore.d.ts +2 -0
- package/dist/src/ui/shared/printGitignore.d.ts.map +1 -1
- package/dist/src/ui/shared/printGitignore.js +13 -12
- package/dist/src/ui/shared/printGitignore.js.map +1 -1
- package/dist/src/ui/shared/printInitStatus.d.ts +4 -4
- package/dist/src/ui/shared/printInitStatus.d.ts.map +1 -1
- package/dist/src/ui/shared/printInitStatus.js +14 -11
- package/dist/src/ui/shared/printInitStatus.js.map +1 -1
- package/dist/src/ui/shared/printOptionErrors.d.ts.map +1 -1
- package/dist/src/ui/shared/printOptionErrors.js +19 -5
- package/dist/src/ui/shared/printOptionErrors.js.map +1 -1
- package/dist/src/ui/theme.d.ts +16 -0
- package/dist/src/ui/theme.d.ts.map +1 -0
- package/dist/src/ui/theme.js +41 -0
- package/dist/src/ui/theme.js.map +1 -0
- package/docs/assets/demo.gif +0 -0
- package/docs/assets/success.png +0 -0
- package/package.json +1 -1
- package/dist/src/ui/scan/printProgress.d.ts +0 -22
- package/dist/src/ui/scan/printProgress.d.ts.map +0 -1
- package/dist/src/ui/scan/printProgress.js +0 -36
- package/dist/src/ui/scan/printProgress.js.map +0 -1
- package/dist/src/ui/shared/printStrictModeError.d.ts +0 -26
- package/dist/src/ui/shared/printStrictModeError.d.ts.map +0 -1
- package/dist/src/ui/shared/printStrictModeError.js +0 -41
- package/dist/src/ui/shared/printStrictModeError.js.map +0 -1
- package/dist/src/ui/shared/printSuccess.d.ts +0 -11
- package/dist/src/ui/shared/printSuccess.d.ts.map +0 -1
- package/dist/src/ui/shared/printSuccess.js +0 -27
- package/dist/src/ui/shared/printSuccess.js.map +0 -1
- package/docs/assets/demo1.gif +0 -0
- package/docs/assets/success1.png +0 -0
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { label, value, warning, error, divider, header } from '../theme.js';
|
|
2
2
|
/**
|
|
3
3
|
* Prints warnings about inconsistent naming patterns in environment variables.
|
|
4
4
|
* @param warnings Array of inconsistent naming warnings
|
|
5
|
+
* @param strict Whether strict mode is enabled
|
|
5
6
|
* @returns void
|
|
6
7
|
*/
|
|
7
|
-
export function printInconsistentNamingWarning(warnings) {
|
|
8
|
-
if (warnings.length === 0)
|
|
8
|
+
export function printInconsistentNamingWarning(warnings, strict = false) {
|
|
9
|
+
if (warnings.length === 0)
|
|
9
10
|
return;
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
const indicator = strict ? error('▸') : warning('▸');
|
|
12
|
+
const textColor = strict ? error : warning;
|
|
13
|
+
console.log();
|
|
14
|
+
console.log(`${indicator} ${header('Inconsistent naming')}`);
|
|
15
|
+
console.log(`${divider}`);
|
|
12
16
|
for (const { key1, key2, suggestion } of warnings) {
|
|
13
|
-
console.log(
|
|
14
|
-
console.log(chalk.gray(` Suggested name: ${suggestion}`));
|
|
17
|
+
console.log(`${label(`${key1} ↔ ${key2}`.padEnd(26))}${textColor(suggestion)}`);
|
|
15
18
|
}
|
|
16
|
-
console.log();
|
|
19
|
+
console.log(`${divider}`);
|
|
17
20
|
}
|
|
18
21
|
//# sourceMappingURL=printInconsistentNamingWarning.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printInconsistentNamingWarning.js","sourceRoot":"","sources":["../../../../src/ui/scan/printInconsistentNamingWarning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printInconsistentNamingWarning.js","sourceRoot":"","sources":["../../../../src/ui/scan/printInconsistentNamingWarning.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAAqC,EACrC,MAAM,GAAG,KAAK;IAEd,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAElC,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;IAE3C,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,IAAI,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IAE1B,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,QAAQ,EAAE,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,MAAM,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printMissing.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printMissing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printMissing.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printMissing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAkB,MAAM,uBAAuB,CAAC;AAKtE;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,EAAE,QAAQ,EAAE,EAChB,eAAe,EAAE,MAAM,GACtB,OAAO,CAkCT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
1
|
import { normalizePath } from '../../core/helpers/normalizePath.js';
|
|
2
|
+
import { label, value, error, divider } from '../theme.js';
|
|
3
3
|
/**
|
|
4
4
|
* Print missing environment variables (used in code but not in env file).
|
|
5
5
|
*
|
|
@@ -12,14 +12,14 @@ export function printMissing(missing, used, comparedAgainst) {
|
|
|
12
12
|
if (missing.length === 0)
|
|
13
13
|
return false;
|
|
14
14
|
const fileType = comparedAgainst || 'environment file';
|
|
15
|
-
console.log(
|
|
16
|
-
|
|
15
|
+
console.log();
|
|
16
|
+
console.log(`${error('▸')} ${value.bold(`Missing in ${fileType}`)}`);
|
|
17
|
+
console.log(`${divider}`);
|
|
17
18
|
const grouped = missing.reduce((acc, variable) => {
|
|
18
19
|
const usages = used.filter((u) => u.variable === variable);
|
|
19
20
|
acc[variable] = usages;
|
|
20
21
|
return acc;
|
|
21
22
|
}, {});
|
|
22
|
-
// Group by file first
|
|
23
23
|
const byFile = new Map();
|
|
24
24
|
for (const [variable, usages] of Object.entries(grouped)) {
|
|
25
25
|
for (const usage of usages) {
|
|
@@ -29,15 +29,12 @@ export function printMissing(missing, used, comparedAgainst) {
|
|
|
29
29
|
byFile.get(file).push({ variable, usage });
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
// Print grouped by file
|
|
33
32
|
for (const [file, items] of byFile) {
|
|
34
|
-
console.log(chalk.bold(` ${file}`));
|
|
35
33
|
for (const { variable, usage } of items) {
|
|
36
|
-
console.log(
|
|
37
|
-
console.log(chalk.red.dim(` ${usage.context.trim()}`));
|
|
34
|
+
console.log(`${label(variable.padEnd(26))}${error(`${normalizePath(usage.file)}:${usage.line}`)}`);
|
|
38
35
|
}
|
|
39
36
|
}
|
|
40
|
-
console.log();
|
|
37
|
+
console.log(`${divider}`);
|
|
41
38
|
return true;
|
|
42
39
|
}
|
|
43
40
|
//# sourceMappingURL=printMissing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printMissing.js","sourceRoot":"","sources":["../../../../src/ui/scan/printMissing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printMissing.js","sourceRoot":"","sources":["../../../../src/ui/scan/printMissing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MA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C,CAAC;YAC5C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,CAAC;QACnC,KAAK,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC;YACxC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACrG,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IAE1B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printMissingExample.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printMissingExample.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printMissingExample.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printMissingExample.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAkBnE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
1
|
import fs from 'fs';
|
|
3
2
|
import path from 'path';
|
|
4
3
|
import { resolveFromCwd } from '../../core/helpers/resolveFromCwd.js';
|
|
4
|
+
import { label, error, warning, divider, header } from '../theme.js';
|
|
5
5
|
/**
|
|
6
6
|
* Print message if the specified example file is missing.
|
|
7
7
|
* Handles CI vs interactive mode output.
|
|
@@ -16,15 +16,12 @@ export function printMissingExample(opts) {
|
|
|
16
16
|
if (!missing)
|
|
17
17
|
return false;
|
|
18
18
|
const fileName = path.basename(opts.examplePath);
|
|
19
|
-
const
|
|
19
|
+
const indicator = opts.isCiMode ? error('▸') : warning('▸');
|
|
20
20
|
console.log();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
console.log(chalk.yellow(`⚠️ ${msgText}`));
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
21
|
+
console.log(`${indicator} ${header('Missing example file')}`);
|
|
22
|
+
console.log(`${divider}`);
|
|
23
|
+
console.log(`${label('File'.padEnd(26))}${(opts.isCiMode ? error : warning)(fileName)}`);
|
|
24
|
+
console.log(`${divider}`);
|
|
25
|
+
return opts.isCiMode ?? false;
|
|
29
26
|
}
|
|
30
27
|
//# sourceMappingURL=printMissingExample.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printMissingExample.js","sourceRoot":"","sources":["../../../../src/ui/scan/printMissingExample.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"printMissingExample.js","sourceRoot":"","sources":["../../../../src/ui/scan/printMissingExample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErE;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAsB;IACxD,IAAI,CAAC,IAAI,CAAC,WAAW;QAAE,OAAO,KAAK,CAAC;IAEpC,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAE3C,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAE3B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE5D,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,IAAI,MAAM,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IAE1B,OAAO,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC;AAChC,CAAC"}
|
|
@@ -2,7 +2,8 @@ import type { SecretFinding } from '../../core/security/secretDetectors.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Print potential secrets detected in the codebase.
|
|
4
4
|
* @param secrets - List of secret findings
|
|
5
|
+
* @param strict - Whether strict mode is enabled
|
|
5
6
|
* @returns void
|
|
6
7
|
*/
|
|
7
|
-
export declare function printSecrets(secrets: SecretFinding[]): void;
|
|
8
|
+
export declare function printSecrets(secrets: SecretFinding[], strict?: boolean): void;
|
|
8
9
|
//# sourceMappingURL=printSecrets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printSecrets.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printSecrets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printSecrets.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printSecrets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AA6B5E;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,MAAM,UAAQ,GAAG,IAAI,CA8B3E"}
|
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
1
|
import { normalizePath } from '../../core/helpers/normalizePath.js';
|
|
3
|
-
|
|
2
|
+
import { label, accent, warning, error, divider, header, } from '../theme.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get the color function for the severity level.
|
|
4
5
|
* @param severity - The severity level of the secret finding.
|
|
5
|
-
* @returns The corresponding
|
|
6
|
+
* @returns The corresponding theme color function.
|
|
6
7
|
*/
|
|
7
8
|
function getSeverityColor(severity) {
|
|
8
9
|
switch (severity) {
|
|
9
10
|
case 'high':
|
|
10
|
-
return
|
|
11
|
+
return error;
|
|
11
12
|
case 'medium':
|
|
12
|
-
return
|
|
13
|
-
case 'low':
|
|
14
|
-
return chalk.green;
|
|
13
|
+
return warning;
|
|
15
14
|
default:
|
|
16
|
-
return
|
|
15
|
+
return accent;
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
/** Get the label for the severity level.
|
|
20
|
-
* @param severity - The severity level of the secret finding.
|
|
21
|
-
* @returns The corresponding label as a string.
|
|
22
|
-
*/
|
|
23
|
-
function getSeverityLabel(severity) {
|
|
24
|
-
return severity.toUpperCase();
|
|
25
|
-
}
|
|
26
18
|
/**
|
|
27
19
|
* Print potential secrets detected in the codebase.
|
|
28
20
|
* @param secrets - List of secret findings
|
|
21
|
+
* @param strict - Whether strict mode is enabled
|
|
29
22
|
* @returns void
|
|
30
23
|
*/
|
|
31
|
-
export function printSecrets(secrets) {
|
|
24
|
+
export function printSecrets(secrets, strict = false) {
|
|
32
25
|
if (!secrets || secrets.length === 0)
|
|
33
26
|
return;
|
|
34
|
-
// Sort by severity (high -> medium -> low)
|
|
35
27
|
const severityOrder = { high: 0, medium: 1, low: 2 };
|
|
36
28
|
const sorted = [...secrets].sort((a, b) => severityOrder[a.severity] - severityOrder[b.severity]);
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
const indicator = strict ? error('▸') : warning('▸');
|
|
30
|
+
console.log();
|
|
31
|
+
console.log(`${indicator} ${header('Potential secrets detected')}`);
|
|
32
|
+
console.log(`${divider}`);
|
|
39
33
|
const byFile = new Map();
|
|
40
34
|
for (const f of sorted) {
|
|
41
35
|
if (!byFile.has(f.file))
|
|
@@ -43,14 +37,11 @@ export function printSecrets(secrets) {
|
|
|
43
37
|
byFile.get(f.file).push(f);
|
|
44
38
|
}
|
|
45
39
|
for (const [file, findings] of byFile) {
|
|
46
|
-
const normalizedFile = normalizePath(file);
|
|
47
|
-
console.log(chalk.bold(` ${normalizedFile}`));
|
|
48
40
|
for (const f of findings) {
|
|
49
41
|
const color = getSeverityColor(f.severity);
|
|
50
|
-
|
|
51
|
-
console.log(color(` ${label}: Line ${f.line} - ${f.message}\n ${chalk.dim(f.snippet)}`));
|
|
42
|
+
console.log(`${label(f.severity.toUpperCase().padEnd(26))}${color(`${normalizePath(f.file)}:${f.line}`)}`);
|
|
52
43
|
}
|
|
53
44
|
}
|
|
54
|
-
console.log();
|
|
45
|
+
console.log(`${divider}`);
|
|
55
46
|
}
|
|
56
47
|
//# sourceMappingURL=printSecrets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printSecrets.js","sourceRoot":"","sources":["../../../../src/ui/scan/printSecrets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printSecrets.js","sourceRoot":"","sources":["../../../../src/ui/scan/printSecrets.ts"],"names":[],"mappings":"AACA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,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAChD,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,EAAE,CAAC;QACtC,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACzB,MAAM,KAAK,GAAG,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC3C,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAC9F,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -2,7 +2,6 @@ import type { ScanStats } from '../../config/types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Print scan statistics for codebase scanning.
|
|
4
4
|
* @param stats The scan statistics
|
|
5
|
-
* @param json Whether to output in JSON format
|
|
6
5
|
* @param showStats Whether to show statistics
|
|
7
6
|
*/
|
|
8
7
|
export declare function printStats(stats: ScanStats, showStats: boolean): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printStats.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printStats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printStats.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printStats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,OAAO,GACjB,IAAI,CAeN"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { label, value, accent, divider, header } from '../theme.js';
|
|
2
2
|
/**
|
|
3
3
|
* Print scan statistics for codebase scanning.
|
|
4
4
|
* @param stats The scan statistics
|
|
5
|
-
* @param json Whether to output in JSON format
|
|
6
5
|
* @param showStats Whether to show statistics
|
|
7
6
|
*/
|
|
8
7
|
export function printStats(stats, showStats) {
|
|
9
8
|
if (!showStats)
|
|
10
9
|
return;
|
|
10
|
+
const row = (lbl, val) => console.log(`${label(lbl.padEnd(26))}${value(String(val))}`);
|
|
11
11
|
console.log();
|
|
12
|
-
console.log(
|
|
13
|
-
console.log(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
console.log(`${accent('▸')} ${header('Scan Statistics')}`);
|
|
13
|
+
console.log(`${divider}`);
|
|
14
|
+
row('Files scanned', stats.filesScanned);
|
|
15
|
+
row('Variable references', stats.totalUsages);
|
|
16
|
+
row('Unique variables', stats.uniqueVariables);
|
|
17
|
+
row('Warnings', stats.warningsCount);
|
|
18
|
+
row('Duration', `${stats.duration.toFixed(2)}s`);
|
|
19
|
+
console.log(`${divider}`);
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=printStats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printStats.js","sourceRoot":"","sources":["../../../../src/ui/scan/printStats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printStats.js","sourceRoot":"","sources":["../../../../src/ui/scan/printStats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEpE;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,KAAgB,EAChB,SAAkB;IAElB,IAAI,CAAC,SAAS;QAAE,OAAO;IAEvB,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,GAAoB,EAAE,EAAE,CAChD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAE/D,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1B,GAAG,CAAC,eAAe,EAAQ,KAAK,CAAC,YAAY,CAAC,CAAC;IAC/C,GAAG,CAAC,qBAAqB,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC9C,GAAG,CAAC,kBAAkB,EAAK,KAAK,CAAC,eAAe,CAAC,CAAC;IAClD,GAAG,CAAC,UAAU,EAAa,KAAK,CAAC,aAAa,CAAC,CAAC;IAChD,GAAG,CAAC,UAAU,EAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Print unused environment variables (defined in env but not used in code).
|
|
3
3
|
*
|
|
4
4
|
* @param unused - Array of unused variable names
|
|
5
|
-
* @param comparedAgainst - File name (.env
|
|
6
|
-
* @param
|
|
5
|
+
* @param comparedAgainst - File name (.env or other)
|
|
6
|
+
* @param strict - Whether strict mode is enabled
|
|
7
7
|
*/
|
|
8
|
-
export declare function printUnused(unused: string[], comparedAgainst: string): void;
|
|
8
|
+
export declare function printUnused(unused: string[], comparedAgainst: string, strict?: boolean): void;
|
|
9
9
|
//# sourceMappingURL=printUnused.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printUnused.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printUnused.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"printUnused.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printUnused.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EAAE,EAChB,eAAe,EAAE,MAAM,EACvB,MAAM,UAAQ,GACb,IAAI,CAgBN"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { label, value, warning, error, divider, header } from '../theme.js';
|
|
2
2
|
/**
|
|
3
3
|
* Print unused environment variables (defined in env but not used in code).
|
|
4
4
|
*
|
|
5
5
|
* @param unused - Array of unused variable names
|
|
6
|
-
* @param comparedAgainst - File name (.env
|
|
7
|
-
* @param
|
|
6
|
+
* @param comparedAgainst - File name (.env or other)
|
|
7
|
+
* @param strict - Whether strict mode is enabled
|
|
8
8
|
*/
|
|
9
|
-
export function printUnused(unused, comparedAgainst) {
|
|
9
|
+
export function printUnused(unused, comparedAgainst, strict = false) {
|
|
10
10
|
if (unused.length === 0)
|
|
11
11
|
return;
|
|
12
12
|
const fileType = comparedAgainst || 'environment file';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
console.log(chalk.yellow(` - ${variable}`));
|
|
16
|
-
});
|
|
13
|
+
const indicator = strict ? error('▸') : warning('▸');
|
|
14
|
+
const textColor = strict ? error : warning;
|
|
17
15
|
console.log();
|
|
16
|
+
console.log(`${indicator} ${header(`Unused in ${fileType}`)}`);
|
|
17
|
+
console.log(`${divider}`);
|
|
18
|
+
for (const variable of unused) {
|
|
19
|
+
console.log(`${label(variable.padEnd(26))}${textColor('unused')}`);
|
|
20
|
+
}
|
|
21
|
+
console.log(`${divider}`);
|
|
18
22
|
}
|
|
19
23
|
//# sourceMappingURL=printUnused.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printUnused.js","sourceRoot":"","sources":["../../../../src/ui/scan/printUnused.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"printUnused.js","sourceRoot":"","sources":["../../../../src/ui/scan/printUnused.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,MAAgB,EAChB,eAAuB,EACvB,MAAM,GAAG,KAAK;IAEd,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEhC,MAAM,QAAQ,GAAG,eAAe,IAAI,kBAAkB,CAAC;IACvD,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;IAE3C,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,IAAI,MAAM,CAAC,aAAa,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IAE1B,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -4,6 +4,7 @@ import type { UppercaseWarning } from '../../config/types.js';
|
|
|
4
4
|
*
|
|
5
5
|
* @param warnings - List of non-uppercase env keys
|
|
6
6
|
* @param comparedAgainst - The .env file name being checked
|
|
7
|
+
* @param strict - Whether strict mode is enabled
|
|
7
8
|
*/
|
|
8
|
-
export declare function printUppercaseWarning(warnings: UppercaseWarning[], comparedAgainst: string): void;
|
|
9
|
+
export declare function printUppercaseWarning(warnings: UppercaseWarning[], comparedAgainst: string, strict?: boolean): void;
|
|
9
10
|
//# sourceMappingURL=printUppercaseWarning.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printUppercaseWarning.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printUppercaseWarning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printUppercaseWarning.d.ts","sourceRoot":"","sources":["../../../../src/ui/scan/printUppercaseWarning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,eAAe,EAAE,MAAM,EACvB,MAAM,UAAQ,GACb,IAAI,CAgBN"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { label, value, error, divider, header, warning } from '../theme.js';
|
|
2
2
|
/**
|
|
3
3
|
* Print warnings for environment variable keys that are not uppercase.
|
|
4
4
|
*
|
|
5
5
|
* @param warnings - List of non-uppercase env keys
|
|
6
6
|
* @param comparedAgainst - The .env file name being checked
|
|
7
|
+
* @param strict - Whether strict mode is enabled
|
|
7
8
|
*/
|
|
8
|
-
export function printUppercaseWarning(warnings, comparedAgainst) {
|
|
9
|
+
export function printUppercaseWarning(warnings, comparedAgainst, strict = false) {
|
|
9
10
|
if (warnings.length === 0)
|
|
10
11
|
return;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
console.log(chalk.yellow(` - ${w.key}`));
|
|
14
|
-
console.log(chalk.yellow.dim(` Consider naming it: ${w.suggestion}`));
|
|
15
|
-
});
|
|
12
|
+
const indicator = strict ? error('▸') : warning('▸');
|
|
13
|
+
const textColor = strict ? error : warning;
|
|
16
14
|
console.log();
|
|
15
|
+
console.log(`${indicator} ${header(`Uppercase warnings (${comparedAgainst})`)}`);
|
|
16
|
+
console.log(`${divider}`);
|
|
17
|
+
for (const w of warnings) {
|
|
18
|
+
console.log(`${label(w.key.padEnd(26))}${textColor(w.suggestion)}`);
|
|
19
|
+
}
|
|
20
|
+
console.log(`${divider}`);
|
|
17
21
|
}
|
|
18
22
|
//# sourceMappingURL=printUppercaseWarning.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printUppercaseWarning.js","sourceRoot":"","sources":["../../../../src/ui/scan/printUppercaseWarning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printUppercaseWarning.js","sourceRoot":"","sources":["../../../../src/ui/scan/printUppercaseWarning.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAA4B,EAC5B,eAAuB,EACvB,MAAM,GAAG,KAAK;IAEd,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAElC,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAErD,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;IAE3C,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,IAAI,MAAM,CAAC,uBAAuB,eAAe,GAAG,CAAC,EAAE,CAAC,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IAE1B,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printAutoFix.d.ts","sourceRoot":"","sources":["../../../../src/ui/shared/printAutoFix.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printAutoFix.d.ts","sourceRoot":"","sources":["../../../../src/ui/shared/printAutoFix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,GACZ,IAAI,CAsBN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { label, value, accent, divider, header, wrapReason } from '../theme.js';
|
|
2
2
|
/**
|
|
3
3
|
* Prints the result of the auto-fix operation.
|
|
4
4
|
* @param result - The result of the auto-fix operation.
|
|
@@ -9,21 +9,23 @@ import chalk from 'chalk';
|
|
|
9
9
|
export function printAutoFix(result, envName, json) {
|
|
10
10
|
if (json)
|
|
11
11
|
return;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
console.log();
|
|
13
|
+
console.log(`${accent('▸')} ${header('Auto-fix')}`);
|
|
14
|
+
console.log(`${divider}`);
|
|
15
|
+
if (!result.fixApplied) {
|
|
16
|
+
console.log(`${label('Status'.padEnd(26))}${value('no changes needed')}`);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
14
19
|
if (result.removedDuplicates.length) {
|
|
15
|
-
console.log(
|
|
20
|
+
console.log(`${label('Removed duplicates'.padEnd(26))}${value(wrapReason(result.removedDuplicates.join(', '), 26))}`);
|
|
16
21
|
}
|
|
17
22
|
if (result.addedEnv.length) {
|
|
18
|
-
console.log(
|
|
23
|
+
console.log(`${label('Added missing keys'.padEnd(26))}${value(wrapReason(result.addedEnv.join(', '), 26))}`);
|
|
19
24
|
}
|
|
20
25
|
if (result.gitignoreUpdated) {
|
|
21
|
-
console.log(
|
|
26
|
+
console.log(`${label('Updated .gitignore'.padEnd(26))}${value(wrapReason(envName, 26))}`);
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
|
-
|
|
25
|
-
console.log(chalk.green('✅ Auto-fix applied: no changes needed.'));
|
|
26
|
-
}
|
|
27
|
-
console.log();
|
|
29
|
+
console.log(`${divider}`);
|
|
28
30
|
}
|
|
29
31
|
//# sourceMappingURL=printAutoFix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printAutoFix.js","sourceRoot":"","sources":["../../../../src/ui/shared/printAutoFix.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printAutoFix.js","sourceRoot":"","sources":["../../../../src/ui/shared/printAutoFix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAkB,EAClB,OAAe,EACf,IAAa;IAEb,IAAI,IAAI;QAAE,OAAO;IAEjB,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,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AAC,CAAC;AAC5B,CAAC"}
|
|
@@ -9,5 +9,5 @@ export declare function printConfigLoaded(filePath: string): void;
|
|
|
9
9
|
* @param error The thrown error
|
|
10
10
|
* @returns void
|
|
11
11
|
*/
|
|
12
|
-
export declare function printConfigLoadError(
|
|
12
|
+
export declare function printConfigLoadError(err: unknown): void;
|
|
13
13
|
//# sourceMappingURL=printConfigStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printConfigStatus.d.ts","sourceRoot":"","sources":["../../../../src/ui/shared/printConfigStatus.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"printConfigStatus.d.ts","sourceRoot":"","sources":["../../../../src/ui/shared/printConfigStatus.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAQxD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CASvD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
1
|
import path from 'path';
|
|
2
|
+
import { label, value, accent, error, divider, header } from '../theme.js';
|
|
3
3
|
/**
|
|
4
4
|
* Prints message when dotenv-diff.config.json is successfully loaded.
|
|
5
5
|
* @param filePath The path to the loaded config file
|
|
@@ -8,20 +8,23 @@ import path from 'path';
|
|
|
8
8
|
export function printConfigLoaded(filePath) {
|
|
9
9
|
const fileName = path.basename(filePath);
|
|
10
10
|
console.log();
|
|
11
|
-
console.log(`${
|
|
11
|
+
console.log(`${accent('▸')} ${header('Config')}`);
|
|
12
|
+
console.log(`${divider}`);
|
|
13
|
+
console.log(`${label('Loaded'.padEnd(26))}${value(fileName)}`);
|
|
14
|
+
console.log(`${divider}`);
|
|
12
15
|
}
|
|
13
16
|
/**
|
|
14
17
|
* Prints message when dotenv-diff.config.json fails to parse.
|
|
15
18
|
* @param error The thrown error
|
|
16
19
|
* @returns void
|
|
17
20
|
*/
|
|
18
|
-
export function printConfigLoadError(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
21
|
+
export function printConfigLoadError(err) {
|
|
22
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
23
|
+
console.log();
|
|
24
|
+
console.log(`${error('▸')} ${header('Config Error')}`);
|
|
25
|
+
console.log(`${divider}`);
|
|
26
|
+
console.log(`${label('Failed to parse'.padEnd(26))}${error('dotenv-diff.config.json')}`);
|
|
27
|
+
console.log(`${label('Reason'.padEnd(26))}${error(message)}`);
|
|
28
|
+
console.log(`${divider}`);
|
|
26
29
|
}
|
|
27
30
|
//# sourceMappingURL=printConfigStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printConfigStatus.js","sourceRoot":"","sources":["../../../../src/ui/shared/printConfigStatus.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"printConfigStatus.js","sourceRoot":"","sources":["../../../../src/ui/shared/printConfigStatus.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE3E;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEzC,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAY;IAC/C,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAEjE,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @param dEx Array of duplicate keys in the example file with their counts.
|
|
7
7
|
* @param json Whether to output in JSON format.
|
|
8
8
|
* @param fix Whether fix mode is enabled (skips printing duplicates as they will be fixed).
|
|
9
|
+
* @param strict Whether strict mode is enabled.
|
|
9
10
|
* @returns void
|
|
10
11
|
*/
|
|
11
12
|
export declare function printDuplicates(envName: string, exampleName: string, dEnv: Array<{
|
|
@@ -14,5 +15,5 @@ export declare function printDuplicates(envName: string, exampleName: string, dE
|
|
|
14
15
|
}>, dEx: Array<{
|
|
15
16
|
key: string;
|
|
16
17
|
count: number;
|
|
17
|
-
}>, json: boolean, fix?: boolean): void;
|
|
18
|
+
}>, json: boolean, fix?: boolean, strict?: boolean): void;
|
|
18
19
|
//# sourceMappingURL=printDuplicates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printDuplicates.d.ts","sourceRoot":"","sources":["../../../../src/ui/shared/printDuplicates.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"printDuplicates.d.ts","sourceRoot":"","sources":["../../../../src/ui/shared/printDuplicates.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EAC3C,GAAG,EAAE,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,IAAI,EAAE,OAAO,EACb,GAAG,UAAQ,EACX,MAAM,UAAQ,GACb,IAAI,CA6BN"}
|