Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
de7267dc
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
de7267dc
编写于
9月 19, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update uglify. bubble errors. scoped eslint
上级
72ef20b5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
58 addition
and
32 deletion
+58
-32
build/gulpfile.common.js
build/gulpfile.common.js
+32
-26
package.json
package.json
+3
-1
src/.eslintrc
src/.eslintrc
+14
-0
src/main.js
src/main.js
+9
-5
未找到文件。
build/gulpfile.common.js
浏览文件 @
de7267dc
...
@@ -18,6 +18,8 @@ const bundle = require('./lib/bundle');
...
@@ -18,6 +18,8 @@ const bundle = require('./lib/bundle');
const
util
=
require
(
'
./lib/util
'
);
const
util
=
require
(
'
./lib/util
'
);
const
i18n
=
require
(
'
./lib/i18n
'
);
const
i18n
=
require
(
'
./lib/i18n
'
);
const
gulpUtil
=
require
(
'
gulp-util
'
);
const
gulpUtil
=
require
(
'
gulp-util
'
);
const
flatmap
=
require
(
'
gulp-flatmap
'
);
const
pump
=
require
(
'
pump
'
);
function
log
(
prefix
,
message
)
{
function
log
(
prefix
,
message
)
{
gulpUtil
.
log
(
gulpUtil
.
colors
.
cyan
(
'
[
'
+
prefix
+
'
]
'
),
message
);
gulpUtil
.
log
(
gulpUtil
.
colors
.
cyan
(
'
[
'
+
prefix
+
'
]
'
),
message
);
...
@@ -210,11 +212,7 @@ exports.optimizeTask = function(opts) {
...
@@ -210,11 +212,7 @@ exports.optimizeTask = function(opts) {
* to have a file "context" to include our copyright only once per file.
* to have a file "context" to include our copyright only once per file.
*/
*/
function
uglifyWithCopyrights
()
{
function
uglifyWithCopyrights
()
{
let
currentFileHasOurCopyright
=
false
;
const
preserveComments
=
f
=>
(
node
,
comment
)
=>
{
const
onNewFile
=
()
=>
currentFileHasOurCopyright
=
false
;
const
preserveComments
=
function
(
node
,
comment
)
{
const
text
=
comment
.
value
;
const
text
=
comment
.
value
;
const
type
=
comment
.
type
;
const
type
=
comment
.
type
;
...
@@ -225,10 +223,10 @@ function uglifyWithCopyrights() {
...
@@ -225,10 +223,10 @@ function uglifyWithCopyrights() {
const
isOurCopyright
=
IS_OUR_COPYRIGHT_REGEXP
.
test
(
text
);
const
isOurCopyright
=
IS_OUR_COPYRIGHT_REGEXP
.
test
(
text
);
if
(
isOurCopyright
)
{
if
(
isOurCopyright
)
{
if
(
currentFileH
asOurCopyright
)
{
if
(
f
.
__h
asOurCopyright
)
{
return
false
;
return
false
;
}
}
currentFileH
asOurCopyright
=
true
;
f
.
__h
asOurCopyright
=
true
;
return
true
;
return
true
;
}
}
...
@@ -241,37 +239,45 @@ function uglifyWithCopyrights() {
...
@@ -241,37 +239,45 @@ function uglifyWithCopyrights() {
return
false
;
return
false
;
};
};
const
uglifyStream
=
uglify
({
preserveComments
});
const
input
=
es
.
through
();
const
output
=
input
.
pipe
(
flatmap
((
stream
,
f
)
=>
{
return
stream
.
pipe
(
uglify
({
preserveComments
:
preserveComments
(
f
)
}));
}));
return
es
.
through
(
function
(
data
)
{
return
es
.
duplex
(
input
,
output
);
onNewFile
();
uglifyStream
.
once
(
'
data
'
,
data
=>
this
.
emit
(
'
data
'
,
data
));
uglifyStream
.
write
(
data
);
},
function
()
{
this
.
emit
(
'
end
'
);
});
}
}
exports
.
minifyTask
=
function
(
src
,
sourceMapBaseUrl
)
{
exports
.
minifyTask
=
function
(
src
,
sourceMapBaseUrl
)
{
const
sourceMappingURL
=
sourceMapBaseUrl
&&
(
f
=>
`
${
sourceMapBaseUrl
}
/
${
f
.
relative
}
.map`
);
const
sourceMappingURL
=
sourceMapBaseUrl
&&
(
f
=>
`
${
sourceMapBaseUrl
}
/
${
f
.
relative
}
.map`
);
return
function
()
{
return
cb
=>
{
const
jsFilter
=
filter
(
'
**/*.js
'
,
{
restore
:
true
});
const
jsFilter
=
filter
(
'
**/*.js
'
,
{
restore
:
true
});
const
cssFilter
=
filter
(
'
**/*.css
'
,
{
restore
:
true
});
const
cssFilter
=
filter
(
'
**/*.css
'
,
{
restore
:
true
});
return
gulp
.
src
([
src
+
'
/**
'
,
'
!
'
+
src
+
'
/**/*.map
'
])
pump
(
.
pipe
(
jsFilter
)
gulp
.
src
([
src
+
'
/**
'
,
'
!
'
+
src
+
'
/**/*.map
'
]),
.
pipe
(
sourcemaps
.
init
({
loadMaps
:
true
}))
jsFilter
,
.
pipe
(
uglifyWithCopyrights
())
sourcemaps
.
init
({
loadMaps
:
true
}),
.
pipe
(
jsFilter
.
restore
)
uglifyWithCopyrights
(),
.
pipe
(
cssFilter
)
jsFilter
.
restore
,
.
pipe
(
minifyCSS
({
reduceIdents
:
false
}))
cssFilter
,
.
pipe
(
cssFilter
.
restore
)
minifyCSS
({
reduceIdents
:
false
}),
.
pipe
(
sourcemaps
.
write
(
'
./
'
,
{
cssFilter
.
restore
,
sourcemaps
.
write
(
'
./
'
,
{
sourceMappingURL
,
sourceMappingURL
,
sourceRoot
:
null
,
sourceRoot
:
null
,
includeContent
:
true
,
includeContent
:
true
,
addComment
:
true
addComment
:
true
}))
}),
.
pipe
(
gulp
.
dest
(
src
+
'
-min
'
));
gulp
.
dest
(
src
+
'
-min
'
)
,
err
=>
{
if
(
err
instanceof
uglify
.
GulpUglifyError
)
{
console
.
error
(
`Uglify error in '
${
err
.
cause
&&
err
.
cause
.
filename
}
'`
);
}
cb
(
err
);
});
};
};
};
};
\ No newline at end of file
package.json
浏览文件 @
de7267dc
...
@@ -57,6 +57,7 @@
...
@@ -57,6 +57,7 @@
"
gulp-concat
"
:
"
^2.6.0
"
,
"
gulp-concat
"
:
"
^2.6.0
"
,
"
gulp-cssnano
"
:
"
^2.1.0
"
,
"
gulp-cssnano
"
:
"
^2.1.0
"
,
"
gulp-filter
"
:
"
^3.0.0
"
,
"
gulp-filter
"
:
"
^3.0.0
"
,
"
gulp-flatmap
"
:
"
^1.0.0
"
,
"
gulp-json-editor
"
:
"
^2.2.1
"
,
"
gulp-json-editor
"
:
"
^2.2.1
"
,
"
gulp-mocha
"
:
"
^2.1.3
"
,
"
gulp-mocha
"
:
"
^2.1.3
"
,
"
gulp-remote-src
"
:
"
^0.4.0
"
,
"
gulp-remote-src
"
:
"
^0.4.0
"
,
...
@@ -66,7 +67,7 @@
...
@@ -66,7 +67,7 @@
"
gulp-sourcemaps
"
:
"
^1.6.0
"
,
"
gulp-sourcemaps
"
:
"
^1.6.0
"
,
"
gulp-tsb
"
:
"
^1.10.1
"
,
"
gulp-tsb
"
:
"
^1.10.1
"
,
"
gulp-tslint
"
:
"
^4.3.0
"
,
"
gulp-tslint
"
:
"
^4.3.0
"
,
"
gulp-uglify
"
:
"
^
1.4.1
"
,
"
gulp-uglify
"
:
"
^
2.0.0
"
,
"
gulp-util
"
:
"
^3.0.6
"
,
"
gulp-util
"
:
"
^3.0.6
"
,
"
gulp-vinyl-zip
"
:
"
^1.2.2
"
,
"
gulp-vinyl-zip
"
:
"
^1.2.2
"
,
"
innosetup-compiler
"
:
"
^5.5.60
"
,
"
innosetup-compiler
"
:
"
^5.5.60
"
,
...
@@ -80,6 +81,7 @@
...
@@ -80,6 +81,7 @@
"
mocha
"
:
"
^2.2.5
"
,
"
mocha
"
:
"
^2.2.5
"
,
"
object-assign
"
:
"
^4.0.1
"
,
"
object-assign
"
:
"
^4.0.1
"
,
"
optimist
"
:
"
0.3.5
"
,
"
optimist
"
:
"
0.3.5
"
,
"
pump
"
:
"
^1.0.1
"
,
"
queue
"
:
"
3.0.6
"
,
"
queue
"
:
"
3.0.6
"
,
"
remap-istanbul
"
:
"
^0.6.4
"
,
"
remap-istanbul
"
:
"
^0.6.4
"
,
"
rimraf
"
:
"
^2.2.8
"
,
"
rimraf
"
:
"
^2.2.8
"
,
...
...
src/.eslintrc
0 → 100644
浏览文件 @
de7267dc
{
"env": {
"node": true,
"es6": false
},
"rules": {
"no-console": 0,
"no-cond-assign": 0,
"no-unused-vars": 1,
"no-extra-semi": "warn",
"semi": "warn"
},
"extends": "eslint:recommended"
}
\ No newline at end of file
src/main.js
浏览文件 @
de7267dc
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
// Perf measurements
// Perf measurements
global
.
vscodeStart
=
Date
.
now
();
global
.
vscodeStart
=
Date
.
now
();
...
@@ -69,7 +71,7 @@ function getNLSConfiguration() {
...
@@ -69,7 +71,7 @@ function getNLSConfiguration() {
// the locale we receive from the user or OS.
// the locale we receive from the user or OS.
locale
=
locale
?
locale
.
toLowerCase
()
:
locale
;
locale
=
locale
?
locale
.
toLowerCase
()
:
locale
;
if
(
locale
===
'
pseudo
'
)
{
if
(
locale
===
'
pseudo
'
)
{
return
{
locale
:
locale
,
availableLanguages
:
{},
pseudo
:
true
}
return
{
locale
:
locale
,
availableLanguages
:
{},
pseudo
:
true
}
;
}
}
var
initialLocale
=
locale
;
var
initialLocale
=
locale
;
if
(
process
.
env
[
'
VSCODE_DEV
'
])
{
if
(
process
.
env
[
'
VSCODE_DEV
'
])
{
...
@@ -132,15 +134,17 @@ app.on('open-file', function (event, path) {
...
@@ -132,15 +134,17 @@ app.on('open-file', function (event, path) {
global
.
macOpenFiles
.
push
(
path
);
global
.
macOpenFiles
.
push
(
path
);
});
});
const
openUrls
=
[];
var
openUrls
=
[];
const
onOpenUrl
=
(
event
,
url
)
=>
{
var
onOpenUrl
=
function
(
event
,
url
)
{
event
.
preventDefault
();
event
.
preventDefault
();
openUrls
.
push
(
url
);
openUrls
.
push
(
url
);
};
};
app
.
on
(
'
will-finish-launching
'
,
()
=>
app
.
on
(
'
open-url
'
,
onOpenUrl
));
app
.
on
(
'
will-finish-launching
'
,
function
()
{
app
.
on
(
'
open-url
'
,
onOpenUrl
);
});
global
.
getOpenUrls
=
()
=>
{
global
.
getOpenUrls
=
function
()
{
app
.
removeListener
(
'
open-url
'
,
onOpenUrl
);
app
.
removeListener
(
'
open-url
'
,
onOpenUrl
);
return
openUrls
;
return
openUrls
;
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录