Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ecc8571a
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,发现更多精彩内容 >>
提交
ecc8571a
编写于
9月 11, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
web - get product config through build and not via API
上级
ab10e260
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
173 deletion
+36
-173
build/gulpfile.vscode.web.js
build/gulpfile.vscode.web.js
+6
-153
src/vs/platform/product/browser/product.ts
src/vs/platform/product/browser/product.ts
+21
-0
src/vs/workbench/browser/web.main.ts
src/vs/workbench/browser/web.main.ts
+9
-14
src/vs/workbench/workbench.web.api.ts
src/vs/workbench/workbench.web.api.ts
+0
-6
未找到文件。
build/gulpfile.vscode.web.js
浏览文件 @
ecc8571a
...
...
@@ -6,158 +6,11 @@
'
use strict
'
;
const
gulp
=
require
(
'
gulp
'
);
const
path
=
require
(
'
path
'
);
const
es
=
require
(
'
event-stream
'
);
const
util
=
require
(
'
./lib/util
'
);
const
task
=
require
(
'
./lib/task
'
);
const
common
=
require
(
'
./lib/optimize
'
);
const
product
=
require
(
'
../product.json
'
);
const
rename
=
require
(
'
gulp-rename
'
);
const
filter
=
require
(
'
gulp-filter
'
);
const
json
=
require
(
'
gulp-json-editor
'
);
const
_
=
require
(
'
underscore
'
);
const
deps
=
require
(
'
./dependencies
'
);
const
vfs
=
require
(
'
vinyl-fs
'
);
const
packageJson
=
require
(
'
../package.json
'
);
const
{
compileBuildTask
}
=
require
(
'
./gulpfile.compile
'
);
const
REPO_ROOT
=
path
.
dirname
(
__dirname
);
const
commit
=
util
.
getVersion
(
REPO_ROOT
);
const
BUILD_ROOT
=
path
.
dirname
(
REPO_ROOT
);
const
WEB_FOLDER
=
path
.
join
(
REPO_ROOT
,
'
remote
'
,
'
web
'
);
const
noop
=
()
=>
{
return
Promise
.
resolve
();
};
const
productionDependencies
=
deps
.
getProductionDependencies
(
WEB_FOLDER
);
const
nodeModules
=
Object
.
keys
(
product
.
dependencies
||
{})
.
concat
(
_
.
uniq
(
productionDependencies
.
map
(
d
=>
d
.
name
)));
const
vscodeWebResources
=
[
// Workbench
'
out-build/vs/{base,platform,editor,workbench}/**/*.{svg,png}
'
,
'
out-build/vs/code/browser/workbench/*.html
'
,
'
out-build/vs/base/browser/ui/octiconLabel/octicons/**
'
,
'
out-build/vs/**/markdown.css
'
,
// Webview
'
out-build/vs/workbench/contrib/webview/browser/pre/*.js
'
,
// Extension Worker
'
out-build/vs/workbench/services/extensions/worker/extensionHostWorkerMain.js
'
,
// Excludes
'
!out-build/vs/**/{node,electron-browser,electron-main}/**
'
,
'
!out-build/vs/editor/standalone/**
'
,
'
!out-build/vs/workbench/**/*-tb.png
'
,
'
!**/test/**
'
];
const
buildfile
=
require
(
'
../src/buildfile
'
);
const
vscodeWebEntryPoints
=
_
.
flatten
([
buildfile
.
entrypoint
(
'
vs/workbench/workbench.web.api
'
),
buildfile
.
base
,
buildfile
.
workerExtensionHost
,
buildfile
.
keyboardMaps
,
buildfile
.
workbenchWeb
]);
const
optimizeVSCodeWebTask
=
task
.
define
(
'
optimize-vscode-web
'
,
task
.
series
(
util
.
rimraf
(
'
out-vscode-web
'
),
common
.
optimizeTask
({
src
:
'
out-build
'
,
entryPoints
:
_
.
flatten
(
vscodeWebEntryPoints
),
otherSources
:
[],
resources
:
vscodeWebResources
,
loaderConfig
:
common
.
loaderConfig
(
nodeModules
),
out
:
'
out-vscode-web
'
,
bundleInfo
:
undefined
})
));
const
minifyVSCodeWebTask
=
task
.
define
(
'
minify-vscode-web
'
,
task
.
series
(
optimizeVSCodeWebTask
,
util
.
rimraf
(
'
out-vscode-web-min
'
),
common
.
minifyTask
(
'
out-vscode-web
'
,
`https://ticino.blob.core.windows.net/sourcemaps/
${
commit
}
/core`
)
));
gulp
.
task
(
minifyVSCodeWebTask
);
function
packageTask
(
sourceFolderName
,
destinationFolderName
)
{
const
destination
=
path
.
join
(
BUILD_ROOT
,
destinationFolderName
);
return
()
=>
{
const
src
=
gulp
.
src
(
sourceFolderName
+
'
/**
'
,
{
base
:
'
.
'
})
.
pipe
(
rename
(
function
(
path
)
{
path
.
dirname
=
path
.
dirname
.
replace
(
new
RegExp
(
'
^
'
+
sourceFolderName
),
'
out
'
);
}))
.
pipe
(
filter
([
'
**
'
,
'
!**/*.js.map
'
]));
const
sources
=
es
.
merge
(
src
);
let
version
=
packageJson
.
version
;
const
quality
=
product
.
quality
;
if
(
quality
&&
quality
!==
'
stable
'
)
{
version
+=
'
-
'
+
quality
;
}
const
name
=
product
.
nameShort
;
const
packageJsonStream
=
gulp
.
src
([
'
remote/web/package.json
'
],
{
base
:
'
remote/web
'
})
.
pipe
(
json
({
name
,
version
}));
const
date
=
new
Date
().
toISOString
();
const
productJsonStream
=
gulp
.
src
([
'
product.json
'
],
{
base
:
'
.
'
})
.
pipe
(
json
({
commit
,
date
}));
const
license
=
gulp
.
src
([
'
remote/LICENSE
'
],
{
base
:
'
remote
'
});
const
dependenciesSrc
=
_
.
flatten
(
productionDependencies
.
map
(
d
=>
path
.
relative
(
REPO_ROOT
,
d
.
path
)).
map
(
d
=>
[
`
${
d
}
/**`
,
`!
${
d
}
/**/{test,tests}/**`
,
`!
${
d
}
/.bin/**`
]));
const
deps
=
gulp
.
src
(
dependenciesSrc
,
{
base
:
'
remote/web
'
,
dot
:
true
})
.
pipe
(
filter
([
'
**
'
,
'
!**/package-lock.json
'
]))
.
pipe
(
util
.
cleanNodeModules
(
path
.
join
(
__dirname
,
'
.nativeignore
'
)));
const
favicon
=
gulp
.
src
(
'
resources/server/favicon.ico
'
,
{
base
:
'
resources/server
'
});
const
manifest
=
gulp
.
src
(
'
resources/server/manifest.json
'
,
{
base
:
'
resources/server
'
});
const
pwaicons
=
es
.
merge
(
gulp
.
src
(
'
resources/server/code-192.png
'
,
{
base
:
'
resources/server
'
}),
gulp
.
src
(
'
resources/server/code-512.png
'
,
{
base
:
'
resources/server
'
})
);
let
all
=
es
.
merge
(
packageJsonStream
,
productJsonStream
,
license
,
sources
,
deps
,
favicon
,
manifest
,
pwaicons
);
let
result
=
all
.
pipe
(
util
.
skipDirectories
())
.
pipe
(
util
.
fixWin32DirectoryPermissions
());
return
result
.
pipe
(
vfs
.
dest
(
destination
));
};
}
const
dashed
=
(
str
)
=>
(
str
?
`-
${
str
}
`
:
``
);
[
''
,
'
min
'
].
forEach
(
minified
=>
{
const
sourceFolderName
=
`out-vscode-web
${
dashed
(
minified
)}
`
;
const
destinationFolderName
=
`vscode-web`
;
const
vscodeWebTaskCI
=
task
.
define
(
`vscode-web
${
dashed
(
minified
)}
-ci`
,
task
.
series
(
minified
?
minifyVSCodeWebTask
:
optimizeVSCodeWebTask
,
util
.
rimraf
(
path
.
join
(
BUILD_ROOT
,
destinationFolderName
)),
packageTask
(
sourceFolderName
,
destinationFolderName
)
));
gulp
.
task
(
vscodeWebTaskCI
);
const
vscodeWebTask
=
task
.
define
(
`vscode-web
${
dashed
(
minified
)}
`
,
task
.
series
(
compileBuildTask
,
vscodeWebTaskCI
));
gulp
.
task
(
vscodeWebTask
);
});
gulp
.
task
(
'
minify-vscode-web
'
,
noop
);
gulp
.
task
(
'
vscode-web
'
,
noop
);
gulp
.
task
(
'
vscode-web-min
'
,
noop
);
gulp
.
task
(
'
vscode-web-ci
'
,
noop
);
gulp
.
task
(
'
vscode-web-min-ci
'
,
noop
);
src/vs/platform/product/browser/product.ts
0 → 100644
浏览文件 @
ecc8571a
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IProductConfiguration
}
from
'
vs/platform/product/common/product
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
// Built time configuration (do NOT modify)
const
product
=
{
/*BUILD->INSERT_PRODUCT_CONFIGURATION*/
}
as
IProductConfiguration
;
// Running out of sources
if
(
Object
.
keys
(
product
).
length
===
0
)
{
assign
(
product
,
{
version
:
'
1.38.0-dev
'
,
nameLong
:
'
Visual Studio Code Web Dev
'
,
nameShort
:
'
VSCode Web Dev
'
});
}
export
default
product
;
src/vs/workbench/browser/web.main.ts
浏览文件 @
ecc8571a
...
...
@@ -13,7 +13,8 @@ import { Workbench } from 'vs/workbench/browser/workbench';
import
{
IChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
REMOTE_FILE_SYSTEM_CHANNEL_NAME
,
RemoteExtensionsFileSystemProvider
}
from
'
vs/platform/remote/common/remoteAgentFileSystemChannel
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IProductService
,
IProductConfiguration
}
from
'
vs/platform/product/common/product
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/product
'
;
import
product
from
'
vs/platform/product/browser/product
'
;
import
{
RemoteAgentService
}
from
'
vs/workbench/services/remote/browser/remoteAgentServiceImpl
'
;
import
{
RemoteAuthorityResolverService
}
from
'
vs/platform/remote/browser/remoteAuthorityResolverService
'
;
import
{
IRemoteAuthorityResolverService
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
...
...
@@ -131,7 +132,13 @@ class CodeRendererMain extends Disposable {
serviceCollection
.
set
(
IWorkbenchEnvironmentService
,
environmentService
);
// Product
const
productService
=
this
.
createProductService
();
const
productService
=
{
_serviceBrand
:
undefined
,
...{
...
product
,
// dev or built time config
...{
urlProtocol
:
''
}
// web related overrides from us
}
};
serviceCollection
.
set
(
IProductService
,
productService
);
// Remote
...
...
@@ -220,18 +227,6 @@ class CodeRendererMain extends Disposable {
fileService
.
registerProvider
(
Schemas
.
userData
,
this
.
configuration
.
userDataProvider
);
}
private
createProductService
():
IProductService
{
const
productConfiguration
=
{
...
this
.
configuration
.
productConfiguration
?
this
.
configuration
.
productConfiguration
:
{
version
:
'
1.38.0-unknown
'
,
nameLong
:
'
Unknown
'
,
extensionAllowedProposedApi
:
[],
},
...{
urlProtocol
:
''
}
}
as
IProductConfiguration
;
return
{
_serviceBrand
:
undefined
,
...
productConfiguration
};
}
private
async
createStorageService
(
payload
:
IWorkspaceInitializationPayload
,
environmentService
:
IWorkbenchEnvironmentService
,
fileService
:
IFileService
,
logService
:
ILogService
):
Promise
<
BrowserStorageService
>
{
const
storageService
=
new
BrowserStorageService
(
environmentService
,
fileService
);
...
...
src/vs/workbench/workbench.web.api.ts
浏览文件 @
ecc8571a
...
...
@@ -11,7 +11,6 @@ import { IWebSocketFactory } from 'vs/platform/remote/browser/browserSocketFacto
import
{
ICredentialsProvider
}
from
'
vs/workbench/services/credentials/browser/credentialsService
'
;
import
{
IExtensionManifest
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
IURLCallbackProvider
}
from
'
vs/workbench/services/url/browser/urlService
'
;
import
{
IProductConfiguration
}
from
'
vs/platform/product/common/product
'
;
import
{
LogLevel
}
from
'
vs/platform/log/common/log
'
;
export
interface
IWorkbenchConstructionOptions
{
...
...
@@ -74,11 +73,6 @@ export interface IWorkbenchConstructionOptions {
*/
urlCallbackProvider
?:
IURLCallbackProvider
;
/**
* Experimental: Support for product configuration.
*/
productConfiguration
?:
IProductConfiguration
;
/**
* Current logging level. Default is `LogLevel.Info`.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录