@nitronjs/framework 0.2.23 → 0.2.24
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/lib/Console/UpdateChecker.js +11 -17
- package/package.json +1 -1
|
@@ -78,34 +78,28 @@ function stripAnsi(str) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function printUpdateNotice(current, latest) {
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
const
|
|
81
|
+
const boxWidth = 70;
|
|
82
|
+
const border = C.yellow;
|
|
83
|
+
const pad = (content, length) => content + " ".repeat(Math.max(0, length - stripAnsi(content).length));
|
|
84
84
|
|
|
85
85
|
const lines = [
|
|
86
|
+
`${border}${C.bold}!${C.reset} ${C.bold}Update available${C.reset}`,
|
|
86
87
|
"",
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
`${C.bold}Current:${C.reset} ${current}`,
|
|
89
|
+
`${C.bold}Latest:${C.reset} ${C.green}${C.bold}${latest}${C.reset}`,
|
|
89
90
|
"",
|
|
90
|
-
|
|
91
|
-
""
|
|
91
|
+
`${C.bold}Run:${C.reset} ${C.cyan}npm update @nitronjs/framework --save${C.reset}`
|
|
92
92
|
];
|
|
93
93
|
|
|
94
|
-
const boxWidth = 50;
|
|
95
|
-
const border = C.gray;
|
|
96
|
-
|
|
97
94
|
console.log();
|
|
98
|
-
console.log(
|
|
95
|
+
console.log(`${border}\u250C${"\u2500".repeat(boxWidth - 2)}\u2510${C.reset}`);
|
|
99
96
|
|
|
100
97
|
for (const line of lines) {
|
|
101
|
-
|
|
102
|
-
const pad = boxWidth - rawLen;
|
|
103
|
-
|
|
104
|
-
console.log(` ${border}\u2502${C.reset}${line}${" ".repeat(Math.max(0, pad))}${border}\u2502${C.reset}`);
|
|
98
|
+
console.log(`${border}\u2502${C.reset} ${pad(line, boxWidth - 4)} ${border}\u2502${C.reset}`);
|
|
105
99
|
}
|
|
106
100
|
|
|
107
|
-
console.log(
|
|
108
|
-
console.log();
|
|
101
|
+
console.log(`${border}\u2502${C.reset} ${" ".repeat(boxWidth - 4)} ${border}\u2502${C.reset}`);
|
|
102
|
+
console.log(`${border}\u2514${"\u2500".repeat(boxWidth - 2)}\u2518${C.reset}`);
|
|
109
103
|
}
|
|
110
104
|
|
|
111
105
|
export default async function checkForUpdates() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitronjs/framework",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"description": "NitronJS is a modern and extensible Node.js MVC framework built on Fastify. It focuses on clean architecture, modular structure, and developer productivity, offering built-in routing, middleware, configuration management, CLI tooling, and native React integration for scalable full-stack applications.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"njs": "./cli/njs.js"
|