@otmc/ui 0.1.4 → 0.1.6
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 +10 -6
- package/scripts/prebuild.js +47 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otmc/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
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": ">=
|
|
36
|
-
"@mantine/dates": ">=
|
|
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": "^
|
|
45
|
-
"@mantine/dates": "^
|
|
46
|
-
"@mantine/hooks": "^
|
|
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,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @License OTMC License
|
|
5
|
+
* @Copyright (c) 2026 OTMC Softwares. All rights reserved.
|
|
6
|
+
* @Contributors Nguyen Van Trung, OTMC Contributors.
|
|
7
|
+
**/
|
|
8
|
+
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
|
|
12
|
+
if (!process.env.BUILD_NUMBER && !process.env.CI) {
|
|
13
|
+
console.log('📚 Dev mode detected: skipping prebuild.');
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const buildId = process.env.BUILD_NUMBER
|
|
18
|
+
? `Jenkins.${process.env.BUILD_NUMBER}`
|
|
19
|
+
: `Dev.${Date.now()}`;
|
|
20
|
+
|
|
21
|
+
const buildTime = new Date().toISOString();
|
|
22
|
+
|
|
23
|
+
const packageJsonPath = path.resolve(
|
|
24
|
+
process.cwd(),
|
|
25
|
+
'package.json'
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
29
|
+
throw new Error(`package.json not found: ${packageJsonPath}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const packageJson = JSON.parse(
|
|
33
|
+
fs.readFileSync(packageJsonPath, 'utf8')
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
packageJson.buildId = buildId;
|
|
37
|
+
packageJson.buildTime = buildTime;
|
|
38
|
+
|
|
39
|
+
fs.writeFileSync(
|
|
40
|
+
packageJsonPath,
|
|
41
|
+
JSON.stringify(packageJson, null, 2) + '\n'
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
console.log('✅ Build info updated:');
|
|
45
|
+
console.log(` - 🏷️ Build Id: ${buildId}`);
|
|
46
|
+
console.log(` - 🕐 Build Time: ${buildTime}`);
|
|
47
|
+
|