Skip to content

Commit

Permalink
update bisheng
Browse files Browse the repository at this point in the history
  • Loading branch information
jljsj33 committed Feb 15, 2019
1 parent e6ddf9f commit 2b511bb
Show file tree
Hide file tree
Showing 161 changed files with 1,225 additions and 12,120 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
_site
34 changes: 0 additions & 34 deletions .eslintrc

This file was deleted.

83 changes: 83 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
const eslintrc = {
extends: ['eslint-config-airbnb'],
env: {
browser: true,
node: true,
jasmine: true,
jest: true,
es6: true,
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
},
},
plugins: [
'markdown',
'react',
'babel',
],
rules: {
'func-names': 0,
'arrow-body-style': 0,
'react/sort-comp': 0,
'react/prop-types': 0,
'react/jsx-first-prop-new-line': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.md'] }],
'import/extensions': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
'prefer-destructuring': 0,
'no-param-reassign': 0,
'no-return-assign': 0,
'max-len': 0,
'consistent-return': 0,
'no-redeclare': 0,
'react/require-extension': 0,
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/anchor-has-content': 0,
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/no-noninteractive-element-interactions': 0,
'jsx-a11y/anchor-is-valid': 0,
'react/no-danger': 0,
'comma-dangle': ['error', 'always-multiline'],
'function-paren-newline': 0,
'object-curly-newline': 0,
'no-restricted-globals': 0,
'jsx-a11y/mouse-events-have-key-events': 0,
'react/jsx-no-target-blank': 0,
'react/no-find-dom-node': 0,
'react/no-unescaped-entities': 0,
'react/prefer-stateless-function': 0,
'import/no-webpack-loader-syntax': 0,
'react/forbid-prop-types': 0,
'react/destructuring-assignment': 0,
'react/no-access-state-in-setstate': 0,
'react/require-default-props': 0,
'jsx-a11y/accessible-emoji': 0
},
};

if (process.env.RUN_ENV === 'DEMO') {
eslintrc.globals = {
React: true,
ReactDOM: true,
mountNode: true,
};

Object.assign(eslintrc.rules, {
indent: 0,
'no-console': 0,
'no-plusplus': 0,
'eol-last': 0,
'prefer-rest-params': 0,
'react/no-multi-comp': 0,
'jsx-a11y/href-no-hash': 0,
'import/newline-after-import': 0,
});
}

module.exports = eslintrc;
22 changes: 22 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "stylelint-config-standard",
"rules": {
"comment-empty-line-before": null,
"declaration-empty-line-before": null,
"function-comma-newline-after": null,
"function-name-case": null,
"function-parentheses-newline-inside": null,
"function-max-empty-lines": null,
"function-whitespace-after": null,
"indentation": null,
"number-leading-zero": null,
"number-no-trailing-zeros": null,
"rule-empty-line-before": null,
"selector-combinator-space-after": null,
"selector-list-comma-newline-after": null,
"selector-pseudo-element-colon-notation": null,
"unit-no-unknown": null,
"value-list-max-empty-lines": null,
"no-descending-specificity": null
}
}
2 changes: 1 addition & 1 deletion exhibition/demo/list-sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ListSort 组件地址: [地址](https://github.com/ant-design/ant-motion/blob/
```jsx
import Icon from 'antd/lib/icon';
import PropTypes from 'prop-types';
import ListSort from '../../src/edit/template/components/ListSort';
import ListSort from '../../site/theme/template/other/ListSort';

const dataArray = [
{
Expand Down
2 changes: 1 addition & 1 deletion language/principle.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ english: Principle
<br/>

```__react
import Principle from '../src/theme/template/other/Principle';
import Principle from '../site/theme/template/other/Principle';
ReactDOM.render(<Principle />, mountNode);
```

Expand Down
6 changes: 3 additions & 3 deletions language/speed.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ english: Speed
> 需要注意:如果在可视窗口中消失的,属于点到点之间的运动,建议使用前后缓动,同理可视窗口中出现也一样。
```__react
import EaseExplain from '../src/theme/template/other/EaseExplain';
import EaseExplain from '../site/theme/template/other/EaseExplain';
ReactDOM.render(<EaseExplain
animation={{
left: 410, duration: 1000, repeat: -1,
Expand All @@ -84,7 +84,7 @@ ReactDOM.render(<EaseExplain
```

```__react
import EaseExplain from '../src/theme/template/other/EaseExplain';
import EaseExplain from '../site/theme/template/other/EaseExplain';
ReactDOM.render(<EaseExplain
title="2.单物体可视范围外进场的运动"
leftHide
Expand All @@ -97,7 +97,7 @@ ReactDOM.render(<EaseExplain
```

```__react
import EaseExplain from '../src/theme/template/other/EaseExplain';
import EaseExplain from '../site/theme/template/other/EaseExplain';
ReactDOM.render(<EaseExplain
title="3.单物体可视范围内出场的运动"
rightHide
Expand Down
97 changes: 48 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
{
"name": "ant-motion",
"version": "1.6.3",
"title": "Ant Motion",
"description": "react animation component",
"homepage": "http://motion.ant.design/",
"repository": {
"type": "git",
"url": "https://github.com/ant-design/ant-motion"
},
"license": "MIT",
"dependencies": {
"antd": "~3.6.2",
"deepcopy": "^0.6.3",
"enquire-js": "^0.1.1",
"file-saver": "^1.3.3",
"jsonml-to-react-component": "^0.2.6",
"jsonml.js": "^0.1.0",
"jszip": "^3.1.4",
"less-loader": "^4.0.5",
"prop-types": "15.5.x",
"raw-js-loader": "^1.4.0",
"raw-loader": "^0.5.1",
"rc-animate": "~2.4.4",
"rc-banner-anim": "~2.0.0",
"rc-drawer": "^1.5.0",
"rc-animate": "^2.6.0",
"rc-banner-anim": "^2.2.0",
"rc-drawer": "^1.7.0",
"rc-queue-anim": "~1.6.0",
"rc-scroll-anim": "~2.5.0",
"rc-texty": "^0.1.0",
"rc-tween-one": "~2.2.12",
"rc-tween-one": "^2.3.0"
},
"devDependencies": {
"antd": "^3.13.2",
"antd-tools": "^7.0.0",
"babel-eslint": "^10.0.1",
"bisheng": "^1.0.1",
"bisheng-plugin-antd": "^1.0.0",
"bisheng-plugin-description": "^0.1.4",
"bisheng-plugin-react": "^1.0.0",
"bisheng-plugin-toc": "^0.4.0",
"cross-env": "^5.1.1",
"enquire-js": "^0.1.1",
"eslint": "^5.4.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-loader": "^2.1.1",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-compat": "^2.6.2",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-markdown": "^1.0.0-beta.6",
"eslint-plugin-react": "^7.11.1",
"eslint-tinker": "^0.5.0",
"jsonml.js": "^0.1.0",
"pre-commit": "1.x",
"prop-types": "15.5.x",
"react": "^16.4.0",
"react-color": "^2.13.8",
"react-copy-to-clipboard": "~5.0.0",
"react-document-title": "^2.0.1",
"react-dom": "^16.4.0",
"react-router": "~3.0.0",
"react-sublime-video": "^0.2.0",
"to-style": "^1.3.3",
"tween-functions": "^1.2.0"
},
"devDependencies": {
"babel-eslint": "^8.0.1",
"babel-plugin-import": "^1.6.2",
"babel-plugin-transform-runtime": "^6.23.0",
"bisheng": "^0.26.0",
"bisheng-plugin-antd": "^0.15.0",
"bisheng-plugin-description": "^0.1.1",
"bisheng-plugin-react": "^0.5.0",
"bisheng-plugin-toc": "^0.4.0",
"bluebird": "^3.5.0",
"concurrently": "^3.5.0",
"dora-plugin-upload": "^0.3.1",
"eslint": "^4.9.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-markdown": "*",
"eslint-plugin-react": "^7.4.0",
"eslint-tinker": "^0.4.0",
"pre-commit": "1.x"
"stylelint": "^9.7.1",
"stylelint-config-standard": "^18.2.0"
},
"pre-commit": [
"lint"
],
"scripts": {
"start": "concurrently \"bisheng start -c ./src/bisheng.index.config.js --no-livereload\" \"bisheng start -c ./src/bisheng.edit.config.js --no-livereload\" \"bisheng start -c ./src/bisheng.templates.config.js --no-livereload\"",
"site": "concurrently \"bisheng build -c ./src/bisheng.index.config.js\" \"bisheng build -c ./src/bisheng.edit.config.js\" \"bisheng build -c ./src/bisheng.templates.config.js\"",
"re-site": "rm -rf _site && mkdir -p _site",
"deploy": "npm run re-site && npm run site && bisheng gh-pages --push-only",
"lint": "eslint ./src ./exhibition --ext '.js,.jsx'",
"demolint": "RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md'",
"eslint-fix": "eslint --fix ./src ./exhibition --ext '.js,.jsx'",
"test": "echo \"Error: no test specified\" && exit 1"
"start": "cross-env NODE_ENV=development bisheng start -c ./site/bisheng.index.config.js",
"build": "cross-env NODE_ENV=production bisheng build -c ./site/bisheng.index.config.js",
"site": "npm run build",
"deploy": "npm run site && bisheng gh-pages --push-only",
"lint": "npm run lint:es && npm run lint:style",
"lint:es": "eslint --fix --ext '.js,.jsx' site",
"lint:style": "stylelint --fix \"site/**/*.less\" --syntax less",
"lint:demo": "cross-env RUN_ENV=DEMO eslint ./ --ext '.md' -c ./.eslintrc.js",
"test": "npm run lint"
},
"theme": "./theme.js"
}
71 changes: 71 additions & 0 deletions site/bisheng.index.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

const path = require('path');
const replaceLib = require('antd-tools/lib/replaceLib');

const isDev = process.env.NODE_ENV === 'development';

function alertBabelConfig(rules) {
rules.forEach((rule) => {
if (rule.loader && rule.loader === 'babel-loader') {
if (rule.options.plugins.indexOf(replaceLib) === -1) {
rule.options.plugins.push(replaceLib);
}
// eslint-disable-next-line
rule.options.plugins = rule.options.plugins.filter(
plugin => !plugin.indexOf || plugin.indexOf('babel-plugin-add-module-exports') === -1,
);
} else if (rule.use) {
alertBabelConfig(rule.use);
}
});
}

module.exports = {
source: {
language: './language',
components: './components',
exhibition: './exhibition',
},
theme: './site/theme',
themeConfig: {},
htmlTemplate: './site/theme/static/index.html',
port: 8111,
lePathMapper(filePath) {
if (filePath === '/index.html') {
return ['/index.html', '/index-cn.html'];
}
if (filePath.endsWith('/index.html')) {
return [filePath, filePath.replace(/\/index\.html$/, '-cn/index.html')];
}
if (filePath !== '/404.html' && filePath !== '/index-cn.html') {
return [filePath, filePath.replace(/\.html$/, '-cn.html')];
}
return filePath;
},
doraConfig: {
verbose: true,
},
lessConfig: {
javascriptEnabled: true,
},
webpackConfig(config) {
config.resolve.alias = {
site: path.join(process.cwd(), 'site'),
'react-router': 'react-router/umd/ReactRouter',
};
if (isDev) {
// eslint-disable-next-line
config.devtool = 'source-map';
}
alertBabelConfig(config.module.rules);
return config;
},
devServerConfig: {
public: process.env.DEV_HOST || 'localhost',
disableHostCheck: !!process.env.DEV_HOST,
},

htmlTemplateExtraData: {
isDev,
},
};
File renamed without changes.
Loading

0 comments on commit 2b511bb

Please sign in to comment.