Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
7e245249
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,发现更多精彩内容 >>
未验证
提交
7e245249
编写于
8月 31, 2021
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
https://github.com/microsoft/vscode/issues/130073
上级
ba6d3d72
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
151 addition
and
37 deletion
+151
-37
build/azure-pipelines/common/sign-win32.js
build/azure-pipelines/common/sign-win32.js
+17
-0
build/azure-pipelines/common/sign.js
build/azure-pipelines/common/sign.js
+77
-0
build/lib/eslint/vscode-dts-literal-or-types.js
build/lib/eslint/vscode-dts-literal-or-types.js
+2
-3
build/lib/eslint/vscode-dts-literal-or-types.ts
build/lib/eslint/vscode-dts-literal-or-types.ts
+7
-7
build/lib/extensions.js
build/lib/extensions.js
+18
-2
build/lib/util.js
build/lib/util.js
+29
-23
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+1
-2
未找到文件。
build/azure-pipelines/common/sign-win32.js
0 → 100644
浏览文件 @
7e245249
"
use strict
"
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
const
sign_1
=
require
(
"
./sign
"
);
const
path
=
require
(
"
path
"
);
(
0
,
sign_1
.
main
)([
process
.
env
[
'
EsrpCliDllPath
'
],
'
windows
'
,
process
.
env
[
'
ESRPPKI
'
],
process
.
env
[
'
ESRPAADUsername
'
],
process
.
env
[
'
ESRPAADPassword
'
],
path
.
dirname
(
process
.
argv
[
2
]),
path
.
basename
(
process
.
argv
[
2
])
]);
build/azure-pipelines/common/sign.js
0 → 100644
浏览文件 @
7e245249
"
use strict
"
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
main
=
void
0
;
const
cp
=
require
(
"
child_process
"
);
const
fs
=
require
(
"
fs
"
);
const
tmp
=
require
(
"
tmp
"
);
const
crypto
=
require
(
"
crypto
"
);
function
getParams
(
type
)
{
switch
(
type
)
{
case
'
windows
'
:
return
'
[{"keyCode":"CP-230012","operationSetCode":"SigntoolSign","parameters":[{"parameterName":"OpusName","parameterValue":"VS Code"},{"parameterName":"OpusInfo","parameterValue":"https://code.visualstudio.com/"},{"parameterName":"Append","parameterValue":"/as"},{"parameterName":"FileDigest","parameterValue":"/fd
\\
"SHA256
\\
""},{"parameterName":"PageHash","parameterValue":"/NPH"},{"parameterName":"TimeStamp","parameterValue":"/tr
\\
"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer
\\
" /td sha256"}],"toolName":"sign","toolVersion":"1.0"},{"keyCode":"CP-230012","operationSetCode":"SigntoolVerify","parameters":[{"parameterName":"VerifyAll","parameterValue":"/all"}],"toolName":"sign","toolVersion":"1.0"}]
'
;
case
'
rpm
'
:
return
'
[{ "keyCode": "CP-450779-Pgp", "operationSetCode": "LinuxSign", "parameters": [], "toolName": "sign", "toolVersion": "1.0" }]
'
;
case
'
darwin-sign
'
:
return
'
[{"keyCode":"CP-401337-Apple","operationSetCode":"MacAppDeveloperSign","parameters":[{"parameterName":"Hardening","parameterValue":"--options=runtime"}],"toolName":"sign","toolVersion":"1.0"}]
'
;
case
'
darwin-notarize
'
:
return
'
[{"keyCode":"CP-401337-Apple","operationSetCode":"MacAppNotarize","parameters":[{"parameterName":"BundleId","parameterValue":"$(BundleIdentifier)"}],"toolName":"sign","toolVersion":"1.0"}]
'
;
default
:
throw
new
Error
(
`Sign type
${
type
}
not found`
);
}
}
function
main
([
esrpCliPath
,
type
,
cert
,
username
,
password
,
folderPath
,
pattern
])
{
tmp
.
setGracefulCleanup
();
const
patternPath
=
tmp
.
tmpNameSync
();
fs
.
writeFileSync
(
patternPath
,
pattern
);
const
paramsPath
=
tmp
.
tmpNameSync
();
fs
.
writeFileSync
(
paramsPath
,
getParams
(
type
));
const
keyFile
=
tmp
.
tmpNameSync
();
const
key
=
crypto
.
randomBytes
(
32
);
const
iv
=
crypto
.
randomBytes
(
16
);
fs
.
writeFileSync
(
keyFile
,
JSON
.
stringify
({
key
:
key
.
toString
(
'
hex
'
),
iv
:
iv
.
toString
(
'
hex
'
)
}));
const
clientkeyPath
=
tmp
.
tmpNameSync
();
const
clientkeyCypher
=
crypto
.
createCipheriv
(
'
aes-256-cbc
'
,
key
,
iv
);
let
clientkey
=
clientkeyCypher
.
update
(
password
,
'
utf8
'
,
'
hex
'
);
clientkey
+=
clientkeyCypher
.
final
(
'
hex
'
);
fs
.
writeFileSync
(
clientkeyPath
,
clientkey
);
const
clientcertPath
=
tmp
.
tmpNameSync
();
const
clientcertCypher
=
crypto
.
createCipheriv
(
'
aes-256-cbc
'
,
key
,
iv
);
let
clientcert
=
clientcertCypher
.
update
(
cert
,
'
utf8
'
,
'
hex
'
);
clientcert
+=
clientcertCypher
.
final
(
'
hex
'
);
fs
.
writeFileSync
(
clientcertPath
,
clientcert
);
const
args
=
[
esrpCliPath
,
'
vsts.sign
'
,
'
-a
'
,
username
,
'
-k
'
,
clientkeyPath
,
'
-z
'
,
clientcertPath
,
'
-f
'
,
folderPath
,
'
-p
'
,
patternPath
,
'
-u
'
,
'
false
'
,
'
-x
'
,
'
regularSigning
'
,
'
-b
'
,
'
input.json
'
,
'
-l
'
,
'
AzSecPack_PublisherPolicyProd.xml
'
,
'
-y
'
,
'
inlineSignParams
'
,
'
-j
'
,
paramsPath
,
'
-c
'
,
'
9997
'
,
'
-t
'
,
'
120
'
,
'
-g
'
,
'
10
'
,
'
-v
'
,
'
Tls12
'
,
'
-s
'
,
'
https://api.esrp.microsoft.com/api/v1
'
,
'
-m
'
,
'
0
'
,
'
-o
'
,
'
Microsoft
'
,
'
-i
'
,
'
https://www.microsoft.com
'
,
'
-n
'
,
'
5
'
,
'
-r
'
,
'
true
'
,
'
-e
'
,
keyFile
,
];
cp
.
spawnSync
(
'
dotnet
'
,
args
,
{
stdio
:
'
inherit
'
});
}
exports
.
main
=
main
;
if
(
require
.
main
===
module
)
{
main
(
process
.
argv
.
slice
(
2
));
}
build/lib/eslint/vscode-dts-literal-or-types.js
浏览文件 @
7e245249
...
...
@@ -12,9 +12,8 @@ module.exports = new class ApiLiteralOrTypes {
}
create
(
context
)
{
return
{
[
'
TSTypeAnnotation TSUnionType TSLiteralType
'
]:
(
node
)
=>
{
var
_a
;
if
(((
_a
=
node
.
literal
)
===
null
||
_a
===
void
0
?
void
0
:
_a
.
type
)
===
'
TSNullKeyword
'
)
{
[
'
TSTypeAnnotation TSUnionType
'
]:
(
node
)
=>
{
if
(
!
node
.
types
.
every
(
value
=>
value
.
type
===
'
TSLiteralType
'
))
{
return
;
}
context
.
report
({
...
...
build/lib/eslint/vscode-dts-literal-or-types.ts
浏览文件 @
7e245249
...
...
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
eslint
from
'
eslint
'
;
import
{
TSESTree
}
from
'
@typescript-eslint/experimental-utils
'
;
export
=
new
class
ApiLiteralOrTypes
implements
eslint
.
Rule
.
RuleModule
{
...
...
@@ -14,14 +15,13 @@ export = new class ApiLiteralOrTypes implements eslint.Rule.RuleModule {
create
(
context
:
eslint
.
Rule
.
RuleContext
):
eslint
.
Rule
.
RuleListener
{
return
{
[
'
TSTypeAnnotation TSUnionType TSLiteralType
'
]:
(
node
:
any
)
=>
{
if
(
node
.
literal
?.
type
===
'
TSNullKeyword
'
)
{
return
;
[
'
TSTypeAnnotation TSUnionType
'
]:
(
node
:
any
)
=>
{
if
((
<
TSESTree
.
TSUnionType
>
node
).
types
.
every
(
value
=>
value
.
type
===
'
TSLiteralType
'
))
{
context
.
report
({
node
:
node
,
messageId
:
'
useEnum
'
});
}
context
.
report
({
node
:
node
,
messageId
:
'
useEnum
'
});
}
};
}
...
...
build/lib/extensions.js
浏览文件 @
7e245249
...
...
@@ -218,11 +218,27 @@ const webBuiltInExtensions = productJson.webBuiltInExtensions || [];
* Loosely based on `getExtensionKind` from `src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts`
*/
function
isWebExtension
(
manifest
)
{
if
(
Boolean
(
manifest
.
browser
))
{
return
true
;
}
if
(
Boolean
(
manifest
.
main
))
{
return
false
;
}
// neither browser nor main
if
(
typeof
manifest
.
extensionKind
!==
'
undefined
'
)
{
const
extensionKind
=
Array
.
isArray
(
manifest
.
extensionKind
)
?
manifest
.
extensionKind
:
[
manifest
.
extensionKind
];
return
(
extensionKind
.
indexOf
(
'
web
'
)
>=
0
);
if
(
extensionKind
.
indexOf
(
'
web
'
)
>=
0
)
{
return
true
;
}
}
if
(
typeof
manifest
.
contributes
!==
'
undefined
'
)
{
for
(
const
id
of
[
'
debuggers
'
,
'
terminal
'
,
'
typescriptServerPlugins
'
])
{
if
(
manifest
.
contributes
.
hasOwnProperty
(
id
))
{
return
false
;
}
}
}
return
(
!
Boolean
(
manifest
.
main
)
||
Boolean
(
manifest
.
browser
))
;
return
true
;
}
function
packageLocalExtensionsStream
(
forWeb
)
{
const
localExtensionsDescriptions
=
(
glob
.
sync
(
'
extensions/*/package.json
'
)
...
...
build/lib/util.js
浏览文件 @
7e245249
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
buildWebNodePaths
=
exports
.
getElectronVersion
=
exports
.
streamToPromise
=
exports
.
versionStringToNumber
=
exports
.
filter
=
exports
.
rebase
=
exports
.
getVersion
=
exports
.
ensureDir
=
exports
.
rreddir
=
exports
.
rimraf
=
exports
.
rewriteSourceMappingURL
=
exports
.
stripSourceMappingURL
=
exports
.
loadSourcemaps
=
exports
.
cleanNodeModules
=
exports
.
skipDirectories
=
exports
.
toFileUri
=
exports
.
setExecutableBit
=
exports
.
fixWin32DirectoryPermissions
=
exports
.
incremental
=
void
0
;
exports
.
buildWebNodePaths
=
exports
.
acquireWebNodePaths
=
exports
.
getElectronVersion
=
exports
.
streamToPromise
=
exports
.
versionStringToNumber
=
exports
.
filter
=
exports
.
rebase
=
exports
.
getVersion
=
exports
.
ensureDir
=
exports
.
rreddir
=
exports
.
rimraf
=
exports
.
rewriteSourceMappingURL
=
exports
.
stripSourceMappingURL
=
exports
.
loadSourcemaps
=
exports
.
cleanNodeModules
=
exports
.
skipDirectories
=
exports
.
toFileUri
=
exports
.
setExecutableBit
=
exports
.
fixWin32DirectoryPermissions
=
exports
.
incremental
=
void
0
;
const
es
=
require
(
"
event-stream
"
);
const
debounce
=
require
(
"
debounce
"
);
const
_filter
=
require
(
"
gulp-filter
"
);
...
...
@@ -274,31 +274,37 @@ function getElectronVersion() {
return
target
;
}
exports
.
getElectronVersion
=
getElectronVersion
;
function
acquireWebNodePaths
()
{
var
_a
;
const
root
=
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
);
const
webPackageJSON
=
path
.
join
(
root
,
'
/remote/web
'
,
'
package.json
'
);
const
webPackages
=
JSON
.
parse
(
fs
.
readFileSync
(
webPackageJSON
,
'
utf8
'
)).
dependencies
;
const
nodePaths
=
{};
for
(
const
key
of
Object
.
keys
(
webPackages
))
{
const
packageJSON
=
path
.
join
(
root
,
'
node_modules
'
,
key
,
'
package.json
'
);
const
packageData
=
JSON
.
parse
(
fs
.
readFileSync
(
packageJSON
,
'
utf8
'
));
let
entryPoint
=
(
_a
=
packageData
.
browser
)
!==
null
&&
_a
!==
void
0
?
_a
:
packageData
.
main
;
// On rare cases a package doesn't have an entrypoint so we assume it has a dist folder with a min.js
if
(
!
entryPoint
)
{
console
.
warn
(
`No entry point for
${
key
}
assuming dist/
${
key
}
.min.js`
);
entryPoint
=
`dist/
${
key
}
.min.js`
;
}
// Remove any starting path information so it's all relative info
if
(
entryPoint
.
startsWith
(
'
./
'
))
{
entryPoint
=
entryPoint
.
substr
(
2
);
}
else
if
(
entryPoint
.
startsWith
(
'
/
'
))
{
entryPoint
=
entryPoint
.
substr
(
1
);
}
nodePaths
[
key
]
=
entryPoint
;
}
return
nodePaths
;
}
exports
.
acquireWebNodePaths
=
acquireWebNodePaths
;
function
buildWebNodePaths
(
outDir
)
{
const
result
=
()
=>
new
Promise
((
resolve
,
_
)
=>
{
var
_a
;
const
root
=
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
);
const
webPackageJSON
=
path
.
join
(
root
,
'
/remote/web
'
,
'
package.json
'
);
const
webPackages
=
JSON
.
parse
(
fs
.
readFileSync
(
webPackageJSON
,
'
utf8
'
)).
dependencies
;
const
nodePaths
=
{};
for
(
const
key
of
Object
.
keys
(
webPackages
))
{
const
packageJSON
=
path
.
join
(
root
,
'
node_modules
'
,
key
,
'
package.json
'
);
const
packageData
=
JSON
.
parse
(
fs
.
readFileSync
(
packageJSON
,
'
utf8
'
));
let
entryPoint
=
(
_a
=
packageData
.
browser
)
!==
null
&&
_a
!==
void
0
?
_a
:
packageData
.
main
;
// On rare cases a package doesn't have an entrypoint so we assume it has a dist folder with a min.js
if
(
!
entryPoint
)
{
console
.
warn
(
`No entry point for
${
key
}
assuming dist/
${
key
}
.min.js`
);
entryPoint
=
`dist/
${
key
}
.min.js`
;
}
// Remove any starting path information so it's all relative info
if
(
entryPoint
.
startsWith
(
'
./
'
))
{
entryPoint
=
entryPoint
.
substr
(
2
);
}
else
if
(
entryPoint
.
startsWith
(
'
/
'
))
{
entryPoint
=
entryPoint
.
substr
(
1
);
}
nodePaths
[
key
]
=
entryPoint
;
}
const
nodePaths
=
acquireWebNodePaths
();
// Now we write the node paths to out/vs
const
outDirectory
=
path
.
join
(
root
,
outDir
,
'
vs
'
);
fs
.
mkdirSync
(
outDirectory
,
{
recursive
:
true
});
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
7e245249
...
...
@@ -179,8 +179,7 @@ declare module 'vscode' {
* @param options The {@link AuthenticationGetSessionOptions} to use
* @returns A thenable that resolves to an authentication session
*/
export
function
getSession
(
providerId
:
string
,
scopes
:
readonly
string
[],
options
:
AuthenticationGetSessionOptions
&
{
forceNewSession
:
true
}):
Thenable
<
AuthenticationSession
>
;
export
function
getSession
(
providerId
:
string
,
scopes
:
readonly
string
[],
options
:
AuthenticationGetSessionOptions
&
{
forceNewSession
:
{
detail
:
string
}
}):
Thenable
<
AuthenticationSession
>
;
export
function
getSession
(
providerId
:
string
,
scopes
:
readonly
string
[],
options
:
AuthenticationGetSessionOptions
&
{
forceNewSession
:
true
|
{
detail
:
string
}
}):
Thenable
<
AuthenticationSession
>
;
}
export
namespace
workspace
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录