Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bornkiller/echarts-bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-xiao-jian committed Dec 17, 2017
2 parents 8f9a42a + b442e63 commit c2edd08
Show file tree
Hide file tree
Showing 10 changed files with 3,485 additions and 48 deletions.
40 changes: 38 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
{
"presets": ["es2015-bk"]
}
"presets": [
[
"env",
{
"modules": false,
"loose": true
}
],
"stage-3"
],
"env": {
"dev": {
"plugins": [
"transform-class-properties"
]
},
"prod": {
"plugins": [
"transform-runtime",
"transform-class-properties"
]
},
"test": {
"plugins": [
[
"istanbul",
{
"exclude": [
"**/*.spec.js",
"node_modules/**/*.js"
]
}
],
"transform-class-properties"
]
}
}
}
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# http://editorconfig.org/

root = true

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

[*.md]
trim_trailing_whitespace = false

[{.travis.yml,.gitlab-ci.yml,package.json}]
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
indent_size = 2
indent_style = space
15 changes: 9 additions & 6 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# eslint configuration
parser: babel-eslint
parserOptions:
ecmaVersion: 6
sourceType: module
ecmaFeatures:
experimentalObjectRestSpread: true
env:
browser: true
es6: true
jasmine: true
node: true
extends:
- 'eslint:recommended'
parserOptions:
ecmaVersion: 6
sourceType: module
ecmaFeatures:
experimentalObjectRestSpread: true
rules:
indent:
- error
Expand All @@ -21,6 +23,7 @@ rules:
quotes:
- error
- single
- allowTemplateLiterals: true
semi:
- error
- always
- always
33 changes: 30 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand All @@ -22,22 +25,46 @@ coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

/dist
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# IDE / OS
.idea
.DS_Store

# Production
dist
build
browser/*.js
browser/*.map
47 changes: 39 additions & 8 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand All @@ -22,25 +25,53 @@ coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Develop files
.babelrc
.eslintignore
.eslintrc.yml
karma.conf.js
rollup.config.js
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# IDE / OS
.idea
.DS_Store

# Develop only
browser
conf
test
/.editorconfig
/.eslintignore
/.eslintrc.yml
/.yarnclean
/*.config.js
/bs-config.js
/LICENSE
/yarn.lock
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
sudo: false
language: node_js
node_js:
- "6.0"
- 8
branches:
only:
- master
- /^Release.*$/
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
- npm install;
- npm install echarts;
script:
- npm run test-travis;
after_success:
- npm install coveralls@2.10.0 && cat ./coverage/lcov/lcov.info | coveralls
- npm install coveralls@2.10.0 && cat ./coverage/lcov/lcov.info | coveralls
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

echarts imperative programming bridge in MV* frontend framework.

## Break Changes
调整入口配置,默认为`commonjs`风格。

## 目标
前端`MV*`框架,共同点都是不提倡直接进行底层`DOM`操作,只能通过框架提供接口(如`angularjs`指令),访问原始元素,但是对待图表这种重`DOM`操作,使用数据同步的方式
进行,效率个人持保留意见。
Expand Down Expand Up @@ -48,4 +51,4 @@ instance.setOption({}).on('click', () => {}).connect(elem);
目前关联项目为基于`angularjs`的封装: [echarts-ng](https://github.com/bornkiller/echarts-ng)

## Contact
hjj491229492@hotmail.com
hjj491229492@hotmail.com
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "echarts-bridge",
"version": "0.5.0",
"description": "echarts imperative programming bridge in MV* frontend framework.",
"main": "dist/bridge.bundle.js",
"main": "dist/bridge.common.js",
"jsnext:main": "index.js",
"browser": "index.js",
"scripts": {
"prepublish": "rollup -c rollup.config.js",
"prepublish": "NODE_ENV=prod rollup -c rollup.config.js",
"test-travis": "karma start karma.conf.js --browsers Firefox --single-run"
},
"repository": {
Expand All @@ -24,7 +25,13 @@
},
"homepage": "https://github.com/bornkiller/echarts-bridge#readme",
"devDependencies": {
"babel-preset-es2015-bk": "^1.3.0",
"babel-eslint": "^7.2.3",
"babel-plugin-istanbul": "^4.1.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.5.2",
"babel-preset-stage-3": "^6.24.1",
"echarts": "^3.6.2",
"eslint": "^3.12.0",
"jasmine-core": "^2.5.2",
"karma": "^1.3.0",
Expand Down
36 changes: 16 additions & 20 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
/**
* @description - observable package rollup configuration
* @description - rollup configuration
* @author - bornkiller <hjj491229492@hotmail.com>
*/
import eslint from 'rollup-plugin-eslint';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';

export default {
const babel = require('rollup-plugin-babel');
const eslint = require('rollup-plugin-eslint');
const resolve = require('rollup-plugin-node-resolve');

module.exports = {
entry: 'index.js',
plugins: [
eslint({
include: ['index.js', 'src/*.js', 'test/*.js']
}),
resolve({ jsnext: true, main: true }),
commonjs({
include: 'node_modules/@bornkiller/**',
include: ['index.js', 'src/*.js']
}),
babel()
resolve(),
babel({
exclude: ['**/*.css', '**/*.scss'],
runtimeHelpers: true
})
],
moduleId: 'bk.echarts',
moduleName: 'bk.echarts',
external: ['echarts'],
globals: {
'echarts': 'echarts'
external: (id) => {
return ['echarts', 'babel-runtime'].some((name) => id.startsWith(name));
},
targets: [
{ format: 'umd', dest: 'dist/bridge.bundle.js' },
{ format: 'es', dest: 'dist/bridge.bundle.esm.js' }
{ dest: 'dist/bridge.common.js', format: 'cjs' }
]
};
};

0 comments on commit c2edd08

Please sign in to comment.