Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
9d5d8be4
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9d5d8be4
编写于
10月 31, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweak build.
上级
e4a010e6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
157 addition
and
61 deletion
+157
-61
.jshintrc
.jshintrc
+1
-0
build/.jshintrc
build/.jshintrc
+76
-0
build/build.js
build/build.js
+16
-13
build/config.js
build/config.js
+21
-8
build/helper.js
build/helper.js
+43
-40
未找到文件。
.jshintrc
浏览文件 @
9d5d8be4
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
"debug": false,
"debug": false,
"eqnull": true,
"eqnull": true,
"esversion": 6,
"esversion": 6,
"module": true,
"evil": true,
"evil": true,
"expr": true,
"expr": true,
"funcscope": false,
"funcscope": false,
...
...
build/.jshintrc
0 → 100644
浏览文件 @
9d5d8be4
{
"bitwise": false,
"camelcase": true,
"curly": true,
"eqeqeq": false,
"forin": false,
"immed": true,
"latedef": false,
"newcap": true,
"noarg": false,
"noempty": true,
"nonew": true,
"plusplus": false,
"quotmark": "single",
"regexp": false,
"undef": true,
"unused": "vars",
"strict": false,
"trailing": false,
"maxparams": 20,
"maxdepth": 6,
"maxlen": 200,
"asi": false,
"boss": false,
"debug": false,
"eqnull": true,
"esversion": 6,
"evil": true,
"expr": true,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": true,
"laxcomma": false,
"loopfunc": false,
"multistr": false,
"onecase": false,
"proto": false,
"regexdash": false,
"scripturl": false,
"smarttabs": false,
"shadow": true,
"sub": true,
"supernew": false,
"validthis": true,
"browser": true,
"couch": false,
"devel": true,
"dojo": false,
"jquery": true,
"mootools": false,
"node": false,
"nonstandard": false,
"prototypejs": false,
"rhino": false,
"wsh": false,
"nomen": false,
"onevar": false,
"passfail": false,
"white": false,
"varstmt": true,
"predef": [
"__DEV__",
"global",
"require",
"exports",
"Buffer",
"__dirname"
]
}
\ No newline at end of file
build/build.js
浏览文件 @
9d5d8be4
#!/usr/bin/env node
#!/usr/bin/env node
le
t
fsExtra
=
require
(
'
fs-extra
'
);
cons
t
fsExtra
=
require
(
'
fs-extra
'
);
le
t
{
resolve
}
=
require
(
'
path
'
);
cons
t
{
resolve
}
=
require
(
'
path
'
);
le
t
config
=
require
(
'
./config.js
'
);
cons
t
config
=
require
(
'
./config.js
'
);
le
t
commander
=
require
(
'
commander
'
);
cons
t
commander
=
require
(
'
commander
'
);
le
t
{
build
,
watch
}
=
require
(
'
./helper
'
);
cons
t
{
build
,
watch
}
=
require
(
'
./helper
'
);
function
run
()
{
function
run
()
{
...
@@ -60,11 +60,11 @@ function run() {
...
@@ -60,11 +60,11 @@ function run() {
let
configs
=
[];
let
configs
=
[];
if
(
isWatch
)
{
if
(
isWatch
)
{
watch
(
config
.
createECharts
Build
(
opt
));
watch
(
config
.
createECharts
(
opt
));
}
}
else
{
else
{
if
(
!
buildAll
)
{
if
(
!
buildAll
)
{
configs
=
[
config
.
createECharts
Build
(
opt
)];
configs
=
[
config
.
createECharts
(
opt
)];
}
}
else
{
else
{
configs
=
[];
configs
=
[];
...
@@ -76,15 +76,15 @@ function run() {
...
@@ -76,15 +76,15 @@ function run() {
{
min
:
true
,
lang
:
'
en
'
}
{
min
:
true
,
lang
:
'
en
'
}
].
forEach
(
function
(
opt
)
{
].
forEach
(
function
(
opt
)
{
[
''
,
'
simple
'
,
'
common
'
].
forEach
(
function
(
type
)
{
[
''
,
'
simple
'
,
'
common
'
].
forEach
(
function
(
type
)
{
configs
.
push
(
config
.
createECharts
Build
(
Object
.
assign
({
type
},
opt
)));
configs
.
push
(
config
.
createECharts
(
Object
.
assign
({
type
},
opt
)));
});
});
});
});
configs
.
push
(
configs
.
push
(
config
.
createBMap
Build
(
false
),
config
.
createBMap
(
false
),
config
.
createBMap
Build
(
true
),
config
.
createBMap
(
true
),
config
.
createDataTool
Build
(
false
),
config
.
createDataTool
(
false
),
config
.
createDataTool
Build
(
true
)
config
.
createDataTool
(
true
)
);
);
}
}
...
@@ -96,7 +96,10 @@ function run() {
...
@@ -96,7 +96,10 @@ function run() {
}
}
}
}
// Based on echarts dir/
/**
* @param {string} relativePath Based on echarts directory.
* @return {string} Absolute path.
*/
function
getPath
(
relativePath
)
{
function
getPath
(
relativePath
)
{
return
resolve
(
__dirname
,
'
../
'
,
relativePath
);
return
resolve
(
__dirname
,
'
../
'
,
relativePath
);
}
}
...
...
build/config.js
浏览文件 @
9d5d8be4
/* global require, __dirname, exports */
const
nodeResolvePlugin
=
require
(
'
rollup-plugin-node-resolve
'
);
const
uglifyPlugin
=
require
(
'
rollup-plugin-uglify
'
);
let
nodeResolvePlugin
=
require
(
'
rollup-plugin-node-resolve
'
);
const
{
dirname
,
resolve
}
=
require
(
'
path
'
);
let
uglifyPlugin
=
require
(
'
rollup-plugin-uglify
'
);
let
{
dirname
,
resolve
}
=
require
(
'
path
'
);
// Based on echarts/
// Based on echarts/
function
getPath
(
relativePath
)
{
function
getPath
(
relativePath
)
{
...
@@ -49,7 +47,7 @@ function getPlugins(min, lang) {
...
@@ -49,7 +47,7 @@ function getPlugins(min, lang) {
* @param {boolean} [opt.min=false]
* @param {boolean} [opt.min=false]
* @param {string} [opt.lang=undefined] null/undefined/'' or 'en' or 'fi' or ...
* @param {string} [opt.lang=undefined] null/undefined/'' or 'en' or 'fi' or ...
*/
*/
exports
.
createECharts
Build
=
function
(
opt
)
{
exports
.
createECharts
=
function
(
opt
)
{
opt
=
opt
||
{};
opt
=
opt
||
{};
let
postfixType
=
opt
.
type
?
'
.
'
+
opt
.
type
:
''
;
let
postfixType
=
opt
.
type
?
'
.
'
+
opt
.
type
:
''
;
let
postfixMin
=
opt
.
min
?
'
.min
'
:
''
;
let
postfixMin
=
opt
.
min
?
'
.min
'
:
''
;
...
@@ -74,7 +72,7 @@ exports.createEChartsBuild = function (opt) {
...
@@ -74,7 +72,7 @@ exports.createEChartsBuild = function (opt) {
/**
/**
* @param {boolean} [min=false]
* @param {boolean} [min=false]
*/
*/
exports
.
createBMap
Build
=
function
(
min
)
{
exports
.
createBMap
=
function
(
min
)
{
let
postfix
=
min
?
'
.min
'
:
''
;
let
postfix
=
min
?
'
.min
'
:
''
;
return
{
return
{
...
@@ -101,7 +99,7 @@ exports.createBMapBuild = function (min) {
...
@@ -101,7 +99,7 @@ exports.createBMapBuild = function (min) {
/**
/**
* @param {boolean} [min=false]
* @param {boolean} [min=false]
*/
*/
exports
.
createDataTool
Build
=
function
(
min
)
{
exports
.
createDataTool
=
function
(
min
)
{
let
postfix
=
min
?
'
.min
'
:
''
;
let
postfix
=
min
?
'
.min
'
:
''
;
return
{
return
{
plugins
:
getPlugins
(
min
),
plugins
:
getPlugins
(
min
),
...
@@ -123,3 +121,18 @@ exports.createDataToolBuild = function (min) {
...
@@ -123,3 +121,18 @@ exports.createDataToolBuild = function (min) {
}
}
};
};
};
};
/**
* @param {string} [absolutePath]
*/
exports
.
createSingleModule
=
function
(
absolutePath
)
{
return
{
plugins
:
getPlugins
(),
input
:
absolutePath
,
legacy
:
true
,
// Support IE8-
output
:
{
name
:
'
echarts
'
,
format
:
'
amd
'
}
};
};
build/helper.js
浏览文件 @
9d5d8be4
/* global require, exports */
const
rollup
=
require
(
'
rollup
'
);
let
rollup
=
require
(
'
rollup
'
);
/**
/**
* @param {Array.<Object>} configs A list of rollup configs:
* @param {Array.<Object>} configs A list of rollup configs:
...
@@ -14,45 +12,50 @@ let rollup = require('rollup');
...
@@ -14,45 +12,50 @@ let rollup = require('rollup');
* },
* },
* ...
* ...
* ]
* ]
* @return {Promise}
*/
*/
exports
.
build
=
function
(
configs
)
{
exports
.
build
=
function
(
configs
)
{
let
index
=
0
;
return
new
Promise
(
function
(
promiseResolve
,
promiseReject
)
{
let
index
=
0
;
buildSingle
();
buildSingle
();
function
buildSingle
()
{
function
buildSingle
()
{
let
singleConfig
=
configs
[
index
++
];
let
singleConfig
=
configs
[
index
++
];
if
(
!
singleConfig
)
{
if
(
!
singleConfig
)
{
return
;
promiseResolve
();
}
return
;
}
console
.
log
(
console
.
log
(
color
(
'
fgCyan
'
,
'
dim
'
)(
'
\n
Bundles
'
),
color
(
'
fgCyan
'
,
'
dim
'
)(
'
\n
Bundles
'
),
color
(
'
fgCyan
'
)(
singleConfig
.
input
),
color
(
'
fgCyan
'
)(
singleConfig
.
input
),
color
(
'
fgCyan
'
,
'
dim
'
)(
'
=>
'
),
color
(
'
fgCyan
'
,
'
dim
'
)(
'
=>
'
),
color
(
'
fgCyan
'
)(
singleConfig
.
output
.
file
),
color
(
'
fgCyan
'
)(
singleConfig
.
output
.
file
),
color
(
'
fgCyan
'
,
'
dim
'
)(
'
...
'
)
color
(
'
fgCyan
'
,
'
dim
'
)(
'
...
'
)
);
);
rollup
rollup
.
rollup
(
singleConfig
)
.
rollup
(
singleConfig
)
.
then
(
function
(
bundle
)
{
.
then
(
function
(
bundle
)
{
return
bundle
.
write
(
singleConfig
.
output
);
return
bundle
.
write
(
singleConfig
.
output
);
})
})
.
then
(
function
()
{
.
then
(
function
()
{
console
.
log
(
console
.
log
(
color
(
'
fgGreen
'
,
'
dim
'
)(
'
Created
'
),
color
(
'
fgGreen
'
,
'
dim
'
)(
'
Created
'
),
color
(
'
fgGreen
'
)(
singleConfig
.
output
.
file
),
color
(
'
fgGreen
'
)(
singleConfig
.
output
.
file
),
color
(
'
fgGreen
'
,
'
dim
'
)(
'
successfully.
'
)
color
(
'
fgGreen
'
,
'
dim
'
)(
'
successfully.
'
)
);
);
buildSingle
();
buildSingle
();
})
})
.
catch
(
function
(
err
)
{
.
catch
(
function
(
err
)
{
console
.
log
(
color
(
'
fgRed
'
)(
err
));
console
.
log
(
color
(
'
fgRed
'
)(
err
));
});
promiseReject
();
}
});
}
}
});
};
/**
/**
* @param {Object} singleConfig A single rollup config:
* @param {Object} singleConfig A single rollup config:
...
@@ -65,7 +68,7 @@ exports.build = function (configs) {
...
@@ -65,7 +68,7 @@ exports.build = function (configs) {
* }
* }
*/
*/
exports
.
watch
=
function
(
singleConfig
)
{
exports
.
watch
=
function
(
singleConfig
)
{
var
watcher
=
rollup
.
watch
(
singleConfig
);
let
watcher
=
rollup
.
watch
(
singleConfig
);
watcher
.
on
(
'
event
'
,
function
(
event
)
{
watcher
.
on
(
'
event
'
,
function
(
event
)
{
// event.code can be one of:
// event.code can be one of:
...
@@ -89,7 +92,7 @@ exports.watch = function (singleConfig) {
...
@@ -89,7 +92,7 @@ exports.watch = function (singleConfig) {
printWatchResult
(
event
);
printWatchResult
(
event
);
}
}
});
});
}
}
;
function
printWatchResult
(
event
)
{
function
printWatchResult
(
event
)
{
console
.
log
(
console
.
log
(
...
@@ -155,12 +158,12 @@ const COLOR_MAP = {
...
@@ -155,12 +158,12 @@ const COLOR_MAP = {
* Print colored text with `console.log`.
* Print colored text with `console.log`.
*
*
* Usage:
* Usage:
*
var
color = require('colorConsole');
*
let
color = require('colorConsole');
* color('fgCyan')('some text'); // cyan text.
* color('fgCyan')('some text'); // cyan text.
* color('fgCyan', 'bright')('some text'); // bright cyan text.
* color('fgCyan', 'bright')('some text'); // bright cyan text.
* color('fgCyan', 'bgRed')('some text') // cyan text and red background.
* color('fgCyan', 'bgRed')('some text') // cyan text and red background.
*/
*/
function
color
()
{
let
color
=
exports
.
color
=
function
()
{
let
prefix
=
[];
let
prefix
=
[];
for
(
let
i
=
0
;
i
<
arguments
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
arguments
.
length
;
i
++
)
{
let
color
=
COLOR_MAP
[
arguments
[
i
]];
let
color
=
COLOR_MAP
[
arguments
[
i
]];
...
@@ -171,4 +174,4 @@ function color() {
...
@@ -171,4 +174,4 @@ function color() {
return
function
(
text
)
{
return
function
(
text
)
{
return
prefix
+
text
+
COLOR_RESET
;
return
prefix
+
text
+
COLOR_RESET
;
};
};
}
}
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录