Skip to content

Commit c0f67a5

Browse files
committed
merge dev for publish v1.3.1
2 parents d74eddb + 2d16ec5 commit c0f67a5

File tree

133 files changed

+416
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+416
-155
lines changed

plugin/upload.js

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const util = require('../build/util.js')
66
const buildReadme = require('../build/build-readme.js')
77
const root = path.join(__dirname,'..')
88
const modulesId = process.env.UNI_MODULES_ID
9-
// const modulesId = 'uni-icons'
9+
// const modulesId = 'uni-forms'
1010
const comName = modulesId.replace(/uni-/, '')
1111
const comPath = path.join(root, 'uni_modules')
1212
// console.error('upload.js - modulesId :' + modulesId);
@@ -44,47 +44,58 @@ if (modulesId === 'uni-ui') {
4444
} else {
4545
// 将组件拷贝到临时目录
4646
util.copyDir(getModulesPath(modulesId), path.join(tempExamplePath, 'uni_modules', modulesId))
47-
handlePageJson(comName, tempExamplePath)
48-
// 获取关联组件
49-
if (packageJson && packageJson.uni_modules && packageJson.uni_modules.dependencies.length > 0) {
50-
relationComponents = packageJson.uni_modules.dependencies
51-
}
52-
// 同步依赖组件
53-
if (relationComponents && relationComponents.length > 0) {
54-
relationComponents.reduce((promise, item) => {
55-
return new Promise((resolve, reject) => {
56-
util.copyDir(getModulesPath(item), path.join(tempExamplePath, 'uni_modules', item))
57-
resolve()
58-
})
59-
}, Promise.resolve([])).then(res => {
60-
// console.error('所有依赖组件同步完成');
61-
setPageComponents(modulesId, comName)
62-
}).catch((err)=>{
63-
console.log('error',err);
64-
})
65-
} else {
66-
setPageComponents(modulesId, comName)
67-
}
47+
handlePageJson(comName, tempExamplePath)
48+
// 同步页面使用的组件
49+
setPageComponents(modulesId, comName)
50+
// 同步组件依赖的组间
51+
syncRelyOn(modulesId)
6852
}
6953

7054
function setPageComponents(modulesId, comName) {
7155
const pagePath = path.join(root, 'pages', 'vue', comName, comName + '.vue')
7256
const pageContent = fs.readFileSync(pagePath).toString()
7357
const pageContents = getComName(pageContent)
74-
// console.error('组件名称:' + pageContents);
75-
7658
if (pageContents.length > 0) {
77-
pageContents.reduce((promise, item) => {
78-
const inputPath = getModulesPath(item)
59+
pageContents.reduce((promise, item) => {
60+
const inputPath = getModulesPath(item)
7961
const exists = fs.existsSync(inputPath)
80-
if (item === modulesId || !exists) return promise
81-
return new Promise((resolve, reject) => {
82-
util.copyDir(inputPath, path.join(tempExamplePath, 'uni_modules', item))
62+
if (item === modulesId || !exists) return promise
63+
return new Promise((resolve, reject) => {
64+
util.copyDir(inputPath, path.join(tempExamplePath, 'uni_modules', item))
65+
resolve()
66+
}).then(()=>{
67+
syncRelyOn(item)
8368
})
8469
}, Promise.resolve([])).then(res => {
85-
// console.error('所有依赖组件同步完成');
70+
// console.log('所有依赖组件同步完成');
8671
})
8772
}
73+
}
74+
75+
function syncRelyOn(modulesName){
76+
const packageJson = getPackage(modulesName, comPath)
77+
let relationComponents = []
78+
// 获取关联组件
79+
if (packageJson && packageJson.uni_modules && packageJson.uni_modules.dependencies.length > 0) {
80+
relationComponents = packageJson.uni_modules.dependencies
81+
}
82+
// 同步依赖组件
83+
if (relationComponents && relationComponents.length > 0) {
84+
return relationComponents.reduce((promise, item) => {
85+
return new Promise((resolve, reject) => {
86+
util.copyDir(getModulesPath(item), path.join(tempExamplePath, 'uni_modules', item))
87+
resolve()
88+
}).then(()=>{
89+
syncRelyOn(item)
90+
})
91+
}, Promise.resolve([])).then(res => {
92+
// console.error('所有依赖组件同步完成');
93+
// setPageComponents(modulesId, comName)
94+
}).catch((err)=>{
95+
// console.log('error',err);
96+
})
97+
}
98+
return Promise.resolve()
8899
}
89100

90101
/**

uni_modules/uni-badge/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.1.1(2021-05-12)
2+
- 新增 组件示例地址
13
## 1.1.0(2021-05-12)
24
- 新增 uni-badge 的 absolute 属性,支持定位
35
- 新增 uni-badge 的 offset 属性,支持定位偏移

uni_modules/uni-badge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "uni-badge",
33
"displayName": "uni-badge 数字角标",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
66
"keywords": [
77
"",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
## 1.3.16(2021-05-12)
2+
- 新增 组件示例地址
13
## 1.3.15(2021-02-04)
24
- 调整为uni_modules目录规范

uni_modules/uni-calendar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "uni-calendar",
33
"displayName": "uni-calendar 日历",
4-
"version": "1.3.15",
4+
"version": "1.3.16",
55
"description": "日历组件",
66
"keywords": [
77
"uni-ui",

uni_modules/uni-calendar/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,8 @@ export default {
9696

9797

9898

99+
100+
101+
## 组件示例
102+
103+
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar](https://hellouniapp.dcloud.net.cn/pages/extUI/calendar/calendar)

uni_modules/uni-card/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
## 1.1.7(2021-05-12)
2+
- 新增 组件示例地址
13
## 1.1.6(2021-02-04)
24
- 调整为uni_modules目录规范

uni_modules/uni-card/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "uni-card",
33
"displayName": "uni-card 卡片",
4-
"version": "1.1.6",
4+
"version": "1.1.7",
55
"description": "Card 组件,提供常见的卡片样式。",
66
"keywords": [
77
"uni-ui",

uni_modules/uni-card/readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,8 @@
9696

9797
|插槽称名 |说明 |
9898
|:-: |:-: |
99-
|footer |卡片底部插槽 |
99+
|footer |卡片底部插槽 |
100+
101+
## 组件示例
102+
103+
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/card/card](https://hellouniapp.dcloud.net.cn/pages/extUI/card/card)

uni_modules/uni-collapse/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.1.7(2021-05-12)
2+
- 新增 组件示例地址
13
## 1.1.6(2021-02-05)
24
- 优化 组件引用关系,通过uni_modules引用组件
35
## 1.1.5(2021-02-05)

0 commit comments

Comments
 (0)