Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1c38df78
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1c38df78
编写于
1月 11, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #18363
上级
3437c463
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
121 addition
and
115 deletion
+121
-115
build/lib/bundle.js
build/lib/bundle.js
+4
-4
build/lib/compilation.js
build/lib/compilation.js
+15
-13
build/lib/compilation.ts
build/lib/compilation.ts
+18
-15
build/lib/extensions.js
build/lib/extensions.js
+3
-3
build/lib/git.js
build/lib/git.js
+2
-2
build/lib/i18n.js
build/lib/i18n.js
+6
-6
build/lib/nls.js
build/lib/nls.js
+7
-8
build/lib/optimize.js
build/lib/optimize.js
+16
-16
build/lib/reporter.js
build/lib/reporter.js
+3
-3
build/lib/tslint/duplicateImportsRule.js
build/lib/tslint/duplicateImportsRule.js
+6
-5
build/lib/tslint/importPatternsRule.js
build/lib/tslint/importPatternsRule.js
+6
-5
build/lib/tslint/layeringRule.js
build/lib/tslint/layeringRule.js
+6
-5
build/lib/tslint/noUnexternalizedStringsRule.js
build/lib/tslint/noUnexternalizedStringsRule.js
+16
-17
build/lib/util.js
build/lib/util.js
+10
-10
build/monaco/api.js
build/monaco/api.js
+3
-3
未找到文件。
build/lib/bundle.js
浏览文件 @
1c38df78
...
...
@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
fs
=
require
(
'
fs
'
);
var
path
=
require
(
'
path
'
);
var
vm
=
require
(
'
vm
'
);
var
fs
=
require
(
"
fs
"
);
var
path
=
require
(
"
path
"
);
var
vm
=
require
(
"
vm
"
);
/**
* Bundle `entryPoints` given config `config`.
*/
...
...
@@ -186,7 +186,7 @@ function extractStrings(destFiles) {
path
:
null
,
contents
:
[
'
(function() {
'
,
(
"
var __m =
"
+
JSON
.
stringify
(
sortedByUseModules
)
+
"
;
"
)
,
"
var __m =
"
+
JSON
.
stringify
(
sortedByUseModules
)
+
"
;
"
,
"
var __M = function(deps) {
"
,
"
var result = [];
"
,
"
for (var i = 0, len = deps.length; i < len; i++) {
"
,
...
...
build/lib/compilation.js
浏览文件 @
1c38df78
...
...
@@ -3,19 +3,19 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
var
gulp
=
require
(
'
gulp
'
);
var
tsb
=
require
(
'
gulp-tsb
'
);
var
es
=
require
(
'
event-stream
'
);
var
gulp
=
require
(
"
gulp
"
);
var
tsb
=
require
(
"
gulp-tsb
"
);
var
es
=
require
(
"
event-stream
"
);
var
watch
=
require
(
'
./watch
'
);
var
nls
=
require
(
'
./nls
'
);
var
util
=
require
(
'
./util
'
);
var
reporter_1
=
require
(
'
./reporter
'
);
var
path
=
require
(
'
path
'
);
var
bom
=
require
(
'
gulp-bom
'
);
var
sourcemaps
=
require
(
'
gulp-sourcemaps
'
);
var
_
=
require
(
'
underscore
'
);
var
monacodts
=
require
(
'
../monaco/api
'
);
var
fs
=
require
(
'
fs
'
);
var
nls
=
require
(
"
./nls
"
);
var
util
=
require
(
"
./util
"
);
var
reporter_1
=
require
(
"
./reporter
"
);
var
path
=
require
(
"
path
"
);
var
bom
=
require
(
"
gulp-bom
"
);
var
sourcemaps
=
require
(
"
gulp-sourcemaps
"
);
var
_
=
require
(
"
underscore
"
);
var
monacodts
=
require
(
"
../monaco/api
"
);
var
fs
=
require
(
"
fs
"
);
var
reporter
=
reporter_1
.
createReporter
();
var
rootDir
=
path
.
join
(
__dirname
,
'
../../src
'
);
var
options
=
require
(
'
../../src/tsconfig.json
'
).
compilerOptions
;
...
...
@@ -23,6 +23,8 @@ options.verbose = false;
options
.
sourceMap
=
true
;
options
.
rootDir
=
rootDir
;
options
.
sourceRoot
=
util
.
toFileUri
(
rootDir
);
var
smSourceRootPath
=
path
.
resolve
(
path
.
dirname
(
rootDir
));
var
smSourceRoot
=
util
.
toFileUri
(
smSourceRootPath
);
function
createCompile
(
build
,
emitError
)
{
var
opts
=
_
.
clone
(
options
);
opts
.
inlineSources
=
!!
build
;
...
...
@@ -46,7 +48,7 @@ function createCompile(build, emitError) {
.
pipe
(
sourcemaps
.
write
(
'
.
'
,
{
addComment
:
false
,
includeContent
:
!!
build
,
sourceRoot
:
options
.
s
ourceRoot
sourceRoot
:
smS
ourceRoot
}))
.
pipe
(
tsFilter
.
restore
)
.
pipe
(
reporter
.
end
(
emitError
));
...
...
build/lib/compilation.ts
浏览文件 @
1c38df78
...
...
@@ -28,14 +28,17 @@ options.sourceMap = true;
options
.
rootDir
=
rootDir
;
options
.
sourceRoot
=
util
.
toFileUri
(
rootDir
);
function
createCompile
(
build
:
boolean
,
emitError
?:
boolean
):
(
token
?:
util
.
ICancellationToken
)
=>
NodeJS
.
ReadWriteStream
{
const
smSourceRootPath
=
path
.
resolve
(
path
.
dirname
(
rootDir
));
const
smSourceRoot
=
util
.
toFileUri
(
smSourceRootPath
);
function
createCompile
(
build
:
boolean
,
emitError
?:
boolean
):
(
token
?:
util
.
ICancellationToken
)
=>
NodeJS
.
ReadWriteStream
{
const
opts
=
_
.
clone
(
options
);
opts
.
inlineSources
=
!!
build
;
opts
.
noFilesystemLookup
=
true
;
const
ts
=
tsb
.
create
(
opts
,
null
,
null
,
err
=>
reporter
(
err
.
toString
()));
return
function
(
token
?:
util
.
ICancellationToken
)
{
return
function
(
token
?:
util
.
ICancellationToken
)
{
const
utf8Filter
=
util
.
filter
(
data
=>
/
(\/
|
\\)
test
(\/
|
\\)
.*utf8/
.
test
(
data
.
path
));
const
tsFilter
=
util
.
filter
(
data
=>
/
\.
ts$/
.
test
(
data
.
path
));
const
noDeclarationsFilter
=
util
.
filter
(
data
=>
!
(
/
\.
d
\.
ts$/
.
test
(
data
.
path
)));
...
...
@@ -54,7 +57,7 @@ function createCompile(build:boolean, emitError?:boolean): (token?:util.ICancell
.
pipe
(
sourcemaps
.
write
(
'
.
'
,
{
addComment
:
false
,
includeContent
:
!!
build
,
sourceRoot
:
options
.
s
ourceRoot
sourceRoot
:
smS
ourceRoot
}))
.
pipe
(
tsFilter
.
restore
)
.
pipe
(
reporter
.
end
(
emitError
));
...
...
@@ -63,7 +66,7 @@ function createCompile(build:boolean, emitError?:boolean): (token?:util.ICancell
};
}
export
function
compileTask
(
out
:
string
,
build
:
boolean
):
()
=>
NodeJS
.
ReadWriteStream
{
export
function
compileTask
(
out
:
string
,
build
:
boolean
):
()
=>
NodeJS
.
ReadWriteStream
{
const
compile
=
createCompile
(
build
,
true
);
return
function
()
{
...
...
@@ -79,7 +82,7 @@ export function compileTask(out:string, build:boolean): () => NodeJS.ReadWriteSt
};
}
export
function
watchTask
(
out
:
string
,
build
:
boolean
):
()
=>
NodeJS
.
ReadWriteStream
{
export
function
watchTask
(
out
:
string
,
build
:
boolean
):
()
=>
NodeJS
.
ReadWriteStream
{
const
compile
=
createCompile
(
build
);
return
function
()
{
...
...
@@ -96,21 +99,21 @@ export function watchTask(out:string, build:boolean): () => NodeJS.ReadWriteStre
};
}
function
monacodtsTask
(
out
:
string
,
isWatch
:
boolean
):
NodeJS
.
ReadWriteStream
{
let
timer
:
NodeJS
.
Timer
=
null
;
function
monacodtsTask
(
out
:
string
,
isWatch
:
boolean
):
NodeJS
.
ReadWriteStream
{
let
timer
:
NodeJS
.
Timer
=
null
;
const
runSoon
=
function
(
howSoon
:
number
)
{
const
runSoon
=
function
(
howSoon
:
number
)
{
if
(
timer
!==
null
)
{
clearTimeout
(
timer
);
timer
=
null
;
}
timer
=
setTimeout
(
function
()
{
timer
=
setTimeout
(
function
()
{
timer
=
null
;
runNow
();
},
howSoon
);
};
const
runNow
=
function
()
{
const
runNow
=
function
()
{
if
(
timer
!==
null
)
{
clearTimeout
(
timer
);
timer
=
null
;
...
...
@@ -133,16 +136,16 @@ function monacodtsTask(out:string, isWatch:boolean): NodeJS.ReadWriteStream {
if
(
isWatch
)
{
const
filesToWatchMap
:
{
[
file
:
string
]:
boolean
;
}
=
{};
monacodts
.
getFilesToWatch
(
out
).
forEach
(
function
(
filePath
)
{
const
filesToWatchMap
:
{
[
file
:
string
]:
boolean
;
}
=
{};
monacodts
.
getFilesToWatch
(
out
).
forEach
(
function
(
filePath
)
{
filesToWatchMap
[
path
.
normalize
(
filePath
)]
=
true
;
});
watch
(
'
build/monaco/*
'
).
pipe
(
es
.
through
(
function
()
{
watch
(
'
build/monaco/*
'
).
pipe
(
es
.
through
(
function
()
{
runSoon
(
5000
);
}));
resultStream
=
es
.
through
(
function
(
data
)
{
resultStream
=
es
.
through
(
function
(
data
)
{
const
filePath
=
path
.
normalize
(
data
.
path
);
if
(
filesToWatchMap
[
filePath
])
{
runSoon
(
5000
);
...
...
@@ -152,7 +155,7 @@ function monacodtsTask(out:string, isWatch:boolean): NodeJS.ReadWriteStream {
}
else
{
resultStream
=
es
.
through
(
null
,
function
()
{
resultStream
=
es
.
through
(
null
,
function
()
{
runNow
();
this
.
emit
(
'
end
'
);
});
...
...
build/lib/extensions.js
浏览文件 @
1c38df78
...
...
@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
event_stream_1
=
require
(
'
event-stream
'
);
var
assign
=
require
(
'
object-assign
'
);
var
remote
=
require
(
'
gulp-remote-src
'
);
var
event_stream_1
=
require
(
"
event-stream
"
);
var
assign
=
require
(
"
object-assign
"
);
var
remote
=
require
(
"
gulp-remote-src
"
);
var
flatmap
=
require
(
'
gulp-flatmap
'
);
var
vzip
=
require
(
'
gulp-vinyl-zip
'
);
var
filter
=
require
(
'
gulp-filter
'
);
...
...
build/lib/git.js
浏览文件 @
1c38df78
...
...
@@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
path
=
require
(
'
path
'
);
var
fs
=
require
(
'
fs
'
);
var
path
=
require
(
"
path
"
);
var
fs
=
require
(
"
fs
"
);
/**
* Returns the sha1 commit version of a repository or undefined in case of failure.
*/
...
...
build/lib/i18n.js
浏览文件 @
1c38df78
...
...
@@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
path
=
require
(
'
path
'
);
var
fs
=
require
(
'
fs
'
);
var
event_stream_1
=
require
(
'
event-stream
'
);
var
File
=
require
(
'
vinyl
'
);
var
Is
=
require
(
'
is
'
);
var
path
=
require
(
"
path
"
);
var
fs
=
require
(
"
fs
"
);
var
event_stream_1
=
require
(
"
event-stream
"
);
var
File
=
require
(
"
vinyl
"
);
var
Is
=
require
(
"
is
"
);
var
util
=
require
(
'
gulp-util
'
);
function
log
(
message
)
{
var
rest
=
[];
...
...
@@ -233,7 +233,7 @@ function processCoreBundleFormat(fileHeader, json, emitter) {
var
modules
=
bundleSection
[
bundle
];
var
contents
=
[
fileHeader
,
(
"
define(
\"
"
+
bundle
+
"
.nls.
"
+
language
.
iso639_2
+
"
\"
, {
"
)
"
define(
\"
"
+
bundle
+
"
.nls.
"
+
language
.
iso639_2
+
"
\"
, {
"
];
modules
.
forEach
(
function
(
module
,
index
)
{
contents
.
push
(
"
\t\"
"
+
module
+
"
\"
: [
"
);
...
...
build/lib/nls.js
浏览文件 @
1c38df78
"
use strict
"
;
var
ts
=
require
(
'
./typescript/typescriptServices
'
);
var
lazy
=
require
(
'
lazy.js
'
);
var
event_stream_1
=
require
(
'
event-stream
'
);
var
File
=
require
(
'
vinyl
'
);
var
sm
=
require
(
'
source-map
'
);
var
assign
=
require
(
'
object-assign
'
);
var
path
=
require
(
'
path
'
);
var
ts
=
require
(
"
./typescript/typescriptServices
"
);
var
lazy
=
require
(
"
lazy.js
"
);
var
event_stream_1
=
require
(
"
event-stream
"
);
var
File
=
require
(
"
vinyl
"
);
var
sm
=
require
(
"
source-map
"
);
var
assign
=
require
(
"
object-assign
"
);
var
path
=
require
(
"
path
"
);
var
CollectStepResult
;
(
function
(
CollectStepResult
)
{
CollectStepResult
[
CollectStepResult
[
"
Yes
"
]
=
0
]
=
"
Yes
"
;
...
...
@@ -71,7 +71,6 @@ function nls() {
function
isImportNode
(
node
)
{
return
node
.
kind
===
212
/* ImportDeclaration */
||
node
.
kind
===
211
/* ImportEqualsDeclaration */
;
}
var
nls
;
(
function
(
nls_1
)
{
function
fileFrom
(
file
,
contents
,
path
)
{
if
(
path
===
void
0
)
{
path
=
file
.
path
;
}
...
...
build/lib/optimize.js
浏览文件 @
1c38df78
...
...
@@ -3,21 +3,21 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
var
path
=
require
(
'
path
'
);
var
gulp
=
require
(
'
gulp
'
);
var
sourcemaps
=
require
(
'
gulp-sourcemaps
'
);
var
filter
=
require
(
'
gulp-filter
'
);
var
minifyCSS
=
require
(
'
gulp-cssnano
'
);
var
uglify
=
require
(
'
gulp-uglify
'
);
var
es
=
require
(
'
event-stream
'
);
var
concat
=
require
(
'
gulp-concat
'
);
var
VinylFile
=
require
(
'
vinyl
'
);
var
bundle
=
require
(
'
./bundle
'
);
var
util
=
require
(
'
./util
'
);
var
i18n
=
require
(
'
./i18n
'
);
var
gulpUtil
=
require
(
'
gulp-util
'
);
var
flatmap
=
require
(
'
gulp-flatmap
'
);
var
pump
=
require
(
'
pump
'
);
var
path
=
require
(
"
path
"
);
var
gulp
=
require
(
"
gulp
"
);
var
sourcemaps
=
require
(
"
gulp-sourcemaps
"
);
var
filter
=
require
(
"
gulp-filter
"
);
var
minifyCSS
=
require
(
"
gulp-cssnano
"
);
var
uglify
=
require
(
"
gulp-uglify
"
);
var
es
=
require
(
"
event-stream
"
);
var
concat
=
require
(
"
gulp-concat
"
);
var
VinylFile
=
require
(
"
vinyl
"
);
var
bundle
=
require
(
"
./bundle
"
);
var
util
=
require
(
"
./util
"
);
var
i18n
=
require
(
"
./i18n
"
);
var
gulpUtil
=
require
(
"
gulp-util
"
);
var
flatmap
=
require
(
"
gulp-flatmap
"
);
var
pump
=
require
(
"
pump
"
);
var
REPO_ROOT_PATH
=
path
.
join
(
__dirname
,
'
../..
'
);
function
log
(
prefix
,
message
)
{
gulpUtil
.
log
(
gulpUtil
.
colors
.
cyan
(
'
[
'
+
prefix
+
'
]
'
),
message
);
...
...
@@ -208,7 +208,7 @@ function uglifyWithCopyrights() {
return
es
.
duplex
(
input
,
output
);
}
function
minifyTask
(
src
,
sourceMapBaseUrl
)
{
var
sourceMappingURL
=
sourceMapBaseUrl
&&
(
function
(
f
)
{
return
(
sourceMapBaseUrl
+
"
/
"
+
f
.
relative
+
"
.map
"
)
;
});
var
sourceMappingURL
=
sourceMapBaseUrl
&&
(
function
(
f
)
{
return
sourceMapBaseUrl
+
"
/
"
+
f
.
relative
+
"
.map
"
;
});
return
function
(
cb
)
{
var
jsFilter
=
filter
(
'
**/*.js
'
,
{
restore
:
true
});
var
cssFilter
=
filter
(
'
**/*.css
'
,
{
restore
:
true
});
...
...
build/lib/reporter.js
浏览文件 @
1c38df78
...
...
@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
var
es
=
require
(
'
event-stream
'
);
var
_
=
require
(
'
underscore
'
);
var
util
=
require
(
'
gulp-util
'
);
var
es
=
require
(
"
event-stream
"
);
var
_
=
require
(
"
underscore
"
);
var
util
=
require
(
"
gulp-util
"
);
var
allErrors
=
[];
var
startTime
=
null
;
var
count
=
0
;
...
...
build/lib/tslint/duplicateImportsRule.js
浏览文件 @
1c38df78
...
...
@@ -8,12 +8,12 @@ var __extends = (this && this.__extends) || function (d, b) {
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
path_1
=
require
(
'
path
'
);
var
Lint
=
require
(
'
tslint
'
);
var
path_1
=
require
(
"
path
"
);
var
Lint
=
require
(
"
tslint
"
);
var
Rule
=
(
function
(
_super
)
{
__extends
(
Rule
,
_super
);
function
Rule
()
{
_super
.
apply
(
this
,
arguments
)
;
return
_super
.
apply
(
this
,
arguments
)
||
this
;
}
Rule
.
prototype
.
apply
=
function
(
sourceFile
)
{
return
this
.
applyWithWalker
(
new
ImportPatterns
(
sourceFile
,
this
.
getOptions
()));
...
...
@@ -24,8 +24,9 @@ exports.Rule = Rule;
var
ImportPatterns
=
(
function
(
_super
)
{
__extends
(
ImportPatterns
,
_super
);
function
ImportPatterns
(
file
,
opts
)
{
_super
.
call
(
this
,
file
,
opts
);
this
.
imports
=
Object
.
create
(
null
);
var
_this
=
_super
.
call
(
this
,
file
,
opts
)
||
this
;
_this
.
imports
=
Object
.
create
(
null
);
return
_this
;
}
ImportPatterns
.
prototype
.
visitImportDeclaration
=
function
(
node
)
{
var
path
=
node
.
moduleSpecifier
.
getText
();
...
...
build/lib/tslint/importPatternsRule.js
浏览文件 @
1c38df78
...
...
@@ -8,12 +8,12 @@ var __extends = (this && this.__extends) || function (d, b) {
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
Lint
=
require
(
'
tslint
'
);
var
minimatch
=
require
(
'
minimatch
'
);
var
Lint
=
require
(
"
tslint
"
);
var
minimatch
=
require
(
"
minimatch
"
);
var
Rule
=
(
function
(
_super
)
{
__extends
(
Rule
,
_super
);
function
Rule
()
{
_super
.
apply
(
this
,
arguments
)
;
return
_super
.
apply
(
this
,
arguments
)
||
this
;
}
Rule
.
prototype
.
apply
=
function
(
sourceFile
)
{
var
configs
=
this
.
getOptions
().
ruleArguments
;
...
...
@@ -31,8 +31,9 @@ exports.Rule = Rule;
var
ImportPatterns
=
(
function
(
_super
)
{
__extends
(
ImportPatterns
,
_super
);
function
ImportPatterns
(
file
,
opts
,
_config
)
{
_super
.
call
(
this
,
file
,
opts
);
this
.
_config
=
_config
;
var
_this
=
_super
.
call
(
this
,
file
,
opts
)
||
this
;
_this
.
_config
=
_config
;
return
_this
;
}
ImportPatterns
.
prototype
.
visitImportDeclaration
=
function
(
node
)
{
var
path
=
node
.
moduleSpecifier
.
getText
();
...
...
build/lib/tslint/layeringRule.js
浏览文件 @
1c38df78
...
...
@@ -8,12 +8,12 @@ var __extends = (this && this.__extends) || function (d, b) {
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
Lint
=
require
(
'
tslint
'
);
var
path_1
=
require
(
'
path
'
);
var
Lint
=
require
(
"
tslint
"
);
var
path_1
=
require
(
"
path
"
);
var
Rule
=
(
function
(
_super
)
{
__extends
(
Rule
,
_super
);
function
Rule
()
{
_super
.
apply
(
this
,
arguments
)
;
return
_super
.
apply
(
this
,
arguments
)
||
this
;
}
Rule
.
prototype
.
apply
=
function
(
sourceFile
)
{
var
parts
=
path_1
.
dirname
(
sourceFile
.
fileName
).
split
(
/
\\
|
\/
/
);
...
...
@@ -44,8 +44,9 @@ exports.Rule = Rule;
var
LayeringRule
=
(
function
(
_super
)
{
__extends
(
LayeringRule
,
_super
);
function
LayeringRule
(
file
,
config
,
opts
)
{
_super
.
call
(
this
,
file
,
opts
);
this
.
_config
=
config
;
var
_this
=
_super
.
call
(
this
,
file
,
opts
)
||
this
;
_this
.
_config
=
config
;
return
_this
;
}
LayeringRule
.
prototype
.
visitImportDeclaration
=
function
(
node
)
{
var
path
=
node
.
moduleSpecifier
.
getText
();
...
...
build/lib/tslint/noUnexternalizedStringsRule.js
浏览文件 @
1c38df78
...
...
@@ -8,15 +8,15 @@ var __extends = (this && this.__extends) || function (d, b) {
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
var
ts
=
require
(
'
typescript
'
);
var
Lint
=
require
(
'
tslint
'
);
var
ts
=
require
(
"
typescript
"
);
var
Lint
=
require
(
"
tslint
"
);
/**
* Implementation of the no-unexternalized-strings rule.
*/
var
Rule
=
(
function
(
_super
)
{
__extends
(
Rule
,
_super
);
function
Rule
()
{
_super
.
apply
(
this
,
arguments
)
;
return
_super
.
apply
(
this
,
arguments
)
||
this
;
}
Rule
.
prototype
.
apply
=
function
(
sourceFile
)
{
return
this
.
applyWithWalker
(
new
NoUnexternalizedStringsRuleWalker
(
sourceFile
,
this
.
getOptions
()));
...
...
@@ -36,14 +36,13 @@ function isPropertyAssignment(node) {
var
NoUnexternalizedStringsRuleWalker
=
(
function
(
_super
)
{
__extends
(
NoUnexternalizedStringsRuleWalker
,
_super
);
function
NoUnexternalizedStringsRuleWalker
(
file
,
opts
)
{
var
_this
=
this
;
_super
.
call
(
this
,
file
,
opts
);
this
.
signatures
=
Object
.
create
(
null
);
this
.
ignores
=
Object
.
create
(
null
);
this
.
messageIndex
=
undefined
;
this
.
keyIndex
=
undefined
;
this
.
usedKeys
=
Object
.
create
(
null
);
var
options
=
this
.
getOptions
();
var
_this
=
_super
.
call
(
this
,
file
,
opts
)
||
this
;
_this
.
signatures
=
Object
.
create
(
null
);
_this
.
ignores
=
Object
.
create
(
null
);
_this
.
messageIndex
=
undefined
;
_this
.
keyIndex
=
undefined
;
_this
.
usedKeys
=
Object
.
create
(
null
);
var
options
=
_this
.
getOptions
();
var
first
=
options
&&
options
.
length
>
0
?
options
[
0
]
:
null
;
if
(
first
)
{
if
(
Array
.
isArray
(
first
.
signatures
))
{
...
...
@@ -53,12 +52,13 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
first
.
ignores
.
forEach
(
function
(
ignore
)
{
return
_this
.
ignores
[
ignore
]
=
true
;
});
}
if
(
typeof
first
.
messageIndex
!==
'
undefined
'
)
{
this
.
messageIndex
=
first
.
messageIndex
;
_
this
.
messageIndex
=
first
.
messageIndex
;
}
if
(
typeof
first
.
keyIndex
!==
'
undefined
'
)
{
this
.
keyIndex
=
first
.
keyIndex
;
_
this
.
keyIndex
=
first
.
keyIndex
;
}
}
return
_this
;
}
NoUnexternalizedStringsRuleWalker
.
prototype
.
visitSourceFile
=
function
(
node
)
{
var
_this
=
this
;
...
...
@@ -89,7 +89,6 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
if
(
functionName
&&
this
.
ignores
[
functionName
])
{
return
;
}
var
x
=
"
foo
"
;
if
(
doubleQuoted
&&
(
!
callInfo
||
callInfo
.
argIndex
===
-
1
||
!
this
.
signatures
[
functionName
]))
{
var
s
=
node
.
getText
();
var
replacement
=
new
Lint
.
Replacement
(
node
.
getStart
(),
node
.
getWidth
(),
"
nls.localize('KEY-
"
+
s
.
substring
(
1
,
s
.
length
-
1
)
+
"
',
"
+
s
+
"
)
"
);
...
...
@@ -113,8 +112,8 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
for
(
var
i
=
0
;
i
<
keyArg
.
properties
.
length
;
i
++
)
{
var
property
=
keyArg
.
properties
[
i
];
if
(
isPropertyAssignment
(
property
))
{
var
name
=
property
.
name
.
getText
();
if
(
name
===
'
key
'
)
{
var
name
_1
=
property
.
name
.
getText
();
if
(
name
_1
===
'
key
'
)
{
var
initializer
=
property
.
initializer
;
if
(
isStringLiteral
(
initializer
))
{
this
.
recordKey
(
initializer
,
this
.
messageIndex
?
callInfo
.
callExpression
.
arguments
[
this
.
messageIndex
]
:
undefined
);
...
...
@@ -167,6 +166,6 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
node
=
parent
;
}
};
NoUnexternalizedStringsRuleWalker
.
DOUBLE_QUOTE
=
'
"
'
;
return
NoUnexternalizedStringsRuleWalker
;
}(
Lint
.
RuleWalker
));
NoUnexternalizedStringsRuleWalker
.
DOUBLE_QUOTE
=
'
"
'
;
build/lib/util.js
浏览文件 @
1c38df78
...
...
@@ -3,16 +3,16 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
var
es
=
require
(
'
event-stream
'
);
var
debounce
=
require
(
'
debounce
'
);
var
_filter
=
require
(
'
gulp-filter
'
);
var
rename
=
require
(
'
gulp-rename
'
);
var
_
=
require
(
'
underscore
'
);
var
path
=
require
(
'
path
'
);
var
fs
=
require
(
'
fs
'
);
var
_rimraf
=
require
(
'
rimraf
'
);
var
git
=
require
(
'
./git
'
);
var
VinylFile
=
require
(
'
vinyl
'
);
var
es
=
require
(
"
event-stream
"
);
var
debounce
=
require
(
"
debounce
"
);
var
_filter
=
require
(
"
gulp-filter
"
);
var
rename
=
require
(
"
gulp-rename
"
);
var
_
=
require
(
"
underscore
"
);
var
path
=
require
(
"
path
"
);
var
fs
=
require
(
"
fs
"
);
var
_rimraf
=
require
(
"
rimraf
"
);
var
git
=
require
(
"
./git
"
);
var
VinylFile
=
require
(
"
vinyl
"
);
var
NoCancellationToken
=
{
isCancellationRequested
:
function
()
{
return
false
;
}
};
function
incremental
(
streamProvider
,
initial
,
supportsCancellation
)
{
var
input
=
es
.
through
();
...
...
build/monaco/api.js
浏览文件 @
1c38df78
...
...
@@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"
use strict
"
;
var
fs
=
require
(
'
fs
'
);
var
ts
=
require
(
'
typescript
'
);
var
path
=
require
(
'
path
'
);
var
fs
=
require
(
"
fs
"
);
var
ts
=
require
(
"
typescript
"
);
var
path
=
require
(
"
path
"
);
var
util
=
require
(
'
gulp-util
'
);
function
log
(
message
)
{
var
rest
=
[];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录