@necrolab/dashboard 0.4.59 → 0.4.60

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": "@necrolab/dashboard",
3
- "version": "0.4.59",
3
+ "version": "0.4.60",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "rm -rf dist && npx workbox-cli generateSW workbox-config.cjs && vite build",
package/postinstall.js CHANGED
@@ -7,13 +7,13 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
7
 
8
8
  // 🎨 Cool colors for better output
9
9
  const colors = {
10
- reset: '\x1b[0m',
11
- bright: '\x1b[1m',
12
- cyan: '\x1b[36m',
13
- green: '\x1b[32m',
14
- yellow: '\x1b[33m',
15
- blue: '\x1b[34m',
16
- magenta: '\x1b[35m'
10
+ reset: "\x1b[0m",
11
+ bright: "\x1b[1m",
12
+ cyan: "\x1b[36m",
13
+ green: "\x1b[32m",
14
+ yellow: "\x1b[33m",
15
+ blue: "\x1b[34m",
16
+ magenta: "\x1b[35m"
17
17
  };
18
18
 
19
19
  // đŸŽ¯ Cool logging functions
@@ -21,7 +21,8 @@ const log = {
21
21
  info: (msg) => console.log(`${colors.cyan}${colors.bright}â„šī¸ ${msg}${colors.reset}`),
22
22
  success: (msg) => console.log(`${colors.green}${colors.bright}✅ ${msg}${colors.reset}`),
23
23
  process: (msg) => console.log(`${colors.yellow}${colors.bright}⚡ ${msg}${colors.reset}`),
24
- path: (label, path) => console.log(`${colors.blue}📁 ${colors.bright}${label}:${colors.reset} ${colors.magenta}${path}${colors.reset}`)
24
+ path: (label, path) =>
25
+ console.log(`${colors.blue}📁 ${colors.bright}${label}:${colors.reset} ${colors.magenta}${path}${colors.reset}`)
25
26
  };
26
27
 
27
28
  // 🚀 Banner for style
@@ -56,20 +57,35 @@ execSync(`node "${vitePath}" build`, {
56
57
 
57
58
  log.success("Vite build completed!");
58
59
 
59
- var oldPath = path.resolve("./dist/");
60
- var distPath = path.resolve(path.join(__dirname, "../../../dashboard/dist/"));
60
+ var oldPath = path.join(__dirname, "dist");
61
+ var projectRoot = path.resolve(__dirname, "../../..");
62
+ var distPath = path.join(projectRoot, "dashboard", "dist");
63
+ var dashboardDir = path.join(projectRoot, "dashboard");
61
64
 
62
65
  log.process("Moving build artifacts...");
63
66
  log.path("Source", oldPath);
64
67
  log.path("Destination", distPath);
65
68
 
69
+ if (!fs.existsSync(dashboardDir)) {
70
+ fs.mkdirSync(dashboardDir, { recursive: true });
71
+ }
72
+
66
73
  fs.rmSync(distPath, {
74
+ recursive: true,
75
+ force: true
76
+ });
77
+
78
+ fs.cpSync(oldPath, distPath, {
67
79
  recursive: true
68
80
  });
69
- fs.renameSync(oldPath, distPath);
81
+
82
+ fs.rmSync(oldPath, {
83
+ recursive: true,
84
+ force: true
85
+ });
70
86
 
71
87
  log.success("Build artifacts moved successfully!");
72
88
 
73
89
  console.log(`${colors.green}${colors.bright}`);
74
90
  console.log("🎉 Postinstall completed successfully!");
75
- console.log(`${colors.reset}`);
91
+ console.log(`${colors.reset}`);
@@ -511,7 +511,7 @@ const openInBrowser = (debug) => {
511
511
  };
512
512
 
513
513
  const formatDate = (date) => {
514
- if (!date) return "-";
514
+ if (!date) return "TBA";
515
515
  const d = new Date(date);
516
516
  const iso = d.toISOString();
517
517
  const [year, month, day] = iso.substring(0, 10).split("-");