jtui3.0 1.2.3 → 1.2.4
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 +7 -1
- package/readme.md +43 -6
- package/scripts/postinstall.js +37 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jtui3.0",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
"postinstall": "node scripts/postinstall.js"
|
|
15
15
|
},
|
|
16
16
|
"description": "jt Components",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=14.0.0",
|
|
19
|
+
"npm": ">=6.0.0",
|
|
20
|
+
"yarn": ">=1.0.0",
|
|
21
|
+
"pnpm": ">=6.0.0"
|
|
22
|
+
},
|
|
17
23
|
"homepage": "http://gitlab.cdjti.com/lww/jtui3.0",
|
|
18
24
|
"license": "MIT",
|
|
19
25
|
"bugs": {
|
package/readme.md
CHANGED
|
@@ -1,24 +1,61 @@
|
|
|
1
1
|
# jtui3.0
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 安装
|
|
4
|
+
|
|
5
|
+
### npm
|
|
6
|
+
```bash
|
|
7
|
+
npm install jtui3.0
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### yarn
|
|
11
|
+
```bash
|
|
12
|
+
yarn add jtui3.0
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### pnpm
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add jtui3.0
|
|
18
|
+
# 如果自动安装失败,请运行:
|
|
19
|
+
# pnpm add jtui3.0 --save-peer-deps
|
|
20
|
+
# 或手动安装所需的peerDependencies
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 自动安装peerDependencies
|
|
24
|
+
|
|
25
|
+
本库会自动尝试安装所需的peerDependencies。如果自动安装失败,请手动安装以下依赖:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# 使用npm
|
|
29
|
+
npm install element-plus@^2.10.2 vue@^3.2.13 axios@^1.7.9 dayjs@^1.11.5 echarts@^5.4.0
|
|
30
|
+
|
|
31
|
+
# 使用yarn
|
|
32
|
+
yarn add element-plus@^2.10.2 vue@^3.2.13 axios@^1.7.9 dayjs@^1.11.5 echarts@^5.4.0
|
|
33
|
+
|
|
34
|
+
# 使用pnpm
|
|
35
|
+
pnpm add element-plus@^2.10.2 vue@^3.2.13 axios@^1.7.9 dayjs@^1.11.5 echarts@^5.4.0
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 开发
|
|
39
|
+
|
|
40
|
+
### 项目设置
|
|
4
41
|
```
|
|
5
42
|
yarn install
|
|
6
43
|
```
|
|
7
44
|
|
|
8
|
-
###
|
|
45
|
+
### 开发环境热重载
|
|
9
46
|
```
|
|
10
47
|
yarn serve
|
|
11
48
|
```
|
|
12
49
|
|
|
13
|
-
###
|
|
50
|
+
### 生产环境构建
|
|
14
51
|
```
|
|
15
52
|
yarn build
|
|
16
53
|
```
|
|
17
54
|
|
|
18
|
-
###
|
|
55
|
+
### 代码检查
|
|
19
56
|
```
|
|
20
57
|
yarn lint
|
|
21
58
|
```
|
|
22
59
|
|
|
23
|
-
###
|
|
24
|
-
|
|
60
|
+
### 自定义配置
|
|
61
|
+
参考 [Vue CLI 配置文档](https://cli.vuejs.org/config/).
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,12 +1,45 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// postinstall脚本,用于在npm/yarn install后自动运行
|
|
4
|
-
const
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
// 尝试加载安装脚本
|
|
8
|
+
function loadInstallScript() {
|
|
9
|
+
try {
|
|
10
|
+
// 尝试从当前目录加载
|
|
11
|
+
const scriptPath = path.join(__dirname, 'install-peer-deps.js');
|
|
12
|
+
if (fs.existsSync(scriptPath)) {
|
|
13
|
+
return require(scriptPath);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// 尝试从上级目录加载(针对pnpm情况)
|
|
17
|
+
const parentScriptPath = path.join(__dirname, '..', 'scripts', 'install-peer-deps.js');
|
|
18
|
+
if (fs.existsSync(parentScriptPath)) {
|
|
19
|
+
return require(parentScriptPath);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
console.log('❌ 无法找到install-peer-deps.js脚本');
|
|
23
|
+
return null;
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.log('❌ 加载安装脚本时出错:', error.message);
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
5
29
|
|
|
6
30
|
// 只有在开发环境或明确启用时才运行
|
|
7
31
|
if (process.env.NODE_ENV !== 'production' && process.env.INSTALL_PEER_DEPS !== 'false') {
|
|
8
|
-
console.log('🚀 运行postinstall脚本...');
|
|
9
|
-
|
|
32
|
+
console.log('🚀 jtui3.0: 运行postinstall脚本...');
|
|
33
|
+
|
|
34
|
+
const installModule = loadInstallScript();
|
|
35
|
+
if (installModule && installModule.main) {
|
|
36
|
+
installModule.main();
|
|
37
|
+
} else {
|
|
38
|
+
console.log('💡 jtui3.0: 建议手动安装peerDependencies:');
|
|
39
|
+
console.log(' npm install jtui3.0 --save-peer-deps');
|
|
40
|
+
console.log(' 或手动安装以下依赖:');
|
|
41
|
+
console.log(' element-plus@^2.10.2, vue@^3.2.13, axios@^1.7.9 等');
|
|
42
|
+
}
|
|
10
43
|
} else {
|
|
11
|
-
console.log('🚫 跳过postinstall脚本执行');
|
|
44
|
+
console.log('🚫 jtui3.0: 跳过postinstall脚本执行');
|
|
12
45
|
}
|