Skip to content

Commit 931df21

Browse files
committed
small change
1 parent 317d07d commit 931df21

File tree

1,869 files changed

+35707
-1
lines changed

Some content is hidden

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

1,869 files changed

+35707
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"loose": true,
7+
"module": false,
8+
"targets": {
9+
"browsers": [
10+
"ie >= 8",
11+
"Chrome >= 21",
12+
"Firefox >= 1",
13+
"Edge >= 13",
14+
"last 3 versions"
15+
]
16+
}
17+
}
18+
],
19+
"react",
20+
"stage-2"
21+
],
22+
"plugins": [
23+
"add-module-exports","transform-runtime", "transform-regenerator", "transform-decorators-legacy", "dynamic-import-webpack"
24+
]
25+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/dist
2+
/node_modules
3+
/server.js
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"extends": "airbnb",
3+
"parser": "babel-eslint",
4+
5+
"env": {
6+
"browser": true,
7+
"node": true
8+
},
9+
"globals": {
10+
"Babel": true,
11+
"React": true
12+
},
13+
"plugins": [
14+
"react"
15+
],
16+
"rules": {
17+
"indent": [2, 4, { "SwitchCase": 1 }],
18+
"object-curly-spacing": [0, "never"],
19+
"global-require": "off",
20+
"import/no-unresolved": "off",
21+
"no-console": "off",
22+
"no-debugger": "error",
23+
"no-underscore-dangle": "off",
24+
"no-new-func": "off",
25+
"no-param-reassign": "off",
26+
"react/prefer-stateless-function": "off",
27+
"react/no-multi-comp": "off",
28+
"react/jsx-no-bind": "off",
29+
"react/jsx-indent": "off",
30+
"react/jsx-first-prop-new-line": "off",
31+
"react/jsx-filename-extension": "off",
32+
"no-restricted-syntax": "off",
33+
"linebreak-style": "off",
34+
"no-bitwise": "off",
35+
"jsx-a11y/no-static-element-interactions": "off",
36+
"arrow-parens": "off",
37+
"consistent-return": "warn"
38+
},
39+
"settings": {
40+
"import/resolver": {
41+
"webpack": {
42+
"config": "webpack.config.dev.js"
43+
}
44+
}
45+
}
46+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
# Runtime data
8+
pids
9+
*.pid
10+
*.seed
11+
*.pid.lock
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
17+
# Compiled binary addons (https://nodejs.org/api/addons.html)
18+
dist/
19+
20+
# Dependency directories
21+
node_modules/
22+
23+
# Optional npm cache directory
24+
.npm
25+
26+
# Optional eslint cache
27+
.eslintcache
28+
29+
# Optional REPL history
30+
.node_repl_history
31+
32+
# Output of 'npm pack'
33+
*.tgz
34+
35+
# Yarn Integrity file
36+
.yarn-integrity
37+
38+
.yarn-error.log
39+
40+
# dotenv environment variables file
41+
.env
42+
43+
.idea
44+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 SAMPSON
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
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, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# 使用说明
2+
## 设计思想
3+
1. 所有功能按照业务模块化
4+
2. 模块里面包含models, view等等
5+
3. 可插拔, 不需要改路由, 最终访问路由和目录路径一一对应, 可以自由移除,添加一个模块而不需要改任何配置
6+
4. 所有页面都是按需加载
7+
5. 平时开发只需要关注模块开发以及模块所放的位置
8+
6. 所有功能模块非常灵活使用
9+
10+
11+
## 模块介绍
12+
1. 每个模块都是一个独立的应用, 也可以理解为一个完整的应用, 开发模式和以前一模一样, 一般开发一个需求都是新建一个模块
13+
2. 每个模块里面包含: views(对应页面), components(对应组件), assets(对应当前模块里面的资源), routes模块下面的子模块
14+
3. 模块之间是一种树型结构, 每个模块里面可以有的页面,也可以有子模块, 子模块目录名对应url的一个子路径, 切记当同时拥有自己的页面和子模块的时候, 页面的路由和模块名称不能重复
15+
4. 详细开发模块, 可以参考里面的src/routes/cartoon, 里面描述的比较清楚
16+
5. 模块根目录下的route.js 是打包时候确定的, 尽量不要在里面加入太多逻辑, 否则打包会比较大, 因为里面的内没不是按需加载的
17+
9. 切记模块与模块之间千万不要有任何依赖, 最多只能是数据共享, 那也只能是父模块与子模块之间的数据共享
18+
19+
20+
## 搭建持续集成环境
21+
1. clone 当前项目
22+
2. 修改deploy.sh文件中uri, pname两个变量值, 其中uri 代表最终部署到线下访问uri, pname代表构建后的压缩文件名(可以随意取名, 只要不与其它文件名冲突)
23+
3. 访问jenkins地址[jenkins](http://ci.mistong.com)并登陆
24+
4. 点击new item, 输入名称(英文),选择Freestyle project并确定
25+
5. 输入描述信息, source code management选择git, 输入git仓库地址
26+
6. 在Build Triggers选择Poll scm, 输入 H/3 * * * * 代表每三分钟检测一次git仓库, 可自行调整
27+
7. 在build 下拉选择execute shell
28+
8. 在输入框中输入
29+
~~~
30+
sh deploy #线上
31+
# sh deploy "235" #235环境
32+
~~~
33+
9. 点击确定新建完成
34+
35+
## 解决ie8/ie9 跨域问题
36+
37+
38+
## 优势
39+
1. 访问路径名即目录名
40+
2. 模块,结构清晰
41+
3. 模块按需加载
42+
4. 注册一个模块不需要改任代码
43+
5. 模块之间不产生任何依赖, 也不会影响别的模块
44+
6. 模块自动注入
45+
7. 页面按需加载
46+
8. 项目可以无限扩展
47+
9. 很容易多人协作
48+
10. 同时适应h5 pc, 也可以把他们放到一起管理
49+
50+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
uri="attainment/xinli"
3+
pname="xinli.tar.gz"
4+
yarn
5+
pwd
6+
if [ "$1"x = "235"x ]
7+
then
8+
yarn run build:235
9+
cd dist
10+
tar -zcf $pname *
11+
scp $pname buweiqiang@10.0.11.68:/home/wwwroot/frontend/tmp/
12+
ssh buweiqiang@10.0.11.68 "cd /home/wwwroot/frontend/ && rm -rf $uri && mkdir -p $uri && tar zxf tmp/$pname -C $uri"
13+
else
14+
yarn run build
15+
cd dist
16+
tar -zcf $pname *
17+
scp $pname buweiqiang@10.0.11.68:/home/wwwroot/frontend_release/tmp/
18+
ssh buweiqiang@10.0.11.68 "cd /home/wwwroot/frontend_release/ && rm -rf $uri && mkdir -p $uri && tar zxf tmp/$pname -C $uri"
19+
fi
20+
21+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"compilerOptions": {
3+
"experimentalDecorators": true
4+
}
5+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"name": "xinli",
3+
"version": "2.0.1",
4+
"description": "春哥",
5+
"main": "./server.js",
6+
"scripts": {
7+
"install": "npm install",
8+
"remove": "rimraf node_modules",
9+
"start": "cross-env NODE_ENV=production port=3000 node server.js",
10+
"dev": "cross-env NODE_ENV=development node server.js",
11+
"dev:es3": "cross-env NODE_ENV=development ES3=true node server.js",
12+
"build": "npm run clean && webpack --config webpack.config.prod.js",
13+
"build:sit": "npm run clean && cross-env EWT_ENV=sit webpack --config webpack.config.prod.js",
14+
"clean": "rimraf dist/*",
15+
"test": "eslint src && echo \"Error: no test specified\" && exit 1"
16+
},
17+
"author": "sampson",
18+
"license": "ISC",
19+
"dependencies": {
20+
"antd": "^1.11.6",
21+
"axios": "^0.18.0",
22+
"classnames": "^2.2.5",
23+
"console-polyfill": "^0.3.0",
24+
"echarts": "^4.1.0",
25+
"es5-shim": "^4.5.9",
26+
"es6-promise": "^3.0.2",
27+
"lodash": "^4.17.4",
28+
"react": "^0.14.9",
29+
"react-dom": "^0.14.9",
30+
"react-redux": "^5.0.1",
31+
"react-router": "2.3.0",
32+
"redux": "^3.6.0",
33+
"redux-logger": "^2.6.1"
34+
},
35+
"devDependencies": {
36+
"assets-webpack-plugin": "^3.5.0",
37+
"autoprefixer": "^9.4.6",
38+
"babel-core": "^6.26.3",
39+
"babel-eslint": "^8.2.2",
40+
"babel-loader": "^6.2.0",
41+
"babel-plugin-add-module-exports": "^0.1.2",
42+
"babel-plugin-dynamic-import-webpack": "^1.0.2",
43+
"babel-plugin-transform-decorators-legacy": "^1.3.5",
44+
"babel-plugin-transform-regenerator": "^6.26.0",
45+
"babel-plugin-transform-runtime": "^6.23.0",
46+
"babel-preset-env": "^1.7.0",
47+
"babel-preset-react": "^6.24.1",
48+
"babel-preset-stage-2": "^6.24.1",
49+
"compression": "^1.7.2",
50+
"cross-env": "^5.1.4",
51+
"css-loader": "^0.26.1",
52+
"es3ify-webpack-plugin": "0.0.1",
53+
"eslint": "^4.19.0",
54+
"eslint-config-airbnb": "^15.1.0",
55+
"eslint-import-resolver-webpack": "^0.8.3",
56+
"eslint-loader": "^1.9.0",
57+
"eslint-plugin-import": "^2.9.0",
58+
"eslint-plugin-jsx-a11y": "^5.1.1",
59+
"eslint-plugin-react": "^7.1.0",
60+
"express": "^4.16.3",
61+
"extract-text-webpack-plugin": "^1.0.1",
62+
"file-loader": "^0.9.0",
63+
"html-webpack-plugin": "^3.1.0",
64+
"json-loader": "^0.5.4",
65+
"less": "^2.7.1",
66+
"less-loader": "^2.2.3",
67+
"postcss-loader": "^3.0.0",
68+
"redux-devtools": "^3.4.1",
69+
"redux-devtools-dock-monitor": "^1.1.3",
70+
"redux-devtools-log-monitor": "^1.4.0",
71+
"rimraf": "^2.5.3",
72+
"style-loader": "^0.13.1",
73+
"url-loader": "^0.5.7",
74+
"webpack": "^1.12.9",
75+
"webpack-dev-middleware": "^1.4.0",
76+
"webpack-hot-middleware": "^2.6.0"
77+
},
78+
"browserslist": [
79+
">0.2%",
80+
"not op_mini all"
81+
]
82+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** postcss-loader 解析器所需的配置文件 **/
2+
module.exports = {
3+
plugins: [require('autoprefixer')()]
4+
}

0 commit comments

Comments
 (0)