esm - provide a bridge to AMD world (#227361)
parent
a5fbd748f1
commit
21135c81b5
|
@ -943,6 +943,14 @@
|
|||
"when": "hasBrowser",
|
||||
"pattern": "vs/workbench/workbench.web.main.js"
|
||||
},
|
||||
{
|
||||
"when": "hasBrowser",
|
||||
"pattern": "vs/workbench/workbench.web.main.internal"
|
||||
},
|
||||
{
|
||||
"when": "hasBrowser",
|
||||
"pattern": "vs/workbench/workbench.web.main.internal.js"
|
||||
},
|
||||
{
|
||||
"when": "hasBrowser",
|
||||
"pattern": "vs/workbench/~"
|
||||
|
@ -1011,6 +1019,25 @@
|
|||
"vs/workbench/workbench.common.main.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "src/vs/workbench/workbench.web.main.internal.ts",
|
||||
"layer": "browser",
|
||||
"restrictions": [
|
||||
"vs/base/~",
|
||||
"vs/base/parts/*/~",
|
||||
"vs/platform/*/~",
|
||||
"vs/editor/~",
|
||||
"vs/editor/contrib/*/~",
|
||||
"vs/editor/editor.all",
|
||||
"vs/editor/editor.all.js",
|
||||
"vs/workbench/~",
|
||||
"vs/workbench/api/~",
|
||||
"vs/workbench/services/*/~",
|
||||
"vs/workbench/contrib/*/~",
|
||||
"vs/workbench/workbench.common.main",
|
||||
"vs/workbench/workbench.common.main.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "src/vs/workbench/workbench.desktop.main.ts",
|
||||
"layer": "electron-sandbox",
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
"src/vs/workbench/api/test/browser/extHostDocumentData.test.perf-data.ts": true,
|
||||
"src/vs/base/test/node/uri.test.data.txt": true,
|
||||
"src/vs/editor/test/node/diffing/fixtures/**": true,
|
||||
"build/loader.min": true
|
||||
},
|
||||
"files.readonlyInclude": {
|
||||
"**/node_modules/**/*.*": true,
|
||||
|
@ -162,7 +163,7 @@
|
|||
"@xterm/headless",
|
||||
"node-pty",
|
||||
"vscode-notebook-renderer",
|
||||
"src/vs/workbench/workbench.web.main.ts"
|
||||
"src/vs/workbench/workbench.web.main.internal.ts"
|
||||
],
|
||||
"[github-issues]": {
|
||||
"editor.wordWrap": "on"
|
||||
|
|
|
@ -95,7 +95,7 @@ exports.workbenchWeb = function () {
|
|||
] : [
|
||||
...createEditorWorkerModuleDescription('vs/workbench/contrib/output/common/outputLinkComputer'),
|
||||
...createEditorWorkerModuleDescription('vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker'),
|
||||
createModuleDescription('vs/code/browser/workbench/workbench', ['vs/workbench/workbench.web.main'])
|
||||
createModuleDescription('vs/code/browser/workbench/workbench', ['vs/workbench/workbench.web.main.internal'])
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ const webEntryPoints = !isAMD() ? [
|
|||
buildfile.keyboardMaps,
|
||||
buildfile.codeWeb
|
||||
].flat() : [
|
||||
buildfile.entrypoint('vs/workbench/workbench.web.main'),
|
||||
buildfile.entrypoint('vs/workbench/workbench.web.main.internal'),
|
||||
buildfile.base,
|
||||
buildfile.workerExtensionHost,
|
||||
buildfile.workerNotebook,
|
||||
|
|
|
@ -22,6 +22,7 @@ const packageJson = require('../package.json');
|
|||
const { compileBuildTask } = require('./gulpfile.compile');
|
||||
const extensions = require('./lib/extensions');
|
||||
const { isAMD } = require('./lib/amd');
|
||||
const VinylFile = require('vinyl');
|
||||
|
||||
const REPO_ROOT = path.dirname(__dirname);
|
||||
const BUILD_ROOT = path.dirname(REPO_ROOT);
|
||||
|
@ -105,9 +106,10 @@ const vscodeWebEntryPoints = !isAMD() ? [
|
|||
buildfile.workerOutputLinks,
|
||||
buildfile.workerBackgroundTokenization,
|
||||
buildfile.keyboardMaps,
|
||||
buildfile.workbenchWeb()
|
||||
buildfile.workbenchWeb(),
|
||||
buildfile.entrypoint('vs/workbench/workbench.web.main.internal') // TODO@esm remove line when we stop supporting web-amd-esm-bridge
|
||||
].flat() : [
|
||||
buildfile.entrypoint('vs/workbench/workbench.web.main'),
|
||||
buildfile.entrypoint('vs/workbench/workbench.web.main.internal'),
|
||||
buildfile.base,
|
||||
buildfile.workerExtensionHost,
|
||||
buildfile.workerNotebook,
|
||||
|
@ -229,8 +231,21 @@ function packageTask(sourceFolderName, destinationFolderName) {
|
|||
|
||||
const extensions = gulp.src('.build/web/extensions/**', { base: '.build/web', dot: true });
|
||||
|
||||
const sources = es.merge(src, extensions)
|
||||
.pipe(filter(['**', '!**/*.js.map'], { dot: true }));
|
||||
const loader = gulp.src('build/loader.min', { base: 'build', dot: true }).pipe(rename('out/vs/loader.js')); // TODO@esm remove line when we stop supporting web-amd-esm-bridge
|
||||
|
||||
const sources = es.merge(...(!isAMD() ? [src, extensions, loader] : [src, extensions]))
|
||||
.pipe(filter(['**', '!**/*.js.map'], { dot: true }))
|
||||
// TODO@esm remove me once we stop supporting our web-esm-bridge
|
||||
.pipe(es.through(function (file) {
|
||||
if (file.relative === 'out/vs/workbench/workbench.web.main.internal.css') {
|
||||
this.emit('data', new VinylFile({
|
||||
contents: file.contents,
|
||||
path: file.path.replace('workbench.web.main.internal.css', 'workbench.web.main.css'),
|
||||
base: file.base
|
||||
}));
|
||||
}
|
||||
this.emit('data', file);
|
||||
}));
|
||||
|
||||
const name = product.nameShort;
|
||||
const packageJsonStream = gulp.src(['remote/web/package.json'], { base: 'remote/web' })
|
||||
|
|
|
@ -255,7 +255,7 @@ function optimizeESMTask(opts, cjsOpts) {
|
|||
'.sh': 'file',
|
||||
},
|
||||
assetNames: 'media/[name]', // moves media assets into a sub-folder "media"
|
||||
banner,
|
||||
banner: entryPoint.name === 'vs/workbench/workbench.web.main' ? undefined : banner, // TODO@esm remove line when we stop supporting web-amd-esm-bridge
|
||||
entryPoints: [
|
||||
{
|
||||
in: path.join(REPO_ROOT_PATH, opts.src, `${entryPoint.name}.js`),
|
||||
|
|
|
@ -343,7 +343,7 @@ function optimizeESMTask(opts: IOptimizeAMDTaskOpts, cjsOpts?: IOptimizeCommonJS
|
|||
'.sh': 'file',
|
||||
},
|
||||
assetNames: 'media/[name]', // moves media assets into a sub-folder "media"
|
||||
banner,
|
||||
banner: entryPoint.name === 'vs/workbench/workbench.web.main' ? undefined : banner, // TODO@esm remove line when we stop supporting web-amd-esm-bridge
|
||||
entryPoints: [
|
||||
{
|
||||
in: path.join(REPO_ROOT_PATH, opts.src, `${entryPoint.name}.js`),
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -65,6 +65,6 @@
|
|||
<script src="{{WORKBENCH_NLS_FALLBACK_URL}}"></script>
|
||||
<!-- attempt to load NLS messages in case non-english -->
|
||||
<script src="{{WORKBENCH_NLS_URL}}"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.js"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.internal.js"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.js"></script>
|
||||
</html>
|
||||
|
|
|
@ -20,7 +20,7 @@ import { isFolderToOpen, isWorkspaceToOpen } from '../../../platform/window/comm
|
|||
import type { IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from '../../../workbench/browser/web.api.js';
|
||||
import { AuthenticationSessionInfo } from '../../../workbench/services/authentication/browser/authenticationService.js';
|
||||
import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js';
|
||||
import { create } from '../../../workbench/workbench.web.main.js';
|
||||
import { create } from '../../../workbench/workbench.web.main.internal.js';
|
||||
|
||||
interface ISecretStorageCrypto {
|
||||
seal(data: string): Promise<string>;
|
||||
|
|
|
@ -0,0 +1,240 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
// #######################################################################
|
||||
// ### ###
|
||||
// ### !!! PLEASE ADD COMMON IMPORTS INTO WORKBENCH.COMMON.MAIN.TS !!! ###
|
||||
// ### ###
|
||||
// #######################################################################
|
||||
|
||||
|
||||
//#region --- workbench common
|
||||
|
||||
import './workbench.common.main.js';
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
//#region --- workbench parts
|
||||
|
||||
import './browser/parts/dialogs/dialog.web.contribution.js';
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
//#region --- workbench (web main)
|
||||
|
||||
import './browser/web.main.js';
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
//#region --- workbench services
|
||||
|
||||
import './services/integrity/browser/integrityService.js';
|
||||
import './services/search/browser/searchService.js';
|
||||
import './services/textfile/browser/browserTextFileService.js';
|
||||
import './services/keybinding/browser/keyboardLayoutService.js';
|
||||
import './services/extensions/browser/extensionService.js';
|
||||
import './services/extensionManagement/browser/extensionsProfileScannerService.js';
|
||||
import './services/extensions/browser/extensionsScannerService.js';
|
||||
import './services/extensionManagement/browser/webExtensionsScannerService.js';
|
||||
import './services/extensionManagement/common/extensionManagementServerService.js';
|
||||
import './services/telemetry/browser/telemetryService.js';
|
||||
import './services/url/browser/urlService.js';
|
||||
import './services/update/browser/updateService.js';
|
||||
import './services/workspaces/browser/workspacesService.js';
|
||||
import './services/workspaces/browser/workspaceEditingService.js';
|
||||
import './services/dialogs/browser/fileDialogService.js';
|
||||
import './services/host/browser/browserHostService.js';
|
||||
import './services/lifecycle/browser/lifecycleService.js';
|
||||
import './services/clipboard/browser/clipboardService.js';
|
||||
import './services/localization/browser/localeService.js';
|
||||
import './services/path/browser/pathService.js';
|
||||
import './services/themes/browser/browserHostColorSchemeService.js';
|
||||
import './services/encryption/browser/encryptionService.js';
|
||||
import './services/secrets/browser/secretStorageService.js';
|
||||
import './services/workingCopy/browser/workingCopyBackupService.js';
|
||||
import './services/tunnel/browser/tunnelService.js';
|
||||
import './services/files/browser/elevatedFileService.js';
|
||||
import './services/workingCopy/browser/workingCopyHistoryService.js';
|
||||
import './services/userDataSync/browser/webUserDataSyncEnablementService.js';
|
||||
import './services/userDataProfile/browser/userDataProfileStorageService.js';
|
||||
import './services/configurationResolver/browser/configurationResolverService.js';
|
||||
import '../platform/extensionResourceLoader/browser/extensionResourceLoaderService.js';
|
||||
import './services/auxiliaryWindow/browser/auxiliaryWindowService.js';
|
||||
|
||||
import { InstantiationType, registerSingleton } from '../platform/instantiation/common/extensions.js';
|
||||
import { IAccessibilityService } from '../platform/accessibility/common/accessibility.js';
|
||||
import { IContextMenuService } from '../platform/contextview/browser/contextView.js';
|
||||
import { ContextMenuService } from '../platform/contextview/browser/contextMenuService.js';
|
||||
import { IExtensionTipsService } from '../platform/extensionManagement/common/extensionManagement.js';
|
||||
import { ExtensionTipsService } from '../platform/extensionManagement/common/extensionTipsService.js';
|
||||
import { IWorkbenchExtensionManagementService } from './services/extensionManagement/common/extensionManagement.js';
|
||||
import { ExtensionManagementService } from './services/extensionManagement/common/extensionManagementService.js';
|
||||
import { LogLevel } from '../platform/log/common/log.js';
|
||||
import { UserDataSyncMachinesService, IUserDataSyncMachinesService } from '../platform/userDataSync/common/userDataSyncMachines.js';
|
||||
import { IUserDataSyncStoreService, IUserDataSyncService, IUserDataAutoSyncService, IUserDataSyncLocalStoreService, IUserDataSyncResourceProviderService } from '../platform/userDataSync/common/userDataSync.js';
|
||||
import { UserDataSyncStoreService } from '../platform/userDataSync/common/userDataSyncStoreService.js';
|
||||
import { UserDataSyncLocalStoreService } from '../platform/userDataSync/common/userDataSyncLocalStoreService.js';
|
||||
import { UserDataSyncService } from '../platform/userDataSync/common/userDataSyncService.js';
|
||||
import { IUserDataSyncAccountService, UserDataSyncAccountService } from '../platform/userDataSync/common/userDataSyncAccount.js';
|
||||
import { UserDataAutoSyncService } from '../platform/userDataSync/common/userDataAutoSyncService.js';
|
||||
import { AccessibilityService } from '../platform/accessibility/browser/accessibilityService.js';
|
||||
import { ICustomEndpointTelemetryService } from '../platform/telemetry/common/telemetry.js';
|
||||
import { NullEndpointTelemetryService } from '../platform/telemetry/common/telemetryUtils.js';
|
||||
import { ITitleService } from './services/title/browser/titleService.js';
|
||||
import { BrowserTitleService } from './browser/parts/titlebar/titlebarPart.js';
|
||||
import { ITimerService, TimerService } from './services/timer/browser/timerService.js';
|
||||
import { IDiagnosticsService, NullDiagnosticsService } from '../platform/diagnostics/common/diagnostics.js';
|
||||
import { ILanguagePackService } from '../platform/languagePacks/common/languagePacks.js';
|
||||
import { WebLanguagePacksService } from '../platform/languagePacks/browser/languagePacks.js';
|
||||
|
||||
registerSingleton(IWorkbenchExtensionManagementService, ExtensionManagementService, InstantiationType.Delayed);
|
||||
registerSingleton(IAccessibilityService, AccessibilityService, InstantiationType.Delayed);
|
||||
registerSingleton(IContextMenuService, ContextMenuService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncStoreService, UserDataSyncStoreService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncMachinesService, UserDataSyncMachinesService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncLocalStoreService, UserDataSyncLocalStoreService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncAccountService, UserDataSyncAccountService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncService, UserDataSyncService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncResourceProviderService, UserDataSyncResourceProviderService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataAutoSyncService, UserDataAutoSyncService, InstantiationType.Eager /* Eager to start auto sync */);
|
||||
registerSingleton(ITitleService, BrowserTitleService, InstantiationType.Eager);
|
||||
registerSingleton(IExtensionTipsService, ExtensionTipsService, InstantiationType.Delayed);
|
||||
registerSingleton(ITimerService, TimerService, InstantiationType.Delayed);
|
||||
registerSingleton(ICustomEndpointTelemetryService, NullEndpointTelemetryService, InstantiationType.Delayed);
|
||||
registerSingleton(IDiagnosticsService, NullDiagnosticsService, InstantiationType.Delayed);
|
||||
registerSingleton(ILanguagePackService, WebLanguagePacksService, InstantiationType.Delayed);
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
//#region --- workbench contributions
|
||||
|
||||
// Logs
|
||||
import './contrib/logs/browser/logs.contribution.js';
|
||||
|
||||
// Localization
|
||||
import './contrib/localization/browser/localization.contribution.js';
|
||||
|
||||
// Performance
|
||||
import './contrib/performance/browser/performance.web.contribution.js';
|
||||
|
||||
// Preferences
|
||||
import './contrib/preferences/browser/keyboardLayoutPicker.js';
|
||||
|
||||
// Debug
|
||||
import './contrib/debug/browser/extensionHostDebugService.js';
|
||||
|
||||
// Welcome Banner
|
||||
import './contrib/welcomeBanner/browser/welcomeBanner.contribution.js';
|
||||
|
||||
// Welcome Dialog
|
||||
import './contrib/welcomeDialog/browser/welcomeDialog.contribution.js';
|
||||
|
||||
// Webview
|
||||
import './contrib/webview/browser/webview.web.contribution.js';
|
||||
|
||||
// Extensions Management
|
||||
import './contrib/extensions/browser/extensions.web.contribution.js';
|
||||
|
||||
// Terminal
|
||||
import './contrib/terminal/browser/terminal.web.contribution.js';
|
||||
import './contrib/externalTerminal/browser/externalTerminal.contribution.js';
|
||||
import './contrib/terminal/browser/terminalInstanceService.js';
|
||||
|
||||
// Tasks
|
||||
import './contrib/tasks/browser/taskService.js';
|
||||
|
||||
// Tags
|
||||
import './contrib/tags/browser/workspaceTagsService.js';
|
||||
|
||||
// Issues
|
||||
import './contrib/issue/browser/issue.contribution.js';
|
||||
|
||||
// Splash
|
||||
import './contrib/splash/browser/splash.contribution.js';
|
||||
|
||||
// Remote Start Entry for the Web
|
||||
import './contrib/remote/browser/remoteStartEntry.contribution.js';
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
//#region --- export workbench factory
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//
|
||||
// Do NOT change these exports in a way that something is removed unless
|
||||
// intentional. These exports are used by web embedders and thus require
|
||||
// an adoption when something changes.
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
import { create, commands, env, window, workspace, logger } from './browser/web.factory.js';
|
||||
import { Menu } from './browser/web.api.js';
|
||||
import { URI } from '../base/common/uri.js';
|
||||
import { Event, Emitter } from '../base/common/event.js';
|
||||
import { Disposable } from '../base/common/lifecycle.js';
|
||||
import { GroupOrientation } from './services/editor/common/editorGroupsService.js';
|
||||
import { UserDataSyncResourceProviderService } from '../platform/userDataSync/common/userDataSyncResourceProvider.js';
|
||||
import { RemoteAuthorityResolverError, RemoteAuthorityResolverErrorCode } from '../platform/remote/common/remoteAuthorityResolver.js';
|
||||
|
||||
// TODO@esm remove me once we stop supporting our web-esm-bridge
|
||||
if ((globalThis as any).__VSCODE_WEB_ESM_PROMISE) {
|
||||
const exports = {
|
||||
|
||||
// Factory
|
||||
create: create,
|
||||
|
||||
// Basic Types
|
||||
URI: URI,
|
||||
Event: Event,
|
||||
Emitter: Emitter,
|
||||
Disposable: Disposable,
|
||||
// GroupOrientation,
|
||||
LogLevel: LogLevel,
|
||||
RemoteAuthorityResolverError: RemoteAuthorityResolverError,
|
||||
RemoteAuthorityResolverErrorCode: RemoteAuthorityResolverErrorCode,
|
||||
|
||||
// Facade API
|
||||
env: env,
|
||||
window: window,
|
||||
workspace: workspace,
|
||||
commands: commands,
|
||||
logger: logger,
|
||||
Menu: Menu
|
||||
};
|
||||
(globalThis as any).__VSCODE_WEB_ESM_PROMISE(exports);
|
||||
delete (globalThis as any).__VSCODE_WEB_ESM_PROMISE;
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
// Factory
|
||||
create,
|
||||
|
||||
// Basic Types
|
||||
URI,
|
||||
Event,
|
||||
Emitter,
|
||||
Disposable,
|
||||
GroupOrientation,
|
||||
LogLevel,
|
||||
RemoteAuthorityResolverError,
|
||||
RemoteAuthorityResolverErrorCode,
|
||||
|
||||
// Facade API
|
||||
env,
|
||||
window,
|
||||
workspace,
|
||||
commands,
|
||||
logger,
|
||||
Menu
|
||||
};
|
||||
|
||||
//#endregion
|
|
@ -4,208 +4,100 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
// #######################################################################
|
||||
// ### ###
|
||||
// ### !!! PLEASE ADD COMMON IMPORTS INTO WORKBENCH.COMMON.MAIN.TS !!! ###
|
||||
// ### ###
|
||||
// #######################################################################
|
||||
// ####################################
|
||||
// ### ###
|
||||
// ### !!! PLEASE DO NOT MODIFY !!! ###
|
||||
// ### ###
|
||||
// ####################################
|
||||
|
||||
// TODO@esm remove me once we stop supporting our web-esm-bridge
|
||||
|
||||
//#region --- workbench common
|
||||
(function () {
|
||||
|
||||
import './workbench.common.main.js';
|
||||
// #region Types
|
||||
type IGlobalDefine = {
|
||||
(moduleName: string, dependencies: string[], callback: (...args: any[]) => any): any;
|
||||
(moduleName: string, dependencies: string[], definition: any): any;
|
||||
(moduleName: string, callback: (...args: any[]) => any): any;
|
||||
(moduleName: string, definition: any): any;
|
||||
(dependencies: string[], callback: (...args: any[]) => any): any;
|
||||
(dependencies: string[], definition: any): any;
|
||||
};
|
||||
|
||||
//#endregion
|
||||
interface ILoaderPlugin {
|
||||
load: (pluginParam: string, parentRequire: IRelativeRequire, loadCallback: IPluginLoadCallback, options: IConfigurationOptions) => void;
|
||||
write?: (pluginName: string, moduleName: string, write: IPluginWriteCallback) => void;
|
||||
writeFile?: (pluginName: string, moduleName: string, req: IRelativeRequire, write: IPluginWriteFileCallback, config: IConfigurationOptions) => void;
|
||||
finishBuild?: (write: (filename: string, contents: string) => void) => void;
|
||||
}
|
||||
interface IRelativeRequire {
|
||||
(dependencies: string[], callback: Function, errorback?: (error: Error) => void): void;
|
||||
toUrl(id: string): string;
|
||||
}
|
||||
interface IPluginLoadCallback {
|
||||
(value: any): void;
|
||||
error(err: any): void;
|
||||
}
|
||||
interface IConfigurationOptions {
|
||||
isBuild: boolean | undefined;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface IPluginWriteCallback {
|
||||
(contents: string): void;
|
||||
getEntryPoint(): string;
|
||||
asModule(moduleId: string, contents: string): void;
|
||||
}
|
||||
interface IPluginWriteFileCallback {
|
||||
(filename: string, contents: string): void;
|
||||
getEntryPoint(): string;
|
||||
asModule(moduleId: string, contents: string): void;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region --- workbench parts
|
||||
const define: IGlobalDefine = (globalThis as any).define;
|
||||
const require: { getConfig?(): any } | undefined = (globalThis as any).require;
|
||||
|
||||
import './browser/parts/dialogs/dialog.web.contribution.js';
|
||||
if (!define || !require || typeof require.getConfig !== 'function') {
|
||||
throw new Error('Expected global define() and require() functions. Please only load this module in an AMD context!');
|
||||
}
|
||||
|
||||
//#endregion
|
||||
let baseUrl = require?.getConfig().baseUrl;
|
||||
if (!baseUrl) {
|
||||
throw new Error('Failed to determine baseUrl for loading AMD modules (tried require.getConfig().baseUrl)');
|
||||
}
|
||||
if (!baseUrl.endsWith('/')) {
|
||||
baseUrl = baseUrl + '/';
|
||||
}
|
||||
globalThis._VSCODE_FILE_ROOT = baseUrl;
|
||||
|
||||
const trustedTypesPolicy: Pick<TrustedTypePolicy<{ createScriptURL(value: string): string }>, 'name' | 'createScriptURL'> | undefined = require.getConfig().trustedTypesPolicy;
|
||||
if (trustedTypesPolicy) {
|
||||
globalThis._VSCODE_WEB_PACKAGE_TTP = trustedTypesPolicy;
|
||||
}
|
||||
|
||||
//#region --- workbench (web main)
|
||||
const promise = new Promise(resolve => {
|
||||
(globalThis as any).__VSCODE_WEB_ESM_PROMISE = resolve;
|
||||
});
|
||||
|
||||
import './browser/web.main.js';
|
||||
define('vs/web-api', [], () => {
|
||||
return {
|
||||
load: (_name, _req, _load, _config) => {
|
||||
const script: any = document.createElement('script');
|
||||
script.type = 'module';
|
||||
script.src = trustedTypesPolicy ? trustedTypesPolicy.createScriptURL(`${baseUrl}vs/workbench/workbench.web.main.internal.js`) as any as string : `${baseUrl}vs/workbench/workbench.web.main.internal.js`;
|
||||
document.head.appendChild(script);
|
||||
|
||||
//#endregion
|
||||
return promise.then(mod => _load(mod));
|
||||
}
|
||||
} as ILoaderPlugin;
|
||||
});
|
||||
|
||||
|
||||
//#region --- workbench services
|
||||
|
||||
import './services/integrity/browser/integrityService.js';
|
||||
import './services/search/browser/searchService.js';
|
||||
import './services/textfile/browser/browserTextFileService.js';
|
||||
import './services/keybinding/browser/keyboardLayoutService.js';
|
||||
import './services/extensions/browser/extensionService.js';
|
||||
import './services/extensionManagement/browser/extensionsProfileScannerService.js';
|
||||
import './services/extensions/browser/extensionsScannerService.js';
|
||||
import './services/extensionManagement/browser/webExtensionsScannerService.js';
|
||||
import './services/extensionManagement/common/extensionManagementServerService.js';
|
||||
import './services/telemetry/browser/telemetryService.js';
|
||||
import './services/url/browser/urlService.js';
|
||||
import './services/update/browser/updateService.js';
|
||||
import './services/workspaces/browser/workspacesService.js';
|
||||
import './services/workspaces/browser/workspaceEditingService.js';
|
||||
import './services/dialogs/browser/fileDialogService.js';
|
||||
import './services/host/browser/browserHostService.js';
|
||||
import './services/lifecycle/browser/lifecycleService.js';
|
||||
import './services/clipboard/browser/clipboardService.js';
|
||||
import './services/localization/browser/localeService.js';
|
||||
import './services/path/browser/pathService.js';
|
||||
import './services/themes/browser/browserHostColorSchemeService.js';
|
||||
import './services/encryption/browser/encryptionService.js';
|
||||
import './services/secrets/browser/secretStorageService.js';
|
||||
import './services/workingCopy/browser/workingCopyBackupService.js';
|
||||
import './services/tunnel/browser/tunnelService.js';
|
||||
import './services/files/browser/elevatedFileService.js';
|
||||
import './services/workingCopy/browser/workingCopyHistoryService.js';
|
||||
import './services/userDataSync/browser/webUserDataSyncEnablementService.js';
|
||||
import './services/userDataProfile/browser/userDataProfileStorageService.js';
|
||||
import './services/configurationResolver/browser/configurationResolverService.js';
|
||||
import '../platform/extensionResourceLoader/browser/extensionResourceLoaderService.js';
|
||||
import './services/auxiliaryWindow/browser/auxiliaryWindowService.js';
|
||||
|
||||
import { InstantiationType, registerSingleton } from '../platform/instantiation/common/extensions.js';
|
||||
import { IAccessibilityService } from '../platform/accessibility/common/accessibility.js';
|
||||
import { IContextMenuService } from '../platform/contextview/browser/contextView.js';
|
||||
import { ContextMenuService } from '../platform/contextview/browser/contextMenuService.js';
|
||||
import { IExtensionTipsService } from '../platform/extensionManagement/common/extensionManagement.js';
|
||||
import { ExtensionTipsService } from '../platform/extensionManagement/common/extensionTipsService.js';
|
||||
import { IWorkbenchExtensionManagementService } from './services/extensionManagement/common/extensionManagement.js';
|
||||
import { ExtensionManagementService } from './services/extensionManagement/common/extensionManagementService.js';
|
||||
import { LogLevel } from '../platform/log/common/log.js';
|
||||
import { UserDataSyncMachinesService, IUserDataSyncMachinesService } from '../platform/userDataSync/common/userDataSyncMachines.js';
|
||||
import { IUserDataSyncStoreService, IUserDataSyncService, IUserDataAutoSyncService, IUserDataSyncLocalStoreService, IUserDataSyncResourceProviderService } from '../platform/userDataSync/common/userDataSync.js';
|
||||
import { UserDataSyncStoreService } from '../platform/userDataSync/common/userDataSyncStoreService.js';
|
||||
import { UserDataSyncLocalStoreService } from '../platform/userDataSync/common/userDataSyncLocalStoreService.js';
|
||||
import { UserDataSyncService } from '../platform/userDataSync/common/userDataSyncService.js';
|
||||
import { IUserDataSyncAccountService, UserDataSyncAccountService } from '../platform/userDataSync/common/userDataSyncAccount.js';
|
||||
import { UserDataAutoSyncService } from '../platform/userDataSync/common/userDataAutoSyncService.js';
|
||||
import { AccessibilityService } from '../platform/accessibility/browser/accessibilityService.js';
|
||||
import { ICustomEndpointTelemetryService } from '../platform/telemetry/common/telemetry.js';
|
||||
import { NullEndpointTelemetryService } from '../platform/telemetry/common/telemetryUtils.js';
|
||||
import { ITitleService } from './services/title/browser/titleService.js';
|
||||
import { BrowserTitleService } from './browser/parts/titlebar/titlebarPart.js';
|
||||
import { ITimerService, TimerService } from './services/timer/browser/timerService.js';
|
||||
import { IDiagnosticsService, NullDiagnosticsService } from '../platform/diagnostics/common/diagnostics.js';
|
||||
import { ILanguagePackService } from '../platform/languagePacks/common/languagePacks.js';
|
||||
import { WebLanguagePacksService } from '../platform/languagePacks/browser/languagePacks.js';
|
||||
|
||||
registerSingleton(IWorkbenchExtensionManagementService, ExtensionManagementService, InstantiationType.Delayed);
|
||||
registerSingleton(IAccessibilityService, AccessibilityService, InstantiationType.Delayed);
|
||||
registerSingleton(IContextMenuService, ContextMenuService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncStoreService, UserDataSyncStoreService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncMachinesService, UserDataSyncMachinesService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncLocalStoreService, UserDataSyncLocalStoreService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncAccountService, UserDataSyncAccountService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncService, UserDataSyncService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataSyncResourceProviderService, UserDataSyncResourceProviderService, InstantiationType.Delayed);
|
||||
registerSingleton(IUserDataAutoSyncService, UserDataAutoSyncService, InstantiationType.Eager /* Eager to start auto sync */);
|
||||
registerSingleton(ITitleService, BrowserTitleService, InstantiationType.Eager);
|
||||
registerSingleton(IExtensionTipsService, ExtensionTipsService, InstantiationType.Delayed);
|
||||
registerSingleton(ITimerService, TimerService, InstantiationType.Delayed);
|
||||
registerSingleton(ICustomEndpointTelemetryService, NullEndpointTelemetryService, InstantiationType.Delayed);
|
||||
registerSingleton(IDiagnosticsService, NullDiagnosticsService, InstantiationType.Delayed);
|
||||
registerSingleton(ILanguagePackService, WebLanguagePacksService, InstantiationType.Delayed);
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
//#region --- workbench contributions
|
||||
|
||||
// Logs
|
||||
import './contrib/logs/browser/logs.contribution.js';
|
||||
|
||||
// Localization
|
||||
import './contrib/localization/browser/localization.contribution.js';
|
||||
|
||||
// Performance
|
||||
import './contrib/performance/browser/performance.web.contribution.js';
|
||||
|
||||
// Preferences
|
||||
import './contrib/preferences/browser/keyboardLayoutPicker.js';
|
||||
|
||||
// Debug
|
||||
import './contrib/debug/browser/extensionHostDebugService.js';
|
||||
|
||||
// Welcome Banner
|
||||
import './contrib/welcomeBanner/browser/welcomeBanner.contribution.js';
|
||||
|
||||
// Welcome Dialog
|
||||
import './contrib/welcomeDialog/browser/welcomeDialog.contribution.js';
|
||||
|
||||
// Webview
|
||||
import './contrib/webview/browser/webview.web.contribution.js';
|
||||
|
||||
// Extensions Management
|
||||
import './contrib/extensions/browser/extensions.web.contribution.js';
|
||||
|
||||
// Terminal
|
||||
import './contrib/terminal/browser/terminal.web.contribution.js';
|
||||
import './contrib/externalTerminal/browser/externalTerminal.contribution.js';
|
||||
import './contrib/terminal/browser/terminalInstanceService.js';
|
||||
|
||||
// Tasks
|
||||
import './contrib/tasks/browser/taskService.js';
|
||||
|
||||
// Tags
|
||||
import './contrib/tags/browser/workspaceTagsService.js';
|
||||
|
||||
// Issues
|
||||
import './contrib/issue/browser/issue.contribution.js';
|
||||
|
||||
// Splash
|
||||
import './contrib/splash/browser/splash.contribution.js';
|
||||
|
||||
// Remote Start Entry for the Web
|
||||
import './contrib/remote/browser/remoteStartEntry.contribution.js';
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
//#region --- export workbench factory
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//
|
||||
// Do NOT change these exports in a way that something is removed unless
|
||||
// intentional. These exports are used by web embedders and thus require
|
||||
// an adoption when something changes.
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
import { create, commands, env, window, workspace, logger } from './browser/web.factory.js';
|
||||
import { Menu } from './browser/web.api.js';
|
||||
import { URI } from '../base/common/uri.js';
|
||||
import { Event, Emitter } from '../base/common/event.js';
|
||||
import { Disposable } from '../base/common/lifecycle.js';
|
||||
import { GroupOrientation } from './services/editor/common/editorGroupsService.js';
|
||||
import { UserDataSyncResourceProviderService } from '../platform/userDataSync/common/userDataSyncResourceProvider.js';
|
||||
import { RemoteAuthorityResolverError, RemoteAuthorityResolverErrorCode } from '../platform/remote/common/remoteAuthorityResolver.js';
|
||||
|
||||
export {
|
||||
|
||||
// Factory
|
||||
create,
|
||||
|
||||
// Basic Types
|
||||
URI,
|
||||
Event,
|
||||
Emitter,
|
||||
Disposable,
|
||||
GroupOrientation,
|
||||
LogLevel,
|
||||
RemoteAuthorityResolverError,
|
||||
RemoteAuthorityResolverErrorCode,
|
||||
|
||||
// Facade API
|
||||
env,
|
||||
window,
|
||||
workspace,
|
||||
commands,
|
||||
logger,
|
||||
Menu
|
||||
};
|
||||
|
||||
//#endregion
|
||||
define(
|
||||
'vs/workbench/workbench.web.main',
|
||||
['require', 'exports', 'vs/web-api!'],
|
||||
function (_require, exports, webApi) {
|
||||
Object.assign(exports, webApi);
|
||||
}
|
||||
);
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue