Skip to content

Commit

Permalink
fix(tiny-vue): 内部和开源代码同步,减少维护成本 [WI2023]
Browse files Browse the repository at this point in the history
Match-id-31a5bd840dddac8f9371b683a11e8d2521d111c1
  • Loading branch information
h-ivy committed Feb 22, 2023
1 parent 0527f95 commit f41a593
Show file tree
Hide file tree
Showing 2,554 changed files with 67,719 additions and 9,965 deletions.
193 changes: 193 additions & 0 deletions .cid/tiny-vue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
version: 0.1.0
name: tiny-vue
language: nodejs

# 构建工具
dependencies:
base:
nodejs: best

# 构建机器
machine:
standard:
euler:
- default

# 构建脚本
scripts:
- sh build.sh

# 构建产物
artifacts:
npm_deploy:
- config_path: ./dist/${componentName}/package.json
# - config_path: ./dist/alert/package.json
# - config_path: ./dist/action-menu/package.json
# - config_path: ./dist/button/package.json
# - config_path: ./dist/vue/package.json
# - config_path: ./dist/action-sheet/package.json
# - config_path: ./dist/amount/package.json
# - config_path: ./dist/area/package.json
# - config_path: ./dist/autocomplete/package.json
# - config_path: ./dist/avatar/package.json
# - config_path: ./dist/badge/package.json
# - config_path: ./dist/breadcrumb/package.json
# - config_path: ./dist/breadcrumb-item/package.json
# - config_path: ./dist/bulletin-board/package.json
# - config_path: ./dist/button-group/package.json
# - config_path: ./dist/calendar/package.json
# - config_path: ./dist/card-template/package.json
# - config_path: ./dist/carousel/package.json
# - config_path: ./dist/carousel-item/package.json
# - config_path: ./dist/cascader/package.json
# - config_path: ./dist/cascader-menu/package.json
# - config_path: ./dist/cascader-node/package.json
# - config_path: ./dist/cascader-panel/package.json
# - config_path: ./dist/chart/package.json
# - config_path: ./dist/chart/autonavi-map/package.json
# - config_path: ./dist/chart/baidu-map/package.json
# - config_path: ./dist/chart/chart-bar/package.json
# - config_path: ./dist/chart/chart-boxplot/package.json
# - config_path: ./dist/chart/chart-candle/package.json
# - config_path: ./dist/chart/chart-core/package.json
# - config_path: ./dist/chart/chart-funnel/package.json
# - config_path: ./dist/chart/chart-gauge/package.json
# - config_path: ./dist/chart/chart-graph/package.json
# - config_path: ./dist/chart/chart-heatmap/package.json
# - config_path: ./dist/chart/chart-histogram/package.json
# - config_path: ./dist/chart/chart-line/package.json
# - config_path: ./dist/chart/chart-liquidfill/package.json
# - config_path: ./dist/chart/chart-map/package.json
# - config_path: ./dist/chart/chart-pie/package.json
# - config_path: ./dist/chart/chart-radar/package.json
# - config_path: ./dist/chart/chart-ring/package.json
# - config_path: ./dist/chart/chart-sankey/package.json
# - config_path: ./dist/chart/chart-scatter/package.json
# - config_path: ./dist/chart/chart-sunburst/package.json
# - config_path: ./dist/chart/chart-tree/package.json
# - config_path: ./dist/chart/chart-waterfall/package.json
# - config_path: ./dist/chart/chart-wordcloud/package.json
# - config_path: ./dist/checkbox/package.json
# - config_path: ./dist/checkbox-button/package.json
# - config_path: ./dist/checkbox-group/package.json
# - config_path: ./dist/col/package.json
# - config_path: ./dist/collapse/package.json
# - config_path: ./dist/collapse-item/package.json
# - config_path: ./dist/collapse-transition/package.json
# - config_path: ./dist/common/package.json
# - config_path: ./dist/company/package.json
# - config_path: ./dist/container/package.json
# - config_path: ./dist/country/package.json
# - config_path: ./dist/credit-card/package.json
# - config_path: ./dist/credit-card-form/package.json
# - config_path: ./dist/crop/package.json
# - config_path: ./dist/currency/package.json
# - config_path: ./dist/date-panel/package.json
# - config_path: ./dist/date-picker/package.json
# - config_path: ./dist/date-range/package.json
# - config_path: ./dist/date-table/package.json
# - config_path: ./dist/dept/package.json
# - config_path: ./dist/detail-page/package.json
# - config_path: ./dist/dialog-box/package.json
# - config_path: ./dist/drop-roles/package.json
# - config_path: ./dist/drop-times/package.json
# - config_path: ./dist/dropdown/package.json
# - config_path: ./dist/dropdown-item/package.json
# - config_path: ./dist/dropdown-menu/package.json
# - config_path: ./dist/espace/package.json
# - config_path: ./dist/exception/package.json
# - config_path: ./dist/file-upload/package.json
# - config_path: ./dist/floatbar/package.json
# - config_path: ./dist/form/package.json
# - config_path: ./dist/form-item/package.json
# - config_path: ./dist/fullscreen/package.json
# - config_path: ./dist/fall-menu/package.json
# - config_path: ./dist/grid/package.json
# - config_path: ./dist/grid-column/package.json
# - config_path: ./dist/grid-manager/package.json
# - config_path: ./dist/grid-toolbar/package.json
# - config_path: ./dist/hrapprover/package.json
# - config_path: ./dist/icon/package.json
# - config_path: ./dist/image/package.json
# - config_path: ./dist/image-viewer/package.json
# - config_path: ./dist/input/package.json
# - config_path: ./dist/ip-address/package.json
# - config_path: ./dist/layout/package.json
# - config_path: ./dist/link/package.json
# - config_path: ./dist/link-menu/package.json
# - config_path: ./dist/list/package.json
# - config_path: ./dist/loading/package.json
# - config_path: ./dist/locale/package.json
# - config_path: ./dist/locales/package.json
# - config_path: ./dist/logon-user/package.json
# - config_path: ./dist/logout/package.json
# - config_path: ./dist/milestone/package.json
# - config_path: ./dist/mini-picker/package.json
# - config_path: ./dist/modal/package.json
# - config_path: ./dist/month-range/package.json
# - config_path: ./dist/month-table/package.json
# - config_path: ./dist/nav-bar/package.json
# - config_path: ./dist/nav-menu/package.json
# - config_path: ./dist/notify/package.json
# - config_path: ./dist/numeric/package.json
# - config_path: ./dist/option/package.json
# - config_path: ./dist/option-group/package.json
# - config_path: ./dist/pager/package.json
# - config_path: ./dist/pager-item/package.json
# - config_path: ./dist/panel/package.json
# - config_path: ./dist/picker/package.json
# - config_path: ./dist/picker-column/package.json
# - config_path: ./dist/pop-upload/package.json
# - config_path: ./dist/popeditor/package.json
# - config_path: ./dist/popover/package.json
# - config_path: ./dist/popup/package.json
# - config_path: ./dist/progress/package.json
# - config_path: ./dist/pull-refresh/package.json
# - config_path: ./dist/radio/package.json
# - config_path: ./dist/radio-button/package.json
# - config_path: ./dist/radio-group/package.json
# - config_path: ./dist/rate/package.json
# - config_path: ./dist/roles/package.json
# - config_path: ./dist/row/package.json
# - config_path: ./dist/scroll-text/package.json
# - config_path: ./dist/scrollbar/package.json
# - config_path: ./dist/search/package.json
# - config_path: ./dist/select/package.json
# - config_path: ./dist/select-dropdown/package.json
# - config_path: ./dist/slide-bar/package.json
# - config_path: ./dist/slider/package.json
# - config_path: ./dist/split/package.json
# - config_path: ./dist/steps/package.json
# - config_path: ./dist/svg-icon/package.json
# - config_path: ./dist/switch/package.json
# - config_path: ./dist/tab-item/package.json
# - config_path: ./dist/tabbar/package.json
# - config_path: ./dist/tabbar-item/package.json
# - config_path: ./dist/table/package.json
# - config_path: ./dist/tabs/package.json
# - config_path: ./dist/tag/package.json
# - config_path: ./dist/text-popup/package.json
# - config_path: ./dist/time/package.json
# - config_path: ./dist/time-line/package.json
# - config_path: ./dist/time-panel/package.json
# - config_path: ./dist/time-picker/package.json
# - config_path: ./dist/time-range/package.json
# - config_path: ./dist/time-select/package.json
# - config_path: ./dist/time-spinner/package.json
# - config_path: ./dist/toggle-menu/package.json
# - config_path: ./dist/tooltip/package.json
# - config_path: ./dist/top-box/package.json
# - config_path: ./dist/transfer/package.json
# - config_path: ./dist/transfer-panel/package.json
# - config_path: ./dist/tree/package.json
# - config_path: ./dist/tree-menu/package.json
# - config_path: ./dist/upload/package.json
# - config_path: ./dist/upload-dragger/package.json
# - config_path: ./dist/upload-list/package.json
# - config_path: ./dist/user/package.json
# - config_path: ./dist/user-account/package.json
# - config_path: ./dist/user-contact/package.json
# - config_path: ./dist/user-head/package.json
# - config_path: ./dist/user-link/package.json
# - config_path: ./dist/wizard/package.json
# - config_path: ./dist/year-table/package.json
36 changes: 36 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env sh
if [ -z "$husky_skip_init" ]; then
debug () {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}

readonly hook_name="$(basename -- "$0")"
debug "starting $hook_name..."

if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi

if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi

readonly husky_skip_init=1
export husky_skip_init
sh -e "$0" "$@"
exitCode="$?"

if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi

if [ $exitCode = 127 ]; then
echo "husky - command not found in PATH=$PATH"
fi

exit $exitCode
fi
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
npx --no-install commitlint --edit
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npx lint-staged
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@huawei:registry=https://npm.cloudartifact.dgg.dragon.tools.huawei.com/artifactory/api/npm/npm-cbcbigate/
_auth=Y2JjYmlnYXRlOkh1YXdlaUAxMjM=
registry=https://npm.inhuawei.com/
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- 报告[新缺陷](https://github.com/opentiny/tiny-vue/issues/new?template=bug-report.yml)
-[已有缺陷](https://github.com/opentiny/tiny-vue/labels/bug)提供更详细的信息,比如补充截图、提供更详细的复现步骤、提供最小可复现demo链接等
- 提交 Pull requests 修复文档中的错别字或让文档更清晰和完善
- 添加官方小助手微信 opentiny,加入技术交流群参与讨论
- 添加官方小助手微信 opentiny-official,加入技术交流群参与讨论

当你亲自使用 TinyVue 组件库,并参与多次以上形式的贡献,对 TinyVue 逐渐熟悉之后,可以尝试做一些更有挑战的事情,比如:

Expand Down Expand Up @@ -63,7 +63,7 @@ npm run dev:vue2
- 请确保你已经完成本地启动中的步骤,并能正常访问:[http://127.0.0.1:5173/](http://127.0.0.1:5173/)
- 创建新分支 `git checkout -b username/feature1`,分支名字建议为 `username/feat-xxx` / `username/fix-xxx`
- 本地编码
- 遵循 Commit Message Format 规范进行提交,不符合提交规范的 PR 将不会被合并
- 遵循 [Commit Message Format](https://www.conventionalcommits.org/zh-hans/v1.0.0/) 规范进行提交,不符合提交规范的 PR 将不会被合并
- 提交到远程仓库:git push origin branchName
- (可选)同步上游仓库 dev 分支最新代码:git pull upstream dev
- 打开 TinyVue 代码仓库的 [Pull requests](https://github.com/opentiny/tiny-vue/pulls) 链接,点击 New pull request 按钮提交 PR
Expand All @@ -77,5 +77,5 @@ npm run dev:vue2

如果你对我们的开源项目感兴趣,欢迎通过以下方式加入我们的开源社区。

- 添加官方小助手微信:opentiny,加入我们的技术交流群
- 添加官方小助手微信:opentiny-official,加入我们的技术交流群
- 加入邮件列表:[email protected]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { Button as TinyButton } from '@opentiny/vue'
```shell
git clone [email protected]:opentiny/tiny-vue.git
cd tiny-vue
npm i
npm i --legacy-peer-deps

# 启动 Vue3 项目
npm run dev:vue3
Expand Down
15 changes: 11 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@

if [ ! $version ];
then npm version 0.1.0-`date "+%Y%m%d%H%M%S"`;
else npm version ${version};
else npm version $version;
fi

npm run bootstrap
npm run build:vue3
npm run release3
npm install

if [ ! $componentName ];
then
npm run build:vue$vueVersion
else
npm run buildfuxi:vue$vueVersion
fi

npm run releasefuxi$vueVersion

if [ $? -ne 0 ]
then
Expand Down
5 changes: 2 additions & 3 deletions build/build-entry-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ const buildFullRuntime = (buildType) => {
fs.writeFileSync(outputPath, output)

utils.logGreen(`npm run build:entry done. [${outputDir}/${buildType}.js]`)
}

;['core', 'base', 'chart'].forEach(buildFullRuntime)
};
['core', 'base', 'chart'].forEach(buildFullRuntime)
4 changes: 2 additions & 2 deletions build/build-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const createEntry = (mode) => {
})

fs.writeFileSync(OUTPUT_PATH, output)
}
;['all', 'pc', 'mobile'].forEach(createEntry)
};
['all', 'pc', 'mobile'].forEach(createEntry)

utils.logGreen(`npm run build:entry done. [${outputDir}/index.js,${outputDir}/pc.js,${outputDir}/mobile.js]`)
4 changes: 2 additions & 2 deletions build/build-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const inputOptions = {
// 如果打包文件中包含 jsx 语法, commonjs 必须放置在 babel 配置下面,否则会报错 PLUGIN_ERROR
commonjs()
],
external: (deps) => /^@opentiny[\\/]-vue-common/.test(deps)
external: (deps) => /^@huawei[\\/]tiny-vue-common/.test(deps)
}

const outputOptions = {
Expand All @@ -49,7 +49,7 @@ const build = (components) => {
if (component.path === 'index.js') {
inputs.external = (deps) => !deps.includes('index.js')
} else {
inputs.external = (deps) => /^@opentiny[\\/]vue-common/.test(deps)
inputs.external = (deps) => /^@huawei[\\/]tiny-vue-common/.test(deps)
}

rollup
Expand Down
4 changes: 2 additions & 2 deletions build/build-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const replaceConstant = {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}

if (process.env.tiny_mode === 'pc') {
if (process.env.TINY_MODE === 'pc') {
outputOptions.format = 'umd'
replaceConstant['process.env.TINY_MODE'] = JSON.stringify(process.env.tiny_mode)
replaceConstant['process.env.TINY_MODE'] = JSON.stringify(process.env.TINY_MODE)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion build/build-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const TAG = process.argv[3] === 'false' ? '' : process.argv[3]
const packages = path.join(ROOT_PATH, 'packages')
const pkgJsonFileName = 'package.json'
const { logGreen } = require('./utils')
const tinyVueReg = /@opentiny\//
const tinyVueReg = /@huawei\//

const targetVersion = process.argv[2] || JSON.parse(fs.readFileSync(path.join(ROOT_PATH, pkgJsonFileName)).toString()).version

Expand Down
Loading

0 comments on commit f41a593

Please sign in to comment.