nero-env 0.1.6 → 1.0.1
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/README.md +1 -1
- package/dist/cli/command.js +3 -3
- package/dist/index.js +20 -2
- package/dist/output/printer.js +15 -15
- package/dist/output/theme.js +26 -0
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<img src="https://img.shields.io/npm/v/nero-env?color=6366f1" alt="npm version" />
|
|
5
|
-
<img src="https://img.shields.io/npm/
|
|
5
|
+
<img src="https://img.shields.io/npm/dt/nero-env?color=0f172a" alt="npm downloads" />
|
|
6
6
|
<img src="https://img.shields.io/github/license/alcanivorax/nero-env?color=22c55e" alt="license" />
|
|
7
7
|
</p>
|
|
8
8
|
|
package/dist/cli/command.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { run } from "./cli/command.js";
|
|
3
|
-
import {
|
|
3
|
+
import { checkForCliUpdate } from "cli-update-check";
|
|
4
|
+
import { CLI_NAME, CLI_VERSION } from "./meta.js";
|
|
5
|
+
import { theme } from "./output/theme.js";
|
|
4
6
|
try {
|
|
5
|
-
notifyUpdate();
|
|
6
7
|
run();
|
|
8
|
+
setTimeout(async () => {
|
|
9
|
+
const msg = await checkForCliUpdate({
|
|
10
|
+
name: CLI_NAME,
|
|
11
|
+
version: CLI_VERSION,
|
|
12
|
+
});
|
|
13
|
+
if (msg) {
|
|
14
|
+
console.log("\n" +
|
|
15
|
+
theme.muted("─────────────") +
|
|
16
|
+
"\n" +
|
|
17
|
+
theme.muted("Update available") +
|
|
18
|
+
"\n" +
|
|
19
|
+
theme.muted(msg.replace("Update available:", "").trim()) +
|
|
20
|
+
"\n" +
|
|
21
|
+
theme.muted("─────────────"));
|
|
22
|
+
}
|
|
23
|
+
}, 0);
|
|
7
24
|
}
|
|
8
25
|
catch (err) {
|
|
9
26
|
console.error("Unexpected error:", err);
|
|
27
|
+
// console.log("Run: nero-env --help for usage");
|
|
10
28
|
process.exit(1);
|
|
11
29
|
}
|
package/dist/output/printer.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { theme } from "./theme.js";
|
|
2
2
|
const icons = {
|
|
3
|
-
error:
|
|
4
|
-
warning:
|
|
5
|
-
success:
|
|
3
|
+
error: theme.severity.high("❌"),
|
|
4
|
+
warning: theme.severity.medium("⚠️"),
|
|
5
|
+
success: theme.severity.low("✅"),
|
|
6
6
|
};
|
|
7
7
|
export function printReport(report) {
|
|
8
8
|
// Title
|
|
9
|
-
console.log(
|
|
10
|
-
console.log(
|
|
9
|
+
console.log(theme.header("Nero Env Check"));
|
|
10
|
+
console.log(theme.muted("─────────────\n"));
|
|
11
11
|
// Success case
|
|
12
12
|
if (!report.hasIssues || report.sections.length === 0) {
|
|
13
|
-
console.log(`${icons.success} ${
|
|
13
|
+
console.log(`${icons.success} ${theme.muted("No environment issues found")}`);
|
|
14
14
|
printSummary(0, 0);
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
@@ -32,27 +32,27 @@ export function printReport(report) {
|
|
|
32
32
|
function printSection(section) {
|
|
33
33
|
const icon = icons[section.severity];
|
|
34
34
|
if (section.source === ".env") {
|
|
35
|
-
console.log(`${icon} ${
|
|
35
|
+
console.log(`${icon} ${theme.title(section.title)} ${theme.muted(`(${section.source})`)}`);
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
console.log(`${icon} ${
|
|
38
|
+
console.log(`${icon} ${theme.title(section.title)} ${theme.muted(`(not declared in ${section.source})`)}`);
|
|
39
39
|
}
|
|
40
40
|
for (const item of section.items) {
|
|
41
|
-
console.log(` ${
|
|
41
|
+
console.log(` ${theme.bullet} ${theme.muted(item)}`);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
function printSummary(errors, warnings) {
|
|
45
|
-
console.log(
|
|
45
|
+
console.log(theme.muted("─────────────"));
|
|
46
46
|
if (errors === 0 && warnings === 0) {
|
|
47
|
-
console.log(
|
|
47
|
+
console.log(theme.title("Summary: ") + theme.muted("No issues found"));
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
const parts = [];
|
|
51
51
|
if (errors > 0) {
|
|
52
|
-
parts.push(
|
|
52
|
+
parts.push(theme.severity.high(`${errors} error${errors > 1 ? "s" : ""}`));
|
|
53
53
|
}
|
|
54
54
|
if (warnings > 0) {
|
|
55
|
-
parts.push(
|
|
55
|
+
parts.push(theme.severity.medium(`${warnings} warning${warnings > 1 ? "s" : ""}`));
|
|
56
56
|
}
|
|
57
|
-
console.log(
|
|
57
|
+
console.log(theme.title("Summary: ") + parts.join(theme.muted(", ")));
|
|
58
58
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
export const theme = {
|
|
3
|
+
// Section headers - soft blue-gray for elegance
|
|
4
|
+
header: chalk.hex("#7AA2F7").bold,
|
|
5
|
+
// Severity labels with refined, professional colors
|
|
6
|
+
severity: {
|
|
7
|
+
high: chalk.hex("#F7768E"), // Soft coral red
|
|
8
|
+
medium: chalk.hex("#E0AF68"), // Muted amber
|
|
9
|
+
low: chalk.hex("#9ABCA7"), // Sage green
|
|
10
|
+
unknown: chalk.hex("#565F89"), // Muted slate
|
|
11
|
+
},
|
|
12
|
+
// General text roles
|
|
13
|
+
title: chalk.hex("#C0CAF5").bold, // Soft periwinkle
|
|
14
|
+
muted: chalk.hex("#565F89"), // Slate gray
|
|
15
|
+
success: chalk.hex("#9ECE6A"), // Soft lime green
|
|
16
|
+
warning: chalk.hex("#E0AF68"), // Muted amber
|
|
17
|
+
error: chalk.hex("#F7768E"), // Soft coral red
|
|
18
|
+
bullet: chalk.hex("#73DACA")("•"), // Soft teal
|
|
19
|
+
// arrow: chalk.hex("#565F89")("→"), // Slate gray
|
|
20
|
+
arrow: chalk.hex("#73DACA")("→"), // Slate gray
|
|
21
|
+
loader: chalk.hex("#C0CAF5"),
|
|
22
|
+
message: chalk.hex("#7AA2F7"),
|
|
23
|
+
divider: (width) => chalk.hex("#414868")("─".repeat(width)), // Dark slate
|
|
24
|
+
// Metadata
|
|
25
|
+
lineInfo: (line) => chalk.hex("#565F89")(`(line ~ ${line})`),
|
|
26
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nero-env",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Validate and compare .env files to catch missing, empty, and unused variables.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,19 +30,22 @@
|
|
|
30
30
|
"devtools",
|
|
31
31
|
"nero"
|
|
32
32
|
],
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/alcanivorax/nero-env"
|
|
36
|
+
},
|
|
33
37
|
"author": "alcanivorax",
|
|
34
38
|
"license": "MIT",
|
|
35
39
|
"packageManager": "pnpm@10.17.1",
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@types/node": "^25.0.3",
|
|
38
|
-
"@types/update-notifier": "^6.0.8",
|
|
39
42
|
"ts-node": "^10.9.2",
|
|
40
43
|
"tsx": "^4.21.0",
|
|
41
44
|
"typescript": "^5.9.3"
|
|
42
45
|
},
|
|
43
46
|
"dependencies": {
|
|
44
47
|
"chalk": "^5.6.2",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
48
|
+
"cli-update-check": "^1.0.0",
|
|
49
|
+
"commander": "^14.0.2"
|
|
47
50
|
}
|
|
48
51
|
}
|