@o861runners/nmp 1.26.13-0.11255 → 1.260130.12200
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/package.json +8 -1
- package/src/core/publisher.js +14 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o861runners/nmp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.260130.12200",
|
|
4
4
|
"description": "CLI tool to build, pack and publish NPM packages to multiple registries with auto-versioning",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -32,5 +32,12 @@
|
|
|
32
32
|
"ora": "^5.4.1",
|
|
33
33
|
"node-fetch": "^2.7.0",
|
|
34
34
|
"form-data": "^4.0.0"
|
|
35
|
+
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/o861runners-gif/multi-registry-publisher"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"registry": "https://registry.npmjs.org/"
|
|
35
42
|
}
|
|
36
43
|
}
|
package/src/core/publisher.js
CHANGED
|
@@ -68,14 +68,21 @@ export class Publisher {
|
|
|
68
68
|
* - 15/12/2026 09:30 → "1.26.1215.10930"
|
|
69
69
|
*/
|
|
70
70
|
generateVersion() {
|
|
71
|
+
// Create a new Date object
|
|
71
72
|
const now = new Date();
|
|
72
|
-
const yy = String(now.getFullYear()).slice(-2);
|
|
73
|
-
const mm = String(now.getMonth() + 1).padStart(2, "0");
|
|
74
|
-
const dd = String(now.getDate()).padStart(2, "0");
|
|
75
|
-
const hh = String(now.getHours()).padStart(2, "0");
|
|
76
|
-
const MM = String(now.getMinutes()).padStart(2, "0");
|
|
77
73
|
|
|
78
|
-
|
|
74
|
+
// Adjust to Vietnam timezone (UTC+7)
|
|
75
|
+
const vietnamTime = new Date(now.toLocaleString("en-US", { timeZone: "Asia/Ho_Chi_Minh" }));
|
|
76
|
+
|
|
77
|
+
// Extract components: year, month, day, hour, minute
|
|
78
|
+
const yy = String(vietnamTime.getFullYear()).slice(-2);
|
|
79
|
+
const mm = String(vietnamTime.getMonth() + 1).padStart(2, "0");
|
|
80
|
+
const dd = String(vietnamTime.getDate()).padStart(2, "0");
|
|
81
|
+
const hh = String(vietnamTime.getHours()).padStart(2, "0");
|
|
82
|
+
const MM = String(vietnamTime.getMinutes()).padStart(2, "0");
|
|
83
|
+
|
|
84
|
+
// Return version string
|
|
85
|
+
return `1.${yy}${mm}${dd}.1${hh}${MM}`;
|
|
79
86
|
}
|
|
80
87
|
|
|
81
88
|
/**
|
|
@@ -263,8 +270,7 @@ export class Publisher {
|
|
|
263
270
|
error: error.message,
|
|
264
271
|
});
|
|
265
272
|
console.log(chalk.red(`✗ ${registry.name}: ${error.message}`));
|
|
266
|
-
}finally{
|
|
267
|
-
|
|
273
|
+
} finally {
|
|
268
274
|
}
|
|
269
275
|
|
|
270
276
|
console.log("");
|