@otmc/ui 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/package.json +10 -6
  2. package/scripts/prebuild.js +45 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otmc/ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "OTMC shared React component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,9 +21,13 @@
21
21
  },
22
22
  "files": [
23
23
  "dist",
24
+ "scripts",
24
25
  "README.md",
25
26
  "LICENSE"
26
27
  ],
28
+ "bin": {
29
+ "prebuild": "./scripts/prebuild.js"
30
+ },
27
31
  "keywords": [
28
32
  "otmc",
29
33
  "ui",
@@ -32,8 +36,8 @@
32
36
  "mantine"
33
37
  ],
34
38
  "peerDependencies": {
35
- "@mantine/core": ">=8",
36
- "@mantine/dates": ">=7",
39
+ "@mantine/core": ">=9",
40
+ "@mantine/dates": ">=9",
37
41
  "react": ">=18",
38
42
  "react-dom": ">=18"
39
43
  },
@@ -41,9 +45,9 @@
41
45
  "access": "public"
42
46
  },
43
47
  "devDependencies": {
44
- "@mantine/core": "^7.0.0",
45
- "@mantine/dates": "^7.17.8",
46
- "@mantine/hooks": "^7.0.0",
48
+ "@mantine/core": "^9.0.0",
49
+ "@mantine/dates": "^9.0.0",
50
+ "@mantine/hooks": "^9.0.0",
47
51
  "@types/react": "^18.0.0",
48
52
  "@types/react-dom": "^18.0.0",
49
53
  "react": "^18.0.0",
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @License OTMC License
3
+ * @Copyright (c) 2026 OTMC Softwares. All rights reserved.
4
+ * @Contributors Nguyen Van Trung, OTMC Contributors.
5
+ **/
6
+
7
+ import fs from 'node:fs';
8
+ import path from 'node:path';
9
+
10
+ if (!process.env.BUILD_NUMBER && !process.env.CI) {
11
+ console.log('📚 Dev mode detected: skipping prebuild');
12
+ process.exit(0);
13
+ }
14
+
15
+ const buildId = process.env.BUILD_NUMBER
16
+ ? `Jenkins.${process.env.BUILD_NUMBER}`
17
+ : `Dev.${Date.now()}`;
18
+
19
+ const buildTime = new Date().toISOString();
20
+
21
+ const packageJsonPath = path.resolve(
22
+ process.cwd(),
23
+ 'package.json'
24
+ );
25
+
26
+ if (!fs.existsSync(packageJsonPath)) {
27
+ throw new Error(`package.json not found: ${packageJsonPath}`);
28
+ }
29
+
30
+ const packageJson = JSON.parse(
31
+ fs.readFileSync(packageJsonPath, 'utf8')
32
+ );
33
+
34
+ packageJson.buildId = buildId;
35
+ packageJson.buildTime = buildTime;
36
+
37
+ fs.writeFileSync(
38
+ packageJsonPath,
39
+ JSON.stringify(packageJson, null, 2) + '\n'
40
+ );
41
+
42
+ console.log('✅ Build info updated:');
43
+ console.log(` - 🏷️ Build Id: ${buildId}`);
44
+ console.log(` - 🕐 Build Time: ${buildTime}`);
45
+