Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
f85314c
chore: release v1.0.1
kagol Sep 3, 2022
2489eea
fix(time-select): 修复 #1290 step小于等于0时会卡死的问题
qinwencheng Sep 1, 2022
989aaf6
docs: update README.md [skip ci]
allcontributors[bot] Sep 4, 2022
b91f095
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 4, 2022
29c261c
fix: 修复 #1292
Sep 4, 2022
c6d898b
fix(modal): 修复dialog的个第一个icon和其他的不对齐#1300
handsomezyw Sep 3, 2022
84c4623
fix(select): 修复select新增选项,删除一个,其他新增的选项全部被删除了 #1274
handsomezyw Sep 3, 2022
3c11a8d
fix(tabs): 修复Tabs溢出不截断 #1062
handsomezyw Sep 3, 2022
dd61433
fix(tabs): 修复tabs溢出鼠标拖动tab不会滑动的问题
handsomezyw Sep 4, 2022
905dd50
fix(mention): 修复Mention 组件的联想文字选中后应替换触发输入的联想文本,而非追加 #1303
handsomezyw Sep 5, 2022
af6f350
chore: release v1.0.2
kagol Sep 5, 2022
14871bc
fix: fix doc 404 close #1310
kagol Sep 6, 2022
f35b2e1
docs: update README
kagol Sep 6, 2022
ca799ce
fix: fix build fail caused by ssr
kagol Sep 6, 2022
cd061b4
fix: fix mobile sidebar scroll problem
kagol Sep 6, 2022
1dd9fcc
docs: update README.md [skip ci]
allcontributors[bot] Sep 6, 2022
e47d20d
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 6, 2022
6c5cdb0
docs: update README.md [skip ci]
allcontributors[bot] Sep 6, 2022
71f0bbc
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 6, 2022
1db5384
style(button): 组件 size 移除 xs 类型 #1199
vaebe Sep 6, 2022
4d602a2
docs(button): 文档 size 描述 四种类型去除 xs 为三种
vaebe Sep 6, 2022
c42a8bd
style(search): 优化search 搜索框样式,统一组件不同size的大小 #1199
vaebe Sep 6, 2022
8589b34
chore: refactor unit-test scripts
kagol Sep 7, 2022
9ba54f1
style(input): input组件 size 大小使用scss变量向标准统一 #1199
vaebe Sep 6, 2022
112d99d
style(radio): radio组件 size 大小使用scss变量向标准统一 #1199
vaebe Sep 7, 2022
f8442ef
docs(radio): radio组件文档更新 去除组件 size xs 类型,按钮形态示例优化。
vaebe Sep 7, 2022
51df792
style(checkbox): checkbox 组件 size 大小使用scss变量向标准统一 #1199
vaebe Sep 7, 2022
d6e1873
style(checkbox-group): checkbox-group 组件 direction排列方向样式优化
vaebe Sep 7, 2022
27e8118
docs(checkbox): checkbox组件文档更新 去除组件 size xs 类型,按钮形态示例优化。
vaebe Sep 7, 2022
575da92
fix: fix unit test error
jxhhdx Sep 9, 2022
ce44eeb
style: wrong eslint
jxhhdx Sep 9, 2022
3e8fc9f
chore: remove only
jxhhdx Sep 11, 2022
4b987da
修改可排序拖拽的bug (#1144)
asdlml6 Sep 11, 2022
30749d4
refactor(dragdrop): extract const SHADOW_ID
kagol Sep 11, 2022
8a38a1c
refactor(dragdrop): Optimize the code according to the review opinion
kagol Sep 11, 2022
0cfa2f1
fix(input): 绑定数据为 ref(null) 导致无法获取 length 的错误 (close #1329)
vaebe Sep 11, 2022
1dbc260
style(collapse): 可自定义过渡持续时间
wowCheng Sep 7, 2022
78630f5
feat(carousel): 增加自定义过渡持续时间 transition-speed
wowCheng Sep 7, 2022
c056e44
style(auto-complete): auto-complete 组件 size 大小使用scss变量向标准统一 #1199
vaebe Sep 7, 2022
449a560
docs(time-select): 更新文档,示例更友好 (#1328)
qinwencheng Sep 11, 2022
9a3e2ce
fix(menu): 修复组件部分错误 (#1334)
GaoNeng-wWw Sep 11, 2022
e65ee54
fix(tag): 移除tag组件 size 属性 xs 类型,统一组件size类型 #1199 (#1335)
vaebe Sep 11, 2022
a6d23b5
docs: update README.md [skip ci]
allcontributors[bot] Sep 11, 2022
ba3a801
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 11, 2022
4618dd0
feat: release v1.1.0
kagol Sep 11, 2022
feccef4
fix(tag-input): 移除 render setup直接导出,打开关闭suggestionList面板逻辑更新
vaebe Sep 12, 2022
a6bb408
feat(tag-input): suggestion-list 使用 FlexibleOverlay
vaebe Sep 12, 2022
2ddbe78
fix(tag-input): valueChange to change
vaebe Sep 12, 2022
f71d570
feat(tag-input): 代码调整将部分逻辑抽离成函数、增加获取父元素宽度的逻辑用于设置suggestion-list的宽度
vaebe Sep 12, 2022
ac31302
test(tag-input): 修复因为逻辑更改导致的测试错误
vaebe Sep 12, 2022
097b4b4
feat(tag-input): add useInputKeydown
vaebe Sep 13, 2022
3b6809a
feat(tag-input): v-model:tags 修改为 v-model,更新文档、测试用例
vaebe Sep 13, 2022
a0bf07e
fix(tag-input): 选择建议面板 选择单个不应该被关闭
vaebe Sep 13, 2022
f14a7c7
feat(colorPicker): 组件无法正常打开选择器
wowCheng Sep 12, 2022
41957fb
docs(card): 文档优化去除 icon css的引入,去除未使用的css样式代码。 (close #1231)
vaebe Sep 13, 2022
a65535d
docs(card): 文档 props:align、shadow 类型展示优化
vaebe Sep 13, 2022
050044c
fix(card): props.shadow 类型 alway 修正为 always
vaebe Sep 13, 2022
a495c57
docs: add maintainers in README
kagol Sep 16, 2022
88e8185
docs: add deprecated tags
kagol Sep 16, 2022
1d4ca02
fix(checkbox): #1323 修复checkboxGroup下,组件底部遮挡问题
xzxldl55 Sep 14, 2022
57bf59e
docs(radio-group): radio-group 根据条件终止切换操作示例,两个radio-group 没有间距 (close…
vaebe Sep 17, 2022
d50ead7
docs: 完善头像英文文档 (#1354)
Bbbtt04 Sep 28, 2022
58c3901
test(input-number): 增加对placeholder属性的测试
qinwencheng Sep 15, 2022
3d3e723
test(input-number): 新增对增减按钮的测试
qinwencheng Sep 18, 2022
be3bff8
test(input-number): 新增对change事件的测试
qinwencheng Sep 18, 2022
f1d04ac
test(input-number): 测试change/focus/blur/input事件
qinwencheng Sep 18, 2022
bad50e2
test(input-number): 新增对focus/blur/select方法的测试
qinwencheng Sep 19, 2022
8b30214
revert: 暂时删除method方法的测试
qinwencheng Sep 23, 2022
95f8c82
fix(modal): 拖拽异常,新增保留上次位置
wowCheng Sep 26, 2022
d28e420
perf(modal): 更正eslint
wowCheng Sep 26, 2022
71fb971
docs(modal): 添加contributors
wowCheng Sep 27, 2022
b29b8b1
chore: update version 1.2.0
kagol Sep 28, 2022
b9b9bb0
release v1.4.0 (#1499)
kagol Dec 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,42 @@
"contributions": [
"code"
]
},
{
"login": "handsomezyw",
"name": "handsomezyw",
"avatar_url": "https://avatars.githubusercontent.com/u/34366225?v=4",
"profile": "https://github.com/handsomezyw",
"contributions": [
"code"
]
},
{
"login": "iamyoki",
"name": "Yoki",
"avatar_url": "https://avatars.githubusercontent.com/u/74389358?v=4",
"profile": "https://github.com/iamyoki",
"contributions": [
"code"
]
},
{
"login": "LadyChatterleyLover",
"name": "luopei",
"avatar_url": "https://avatars.githubusercontent.com/u/35223515?v=4",
"profile": "https://github.com/LadyChatterleyLover",
"contributions": [
"code"
]
},
{
"login": "wowCheng",
"name": "Mr.Cheng",
"avatar_url": "https://avatars.githubusercontent.com/u/69743874?v=4",
"profile": "https://github.com/wowCheng",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 10,
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/auto-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Auto publish

on:
push:
branches: ['dev']

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: CheckOut Code
uses: actions/checkout@master

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Get package version
uses: tyankatsu0105/read-package-version-actions@v1
id: package-version
with:
path: packages/devui-vue

- name: Create a tag
uses: negz/create-tag@v1
with:
version: v${{ steps.package-version.outputs.version }}
message: 'Release v${{ steps.package-version.outputs.version }}'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Build Scripts
working-directory: packages/devui-vue/
run: |
ls
node -v
npm install pnpm -g
pnpm -v
pnpm i
pnpm run build:lib

- name: Publish
working-directory: packages/devui-vue/build
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.package-version.outputs.version }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
run: pnpm i

- name: Build site
run: pnpm scripts run build
run: pnpm build

- name: ESLint
run: pnpm cli --filter vue-devui -- code-check -t eslint

- name: Unit test
run: pnpm scripts run tests.test
run: pnpm cli --filter vue-devui -- code-check -t unit-test
1 change: 1 addition & 0 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ignore:
- packages/devui-cli/node_modules
# devui-theme
- packages/devui-theme/dist
- packages/devui-theme/build
- packages/devui-theme/node_modules
- packages/devui-theme/src/styles-var
# devui-vue
Expand Down
201 changes: 127 additions & 74 deletions README.md

Large diffs are not rendered by default.

185 changes: 128 additions & 57 deletions README.zh-CN.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"precommit": "lint-staged",
"scripts": "better-scripts",
"dev": "pnpm scripts run dev",
"build": "pnpm scripts run build"
"build": "pnpm scripts run build",
"build:lib": "pnpm scripts run build:lib",
"test": "pnpm scripts run tests.test"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body[ui-theme='deep-theme'],
body[ui-theme='galaxy-theme'] {
// TODO: 组件支持全局配置默认尺寸参数后删除
// button default size change to '32px'
.#{$devui-prefix}-button:not(.#{$devui-prefix}-button--xs):not(.#{$devui-prefix}-button--sm):not(.#{$devui-prefix}-button--lg) {
.#{$devui-prefix}-button:not(.#{$devui-prefix}-button--sm):not(.#{$devui-prefix}-button--lg) {
height: 32px;
line-height: 32px;
}
Expand Down
67 changes: 67 additions & 0 deletions packages/devui-vue/devui-cli/commands/build-volar-support.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
const path = require("path");
const {
buildComponentItem,
buildGlobalDTSEnd,
buildGlobalDTSStart,
buildComponents,
buildDirectiveItem,
buildDirective,
buildServiceItem,
buildService
} = require('../templates/dts');
const { writeFileSync } = require('fs');
const { useRelationTree } = require("../composables/use-relation-tree");
const { bigCamelCase } = require('../shared/utils');

/**
* @param {Record<string,any>} replaceIdentifier
* @param {string[]} readyToReleaseComponentName
*/
exports.volarSupport = (replaceIdentifier, readyToReleaseComponentName) => {
const componentDTSItem = [];
const directiveDTSItem = [];
const serviceDTSItem = [];
const componentPath = readyToReleaseComponentName.map((name) => path.resolve('./devui', name, 'index.ts'));
const tree = useRelationTree(componentPath);
tree.forEachChild((foldNode) => {
foldNode.forEachChild((node) => {
let nodeName = node.name.replace(/\$/gim, '').replace(/directive/gim, '');
let reference = nodeName;
const needToTransform = replaceIdentifier?.[foldNode.name]?.[node.name] !== undefined;
if (!node.isComponet){
const hasType = new RegExp(node.type, 'gim');
if (!hasType.test(reference)){
reference += `-${node.type}`;
}
reference = bigCamelCase(reference);
}
if (needToTransform){
reference = replaceIdentifier[foldNode.name][node.name]?.['reference'];
nodeName = replaceIdentifier[foldNode.name][node.name]?.['exportKey'];
}
if (node.type === 'component'){
componentDTSItem.push(buildComponentItem(bigCamelCase(nodeName), reference));
}
if (node.type === 'directive'){
directiveDTSItem.push(buildDirectiveItem(nodeName, reference));
}
if (node.type === 'service'){
serviceDTSItem.push(buildServiceItem(nodeName, reference));
}
});
});
const template = `
${buildGlobalDTSStart()}
${buildComponents(componentDTSItem.join('\n'))}
${buildDirective(directiveDTSItem.join('\n'))}
${buildService(serviceDTSItem.join('\n'))}
${buildGlobalDTSEnd()}
`;
try {
writeFileSync('./build/global.d.ts', template);
} catch (e) {
console.log(e.message);
return false;
}
return true;
};
29 changes: 25 additions & 4 deletions packages/devui-vue/devui-cli/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ const vue = require('@vitejs/plugin-vue');
const vueJsx = require('@vitejs/plugin-vue-jsx');
const nuxtBuild = require('./build-nuxt-auto-import');
const { isReadyToRelease } = require('../shared/utils');

const { execSync } = require('child_process');
const { volarSupport } = require('./build-volar-support');
const logger = require('../shared/logger');
const replaceIdentifierPath = path.resolve(__dirname,'../replaceIdentifer.json');
const replaceIdentifier = JSON.parse(fs.readFileSync(replaceIdentifierPath).toString());
const entryDir = path.resolve(__dirname, '../../devui');
const outputDir = path.resolve(__dirname, '../../build');

Expand Down Expand Up @@ -67,7 +71,8 @@ const createPackageJson = (name) => {
"version": "0.0.0",
"main": "index.umd.js",
"module": "index.es.js",
"style": "style.css"
"style": "style.css",
"types": "../types/${name}/index.d.ts"
}`;

fsExtra.outputFile(path.resolve(outputDir, `${name}/package.json`), fileStr, 'utf-8');
Expand All @@ -81,15 +86,31 @@ exports.build = async () => {
const isDir = fs.lstatSync(componentDir).isDirectory();
return isDir && fs.readdirSync(componentDir).includes('index.ts');
});

const readyToReleaseComponentName = [];
for (const name of components) {
if (!isReadyToRelease(name)) {
continue;
}
readyToReleaseComponentName.push(name);
await buildSingle(name);
createPackageJson(name);
nuxtBuild.createAutoImportedComponent(name);
}

// 生成global.d.ts
try {
execSync(`pnpm run build:components:dts`);
} catch {}
nuxtBuild.createNuxtPlugin();
logger.success('准备生成global.d.ts');
const volarSupportbuildState = volarSupport(replaceIdentifier, readyToReleaseComponentName);
fs.writeFileSync('./build/index.d.ts', `
export * from './types/vue-devui';
import _default from './types/vue-devui';
export default _default;
`);
if (volarSupportbuildState){
logger.success('global.d.ts生成成功');
} else {
logger.error('global.d.ts生成失败, 因为发生错误');
}
};
18 changes: 10 additions & 8 deletions packages/devui-vue/devui-cli/commands/code-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@ const chalk = require('chalk');
const { isReadyToRelease } = require('../shared/utils');

const log = console.log;

const chalkEslint = chalk.hex('#4b32c3');

const chalkUnitTest = chalk.hex('#99425b');

const chalkError = chalk.hex('#F66F6A');

const chalkSuccess = chalk.hex('#3DCCA6');

const entryDir = path.resolve(__dirname, '../../devui');

const unitTestFailedComponents = [];

const completeComponents = fs.readdirSync(entryDir).filter((name) => {
Expand Down Expand Up @@ -87,8 +81,16 @@ const unitTestSome = async (components) => {
};

const unitTestAll = async () => {
for (const name of completeComponents) {
await unitTestSingle(name);
// 单个组件执行单元测试,总耗时太长
// for (const name of completeComponents) {
// await unitTestSingle(name);
// }

const unitTestResult = await shell.exec('pnpm --filter vue-devui test --reporter default');
// 解决单元测试报错,但PR合入门禁不中断问题
if (/failed|ERR_/.test(unitTestResult.stderr)) {
shell.echo(chalkError('Error: Unit test failed.'));
shell.exit(1);
}

log(chalkSuccess('\nCongratulations, all components have passed the unit test!'));
Expand Down
2 changes: 1 addition & 1 deletion packages/devui-vue/devui-cli/commands/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getVersion = (version) => {
};

const createPackageJson = async (version) => {
package.version = getVersion(version);
// package.version = getVersion(version);
package.dependencies = omit(package.dependencies, 'vue');
const fileStr = JSON.stringify(omit(package, 'scripts', 'devDependencies'), null, 2);
await fsExtra.outputFile(path.resolve(outputDir, `package.json`), fileStr, 'utf-8');
Expand Down
57 changes: 57 additions & 0 deletions packages/devui-vue/devui-cli/composables/use-extra.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const ts = require('typescript');
/**
*
* @param {string} code node full text.
* @returns {RegExpMatchArray | null}
*/
function extraComponentName(code){
const regexp = /app\.component\(((?<components>.*)\.name), (?<fileName>.*)\)/;
const groups = regexp.exec(code)?.groups;
if (groups?.components){
return groups.components;
}
}
/**
*
app.directive('file-drop', fileDropDirective);
* @param {string} code
*/
function extraDirective(code){
const regexp = /app\.directive\('(?<directiveName>.*), ?(?<fileName>.*)\);/;
const groups = regexp.exec(code)?.groups;
if (groups?.fileName){
return groups.fileName;
}
}

function extraGlobalProperties(code) {
const globalPropertiesReg = /app\.config\.globalProperties\.(?<serviceName>\$.*) = (?<serviceFileName>.*);/;
const provideReg = /app\.provide\((?<serviceName>.*)\..*, ?new? ?(?<instanceName>.*)\((?<param>.*)\);/gm;
const groups = globalPropertiesReg.exec(code)?.groups || provideReg.exec(code);
if (groups?.serviceName){
return groups.serviceName;
}
}

function extraValue(code){
return extraComponentName(code) ?? extraDirective(code) ?? extraGlobalProperties(code);
}
/**
*
* @param {string} code
*/
function extraType(code){
const isDirective = /app\.directive/.test(code);
const isComponent = /app\.component/.test(code);
const isGlobalProperties = /app\.config\.globalProperties/.test(code);
const isProvide = /app\.provide/.test(code);
if (isDirective) {return 'directive';}
if (isComponent) {return 'component';}
if (isGlobalProperties || isProvide) {return 'service';}
}

exports.extra = extraValue;
exports.extraType = extraType;
exports.extraDirective = extraDirective;
exports.extraComponentName = extraComponentName;
exports.extraGlobalProperties = extraGlobalProperties;
Loading