Skip to content

Commit 9be54a5

Browse files
committed
jest
0 parents  commit 9be54a5

File tree

210 files changed

+28845
-0
lines changed

Some content is hidden

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

210 files changed

+28845
-0
lines changed

.babelrc

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"presets": [
3+
[
4+
"env"
5+
],
6+
"stage-0",
7+
"react"
8+
],
9+
"plugins": [
10+
"transform-runtime",
11+
"transform-decorators-legacy",
12+
[
13+
"import",
14+
{
15+
"libraryName": "antd",
16+
"style": true
17+
}
18+
]
19+
],
20+
"env": {
21+
"test": {
22+
"presets": [["env"], "react", "stage-0"],
23+
"plugins": ["transform-runtime", "transform-decorators-legacy"]
24+
}
25+
}
26+
}

.circleci/config.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
version: 2
2+
3+
references:
4+
container_config: &container_config
5+
docker:
6+
- image: circleci/node:8
7+
working_directory: ~/react
8+
9+
attach_workspace: &attach_workspace
10+
attach_workspace:
11+
at: ~/react
12+
13+
react_16: &react_16
14+
environment:
15+
REACT: 16
16+
17+
workflow: &workflow
18+
jobs:
19+
- setup:
20+
filters:
21+
branches:
22+
ignore: gh-pages
23+
- testing:
24+
requires:
25+
- setup
26+
- lint:
27+
requires:
28+
- setup
29+
- jest:
30+
requires:
31+
- setup
32+
33+
34+
jobs:
35+
setup:
36+
<<: *container_config
37+
steps:
38+
- checkout
39+
- run: node -v
40+
- run: npm -v
41+
- run: npm install
42+
- run:
43+
command: |
44+
set +eo
45+
npm ls
46+
true
47+
- persist_to_workspace:
48+
root: ~/react
49+
paths:
50+
- node_modules
51+
52+
testing:
53+
<<: *container_config
54+
steps:
55+
- checkout
56+
- *attach_workspace
57+
- run: npm run testing
58+
- run: node ./scripts/webpack.testing.config.js
59+
- persist_to_workspace:
60+
root: ~/react
61+
paths:
62+
- dist
63+
64+
65+
lint:
66+
<<: *container_config
67+
steps:
68+
- checkout
69+
- *attach_workspace
70+
- run: npm run lint
71+
72+
jest:
73+
<<: *container_config
74+
steps:
75+
- checkout
76+
- *attach_workspace
77+
- run: npm run test
78+
79+
orbs:
80+
codecov: codecov/[email protected]
81+
82+
83+
workflows:
84+
version: 2
85+
build_test:
86+
<<: *workflow
87+
nightly:
88+
<<: *workflow
89+
triggers:
90+
- schedule:
91+
cron: "0 0 * * *"
92+
filters:
93+
branches:
94+
only:
95+
- master

.eslintignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# /node_modules/* and /bower_components/* ignored by default
2+
3+
/*
4+
!app
5+
6+
/test
7+
8+
/app/components/draw/__mocks__/draw.js
9+
10+
/app/configs/__mocks__/ajax.js
11+
12+
# app/configs
13+
# app/components
14+
# app/pages

.eslintrc.json

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"extends": "airbnb",
3+
"env": {
4+
"browser": true,
5+
"node": true,
6+
"es6": true
7+
},
8+
"settings": {
9+
"import/core-modules": [
10+
"components",
11+
"actions",
12+
"api",
13+
"reducers",
14+
"utils",
15+
"constants"
16+
]
17+
},
18+
"parser": "babel-eslint",
19+
"parserOptions": {
20+
"ecmaFeatures": {
21+
"jsx": true,
22+
"experimentalObjectRestSpread": true
23+
}
24+
},
25+
"rules": {
26+
"linebreak-style": "off",
27+
"func-names": 0,
28+
"max-len": [
29+
"warn",
30+
200,
31+
4,
32+
{
33+
"comments": 150
34+
}
35+
],
36+
"indent": [
37+
"error",
38+
2,
39+
{
40+
"SwitchCase": 1
41+
}
42+
],
43+
"react/jsx-indent": [
44+
2,
45+
2
46+
],
47+
"semi": 0,
48+
"react/sort-comp": 0,
49+
"react/prop-types": 0,
50+
"react/prefer-es6-class": 0,
51+
"react/prefer-stateless-function": 0,
52+
"react/jsx-first-prop-new-line": 0,
53+
"react/jsx-filename-extension": 0,
54+
"no-return-assign": 0,
55+
"react/no-multi-comp": 0,
56+
"array-callback-return": 0,
57+
"no-underscore-dangle": 0,
58+
"no-bitwise": [
59+
"error",
60+
{
61+
"allow": [
62+
"~"
63+
]
64+
}
65+
],
66+
"no-plusplus": 1,
67+
"no-unused-expressions": [
68+
"warn",
69+
{
70+
"allowShortCircuit": true,
71+
"allowTernary": true
72+
}
73+
],
74+
"import/no-unresolved": 0,
75+
"import/no-extraneous-dependencies": 0,
76+
"jsx-a11y/no-static-element-interactions": 0,
77+
"jsx-a11y/img-has-alt": 0,
78+
"no-unused-vars": [
79+
"warn",
80+
{
81+
"vars": "all",
82+
"args": "none"
83+
}
84+
],
85+
"react/no-unused-state": [
86+
"warn"
87+
],
88+
"no-param-reassign": [
89+
"error",
90+
{
91+
"props": false
92+
}
93+
],
94+
"object-shorthand": 0,
95+
"jsx-a11y/anchor-is-valid": 0,
96+
"react/no-array-index-key": 0,
97+
"jsx-a11y/click-events-have-key-events": 0,
98+
"import/extensions": 0,
99+
"no-debugger": "off",
100+
"react/jsx-closing-tag-location": 0,
101+
"import/prefer-default-export": 0,
102+
"react/forbid-prop-types": 1,
103+
"class-methods-use-this": 0,
104+
"consistent-return": 1,
105+
"import/first": 1,
106+
"no-console":"off",
107+
"prefer-destructuring": [
108+
"warn"
109+
],
110+
"object-curly-newline": [
111+
"error",
112+
{
113+
"minProperties": 5,
114+
"consistent": true,
115+
"multiline":true
116+
}
117+
]
118+
},
119+
"plugins": [
120+
"jsx-a11y"
121+
]
122+
}

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.js eol=lf
2+
*.json eol=lf
3+
*.jsx eol=lf
4+
*.ts eol=lf

.gitignore

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# vscode
7+
jsconfig.json
8+
dist
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# node-waf configuration
29+
.lock-wscript
30+
31+
# Compiled binary addons (http://nodejs.org/api/addons.html)
32+
build/Release
33+
34+
# Dependency directories
35+
node_modules
36+
jspm_packages
37+
38+
# Optional npm cache directory
39+
.npm
40+
41+
# Optional REPL history
42+
.node_repl_history
43+
44+
#mac
45+
.DS_Store
46+
47+
#vscode
48+
.vscode
49+
/.idea/
50+
51+
#eslint
52+
.eslintcache
53+
54+
#cashe
55+
.cache
56+
57+
#app/components/condition1.0
58+
59+
#don't upload node_modules.rar
60+
node_modules.rar

.lintstagedrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"linters": {
3+
"app/**/*.js": [
4+
"npm run lint",
5+
"git add"
6+
]
7+
}
8+
}

.travis.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: node_js
2+
node_js:
3+
- '8'
4+
cache:
5+
directories:
6+
- node_modules
7+
8+
install:
9+
- npm install
10+
11+
script:
12+
- 'npm run test:report'

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017-present, dupi, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

0 commit comments

Comments
 (0)