Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
45200866
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,发现更多精彩内容 >>
提交
45200866
编写于
9月 21, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #58589
上级
f6960901
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
70 addition
and
142 deletion
+70
-142
build/builtInExtensions.json
build/builtInExtensions.json
+23
-3
build/lib/builtInExtensions.js
build/lib/builtInExtensions.js
+1
-1
build/lib/extensions.js
build/lib/extensions.js
+18
-65
build/lib/extensions.ts
build/lib/extensions.ts
+28
-73
未找到文件。
build/builtInExtensions.json
浏览文件 @
45200866
...
@@ -2,11 +2,31 @@
...
@@ -2,11 +2,31 @@
{
{
"name"
:
"ms-vscode.node-debug"
,
"name"
:
"ms-vscode.node-debug"
,
"version"
:
"1.28.2"
,
"version"
:
"1.28.2"
,
"repo"
:
"https://github.com/Microsoft/vscode-node-debug"
"repo"
:
"https://github.com/Microsoft/vscode-node-debug"
,
"metadata"
:
{
"id"
:
"b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6"
,
"publisherId"
:
{
"publisherId"
:
"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee"
,
"publisherName"
:
"ms-vscode"
,
"displayName"
:
"Microsoft"
,
"flags"
:
"verified"
},
"publisherDisplayName"
:
"Microsoft"
}
},
},
{
{
"name"
:
"ms-vscode.node-debug2"
,
"name"
:
"ms-vscode.node-debug2"
,
"version"
:
"1.28.2"
,
"version"
:
"1.28.2"
,
"repo"
:
"https://github.com/Microsoft/vscode-node-debug2"
"repo"
:
"https://github.com/Microsoft/vscode-node-debug2"
,
"metadata"
:
{
"id"
:
"36d19e17-7569-4841-a001-947eb18602b2"
,
"publisherId"
:
{
"publisherId"
:
"5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee"
,
"publisherName"
:
"ms-vscode"
,
"displayName"
:
"Microsoft"
,
"flags"
:
"verified"
},
"publisherDisplayName"
:
"Microsoft"
}
}
}
]
]
\ No newline at end of file
build/lib/builtInExtensions.js
浏览文件 @
45200866
...
@@ -49,7 +49,7 @@ function syncMarketplaceExtension(extension) {
...
@@ -49,7 +49,7 @@ function syncMarketplaceExtension(extension) {
rimraf
.
sync
(
getExtensionPath
(
extension
));
rimraf
.
sync
(
getExtensionPath
(
extension
));
return
ext
.
fromMarketplace
(
extension
.
name
,
extension
.
version
)
return
ext
.
fromMarketplace
(
extension
.
name
,
extension
.
version
,
extension
.
metadata
)
.
pipe
(
rename
(
p
=>
p
.
dirname
=
`
${
extension
.
name
}
/
${
p
.
dirname
}
`
))
.
pipe
(
rename
(
p
=>
p
.
dirname
=
`
${
extension
.
name
}
/
${
p
.
dirname
}
`
))
.
pipe
(
vfs
.
dest
(
'
.build/builtInExtensions
'
))
.
pipe
(
vfs
.
dest
(
'
.build/builtInExtensions
'
))
.
on
(
'
end
'
,
()
=>
util
.
log
(
util
.
colors
.
blue
(
'
[marketplace]
'
),
extension
.
name
,
util
.
colors
.
green
(
'
✔︎
'
)));
.
on
(
'
end
'
,
()
=>
util
.
log
(
util
.
colors
.
blue
(
'
[marketplace]
'
),
extension
.
name
,
util
.
colors
.
green
(
'
✔︎
'
)));
...
...
build/lib/extensions.js
浏览文件 @
45200866
...
@@ -24,7 +24,6 @@ var File = require("vinyl");
...
@@ -24,7 +24,6 @@ var File = require("vinyl");
var
vsce
=
require
(
"
vsce
"
);
var
vsce
=
require
(
"
vsce
"
);
var
stats_1
=
require
(
"
./stats
"
);
var
stats_1
=
require
(
"
./stats
"
);
var
util2
=
require
(
"
./util
"
);
var
util2
=
require
(
"
./util
"
);
var
assign
=
require
(
"
object-assign
"
);
var
remote
=
require
(
"
gulp-remote-src
"
);
var
remote
=
require
(
"
gulp-remote-src
"
);
var
flatmap
=
require
(
'
gulp-flatmap
'
);
var
flatmap
=
require
(
'
gulp-flatmap
'
);
var
vzip
=
require
(
'
gulp-vinyl-zip
'
);
var
vzip
=
require
(
'
gulp-vinyl-zip
'
);
...
@@ -163,74 +162,28 @@ var baseHeaders = {
...
@@ -163,74 +162,28 @@ var baseHeaders = {
'
User-Agent
'
:
'
VSCode Build
'
,
'
User-Agent
'
:
'
VSCode Build
'
,
'
X-Market-User-Id
'
:
'
291C1CD0-051A-4123-9B4B-30D60EF52EE2
'
,
'
X-Market-User-Id
'
:
'
291C1CD0-051A-4123-9B4B-30D60EF52EE2
'
,
};
};
function
fromMarketplace
(
extensionName
,
version
)
{
function
fromMarketplace
(
extensionName
,
version
,
metadata
)
{
var
filterType
=
7
;
var
_a
=
extensionName
.
split
(
'
.
'
),
publisher
=
_a
[
0
],
name
=
_a
[
1
];
var
value
=
extensionName
;
var
url
=
"
https://marketplace.visualstudio.com/_apis/public/gallery/publishers/
"
+
publisher
+
"
/vsextensions/
"
+
name
+
"
/
"
+
version
+
"
/vspackage
"
;
var
criterium
=
{
filterType
:
filterType
,
value
:
value
};
util
.
log
(
'
Downloading extension:
'
,
util
.
colors
.
yellow
(
extensionName
+
"
@
"
+
version
),
'
...
'
);
var
criteria
=
[
criterium
];
var
pageNumber
=
1
;
var
pageSize
=
1
;
var
sortBy
=
0
;
var
sortOrder
=
0
;
var
flags
=
0x1
|
0x2
|
0x80
;
var
assetTypes
=
[
'
Microsoft.VisualStudio.Services.VSIXPackage
'
];
var
filters
=
[{
criteria
:
criteria
,
pageNumber
:
pageNumber
,
pageSize
:
pageSize
,
sortBy
:
sortBy
,
sortOrder
:
sortOrder
}];
var
body
=
JSON
.
stringify
({
filters
:
filters
,
assetTypes
:
assetTypes
,
flags
:
flags
});
var
headers
=
assign
({},
baseHeaders
,
{
'
Content-Type
'
:
'
application/json
'
,
'
Accept
'
:
'
application/json;api-version=3.0-preview.1
'
,
'
Content-Length
'
:
body
.
length
});
var
options
=
{
var
options
=
{
base
:
'
https://marketplace.visualstudio.com/_apis/public/gallery
'
,
base
:
url
,
requestOptions
:
{
requestOptions
:
{
method
:
'
POST
'
,
gzip
:
true
,
gzip
:
true
,
headers
:
headers
,
headers
:
baseHeaders
body
:
body
}
}
};
};
return
remote
(
'
/extensionquery
'
,
options
)
return
remote
(
''
,
options
)
.
pipe
(
flatmap
(
function
(
stream
,
f
)
{
.
pipe
(
flatmap
(
function
(
stream
)
{
var
rawResult
=
f
.
contents
.
toString
(
'
utf8
'
);
var
packageJsonFilter
=
filter
(
'
package.json
'
,
{
restore
:
true
});
var
result
=
JSON
.
parse
(
rawResult
);
return
stream
var
extension
=
result
.
results
[
0
].
extensions
[
0
];
.
pipe
(
vzip
.
src
())
if
(
!
extension
)
{
.
pipe
(
filter
(
'
extension/**
'
))
return
error
(
"
No such extension:
"
+
extension
);
.
pipe
(
rename
(
function
(
p
)
{
return
p
.
dirname
=
p
.
dirname
.
replace
(
/^extension
\/?
/
,
''
);
}))
}
.
pipe
(
packageJsonFilter
)
var
metadata
=
{
.
pipe
(
buffer
())
id
:
extension
.
extensionId
,
.
pipe
(
json
({
__metadata
:
metadata
}))
publisherId
:
extension
.
publisher
,
.
pipe
(
packageJsonFilter
.
restore
);
publisherDisplayName
:
extension
.
publisher
.
displayName
};
var
extensionVersion
=
extension
.
versions
.
filter
(
function
(
v
)
{
return
v
.
version
===
version
;
})[
0
];
if
(
!
extensionVersion
)
{
return
error
(
"
No such extension version:
"
+
extensionName
+
"
@
"
+
version
);
}
var
asset
=
extensionVersion
.
files
.
filter
(
function
(
f
)
{
return
f
.
assetType
===
'
Microsoft.VisualStudio.Services.VSIXPackage
'
;
})[
0
];
if
(
!
asset
)
{
return
error
(
"
No VSIX found for extension version:
"
+
extensionName
+
"
@
"
+
version
);
}
util
.
log
(
'
Downloading extension:
'
,
util
.
colors
.
yellow
(
extensionName
+
"
@
"
+
version
),
'
...
'
);
var
options
=
{
base
:
asset
.
source
,
requestOptions
:
{
gzip
:
true
,
headers
:
baseHeaders
}
};
return
remote
(
''
,
options
)
.
pipe
(
flatmap
(
function
(
stream
)
{
var
packageJsonFilter
=
filter
(
'
package.json
'
,
{
restore
:
true
});
return
stream
.
pipe
(
vzip
.
src
())
.
pipe
(
filter
(
'
extension/**
'
))
.
pipe
(
rename
(
function
(
p
)
{
return
p
.
dirname
=
p
.
dirname
.
replace
(
/^extension
\/?
/
,
''
);
}))
.
pipe
(
packageJsonFilter
)
.
pipe
(
buffer
())
.
pipe
(
json
({
__metadata
:
metadata
}))
.
pipe
(
packageJsonFilter
.
restore
);
}));
}));
}));
}
}
exports
.
fromMarketplace
=
fromMarketplace
;
exports
.
fromMarketplace
=
fromMarketplace
;
...
@@ -272,7 +225,7 @@ function packageExtensionsStream(opts) {
...
@@ -272,7 +225,7 @@ function packageExtensionsStream(opts) {
return
opts
.
desiredExtensions
?
opts
.
desiredExtensions
.
indexOf
(
name
)
>=
0
:
true
;
return
opts
.
desiredExtensions
?
opts
.
desiredExtensions
.
indexOf
(
name
)
>=
0
:
true
;
})
})
.
map
(
function
(
extension
)
{
.
map
(
function
(
extension
)
{
return
fromMarketplace
(
extension
.
name
,
extension
.
version
)
return
fromMarketplace
(
extension
.
name
,
extension
.
version
,
extension
.
metadata
)
.
pipe
(
rename
(
function
(
p
)
{
return
p
.
dirname
=
"
extensions/
"
+
extension
.
name
+
"
/
"
+
p
.
dirname
;
}));
.
pipe
(
rename
(
function
(
p
)
{
return
p
.
dirname
=
"
extensions/
"
+
extension
.
name
+
"
/
"
+
p
.
dirname
;
}));
}));
}));
return
es
.
merge
(
localExtensions
,
localExtensionDependencies
,
marketplaceExtensions
)
return
es
.
merge
(
localExtensions
,
localExtensionDependencies
,
marketplaceExtensions
)
...
...
build/lib/extensions.ts
浏览文件 @
45200866
...
@@ -13,7 +13,6 @@ import * as File from 'vinyl';
...
@@ -13,7 +13,6 @@ import * as File from 'vinyl';
import
*
as
vsce
from
'
vsce
'
;
import
*
as
vsce
from
'
vsce
'
;
import
{
createStatsStream
}
from
'
./stats
'
;
import
{
createStatsStream
}
from
'
./stats
'
;
import
*
as
util2
from
'
./util
'
;
import
*
as
util2
from
'
./util
'
;
import
assign
=
require
(
'
object-assign
'
);
import
remote
=
require
(
'
gulp-remote-src
'
);
import
remote
=
require
(
'
gulp-remote-src
'
);
const
flatmap
=
require
(
'
gulp-flatmap
'
);
const
flatmap
=
require
(
'
gulp-flatmap
'
);
const
vzip
=
require
(
'
gulp-vinyl-zip
'
);
const
vzip
=
require
(
'
gulp-vinyl-zip
'
);
...
@@ -188,83 +187,32 @@ const baseHeaders = {
...
@@ -188,83 +187,32 @@ const baseHeaders = {
'
X-Market-User-Id
'
:
'
291C1CD0-051A-4123-9B4B-30D60EF52EE2
'
,
'
X-Market-User-Id
'
:
'
291C1CD0-051A-4123-9B4B-30D60EF52EE2
'
,
};
};
export
function
fromMarketplace
(
extensionName
:
string
,
version
:
string
):
Stream
{
export
function
fromMarketplace
(
extensionName
:
string
,
version
:
string
,
metadata
:
any
):
Stream
{
const
filterType
=
7
;
const
[
publisher
,
name
]
=
extensionName
.
split
(
'
.
'
);
const
value
=
extensionName
;
const
url
=
`https://marketplace.visualstudio.com/_apis/public/gallery/publishers/
${
publisher
}
/vsextensions/
${
name
}
/
${
version
}
/vspackage`
;
const
criterium
=
{
filterType
,
value
};
const
criteria
=
[
criterium
];
util
.
log
(
'
Downloading extension:
'
,
util
.
colors
.
yellow
(
`
${
extensionName
}
@
${
version
}
`
),
'
...
'
);
const
pageNumber
=
1
;
const
pageSize
=
1
;
const
sortBy
=
0
;
const
sortOrder
=
0
;
const
flags
=
0x1
|
0x2
|
0x80
;
const
assetTypes
=
[
'
Microsoft.VisualStudio.Services.VSIXPackage
'
];
const
filters
=
[{
criteria
,
pageNumber
,
pageSize
,
sortBy
,
sortOrder
}];
const
body
=
JSON
.
stringify
({
filters
,
assetTypes
,
flags
});
const
headers
:
any
=
assign
({},
baseHeaders
,
{
'
Content-Type
'
:
'
application/json
'
,
'
Accept
'
:
'
application/json;api-version=3.0-preview.1
'
,
'
Content-Length
'
:
body
.
length
});
const
options
=
{
const
options
=
{
base
:
'
https://marketplace.visualstudio.com/_apis/public/gallery
'
,
base
:
url
,
requestOptions
:
{
requestOptions
:
{
method
:
'
POST
'
,
gzip
:
true
,
gzip
:
true
,
headers
,
headers
:
baseHeaders
body
}
}
};
};
return
remote
(
'
/extensionquery
'
,
options
)
return
remote
(
''
,
options
)
.
pipe
(
flatmap
((
_
,
f
)
=>
{
.
pipe
(
flatmap
(
stream
=>
{
const
rawResult
=
f
.
contents
.
toString
(
'
utf8
'
);
const
packageJsonFilter
=
filter
(
'
package.json
'
,
{
restore
:
true
});
const
result
=
JSON
.
parse
(
rawResult
);
const
extension
=
result
.
results
[
0
].
extensions
[
0
];
return
stream
if
(
!
extension
)
{
.
pipe
(
vzip
.
src
())
return
error
(
`No such extension:
${
extension
}
`
);
.
pipe
(
filter
(
'
extension/**
'
))
}
.
pipe
(
rename
(
p
=>
p
.
dirname
=
p
.
dirname
.
replace
(
/^extension
\/?
/
,
''
)))
.
pipe
(
packageJsonFilter
)
const
metadata
=
{
.
pipe
(
buffer
())
id
:
extension
.
extensionId
,
.
pipe
(
json
({
__metadata
:
metadata
}))
publisherId
:
extension
.
publisher
,
.
pipe
(
packageJsonFilter
.
restore
);
publisherDisplayName
:
extension
.
publisher
.
displayName
};
const
extensionVersion
=
extension
.
versions
.
filter
(
v
=>
v
.
version
===
version
)[
0
];
if
(
!
extensionVersion
)
{
return
error
(
`No such extension version:
${
extensionName
}
@
${
version
}
`
);
}
const
asset
=
extensionVersion
.
files
.
filter
(
f
=>
f
.
assetType
===
'
Microsoft.VisualStudio.Services.VSIXPackage
'
)[
0
];
if
(
!
asset
)
{
return
error
(
`No VSIX found for extension version:
${
extensionName
}
@
${
version
}
`
);
}
util
.
log
(
'
Downloading extension:
'
,
util
.
colors
.
yellow
(
`
${
extensionName
}
@
${
version
}
`
),
'
...
'
);
const
options
=
{
base
:
asset
.
source
,
requestOptions
:
{
gzip
:
true
,
headers
:
baseHeaders
}
};
return
remote
(
''
,
options
)
.
pipe
(
flatmap
(
stream
=>
{
const
packageJsonFilter
=
filter
(
'
package.json
'
,
{
restore
:
true
});
return
stream
.
pipe
(
vzip
.
src
())
.
pipe
(
filter
(
'
extension/**
'
))
.
pipe
(
rename
(
p
=>
p
.
dirname
=
p
.
dirname
.
replace
(
/^extension
\/?
/
,
''
)))
.
pipe
(
packageJsonFilter
)
.
pipe
(
buffer
())
.
pipe
(
json
({
__metadata
:
metadata
}))
.
pipe
(
packageJsonFilter
.
restore
);
}));
}));
}));
}
}
...
@@ -283,7 +231,14 @@ const excludedExtensions = [
...
@@ -283,7 +231,14 @@ const excludedExtensions = [
'
ms-vscode.node-debug2
'
,
'
ms-vscode.node-debug2
'
,
];
];
const
builtInExtensions
:
{
name
:
string
,
version
:
string
,
repo
:
string
;
}[]
=
require
(
'
../builtInExtensions.json
'
);
interface
IBuiltInExtension
{
name
:
string
;
version
:
string
;
repo
:
string
;
metadata
:
any
;
}
const
builtInExtensions
:
IBuiltInExtension
[]
=
require
(
'
../builtInExtensions.json
'
);
export
function
packageExtensionsStream
(
opts
?:
IPackageExtensionsOptions
):
NodeJS
.
ReadWriteStream
{
export
function
packageExtensionsStream
(
opts
?:
IPackageExtensionsOptions
):
NodeJS
.
ReadWriteStream
{
opts
=
opts
||
{};
opts
=
opts
||
{};
...
@@ -309,7 +264,7 @@ export function packageExtensionsStream(opts?: IPackageExtensionsOptions): NodeJ
...
@@ -309,7 +264,7 @@ export function packageExtensionsStream(opts?: IPackageExtensionsOptions): NodeJ
...
builtInExtensions
...
builtInExtensions
.
filter
(({
name
})
=>
opts
.
desiredExtensions
?
opts
.
desiredExtensions
.
indexOf
(
name
)
>=
0
:
true
)
.
filter
(({
name
})
=>
opts
.
desiredExtensions
?
opts
.
desiredExtensions
.
indexOf
(
name
)
>=
0
:
true
)
.
map
(
extension
=>
{
.
map
(
extension
=>
{
return
fromMarketplace
(
extension
.
name
,
extension
.
version
)
return
fromMarketplace
(
extension
.
name
,
extension
.
version
,
extension
.
metadata
)
.
pipe
(
rename
(
p
=>
p
.
dirname
=
`extensions/
${
extension
.
name
}
/
${
p
.
dirname
}
`
));
.
pipe
(
rename
(
p
=>
p
.
dirname
=
`extensions/
${
extension
.
name
}
/
${
p
.
dirname
}
`
));
})
})
);
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录