Skip to content

Commit

Permalink
feat: merge recent dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kongshan committed Jan 15, 2021
2 parents ee4beff + 0bc8cae commit 5f05458
Show file tree
Hide file tree
Showing 76 changed files with 6,214 additions and 35,157 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
node_modules
storybook-static
lib
dist
dist
.temporary_files
coverage
package-lock.json
88 changes: 41 additions & 47 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,52 @@
# Read more: https://docs.gitlab.com/12.7/ee/ci/yaml/README.html

cache:
paths:
- node_modules/
paths:
- .yarn
- node_modules/

# 当 merge_requests, master, dev, test 分支时会执行依赖安装
before_script:
- "npm cache verify"
- "npm install --unsafe-perm=true --allow-root"
- yarn install --cache-folder .yarn

stages:
- lint
- lintdoc
- check-types
- test
- build_deploy

# 当 merge_requests 执行 eslint 检查
code_quality:
stage: lint
script:
- npm run lint
only:
- merge_requests
- lint
- lint_doc
- check_types
- test
- build_deploy
- code_analysis

code_quality:
stage: lint
script:
- yarn lint
only:
- merge_requests

# 当 merge_requests 执行 tsc 类型检查
check_types:
stage: check-types
script:
- npm run check-types
only:
- merge_requests
stage: check_types
script:
- yarn check-types
only:
- merge_requests

# 当 merge_requests 有更时会执行单元测试任务
test:
stage: test
script:
- npm run test
only:
- merge_requests
stage: test
script:
- yarn test
only:
- merge_requests
- dev

#执行 MD 文档校验, 为 doc 或者 master 命名当分支更新时才会触发
doc_quality:
stage: lintdoc
script:
- npm run lint-doc
only:
- /doc(s)|release/
- master

# 更新部署
build_deploy: # deploy environment
stage: build_deploy
script:
- npm run deploy
only:
- /master/
stage: lint_doc
script:
- yarn lint-doc
only:
- /doc(s)|release/
- master

build_deploy:
stage: build_deploy
script:
- yarn deploy
only:
- dev
6 changes: 5 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ setupTests.js
storyshots.test.js
tsconfig.build.json
tsconfig.json
dist
dist
gulpfile.js
coverage
css-plugin.js
yarn.lock
44 changes: 43 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,48 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.0.2](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/compare/v2.0.1...v2.0.2) (2021-01-05)


### Bug Fixes

* fix css demand load error due to styles name ([781691a](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/781691a))
* fix ellipsisText style ([1dbe3ae](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/1dbe3ae))


### Build System

* **package:** update some pkg version ([c41e1a2](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/c41e1a2))


### Features

* codesanbox example add ([1d8125e](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/1d8125e))



### [2.0.1](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/compare/v2.0.0...v2.0.1) (2020-12-03)


### Bug Fixes

* del useless easy-select files ([af9401f](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/af9401f))
* fix command word ([3b4fed4](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/3b4fed4))
* fix task exec order ([4171d11](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/4171d11))


### Build System

* add gulpfile in npmignore ([5e412ef](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/5e412ef))
* fix Load missing styles on demand ([bdbb319](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/bdbb319))


### Features

* **gitlab-ci:** update config ([9736168](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/9736168))



## [2.0.0](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/compare/v1.4.1...v2.0.0) (2020-10-30)


Expand Down Expand Up @@ -50,7 +92,7 @@ All notable changes to this project will be documented in this file. See [standa

### Tests

* **multiSearchInput:** 解决晨风提的键盘事件mockFunction无法触发的问题 ([b59fa20](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/b59fa20))
* **multiSearchInput:** 解决晨风提的键盘事件 mockFunction 无法触发的问题 ([b59fa20](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/b59fa20))
* add easySelect test ([4201cf4](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/4201cf4))
* correct import form ([df20482](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/df20482))
* update reference path ([b41e292](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/commit/b41e292))
Expand Down
120 changes: 120 additions & 0 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# dt-react-component

[![NPM version][npm-image]][npm-url] [![NPM downloads][download-img]][download-url]

[npm-image]: https://img.shields.io/npm/v/dt-react-component.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/dt-react-component

[download-img]: https://img.shields.io/npm/dm/dt-react-component.svg?style=flat
[download-url]: https://www.npmjs.com/package/dt-react-component

[English](./README.md) | 简体中文

基于 [ant-design](https://github.com/ant-design/ant-design) 的 React UI 组件库。 主要用于中,后台产品。我们的目标是**满足更具体的业务场景组件**。 当然,我们也有基于原生 javascript 实现的业务组件,例如**ContextMenu****KeyEventListener**等。

## 何时使用
+ 当发现其他组件库提供的基本组件不符合当前的业务场景,并且需要基于这些基本组件实现功能时,可以考虑使用 dt-react-component 解决问题。
+ 当业务复杂时,将沉淀越来越多的业务组件。 为了更好地管理组件并减少代码的冗余,可以使用 dt-react-component。 当然,我们欢迎 PR。 我们也将及时审查和合并常见的业务场景组件。

## 安装

```js
// use npm
npm install dt-react-component

// use yarn
yarn add dt-react-component
```

## 使用

```js
import { Circle, GoBack } from 'dt-react-component'
const App = () => (
<>
<Circle type='finished'/>
<GoBack url='/api/manage' />
</>
);
```
并手动导入样式:

```js
import 'dt-react-component/lib/style/index.css'

// or
import 'dt-react-component/lib/style/index.scss'

```

### 按需加载

下面两种方式都可以只加载用到的组件。
+ 我们强烈建议您使用 [babel-plugin-treasure](https://github.com/DTStack/babel-plugin-treasure) 完全适配 dt-react-component 的插件。

```js
// .babelrc or babel-loader option
"plugins": [
[
"treasure",
{
"libraryName": "dt-react-component",
"libraryDirectory": "lib",
"style": "css" // `style: true` Will load the scss file
}
]
]

```

然后只需从 dt-react-component 引入模块即可,无需单独引入样式。等同于下面手动引入的方式。

```js
// babel-plugin-treasure will help you load JS and CSS
import { ContextMenu } from 'dt-react-component';
```
更多请见 [babel-plugin-treasure](https://github.com/DTStack/babel-plugin-treasure).

+ 手动引入

```js
import MarkdownRender from 'dt-react-component/lib/markdownRender'; // Load JS
import 'dt-react-component/lib/markdownRender/style/css'; // Load CSS
// import 'dt-react-component/lib/markdownRender/style'; // Load SCSS
```

### TypeScript
dt-react-component 完全基于 TypeScript 编写,具有完整的类型定义,因此您将拥有更好的体验。

### 预览地址
您可以在此地址查看最新的组件和文档。

[https://dtstack.github.io/dt-react-component/](https://dtstack.github.io/dt-react-component/)


## 开发

本地克隆:

```js
$ git clone ssh://git@gitlab.prod.dtstack.cn:10022/dt-insight-front/infrastructure/dt-react-component.git
$ cd dt-react-component
$ npm install
$ npm run storybook
```
打开浏览器并访问 [http://127.0.0.1:9001](http://127.0.0.1:9001),我们基于 stroybook 管理组件。 更多信息请访问 [Storybook](https://storybook.js.org/).

## 路线图
+ 支持和改进更多组件
+ 国际化语言支持
+ 支持主题定制

## 贡献

我们欢迎所有贡献。 您可以将任何想法提交为 [pull requests](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/merge_requests) 或者 [issues](http://gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/dt-react-component/issues).

最后,感谢我们所有 [contributors](https://github.com/DTStack/dt-react-component/graphs/contributors)

## 许可证

ISC
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# dt-react-component

React UI component library based on ant-design. Mainly used for middle and back-end products. Most importantly, its purpose is not to replace excellent component libraries such as ant-design and element-ui. Our goal is to **meet more specific and more specific business scenario components**. Of course, we also have excellent business components based on native javascript, such as **ContextMenu**, **KeyEventListener** and so on.
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-img]][download-url]

[npm-image]: https://img.shields.io/npm/v/dt-react-component.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/dt-react-component

[download-img]: https://img.shields.io/npm/dm/dt-react-component.svg?style=flat
[download-url]: https://www.npmjs.com/package/dt-react-component

English | [简体中文](./README-zh_CN.md)

React UI component library based on [ant-design](https://github.com/ant-design/ant-design). Mainly used for middle and back-end products. Our goal is to **meet more specific and more specific business scenario components**. Of course, we also have excellent business components based on native javascript, such as **ContextMenu**, **KeyEventListener** and so on.

## When to use
+ When you find that the basic components provided by other component libraries do not meet the current business scenario, and you need to implement functions based on the basic components, you can use dt-react-component to solve the problem.
Expand Down
Loading

0 comments on commit 5f05458

Please sign in to comment.