@o861runners/nmp 1.260130.11453 → 1.260130.12206

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o861runners/nmp",
3
- "version": "1.260130.11453",
3
+ "version": "1.260130.12206",
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",
@@ -68,13 +68,20 @@ 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
 
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
78
85
  return `1.${yy}${mm}${dd}.1${hh}${MM}`;
79
86
  }
80
87
 
@@ -98,8 +105,6 @@ export class Publisher {
98
105
  // Update version
99
106
  registryPkg.version = newVersion;
100
107
 
101
- console.log(JSON.stringify({ registry, originalPkg, registryPkg }, null, 2));
102
-
103
108
  // Update package name based on registry config
104
109
  if (registry.config.scope) {
105
110
  // Remove existing scope if any