Skip to content

Commit

Permalink
feat: init repo with code of v5
Browse files Browse the repository at this point in the history
  • Loading branch information
awmleer committed Jul 20, 2021
1 parent 7155859 commit 087a840
Show file tree
Hide file tree
Showing 267 changed files with 24,072 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
[
"@babel/preset-env",
{
"loose": true,
"modules": false
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": ["babel-plugin-transform-async-to-promises"],
"ignore": ["**/demos"]
}
5 changes: 5 additions & 0 deletions .dumi/theme/builtins/ApiTable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Api = () => {
return 'hello'
}

export default Api
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
55 changes: 55 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module.exports = {
'env': {
'browser': true,
'es6': true,
},
'extends': [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
'prettier/react',
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'project': 'tsconfig.json',
'sourceType': 'module',
},
'plugins': ['@typescript-eslint'],
'rules': {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/camelcase': 'off',
'react/prop-types': 'off',
'react/jsx-no-target-blank': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'no-case-declarations': 'off',
'no-prototype-builtins': 'off',
'@typescript-eslint/no-empty-function': 'off',
'no-inner-declarations': 'off',
'react/no-unescaped-entities': 'off',
'no-empty': [
'error',
{
allowEmptyCatch: true,
},
],
'no-constant-condition': [
'error',
{
checkLoops: false,
},
],
// 下面的是临时规则
'react/display-name': 'off',
},
settings: {
react: {
version: 'detect',
},
},
}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/node_modules/
/npm-debug.log
/yarn-error.log
/coverage/
.DS_Store
.doc
.umi
.umi-production

# build
/dist/
/lib/
/es/

# dumi assets meta data
/assets.json

/.vscode/
/.idea/
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
packages/**/*.md
packages/**/*.mdx
package.json
.umi
.umi-production
17 changes: 17 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
'semi': false,
'trailingComma': 'es5',
'bracketSpacing': false,
'tabWidth': 2,
'singleQuote': true,
'jsxBracketSameLine': false,
'jsxSingleQuote': true,
'quoteProps': 'preserve',
'arrowParens': 'avoid',
'overrides': [
{
'files': '.prettierrc',
'options': {'parser': 'json'},
},
],
}
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry "https://registry.npm.taobao.org"
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT LICENSE

Copyright (c) 2016-present Alipay.com, https://www.alipay.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ant Design Mobile

## 开发

```bash
# 安装依赖
$ yarn install

# 开发
$ yarn start
```
107 changes: 107 additions & 0 deletions config/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
export default {
mode: 'site',
title: 'Ant Design Mobile',
logo: 'https://gw.alipayobjects.com/mdn/rms_2ddd4c/afts/img/A*XGPHS5H4-GkAAAAAAAAAAAAAARQnAQ',
navs: [
{
title: '组件',
path: '/components',
},
{
title: '文档',
path: '/docs',
},
],
menus: {
'/docs': [
{
title: '使用文档',
children: ['quick-start'],
},
],
'/components': [
{
title: '基础组件',
children: ['button'],
},
{
title: '数据展示',
children: [
'notice-bar',
'water-mark',
'steps',
'index-bar',
'tag',
'desens-text',
'infinite-scroll',
'popover',
'ellipsis',
'badge',
'image',
'image-viewer',
'empty',
'card',
],
},
{
title: '数据录入',
children: [
'input',
'checkbox',
'radio',
'selector',
'switch',
'slider',
'picker',
'date-picker',
'form',
'cascader',
'search',
],
},
{
title: '反馈',
children: [
'dialog',
'loading',
'mask',
'result',
'toast',
'error',
'progress-bar',
'progress-circle',
'pull-to-refresh',
'action-sheet',
],
},
{
title: '导航和布局',
children: [
'list',
'tabs',
'space',
'grid',
'dropdown',
'popup',
'tab-bar',
'divider',
],
},
],
},
resolve: {
includes: ['docs', 'src', 'src/components'],
},
styles: [
`#root .__dumi-default-mobile-demo-layout {
padding: 0;
min-height: 100vh;
background: #f5f5f5;
}`,
],
themeConfig: {
hd: {
rules: [],
},
},
}
29 changes: 29 additions & 0 deletions docs/docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 快速上手

## 安装

```bash
$ npm install --save antd-mobile
# or
$ yarn add antd-mobile
```

## 引入

需要先在入口文件(例如 `app.ts`)中引入样式文件:

```js
import 'antd-mobile/lib/index.css'
```

如果是 2 倍布局的话(例如 750 高清方案),需要引入 2x 版本的样式文件:

```js
import 'antd-mobile/lib/[email protected]'
```

接下来就可以正常地使用组件了,例如:

```js
import {Button} from 'antd-mobile'
```
Loading

0 comments on commit 087a840

Please sign in to comment.