ESM merge to main (#227184)

Co-authored-by: Johannes Rieken <jrieken@microsoft.com>
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
This commit is contained in:
Benjamin Pasero 2024-08-30 10:31:46 +02:00 committed by GitHub
parent 11ad426fe2
commit 6b924c5152
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3921 changed files with 50060 additions and 50016 deletions

View File

@ -44,7 +44,9 @@ export = new class implements eslint.Rule.RuleModule {
readonly meta: eslint.Rule.RuleMetaData = {
messages: {
badImport: 'Imports violates \'{{restrictions}}\' restrictions. See https://github.com/microsoft/vscode/wiki/Source-Code-Organization',
badFilename: 'Missing definition in `code-import-patterns` for this file. Define rules at https://github.com/microsoft/vscode/blob/main/.eslintrc.json'
badFilename: 'Missing definition in `code-import-patterns` for this file. Define rules at https://github.com/microsoft/vscode/blob/main/.eslintrc.json',
badAbsolute: 'Imports have to be relative to support ESM',
badExtension: 'Imports have to end with `.js` or `.css` to support ESM',
},
docs: {
url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
@ -181,8 +183,8 @@ export = new class implements eslint.Rule.RuleModule {
if (targetIsVS) {
// Always add "vs/nls" and "vs/amdX"
restrictions.push('vs/nls');
restrictions.push('vs/amdX'); // TODO@jrieken remove after ESM is real
restrictions.push('vs/nls.js');
restrictions.push('vs/amdX.js'); // TODO@jrieken remove after ESM is real
}
if (targetIsVS && option.layer) {
@ -212,6 +214,25 @@ export = new class implements eslint.Rule.RuleModule {
}
private _checkImport(context: eslint.Rule.RuleContext, config: ImportPatternsConfig, node: TSESTree.Node, importPath: string) {
const targetIsVS = /^src\/vs\//.test(getRelativeFilename(context));
if (targetIsVS) {
// ESM: check for import ending with ".js" or ".css"
if (importPath[0] === '.' && !importPath.endsWith('.js') && !importPath.endsWith('.css')) {
context.report({
loc: node.loc,
messageId: 'badExtension',
});
}
// check for import being relative
if (importPath.startsWith('vs/')) {
context.report({
loc: node.loc,
messageId: 'badAbsolute',
});
}
}
// resolve relative paths
if (importPath[0] === '.') {

View File

@ -656,6 +656,7 @@
"http",
"https",
"minimist",
"node:module",
"native-keymap",
"native-watchdog",
"net",
@ -692,6 +693,7 @@
"when": "test",
"allow": [
"vs/css.build",
"vs/css.build.js",
"assert",
"sinon",
"sinon-test"
@ -937,6 +939,10 @@
"when": "hasBrowser",
"pattern": "vs/workbench/workbench.web.main"
},
{
"when": "hasBrowser",
"pattern": "vs/workbench/workbench.web.main.js"
},
{
"when": "hasBrowser",
"pattern": "vs/workbench/~"
@ -977,11 +983,13 @@
"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/contrib/terminal/terminal.all"
"vs/workbench/contrib/terminal/terminal.all",
"vs/workbench/contrib/terminal/terminal.all.js"
]
},
{
@ -994,11 +1002,13 @@
"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",
"vs/workbench/workbench.common.main.js"
]
},
{
@ -1011,11 +1021,13 @@
"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",
"vs/workbench/workbench.common.main.js"
]
},
{
@ -1025,7 +1037,7 @@
]
},
{
"target": "src/vs/{loader.d.ts,css.ts,css.build.ts,monaco.d.ts,nls.messages.ts,nls.ts}",
"target": "src/vs/{loader.d.ts,css.ts,css.build.ts,monaco.d.ts,nls.ts,nls.messages.ts}",
"restrictions": []
},
{

View File

@ -65,34 +65,34 @@ jobs:
- name: Run Monaco Editor Checks
run: yarn monaco-compile-check
- name: Editor Distro & ESM
run: yarn gulp editor-esm
# - name: Editor Distro & ESM
# run: yarn gulp editor-esm
- name: Editor ESM sources check
working-directory: ./test/monaco
run: yarn run esm-check
# - name: Editor ESM sources check
# working-directory: ./test/monaco
# run: yarn run esm-check
- name: Typings validation prep
run: |
mkdir typings-test
# - name: Typings validation prep
# run: |
# mkdir typings-test
- name: Typings validation
working-directory: ./typings-test
run: |
yarn init -yp
../node_modules/.bin/tsc --init
echo "import '../out-monaco-editor-core';" > a.ts
../node_modules/.bin/tsc --noEmit
# - name: Typings validation
# working-directory: ./typings-test
# run: |
# yarn init -yp
# ../node_modules/.bin/tsc --init
# echo "import '../out-monaco-editor-core';" > a.ts
# ../node_modules/.bin/tsc --noEmit
- name: Package Editor with Webpack
working-directory: ./test/monaco
run: yarn run bundle-webpack
# - name: Package Editor with Webpack
# working-directory: ./test/monaco
# run: yarn run bundle-webpack
- name: Compile Editor Tests
working-directory: ./test/monaco
run: yarn run compile
# - name: Compile Editor Tests
# working-directory: ./test/monaco
# run: yarn run compile
- name: Run Editor Tests
timeout-minutes: 5
working-directory: ./test/monaco
run: yarn test
# - name: Run Editor Tests
# timeout-minutes: 5
# working-directory: ./test/monaco
# run: yarn test

View File

@ -76,7 +76,7 @@
"npm.exclude": "**/extensions/**",
"npm.packageManager": "yarn",
"emmet.excludeLanguages": [],
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.quoteStyle": "single",
"json.schemas": [
{

View File

@ -7,7 +7,7 @@ parameters:
type: boolean
- name: VSCODE_RUN_SMOKE_TESTS
type: boolean
- name: VSCODE_BUILD_ESM
- name: VSCODE_BUILD_AMD
type: boolean
default: false
@ -20,19 +20,19 @@ steps:
- ${{ if eq(parameters.VSCODE_RUN_UNIT_TESTS, true) }}:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- script: ./scripts/test-esm.sh --tfs "Unit Tests"
displayName: Run unit tests (Electron) [ESM]
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- script: ./scripts/test-amd.sh --tfs "Unit Tests"
displayName: Run unit tests (Electron) [AMD]
timeoutInMinutes: 15
- script: yarn test-node-esm
displayName: Run unit tests (node.js) [ESM]
- script: yarn test-node-amd
displayName: Run unit tests (node.js) [AMD]
timeoutInMinutes: 15
- script: yarn test-browser-esm-no-install --sequential --browser chromium --browser webkit --tfs "Browser Unit Tests"
- script: yarn test-browser-amd-no-install --sequential --browser chromium --browser webkit --tfs "Browser Unit Tests"
env:
DEBUG: "*browser*"
displayName: Run unit tests (Browser, Chromium & Webkit) [ESM]
displayName: Run unit tests (Browser, Chromium & Webkit) [AMD]
timeoutInMinutes: 30
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- script: ./scripts/test.sh --tfs "Unit Tests"
displayName: Run unit tests (Electron)
timeoutInMinutes: 15
@ -46,19 +46,19 @@ steps:
timeoutInMinutes: 30
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- script: ./scripts/test-esm.sh --build --tfs "Unit Tests"
displayName: Run unit tests (Electron) [ESM]
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- script: ./scripts/test-amd.sh --build --tfs "Unit Tests"
displayName: Run unit tests (Electron) [AMD]
timeoutInMinutes: 15
- script: yarn test-node-esm --build
displayName: Run unit tests (node.js) [ESM]
- script: yarn test-node-amd --build
displayName: Run unit tests (node.js) [AMD]
timeoutInMinutes: 15
- script: yarn test-browser-esm-no-install --sequential --build --browser chromium --browser webkit --tfs "Browser Unit Tests"
- script: yarn test-browser-amd-no-install --sequential --build --browser chromium --browser webkit --tfs "Browser Unit Tests"
env:
DEBUG: "*browser*"
displayName: Run unit tests (Browser, Chromium & Webkit) [ESM]
displayName: Run unit tests (Browser, Chromium & Webkit) [AMD]
timeoutInMinutes: 30
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- script: ./scripts/test.sh --build --tfs "Unit Tests"
displayName: Run unit tests (Electron)
timeoutInMinutes: 15
@ -94,17 +94,17 @@ steps:
displayName: Build integration tests
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- script: ./scripts/test-integration-esm.sh --tfs "Integration Tests"
displayName: Run integration tests (Electron) [ESM]
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- script: ./scripts/test-integration-amd.sh --tfs "Integration Tests"
displayName: Run integration tests (Electron) [AMD]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- script: ./scripts/test-integration --tfs "Integration Tests"
displayName: Run integration tests (Electron)
timeoutInMinutes: 20
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- script: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests
@ -113,12 +113,12 @@ steps:
APP_ROOT="$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)"
APP_NAME="`ls $APP_ROOT | head -n 1`"
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
./scripts/test-integration-esm.sh --build --tfs "Integration Tests"
./scripts/test-integration-amd.sh --build --tfs "Integration Tests"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-darwin-$(VSCODE_ARCH)
displayName: Run integration tests (Electron) [ESM]
displayName: Run integration tests (Electron) [AMD]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- script: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests

View File

@ -9,7 +9,7 @@ parameters:
type: boolean
- name: VSCODE_RUN_SMOKE_TESTS
type: boolean
- name: VSCODE_BUILD_ESM
- name: VSCODE_BUILD_AMD
type: boolean
default: false
@ -177,7 +177,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }}
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ parameters.VSCODE_BUILD_AMD }}
- ${{ elseif and(ne(parameters.VSCODE_CIBUILD, true), ne(parameters.VSCODE_QUALITY, 'oss')) }}:
- task: DownloadPipelineArtifact@2

View File

@ -5,7 +5,7 @@ parameters:
type: boolean
- name: VSCODE_ARCH
type: string
- name: VSCODE_BUILD_ESM
- name: VSCODE_BUILD_AMD
type: boolean
default: false
@ -204,7 +204,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: false
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ parameters.VSCODE_BUILD_AMD }}
${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1

View File

@ -10,7 +10,7 @@ parameters:
- name: PUBLISH_TASK_NAME
type: string
default: PublishPipelineArtifact@0
- name: VSCODE_BUILD_ESM
- name: VSCODE_BUILD_AMD
type: boolean
default: false
@ -36,21 +36,21 @@ steps:
- ${{ if eq(parameters.VSCODE_RUN_UNIT_TESTS, true) }}:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- script: ./scripts/test-esm.sh --tfs "Unit Tests"
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- script: ./scripts/test-amd.sh --tfs "Unit Tests"
env:
DISPLAY: ":10"
displayName: Run unit tests (Electron) [ESM]
displayName: Run unit tests (Electron) [AMD]
timeoutInMinutes: 15
- script: yarn test-node-esm
displayName: Run unit tests (node.js) [ESM]
- script: yarn test-node-amd
displayName: Run unit tests (node.js) [AMD]
timeoutInMinutes: 15
- script: yarn test-browser-esm-no-install --browser chromium --tfs "Browser Unit Tests"
- script: yarn test-browser-amd-no-install --browser chromium --tfs "Browser Unit Tests"
env:
DEBUG: "*browser*"
displayName: Run unit tests (Browser, Chromium) [ESM]
displayName: Run unit tests (Browser, Chromium) [AMD]
timeoutInMinutes: 15
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- script: ./scripts/test.sh --tfs "Unit Tests"
env:
DISPLAY: ":10"
@ -67,19 +67,19 @@ steps:
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- script: ./scripts/test-esm.sh --build --tfs "Unit Tests"
displayName: Run unit tests (Electron) [ESM]
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- script: ./scripts/test-amd.sh --build --tfs "Unit Tests"
displayName: Run unit tests (Electron) [AMD]
timeoutInMinutes: 15
- script: yarn test-node-esm --build
displayName: Run unit tests (node.js) [ESM]
- script: yarn test-node-amd --build
displayName: Run unit tests (node.js) [AMD]
timeoutInMinutes: 15
- script: yarn test-browser-esm-no-install --build --browser chromium --tfs "Browser Unit Tests"
- script: yarn test-browser-amd-no-install --build --browser chromium --tfs "Browser Unit Tests"
env:
DEBUG: "*browser*"
displayName: Run unit tests (Browser, Chromium) [ESM]
displayName: Run unit tests (Browser, Chromium) [AMD]
timeoutInMinutes: 15
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- script: ./scripts/test.sh --build --tfs "Unit Tests"
displayName: Run unit tests (Electron)
timeoutInMinutes: 15
@ -116,13 +116,13 @@ steps:
- ${{ if eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true) }}:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- script: ./scripts/test-integration-esm.sh --tfs "Integration Tests"
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- script: ./scripts/test-integration-amd.sh --tfs "Integration Tests"
env:
DISPLAY: ":10"
displayName: Run integration tests (Electron) [ESM]
displayName: Run integration tests (Electron) [AMD]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- script: ./scripts/test-integration.sh --tfs "Integration Tests"
env:
DISPLAY: ":10"
@ -138,7 +138,7 @@ steps:
timeoutInMinutes: 20
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- script: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests
@ -148,12 +148,12 @@ steps:
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
INTEGRATION_TEST_APP_NAME="$APP_NAME" \
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
./scripts/test-integration-esm.sh --build --tfs "Integration Tests"
./scripts/test-integration-amd.sh --build --tfs "Integration Tests"
env:
VSCODE_REMOTE_SERVER_PATH: $(agent.builddirectory)/vscode-server-linux-$(VSCODE_ARCH)
displayName: Run integration tests (Electron) [ESM]
displayName: Run integration tests (Electron) [AMD]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- script: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests

View File

@ -11,7 +11,7 @@ parameters:
type: boolean
- name: VSCODE_ARCH
type: string
- name: VSCODE_BUILD_ESM
- name: VSCODE_BUILD_AMD
type: boolean
default: false
@ -270,7 +270,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }}
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ parameters.VSCODE_BUILD_AMD }}
${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1

View File

@ -21,6 +21,8 @@ variables:
value: oss
- name: VSCODE_STEP_ON_IT
value: false
- name: VSCODE_BUILD_AMD
value: false
jobs:
- ${{ if ne(variables['VSCODE_CIBUILD'], true) }}:
@ -48,6 +50,7 @@ jobs:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true
VSCODE_RUN_INTEGRATION_TESTS: false
@ -66,6 +69,7 @@ jobs:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: true
@ -84,6 +88,7 @@ jobs:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
@ -107,6 +112,7 @@ jobs:
- template: win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true
@ -124,6 +130,7 @@ jobs:
- template: win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false

View File

@ -100,8 +100,8 @@ parameters:
displayName: "Skip tests"
type: boolean
default: false
- name: VSCODE_BUILD_ESM # TODO@bpasero TODO@esm remove me once ESM is shipped
displayName: "️❗ Build as ESM (!FOR TESTING ONLY!) ️❗"
- name: VSCODE_BUILD_AMD # TODO@bpasero TODO@esm remove me once AMD is removed
displayName: "️❗ Build as AMD (!FOR EMERGENCY ONLY!) ️❗"
type: boolean
default: false
@ -114,8 +114,8 @@ variables:
value: ${{ parameters.CARGO_REGISTRY }}
- name: VSCODE_QUALITY
value: ${{ parameters.VSCODE_QUALITY }}
- name: VSCODE_BUILD_ESM
value: ${{ parameters.VSCODE_BUILD_ESM }}
- name: VSCODE_BUILD_AMD
value: ${{ parameters.VSCODE_BUILD_AMD }}
- name: VSCODE_BUILD_STAGE_WINDOWS
value: ${{ or(eq(parameters.VSCODE_BUILD_WIN32, true), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}
- name: VSCODE_BUILD_STAGE_LINUX
@ -224,7 +224,7 @@ extends:
- template: build/azure-pipelines/product-compile.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
- ${{ if or(eq(parameters.VSCODE_BUILD_LINUX, true),eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true),eq(parameters.VSCODE_BUILD_LINUX_ARM64, true),eq(parameters.VSCODE_BUILD_ALPINE, true),eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true),eq(parameters.VSCODE_BUILD_MACOS, true),eq(parameters.VSCODE_BUILD_MACOS_ARM64, true),eq(parameters.VSCODE_BUILD_WIN32, true),eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}:
- stage: CompileCLI
@ -362,7 +362,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true
@ -377,7 +377,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
@ -392,7 +392,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
@ -408,7 +408,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_ARCH: x64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
@ -432,7 +432,7 @@ extends:
- template: build/azure-pipelines/win32/product-build-win32.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_ARCH: arm64
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
@ -461,7 +461,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true
VSCODE_RUN_INTEGRATION_TESTS: false
@ -477,7 +477,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: true
@ -493,7 +493,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
@ -511,7 +511,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
@ -537,7 +537,7 @@ extends:
parameters:
VSCODE_ARCH: armhf
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
@ -553,7 +553,7 @@ extends:
parameters:
VSCODE_ARCH: arm64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
@ -578,7 +578,7 @@ extends:
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
- ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF_LEGACY_SERVER, true) }}:
@ -591,7 +591,7 @@ extends:
parameters:
VSCODE_ARCH: armhf
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_RUN_INTEGRATION_TESTS: false
- ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64_LEGACY_SERVER, true) }}:
@ -604,7 +604,7 @@ extends:
parameters:
VSCODE_ARCH: arm64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_RUN_INTEGRATION_TESTS: false
- ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_COMPILE_ONLY, false), eq(variables['VSCODE_BUILD_STAGE_ALPINE'], true)) }}:
@ -657,7 +657,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: true
VSCODE_RUN_INTEGRATION_TESTS: false
@ -671,7 +671,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: true
@ -685,7 +685,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
@ -700,7 +700,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false
@ -715,7 +715,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }}
@ -747,7 +747,7 @@ extends:
- template: build/azure-pipelines/darwin/product-build-darwin.yml@self
parameters:
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
VSCODE_BUILD_ESM: ${{ variables.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ variables.VSCODE_BUILD_AMD }}
VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }}
VSCODE_RUN_UNIT_TESTS: false
VSCODE_RUN_INTEGRATION_TESTS: false

View File

@ -1,7 +1,7 @@
parameters:
- name: VSCODE_QUALITY
type: string
- name: VSCODE_BUILD_ESM
- name: VSCODE_BUILD_AMD
type: boolean
default: false
@ -101,9 +101,9 @@ steps:
- script: node build/azure-pipelines/distro/mixin-quality
displayName: Mixin distro quality
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- script: node migrate.mjs --disable-watch
displayName: Migrate to ESM
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- script: node migrate.mjs --disable-watch --enable-esm-to-amd
displayName: Migrate ESM -> AMD
- template: common/install-builtin-extensions.yml@self

View File

@ -12,7 +12,7 @@ parameters:
- name: PUBLISH_TASK_NAME
type: string
default: PublishPipelineArtifact@0
- name: VSCODE_BUILD_ESM
- name: VSCODE_BUILD_AMD
type: boolean
default: false
@ -25,17 +25,17 @@ steps:
- ${{ if eq(parameters.VSCODE_RUN_UNIT_TESTS, true) }}:
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- powershell: .\scripts\test-esm.bat --tfs "Unit Tests"
displayName: Run unit tests (Electron) [ESM]
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- powershell: .\scripts\test-amd.bat --tfs "Unit Tests"
displayName: Run unit tests (Electron) [AMD]
timeoutInMinutes: 15
- powershell: yarn test-node-esm
displayName: Run unit tests (node.js) [ESM]
- powershell: yarn test-node-amd
displayName: Run unit tests (node.js) [AMD]
timeoutInMinutes: 15
- powershell: node test/unit/browser/index.esm.js --sequential --browser chromium --tfs "Browser Unit Tests"
displayName: Run unit tests (Browser, Chromium) [ESM]
- powershell: node test/unit/browser/index.amd.js --sequential --browser chromium --tfs "Browser Unit Tests"
displayName: Run unit tests (Browser, Chromium) [AMD]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- powershell: .\scripts\test.bat --tfs "Unit Tests"
displayName: Run unit tests (Electron)
timeoutInMinutes: 15
@ -47,17 +47,17 @@ steps:
timeoutInMinutes: 20
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- powershell: .\scripts\test-esm.bat --build --tfs "Unit Tests"
displayName: Run unit tests (Electron) [ESM]
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- powershell: .\scripts\test-amd.bat --build --tfs "Unit Tests"
displayName: Run unit tests (Electron) [AMD]
timeoutInMinutes: 15
- script: yarn test-node-esm --build
displayName: Run unit tests (node.js) [ESM]
- script: yarn test-node-amd --build
displayName: Run unit tests (node.js) [AMD]
timeoutInMinutes: 15
- powershell: yarn test-browser-esm-no-install --sequential --build --browser chromium --tfs "Browser Unit Tests"
displayName: Run unit tests (Browser, Chromium) [ESM]
- powershell: yarn test-browser-amd-no-install --sequential --build --browser chromium --tfs "Browser Unit Tests"
displayName: Run unit tests (Browser, Chromium) [AMD]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- powershell: .\scripts\test.bat --build --tfs "Unit Tests"
displayName: Run unit tests (Electron)
timeoutInMinutes: 15
@ -98,17 +98,17 @@ steps:
condition: succeededOrFailed()
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- powershell: .\scripts\test-integration-esm.bat --tfs "Integration Tests"
displayName: Run integration tests (Electron) [ESM]
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- powershell: .\scripts\test-integration-amd.bat --tfs "Integration Tests"
displayName: Run integration tests (Electron) [AMD]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- powershell: .\scripts\test-integration.bat --tfs "Integration Tests"
displayName: Run integration tests (Electron)
timeoutInMinutes: 20
- powershell: .\scripts\test-web-integration.bat --browser firefox
displayName: Run integration tests (Browser, Firefox)
- powershell: .\scripts\test-web-integration.bat --browser chromium
displayName: Run integration tests (Browser, Chromium)
timeoutInMinutes: 20
- powershell: .\scripts\test-remote-integration.bat
@ -116,7 +116,7 @@ steps:
timeoutInMinutes: 20
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- ${{ if eq(parameters.VSCODE_BUILD_ESM, true) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, true) }}:
- powershell: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests
@ -128,10 +128,10 @@ steps:
$AppNameShort = $AppProductJson.nameShort
$env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"
$env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-server-win32-$(VSCODE_ARCH)"
exec { .\scripts\test-integration-esm.bat --build --tfs "Integration Tests" }
displayName: Run integration tests (Electron) [ESM]
exec { .\scripts\test-integration-amd.bat --build --tfs "Integration Tests" }
displayName: Run integration tests (Electron) [AMD]
timeoutInMinutes: 20
- ${{ if eq(parameters.VSCODE_BUILD_ESM, false) }}:
- ${{ if eq(parameters.VSCODE_BUILD_AMD, false) }}:
- powershell: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests

View File

@ -11,7 +11,7 @@ parameters:
type: boolean
- name: VSCODE_RUN_SMOKE_TESTS
type: boolean
- name: VSCODE_BUILD_ESM
- name: VSCODE_BUILD_AMD
type: boolean
default: false
@ -182,7 +182,7 @@ steps:
VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }}
VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }}
VSCODE_BUILD_ESM: ${{ parameters.VSCODE_BUILD_ESM }}
VSCODE_BUILD_AMD: ${{ parameters.VSCODE_BUILD_AMD }}
${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
PUBLISH_TASK_NAME: 1ES.PublishPipelineArtifact@1

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const { isESM } = require('./lib/esm');
const { isAMD } = require('./lib/amd');
/**
* @param {string} name
@ -71,7 +71,7 @@ exports.workerOutputLinks = createEditorWorkerModuleDescription('vs/workbench/co
exports.workerBackgroundTokenization = createEditorWorkerModuleDescription('vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker');
exports.workbenchDesktop = function () {
return isESM() ? [
return !isAMD() ? [
createModuleDescription('vs/workbench/contrib/debug/node/telemetryApp'),
createModuleDescription('vs/platform/files/node/watcher/watcherMain'),
createModuleDescription('vs/platform/terminal/node/ptyHostMain'),
@ -90,7 +90,7 @@ exports.workbenchDesktop = function () {
};
exports.workbenchWeb = function () {
return isESM() ? [
return !isAMD() ? [
createModuleDescription('vs/workbench/workbench.web.main')
] : [
...createEditorWorkerModuleDescription('vs/workbench/contrib/output/common/outputLinkComputer'),

View File

@ -9,7 +9,7 @@ const fs = require("fs");
const minimatch = require("minimatch");
const vscode_universal_bundler_1 = require("vscode-universal-bundler");
const cross_spawn_promise_1 = require("@malept/cross-spawn-promise");
const esm_1 = require("../lib/esm");
const amd_1 = require("../lib/amd");
const root = path.dirname(path.dirname(__dirname));
async function main(buildDir) {
const arch = process.env['VSCODE_ARCH'];
@ -27,7 +27,7 @@ async function main(buildDir) {
'**/CodeResources',
'**/Credits.rtf',
];
const canAsar = !(0, esm_1.isESM)('ASAR disabled in universal build'); // TODO@esm ASAR disabled in ESM
const canAsar = (0, amd_1.isAMD)(); // TODO@esm ASAR disabled in ESM
await (0, vscode_universal_bundler_1.makeUniversalApp)({
x64AppPath,
arm64AppPath,

View File

@ -8,7 +8,7 @@ import * as fs from 'fs';
import * as minimatch from 'minimatch';
import { makeUniversalApp } from 'vscode-universal-bundler';
import { spawn } from '@malept/cross-spawn-promise';
import { isESM } from '../lib/esm';
import { isAMD } from '../lib/amd';
const root = path.dirname(path.dirname(__dirname));
@ -32,7 +32,7 @@ async function main(buildDir?: string) {
'**/Credits.rtf',
];
const canAsar = !isESM('ASAR disabled in universal build'); // TODO@esm ASAR disabled in ESM
const canAsar = isAMD(); // TODO@esm ASAR disabled in ESM
await makeUniversalApp({
x64AppPath,

View File

@ -9,12 +9,12 @@
const gulp = require('gulp');
const util = require('./lib/util');
const date = require('./lib/date');
const esm = require('./lib/esm');
const amd = require('./lib/amd');
const task = require('./lib/task');
const compilation = require('./lib/compilation');
const optimize = require('./lib/optimize');
const isESMBuild = typeof process.env.VSCODE_BUILD_ESM === 'string' && process.env.VSCODE_BUILD_ESM.toLowerCase() === 'true';
const isAMDBuild = typeof process.env.VSCODE_BUILD_AMD === 'string' && process.env.VSCODE_BUILD_AMD.toLowerCase() === 'true';
/**
* @param {boolean} disableMangle
@ -24,9 +24,9 @@ function makeCompileBuildTask(disableMangle) {
util.rimraf('out-build'),
util.buildWebNodePaths('out-build'),
date.writeISODate('out-build'),
esm.setESM(isESMBuild),
amd.setAMD(isAMDBuild),
compilation.compileApiProposalNamesTask,
compilation.compileTask(isESMBuild ? 'src2' : 'src', 'out-build', true, { disableMangle }),
compilation.compileTask(isAMDBuild ? 'src2' : 'src', 'out-build', true, { disableMangle }),
optimize.optimizeLoaderTask('out-build', 'out-build', true)
);
}

View File

@ -34,15 +34,15 @@ gulp.task(compileClientTask);
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(watchTask('out', false), watchApiProposalNamesTask)));
gulp.task(watchClientTask);
const watchClientESMTask = task.define('watch-client-esm', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(watchTask('out', false, 'src2'), watchApiProposalNamesTask)));
gulp.task(watchClientESMTask);
const watchClientAMDTask = task.define('watch-client-amd', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(watchTask('out', false, 'src2'), watchApiProposalNamesTask)));
gulp.task(watchClientAMDTask);
// All
const _compileTask = task.define('compile', task.parallel(monacoTypecheckTask, compileClientTask, compileExtensionsTask, compileExtensionMediaTask));
gulp.task(_compileTask);
gulp.task(task.define('watch', task.parallel(/* monacoTypecheckWatchTask, */ watchClientTask, watchExtensionsTask)));
gulp.task(task.define('watch-esm', task.parallel(/* monacoTypecheckWatchTask, */ watchClientESMTask, watchExtensionsTask)));
gulp.task(task.define('watch-amd', task.parallel(/* monacoTypecheckWatchTask, */ watchClientAMDTask, watchExtensionsTask)));
// Default
gulp.task('default', _compileTask);

View File

@ -31,7 +31,7 @@ const { compileExtensionsBuildTask, compileExtensionMediaBuildTask } = require('
const { vscodeWebResourceIncludes, createVSCodeWebFileContentMapper } = require('./gulpfile.vscode.web');
const cp = require('child_process');
const log = require('fancy-log');
const { isESM } = require('./lib/esm');
const { isAMD } = require('./lib/amd');
const buildfile = require('./buildfile');
const REPO_ROOT = path.dirname(__dirname);
@ -88,7 +88,7 @@ const serverResources = [
...serverResourceExcludes
];
const serverWithWebResourceIncludes = isESM() ? [
const serverWithWebResourceIncludes = !isAMD() ? [
...serverResourceIncludes,
'out-build/vs/code/browser/workbench/*.html',
...vscodeWebResourceIncludes
@ -131,7 +131,7 @@ const serverEntryPoints = [
}
];
const webEntryPoints = isESM() ? [
const webEntryPoints = !isAMD() ? [
buildfile.base,
buildfile.workerExtensionHost,
buildfile.workerNotebook,
@ -343,7 +343,7 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
let packageJsonContents;
const packageJsonStream = gulp.src(['remote/package.json'], { base: 'remote' })
.pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined, ...(isESM(`Setting 'type: module' in top level package.json`) ? { type: 'module' } : {}) })) // TODO@esm this should be configured in the top level package.json
.pipe(json({ name, version, dependencies: undefined, optionalDependencies: undefined, ...(!isAMD() ? { type: 'module' } : {}) })) // TODO@esm this should be configured in the top level package.json
.pipe(es.through(function (file) {
packageJsonContents = file.contents.toString();
this.emit('data', file);

View File

@ -33,12 +33,12 @@ const minimist = require('minimist');
const { compileBuildTask } = require('./gulpfile.compile');
const { compileExtensionsBuildTask, compileExtensionMediaBuildTask } = require('./gulpfile.extensions');
const { promisify } = require('util');
const { isESM } = require('./lib/esm');
const { isAMD } = require('./lib/amd');
const glob = promisify(require('glob'));
const rcedit = promisify(require('rcedit'));
// Build
const vscodeEntryPoints = isESM() ? [
const vscodeEntryPoints = !isAMD() ? [
buildfile.base,
buildfile.workerExtensionHost,
buildfile.workerNotebook,
@ -61,7 +61,7 @@ const vscodeEntryPoints = isESM() ? [
buildfile.code
].flat();
const vscodeResourceIncludes = isESM() ? [
const vscodeResourceIncludes = !isAMD() ? [
// NLS
'out-build/nls.messages.json',
@ -163,7 +163,7 @@ const vscodeResources = [
// be inlined into the target window file in this order
// and they depend on each other in this way.
const windowBootstrapFiles = [];
if (!isESM('Skipping loader.js in window bootstrap files')) {
if (isAMD()) {
windowBootstrapFiles.push('out-build/vs/loader.js');
}
windowBootstrapFiles.push('out-build/bootstrap-window.js');
@ -296,7 +296,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
'vs/workbench/workbench.desktop.main.js',
'vs/workbench/workbench.desktop.main.css',
'vs/workbench/api/node/extensionHostProcess.js',
isESM() ? 'vs/code/electron-sandbox/workbench/workbench.esm.html' : 'vs/code/electron-sandbox/workbench/workbench.html',
!isAMD() ? 'vs/code/electron-sandbox/workbench/workbench.esm.html' : 'vs/code/electron-sandbox/workbench/workbench.html',
'vs/code/electron-sandbox/workbench/workbench.js'
]);
@ -325,13 +325,8 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
version += '-' + quality;
}
if (isESM() && typeof quality === 'string' && quality !== 'exploration') {
// TODO@esm remove this safeguard
throw new Error('Refuse to build ESM on quality other than exploration');
}
const name = product.nameShort;
const packageJsonUpdates = { name, version, ...(isESM(`Setting 'type: module' and 'main: out/main.js' in top level package.json`) ? { type: 'module', main: 'out/main.js' } : {}) }; // TODO@esm this should be configured in the top level package.json
const packageJsonUpdates = { name, version, ...(!isAMD() ? { type: 'module', main: 'out/main.js' } : {}) }; // TODO@esm this should be configured in the top level package.json
// for linux url handling
if (platform === 'linux') {
@ -374,7 +369,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
.pipe(util.rewriteSourceMappingURL(sourceMappingURLBase))
.pipe(jsFilter.restore);
if (!isESM('ASAR disabled in VS Code builds')) { // TODO@esm: ASAR disabled in ESM
if (isAMD()) { // TODO@esm: ASAR disabled in ESM
deps = deps.pipe(createAsar(path.join(process.cwd(), 'node_modules'), [
'**/*.node',
'**/@vscode/ripgrep/bin/*',

View File

@ -21,7 +21,7 @@ const vfs = require('vinyl-fs');
const packageJson = require('../package.json');
const { compileBuildTask } = require('./gulpfile.compile');
const extensions = require('./lib/extensions');
const { isESM } = require('./lib/esm');
const { isAMD } = require('./lib/amd');
const REPO_ROOT = path.dirname(__dirname);
const BUILD_ROOT = path.dirname(REPO_ROOT);
@ -31,7 +31,7 @@ const commit = getVersion(REPO_ROOT);
const quality = product.quality;
const version = (quality && quality !== 'stable') ? `${packageJson.version}-${quality}` : packageJson.version;
const vscodeWebResourceIncludes = isESM() ? [
const vscodeWebResourceIncludes = !isAMD() ? [
// NLS
'out-build/nls.messages.js',
@ -96,7 +96,7 @@ const vscodeWebResources = [
const buildfile = require('./buildfile');
const vscodeWebEntryPoints = isESM() ? [
const vscodeWebEntryPoints = !isAMD() ? [
buildfile.base,
buildfile.workerExtensionHost,
buildfile.workerNotebook,

View File

@ -4,33 +4,33 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.setESM = setESM;
exports.isESM = isESM;
exports.setAMD = setAMD;
exports.isAMD = isAMD;
const path = require("path");
const fs = require("fs");
// TODO@esm remove this
const outDirectory = path.join(__dirname, '..', '..', 'out-build');
const esmMarkerFile = path.join(outDirectory, 'esm');
function setESM(enabled) {
const amdMarkerFile = path.join(outDirectory, 'amd');
function setAMD(enabled) {
const result = () => new Promise((resolve, _) => {
if (enabled) {
fs.mkdirSync(outDirectory, { recursive: true });
fs.writeFileSync(esmMarkerFile, 'true', 'utf8');
console.warn(`Setting build to ESM: true`);
fs.writeFileSync(amdMarkerFile, 'true', 'utf8');
console.warn(`Setting build to AMD: true`);
}
else {
console.warn(`Setting build to ESM: false`);
console.warn(`Setting build to AMD: false`);
}
resolve();
});
result.taskName = 'set-esm';
result.taskName = 'set-amd';
return result;
}
function isESM(logWarning) {
function isAMD(logWarning) {
try {
const res = (typeof process.env.VSCODE_BUILD_ESM === 'string' && process.env.VSCODE_BUILD_ESM.toLowerCase() === 'true') || (fs.readFileSync(esmMarkerFile, 'utf8') === 'true');
const res = (typeof process.env.VSCODE_BUILD_AMD === 'string' && process.env.VSCODE_BUILD_AMD.toLowerCase() === 'true') || (fs.readFileSync(amdMarkerFile, 'utf8') === 'true');
if (res && logWarning) {
console.warn(`[esm] ${logWarning}`);
console.warn(`[amd] ${logWarning}`);
}
return res;
}
@ -38,4 +38,4 @@ function isESM(logWarning) {
return false;
}
}
//# sourceMappingURL=esm.js.map
//# sourceMappingURL=amd.js.map

View File

@ -9,29 +9,29 @@ import * as fs from 'fs';
// TODO@esm remove this
const outDirectory = path.join(__dirname, '..', '..', 'out-build');
const esmMarkerFile = path.join(outDirectory, 'esm');
const amdMarkerFile = path.join(outDirectory, 'amd');
export function setESM(enabled: boolean) {
export function setAMD(enabled: boolean) {
const result = () => new Promise<void>((resolve, _) => {
if (enabled) {
fs.mkdirSync(outDirectory, { recursive: true });
fs.writeFileSync(esmMarkerFile, 'true', 'utf8');
console.warn(`Setting build to ESM: true`);
fs.writeFileSync(amdMarkerFile, 'true', 'utf8');
console.warn(`Setting build to AMD: true`);
} else {
console.warn(`Setting build to ESM: false`);
console.warn(`Setting build to AMD: false`);
}
resolve();
});
result.taskName = 'set-esm';
result.taskName = 'set-amd';
return result;
}
export function isESM(logWarning?: string): boolean {
export function isAMD(logWarning?: string): boolean {
try {
const res = (typeof process.env.VSCODE_BUILD_ESM === 'string' && process.env.VSCODE_BUILD_ESM.toLowerCase() === 'true') || (fs.readFileSync(esmMarkerFile, 'utf8') === 'true');
const res = (typeof process.env.VSCODE_BUILD_AMD === 'string' && process.env.VSCODE_BUILD_AMD.toLowerCase() === 'true') || (fs.readFileSync(amdMarkerFile, 'utf8') === 'true');
if (res && logWarning) {
console.warn(`[esm] ${logWarning}`);
console.warn(`[amd] ${logWarning}`);
}
return res;
} catch (error) {

View File

@ -72,6 +72,7 @@ const CORE_TYPES = [
'__global',
'PerformanceMark',
'PerformanceObserver',
'ImportMeta'
];
// Types that are defined in a common layer but are known to be only
// available in native environments should not be allowed in browser

View File

@ -73,6 +73,7 @@ const CORE_TYPES = [
'__global',
'PerformanceMark',
'PerformanceObserver',
'ImportMeta'
];
// Types that are defined in a common layer but are known to be only

View File

@ -14,7 +14,7 @@ const ts = require("typescript");
const url_1 = require("url");
const workerpool = require("workerpool");
const staticLanguageServiceHost_1 = require("./staticLanguageServiceHost");
const esm_1 = require("../esm");
const amd_1 = require("../amd");
const buildfile = require('../../buildfile');
class ShortIdent {
prefix;
@ -264,7 +264,7 @@ const skippedExportMangledFiles = function () {
// Module passed around as type
'pfs',
// entry points
...(0, esm_1.isESM)() ? [
...!(0, amd_1.isAMD)() ? [
buildfile.entrypoint('vs/server/node/server.main'),
buildfile.base,
buildfile.workerExtensionHost,

View File

@ -12,7 +12,7 @@ import * as ts from 'typescript';
import { pathToFileURL } from 'url';
import * as workerpool from 'workerpool';
import { StaticLanguageServiceHost } from './staticLanguageServiceHost';
import { isESM } from '../esm';
import { isAMD } from '../amd';
const buildfile = require('../../buildfile');
class ShortIdent {
@ -280,7 +280,7 @@ function isNameTakenInFile(node: ts.Node, name: string): boolean {
return false;
}
const skippedExportMangledFiles = function () { // using a function() to ensure late isESM() check
const skippedExportMangledFiles = function () { // using a function() to ensure late isAMD() check
return [
// Build
'css.build',
@ -300,7 +300,7 @@ const skippedExportMangledFiles = function () { // using a function() to ensure
'pfs',
// entry points
...isESM() ? [
...!isAMD() ? [
buildfile.entrypoint('vs/server/node/server.main'),
buildfile.base,
buildfile.workerExtensionHost,

View File

@ -11,7 +11,7 @@ const File = require("vinyl");
const sm = require("source-map");
const path = require("path");
const sort = require("gulp-sort");
const esm_1 = require("./esm");
const amd_1 = require("./amd");
var CollectStepResult;
(function (CollectStepResult) {
CollectStepResult[CollectStepResult["Yes"] = 0] = "Yes";
@ -171,7 +171,7 @@ var _nls;
.map(n => n)
.filter(d => d.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference)
.filter(d => {
if ((0, esm_1.isESM)()) {
if (!(0, amd_1.isAMD)()) {
return d.moduleReference.expression.getText().endsWith(`/nls.js'`);
}
return d.moduleReference.expression.getText() === '\'vs/nls\'';
@ -182,7 +182,7 @@ var _nls;
.map(n => n)
.filter(d => d.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral)
.filter(d => {
if ((0, esm_1.isESM)()) {
if (!(0, amd_1.isAMD)()) {
return d.moduleSpecifier.getText().endsWith(`/nls.js'`);
}
return d.moduleSpecifier.getText() === '\'vs/nls\'';

View File

@ -10,7 +10,7 @@ import * as File from 'vinyl';
import * as sm from 'source-map';
import * as path from 'path';
import * as sort from 'gulp-sort';
import { isESM } from './esm';
import { isAMD } from './amd';
declare class FileSourceMap extends File {
public sourceMap: sm.RawSourceMap;
@ -233,7 +233,7 @@ module _nls {
.map(n => <ts.ImportEqualsDeclaration>n)
.filter(d => d.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference)
.filter(d => {
if (isESM()) {
if (!isAMD()) {
return (<ts.ExternalModuleReference>d.moduleReference).expression.getText().endsWith(`/nls.js'`);
}
return (<ts.ExternalModuleReference>d.moduleReference).expression.getText() === '\'vs/nls\'';
@ -245,7 +245,7 @@ module _nls {
.map(n => <ts.ImportDeclaration>n)
.filter(d => d.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral)
.filter(d => {
if (isESM()) {
if (!isAMD()) {
return d.moduleSpecifier.getText().endsWith(`/nls.js'`);
}
return d.moduleSpecifier.getText() === '\'vs/nls\'';

View File

@ -25,7 +25,7 @@ const util = require("./util");
const postcss_1 = require("./postcss");
const esbuild = require("esbuild");
const sourcemaps = require("gulp-sourcemaps");
const esm_1 = require("./esm");
const amd_1 = require("./amd");
const REPO_ROOT_PATH = path.join(__dirname, '../..');
function log(prefix, message) {
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
@ -344,7 +344,7 @@ function optimizeLoaderTask(src, out, bundleLoader, bundledFileHeader = '', exte
function optimizeTask(opts) {
return function () {
const optimizers = [];
if ((0, esm_1.isESM)('Running optimizer in ESM mode')) {
if (!(0, amd_1.isAMD)()) {
optimizers.push(optimizeESMTask(opts.amd, opts.commonJS));
}
else {

View File

@ -20,7 +20,7 @@ import * as util from './util';
import { gulpPostcss } from './postcss';
import * as esbuild from 'esbuild';
import * as sourcemaps from 'gulp-sourcemaps';
import { isESM } from './esm';
import { isAMD } from './amd';
const REPO_ROOT_PATH = path.join(__dirname, '../..');
@ -504,7 +504,7 @@ export interface IOptimizeTaskOpts {
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
return function () {
const optimizers: NodeJS.ReadWriteStream[] = [];
if (isESM('Running optimizer in ESM mode')) {
if (!isAMD()) {
optimizers.push(optimizeESMTask(opts.amd, opts.commonJS));
} else {
optimizers.push(optimizeAMDTask(opts.amd));

View File

@ -15,7 +15,7 @@ const dep_lists_2 = require("./rpm/dep-lists");
const types_1 = require("./debian/types");
const types_2 = require("./rpm/types");
const product = require("../../product.json");
const esm_1 = require("../lib/esm");
const amd_1 = require("../lib/amd");
// A flag that can easily be toggled.
// Make sure to compile the build directory after toggling the value.
// If false, we warn about new dependencies if they show up
@ -44,7 +44,7 @@ async function getDependencies(packageType, buildDir, applicationName, arch) {
throw new Error('Invalid RPM arch string ' + arch);
}
// Get the files for which we want to find dependencies.
const canAsar = !(0, esm_1.isESM)('ASAR disabled in Linux builds'); // TODO@esm ASAR disabled in ESM
const canAsar = (0, amd_1.isAMD)(); // TODO@esm ASAR disabled in ESM
const nativeModulesPath = path.join(buildDir, 'resources', 'app', canAsar ? 'node_modules.asar.unpacked' : 'node_modules');
const findResult = (0, child_process_1.spawnSync)('find', [nativeModulesPath, '-name', '*.node']);
if (findResult.status) {

View File

@ -15,7 +15,7 @@ import { referenceGeneratedDepsByArch as rpmGeneratedDeps } from './rpm/dep-list
import { DebianArchString, isDebianArchString } from './debian/types';
import { isRpmArchString, RpmArchString } from './rpm/types';
import product = require('../../product.json');
import { isESM } from '../lib/esm';
import { isAMD } from '../lib/amd';
// A flag that can easily be toggled.
// Make sure to compile the build directory after toggling the value.
@ -48,7 +48,7 @@ export async function getDependencies(packageType: 'deb' | 'rpm', buildDir: stri
}
// Get the files for which we want to find dependencies.
const canAsar = !isESM('ASAR disabled in Linux builds'); // TODO@esm ASAR disabled in ESM
const canAsar = isAMD(); // TODO@esm ASAR disabled in ESM
const nativeModulesPath = path.join(buildDir, 'resources', 'app', canAsar ? 'node_modules.asar.unpacked' : 'node_modules');
const findResult = spawnSync('find', [nativeModulesPath, '-name', '*.node']);
if (findResult.status) {

View File

@ -59,9 +59,9 @@ function migrate() {
}
console.log(`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`);
console.log(`COMPLETED ${amdToEsm ? 'AMD->ESM' : 'ESM->AMD'} MIGRATION of ${enableInPlace ? 'src in-place' : 'src to src2'}. You can now launch yarn watch-esm or yarn watch-client-esm`);
if (amdToEsm) {
console.log(`Make sure to set the environment variable VSCODE_BUILD_ESM to a string of value 'true' if you want to build VS Code`);
console.log(`COMPLETED ${amdToEsm ? 'AMD->ESM' : 'ESM->AMD'} MIGRATION of ${enableInPlace ? 'src in-place' : 'src to src2'}. You can now launch yarn watch-amd or yarn watch-client-amd`);
if (esmToAmd) {
console.log(`Make sure to set the environment variable VSCODE_BUILD_AMD to a string of value 'true' if you want to build VS Code as AMD`);
}
if (watchSrc) {

View File

@ -1,6 +1,6 @@
{
"name": "code-oss-dev",
"version": "1.93.0",
"version": "1.94.0",
"distro": "2560b0e8d341a0b6734d28ef71b08e1920ff2501",
"author": {
"name": "Microsoft Corporation"
@ -11,17 +11,17 @@
"scripts": {
"test": "echo Please run any of the test scripts from the scripts folder.",
"test-browser": "npx playwright install && node test/unit/browser/index.js",
"test-browser-esm": "npx playwright install && node test/unit/browser/index.esm.js",
"test-browser-amd": "npx playwright install && node test/unit/browser/index.amd.js",
"test-browser-no-install": "node test/unit/browser/index.js",
"test-browser-esm-no-install": "node test/unit/browser/index.esm.js",
"test-node": "mocha test/unit/node/index.js --delay --ui=tdd --timeout=5000 --exit",
"test-node-esm": "mocha test/unit/node/index.mjs --delay --ui=tdd --timeout=5000 --exit",
"test-browser-amd-no-install": "node test/unit/browser/index.amd.js",
"test-node": "mocha test/unit/node/index.mjs --delay --ui=tdd --timeout=5000 --exit",
"test-node-amd": "mocha test/unit/node/index.amd.js --delay --ui=tdd --timeout=5000 --exit",
"test-extension": "vscode-test",
"preinstall": "node build/npm/preinstall.js",
"postinstall": "node build/npm/postinstall.js",
"compile": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile",
"watch": "npm-run-all -lp watch-client watch-extensions",
"watch-esm": "npm-run-all -lp watch-client-esm watch-extensions",
"watch-amd": "npm-run-all -lp watch-client-amd watch-extensions",
"watchd": "deemon yarn watch",
"watch-webd": "deemon yarn watch-web",
"kill-watchd": "deemon --kill yarn watch",
@ -29,7 +29,7 @@
"restart-watchd": "deemon --restart yarn watch",
"restart-watch-webd": "deemon --restart yarn watch-web",
"watch-client": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-client",
"watch-client-esm": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-client-esm",
"watch-client-amd": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-client-amd",
"watch-clientd": "deemon yarn watch-client",
"kill-watch-clientd": "deemon --kill yarn watch-client",
"watch-extensions": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-extensions watch-extension-media",

View File

@ -74,7 +74,7 @@ async function main() {
openSystemBrowser = true;
}
if (fs.existsSync(path.join(APP_ROOT, 'src2')) || fs.existsSync(path.join(APP_ROOT, 'out-build', 'esm'))) {
if (!fs.existsSync(path.join(APP_ROOT, 'src2')) && !fs.existsSync(path.join(APP_ROOT, 'out-build', 'amd'))) {
serverArgs.push('--esm');
}

View File

@ -17,7 +17,7 @@ if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
:: Run tests
set ELECTRON_ENABLE_LOGGING=1
%CODE% .\test\unit\electron\index.esm.js --crash-reporter-directory=%~dp0\..\.build\crashes %*
%CODE% .\test\unit\electron\index.amd.js --crash-reporter-directory=%~dp0\..\.build\crashes %*
popd

View File

@ -34,10 +34,10 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
cd $ROOT ; ulimit -n 4096 ; \
ELECTRON_ENABLE_LOGGING=1 \
"$CODE" \
test/unit/electron/index.esm.js --crash-reporter-directory=$VSCODECRASHDIR "$@"
test/unit/electron/index.amd.js --crash-reporter-directory=$VSCODECRASHDIR "$@"
else
cd $ROOT ; \
ELECTRON_ENABLE_LOGGING=1 \
"$CODE" \
test/unit/electron/index.esm.js --crash-reporter-directory=$VSCODECRASHDIR $LINUX_EXTRA_ARGS "$@"
test/unit/electron/index.amd.js --crash-reporter-directory=$VSCODECRASHDIR $LINUX_EXTRA_ARGS "$@"
fi

View File

@ -29,7 +29,7 @@ echo Storing log files into '%VSCODELOGSDIR%'.
echo.
echo ### node.js integration tests
call .\scripts\test-esm.bat --runGlob **\*.integrationTest.js %*
call .\scripts\test-amd.bat --runGlob **\*.integrationTest.js %*
if %errorlevel% neq 0 exit /b %errorlevel%

View File

@ -39,7 +39,7 @@ echo "Storing log files into '$VSCODELOGSDIR'."
echo
echo "### node.js integration tests"
echo
./scripts/test-esm.sh --runGlob **/*.integrationTest.js "$@"
./scripts/test-amd.sh --runGlob **/*.integrationTest.js "$@"
# Tests in the extension host

180
src/bootstrap-amd.js vendored
View File

@ -12,37 +12,37 @@
*/
// ESM-uncomment-begin
// import * as path from 'path';
// import * as fs from 'fs';
// import { fileURLToPath } from 'url';
// import { createRequire, register } from 'node:module';
// import { product, pkg } from './bootstrap-meta.js';
// import './bootstrap-node.js';
// import * as performance from './vs/base/common/performance.js';
//
// const require = createRequire(import.meta.url);
// /** @type any */
// const module = { exports: {} };
// const __dirname = path.dirname(fileURLToPath(import.meta.url));
//
// // Install a hook to module resolution to map 'fs' to 'original-fs'
// if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
// const jsCode = `
// export async function resolve(specifier, context, nextResolve) {
// if (specifier === 'fs') {
// return {
// format: 'builtin',
// shortCircuit: true,
// url: 'node:original-fs'
// };
// }
import * as path from 'path';
import * as fs from 'fs';
import { fileURLToPath } from 'url';
import { createRequire, register } from 'node:module';
import { product, pkg } from './bootstrap-meta.js';
import './bootstrap-node.js';
import * as performance from './vs/base/common/performance.js';
// // Defer to the next hook in the chain, which would be the
// // Node.js default resolve if this is the last user-specified loader.
// return nextResolve(specifier, context);
// }`;
// register(`data:text/javascript;base64,${Buffer.from(jsCode).toString('base64')}`, import.meta.url);
// }
const require = createRequire(import.meta.url);
/** @type any */
const module = { exports: {} };
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// Install a hook to module resolution to map 'fs' to 'original-fs'
if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
const jsCode = `
export async function resolve(specifier, context, nextResolve) {
if (specifier === 'fs') {
return {
format: 'builtin',
shortCircuit: true,
url: 'node:original-fs'
};
}
// Defer to the next hook in the chain, which would be the
// Node.js default resolve if this is the last user-specified loader.
return nextResolve(specifier, context);
}`;
register(`data:text/javascript;base64,${Buffer.from(jsCode).toString('base64')}`, import.meta.url);
}
// ESM-uncomment-end
// Store the node.js require function in a variable
@ -56,10 +56,10 @@ globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target
// VSCODE_GLOBALS: package/product.json
/** @type Partial<IProductConfiguration> */
// ESM-comment-begin
globalThis._VSCODE_PRODUCT_JSON = require('./bootstrap-meta').product;
// globalThis._VSCODE_PRODUCT_JSON = require('./bootstrap-meta').product;
// ESM-comment-end
// ESM-uncomment-begin
// globalThis._VSCODE_PRODUCT_JSON = { ...product };
globalThis._VSCODE_PRODUCT_JSON = { ...product };
// ESM-uncomment-end
if (process.env['VSCODE_DEV']) {
// Patch product overrides when running out of sources
@ -70,19 +70,19 @@ if (process.env['VSCODE_DEV']) {
} catch (error) { /* ignore */ }
}
// ESM-comment-begin
globalThis._VSCODE_PACKAGE_JSON = require('./bootstrap-meta').pkg;
// globalThis._VSCODE_PACKAGE_JSON = require('./bootstrap-meta').pkg;
// ESM-comment-end
// ESM-uncomment-begin
// globalThis._VSCODE_PACKAGE_JSON = { ...pkg };
globalThis._VSCODE_PACKAGE_JSON = { ...pkg };
// ESM-uncomment-end
// VSCODE_GLOBALS: file root of all resources
globalThis._VSCODE_FILE_ROOT = __dirname;
// ESM-comment-begin
const bootstrapNode = require('./bootstrap-node');
const performance = require(`./vs/base/common/performance`);
const fs = require('fs');
// const bootstrapNode = require('./bootstrap-node');
// const performance = require(`./vs/base/common/performance`);
// const fs = require('fs');
// ESM-comment-end
//#region NLS helpers
@ -169,47 +169,6 @@ async function doSetupNLS() {
//#region Loader Config
// ESM-uncomment-begin
// /**
// * @param {string=} entrypoint
// * @param {(value: any) => void} [onLoad]
// * @param {(err: Error) => void} [onError]
// */
// module.exports.load = function (entrypoint, onLoad, onError) {
// if (!entrypoint) {
// return;
// }
// entrypoint = `./${entrypoint}.js`;
// onLoad = onLoad || function () { };
// onError = onError || function (err) { console.error(err); };
// setupNLS().then(() => {
// performance.mark(`code/fork/willLoadCode`);
// import(entrypoint).then(onLoad, onError);
// });
// };
// ESM-uncomment-end
// ESM-comment-begin
// @ts-ignore
const loader = require('./vs/loader');
loader.config({
baseUrl: bootstrapNode.fileUriFromPath(__dirname, { isWindows: process.platform === 'win32' }),
catchError: true,
nodeRequire,
amdModulesPattern: /^vs\//,
recordStats: true
});
// Running in Electron
if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
loader.define('fs', ['original-fs'], function (/** @type {import('fs')} */originalFS) {
return originalFS; // replace the patched electron fs with the original node fs for all AMD code
});
}
/**
* @param {string=} entrypoint
* @param {(value: any) => void} [onLoad]
@ -220,28 +179,69 @@ module.exports.load = function (entrypoint, onLoad, onError) {
return;
}
// code cache config
if (process.env['VSCODE_CODE_CACHE_PATH']) {
loader.config({
nodeCachedData: {
path: process.env['VSCODE_CODE_CACHE_PATH'],
seed: entrypoint
}
});
}
entrypoint = `./${entrypoint}.js`;
onLoad = onLoad || function () { };
onError = onError || function (err) { console.error(err); };
setupNLS().then(() => {
performance.mark('code/fork/willLoadCode');
loader([entrypoint], onLoad, onError);
performance.mark(`code/fork/willLoadCode`);
import(entrypoint).then(onLoad, onError);
});
};
// ESM-uncomment-end
// ESM-comment-begin
// // @ts-ignore
// const loader = require('./vs/loader');
//
// loader.config({
// baseUrl: bootstrapNode.fileUriFromPath(__dirname, { isWindows: process.platform === 'win32' }),
// catchError: true,
// nodeRequire,
// amdModulesPattern: /^vs\//,
// recordStats: true
// });
//
// // Running in Electron
// if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
// loader.define('fs', ['original-fs'], function (/** @type {import('fs')} */originalFS) {
// return originalFS; // replace the patched electron fs with the original node fs for all AMD code
// });
// }
//
// /**
// * @param {string=} entrypoint
// * @param {(value: any) => void} [onLoad]
// * @param {(err: Error) => void} [onError]
// */
// module.exports.load = function (entrypoint, onLoad, onError) {
// if (!entrypoint) {
// return;
// }
//
// // code cache config
// if (process.env['VSCODE_CODE_CACHE_PATH']) {
// loader.config({
// nodeCachedData: {
// path: process.env['VSCODE_CODE_CACHE_PATH'],
// seed: entrypoint
// }
// });
// }
//
// onLoad = onLoad || function () { };
// onError = onError || function (err) { console.error(err); };
//
// setupNLS().then(() => {
// performance.mark('code/fork/willLoadCode');
// loader([entrypoint], onLoad, onError);
// });
// };
// ESM-comment-end
//#endregion
// ESM-uncomment-begin
// export const load = module.exports.load;
export const load = module.exports.load;
// ESM-uncomment-end

12
src/bootstrap-fork.js vendored
View File

@ -7,14 +7,14 @@
'use strict';
// ESM-comment-begin
const performance = require('./vs/base/common/performance');
const bootstrapNode = require('./bootstrap-node');
const bootstrapAmd = require('./bootstrap-amd');
// const performance = require('./vs/base/common/performance');
// const bootstrapNode = require('./bootstrap-node');
// const bootstrapAmd = require('./bootstrap-amd');
// ESM-comment-end
// ESM-uncomment-begin
// import * as performance from './vs/base/common/performance.js';
// import * as bootstrapNode from './bootstrap-node.js';
// import * as bootstrapAmd from './bootstrap-amd.js';
import * as performance from './vs/base/common/performance.js';
import * as bootstrapNode from './bootstrap-node.js';
import * as bootstrapAmd from './bootstrap-amd.js';
// ESM-uncomment-end
performance.mark('code/fork/start');

14
src/bootstrap-meta.js vendored
View File

@ -11,11 +11,11 @@
*/
// ESM-uncomment-begin
// import { createRequire } from 'node:module';
//
// const require = createRequire(import.meta.url);
// /** @type any */
// const module = { exports: {} };
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
/** @type any */
const module = { exports: {} };
// ESM-uncomment-end
/** @type Partial<IProductConfiguration> & { BUILD_INSERT_PRODUCT_CONFIGURATION?: string } */
@ -36,6 +36,6 @@ module.exports.product = productObj;
module.exports.pkg = pkgObj;
// ESM-uncomment-begin
// export const product = module.exports.product;
// export const pkg = module.exports.pkg;
export const product = module.exports.product;
export const pkg = module.exports.pkg;
// ESM-uncomment-end

117
src/bootstrap-node.js vendored
View File

@ -7,20 +7,21 @@
'use strict';
// ESM-comment-begin
const path = require('path');
const fs = require('fs');
const Module = require('module');
// const path = require('path');
// const fs = require('fs');
// const Module = require('module');
// ESM-comment-end
// ESM-uncomment-begin
// import * as path from 'path';
// import * as fs from 'fs';
// import { fileURLToPath } from 'url';
// import { createRequire } from 'node:module';
//
// const require = createRequire(import.meta.url);
// /** @type any */
// const module = { exports: {} };
// const __dirname = path.dirname(fileURLToPath(import.meta.url));
import * as path from 'path';
import * as fs from 'fs';
import { fileURLToPath } from 'url';
import { createRequire } from 'node:module';
/** @ts-ignore */
const require = createRequire(import.meta.url);
/** @type any */
const module = { exports: {} };
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// ESM-uncomment-end
// increase number of stack frames(from 10, https://github.com/v8/v8/wiki/Stack-Trace-API)
@ -84,29 +85,29 @@ module.exports.devInjectNodeModuleLookupPath = function (injectPath) {
const Module = require('node:module');
// ESM-uncomment-begin
// // register a loader hook
// Module.register('./bootstrap-import.js', { parentURL: import.meta.url, data: injectPath });
// register a loader hook
Module.register('./bootstrap-import.js', { parentURL: import.meta.url, data: injectPath });
// ESM-uncomment-end
// ESM-comment-begin
const nodeModulesPath = path.join(__dirname, '../node_modules');
// @ts-ignore
const originalResolveLookupPaths = Module._resolveLookupPaths;
// @ts-ignore
Module._resolveLookupPaths = function (moduleName, parent) {
const paths = originalResolveLookupPaths(moduleName, parent);
if (Array.isArray(paths)) {
for (let i = 0, len = paths.length; i < len; i++) {
if (paths[i] === nodeModulesPath) {
paths.splice(i, 0, injectPath);
break;
}
}
}
return paths;
};
// const nodeModulesPath = path.join(__dirname, '../node_modules');
//
// // @ts-ignore
// const originalResolveLookupPaths = Module._resolveLookupPaths;
//
// // @ts-ignore
// Module._resolveLookupPaths = function (moduleName, parent) {
// const paths = originalResolveLookupPaths(moduleName, parent);
// if (Array.isArray(paths)) {
// for (let i = 0, len = paths.length; i < len; i++) {
// if (paths[i] === nodeModulesPath) {
// paths.splice(i, 0, injectPath);
// break;
// }
// }
// }
//
// return paths;
// };
// ESM-comment-end
};
@ -208,26 +209,26 @@ module.exports.configurePortable = function (product) {
*/
module.exports.enableASARSupport = function () {
// ESM-comment-begin
const NODE_MODULES_PATH = path.join(__dirname, '../node_modules');
const NODE_MODULES_ASAR_PATH = `${NODE_MODULES_PATH}.asar`;
// @ts-ignore
const originalResolveLookupPaths = Module._resolveLookupPaths;
// @ts-ignore
Module._resolveLookupPaths = function (request, parent) {
const paths = originalResolveLookupPaths(request, parent);
if (Array.isArray(paths)) {
for (let i = 0, len = paths.length; i < len; i++) {
if (paths[i] === NODE_MODULES_PATH) {
paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
break;
}
}
}
return paths;
};
// const NODE_MODULES_PATH = path.join(__dirname, '../node_modules');
// const NODE_MODULES_ASAR_PATH = `${NODE_MODULES_PATH}.asar`;
//
// // @ts-ignore
// const originalResolveLookupPaths = Module._resolveLookupPaths;
//
// // @ts-ignore
// Module._resolveLookupPaths = function (request, parent) {
// const paths = originalResolveLookupPaths(request, parent);
// if (Array.isArray(paths)) {
// for (let i = 0, len = paths.length; i < len; i++) {
// if (paths[i] === NODE_MODULES_PATH) {
// paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
// break;
// }
// }
// }
//
// return paths;
// };
// ESM-comment-end
};
@ -270,9 +271,9 @@ module.exports.fileUriFromPath = function (path, config) {
//#endregion
// ESM-uncomment-begin
// export const devInjectNodeModuleLookupPath = module.exports.devInjectNodeModuleLookupPath;
// export const removeGlobalNodeJsModuleLookupPaths = module.exports.removeGlobalNodeJsModuleLookupPaths;
// export const configurePortable = module.exports.configurePortable;
// export const enableASARSupport = module.exports.enableASARSupport;
// export const fileUriFromPath = module.exports.fileUriFromPath;
export const devInjectNodeModuleLookupPath = module.exports.devInjectNodeModuleLookupPath;
export const removeGlobalNodeJsModuleLookupPaths = module.exports.removeGlobalNodeJsModuleLookupPaths;
export const configurePortable = module.exports.configurePortable;
export const enableASARSupport = module.exports.enableASARSupport;
export const fileUriFromPath = module.exports.fileUriFromPath;
// ESM-uncomment-end

View File

@ -89,130 +89,130 @@
window['MonacoEnvironment'] = {};
// ESM-uncomment-begin
// // Signal before require()
// if (typeof options?.beforeRequire === 'function') {
// options.beforeRequire(configuration);
// }
// const baseUrl = new URL(`${fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out/`);
// globalThis._VSCODE_FILE_ROOT = baseUrl.toString();
// // DEV ---------------------------------------------------------------------------------------
// // DEV: This is for development and enables loading CSS via import-statements via import-maps.
// // DEV: For each CSS modules that we have we defined an entry in the import map that maps to
// // DEV: a blob URL that loads the CSS via a dynamic @import-rule.
// // DEV ---------------------------------------------------------------------------------------
// if (Array.isArray(configuration.cssModules) && configuration.cssModules.length > 0) {
// performance.mark('code/willAddCssLoader');
// const style = document.createElement('style');
// style.type = 'text/css';
// style.media = 'screen';
// style.id = 'vscode-css-loading';
// document.head.appendChild(style);
// globalThis._VSCODE_CSS_LOAD = function (url) {
// style.textContent += `@import url(${url});\n`;
// };
// /**
// * @type { { imports: Record<string, string> }}
// */
// const importMap = { imports: {} };
// for (const cssModule of configuration.cssModules) {
// const cssUrl = new URL(cssModule, baseUrl).href;
// const jsSrc = `globalThis._VSCODE_CSS_LOAD('${cssUrl}');\n`;
// const blob = new Blob([jsSrc], { type: 'application/javascript' });
// importMap.imports[cssUrl] = URL.createObjectURL(blob);
// }
// const ttp = window.trustedTypes?.createPolicy('vscode-bootstrapImportMap', { createScript(value) { return value; }, });
// const importMapSrc = JSON.stringify(importMap, undefined, 2);
// const importMapScript = document.createElement('script');
// importMapScript.type = 'importmap';
// importMapScript.setAttribute('nonce', '0c6a828f1297');
// // @ts-ignore
// importMapScript.textContent = ttp?.createScript(importMapSrc) ?? importMapSrc;
// document.head.appendChild(importMapScript);
// performance.mark('code/didAddCssLoader');
// }
// const result = Promise.all(modulePaths.map(modulePath => {
// if (modulePath.includes('vs/css!')) {
// // ESM/CSS when seeing the old `vs/css!` prefix we use that as a signal to
// // load CSS via a <link> tag
// const cssModule = modulePath.replace('vs/css!', '');
// const link = document.createElement('link');
// link.rel = 'stylesheet';
// link.href = new URL(`${cssModule}.css`, baseUrl).href;
// document.head.appendChild(link);
// return Promise.resolve();
// } else {
// // ESM/JS module loading
// return import(new URL(`${modulePath}.js`, baseUrl).href);
// }
// }));
// result.then((res) => invokeResult(res[0]), onUnexpectedError);
// ESM-uncomment-end
// ESM-comment-begin
/** @type {LoaderConfig} */
const loaderConfig = {
baseUrl: `${fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out`,
preferScriptTags: true
};
// use a trusted types policy when loading via script tags
loaderConfig.trustedTypesPolicy = window.trustedTypes?.createPolicy('amdLoader', {
createScriptURL(value) {
if (value.startsWith(window.location.origin)) {
return value;
}
throw new Error(`Invalid script url: ${value}`);
}
});
// Teach the loader the location of the node modules we use in renderers
// This will enable to load these modules via <script> tags instead of
// using a fallback such as node.js require which does not exist in sandbox
const baseNodeModulesPath = isDev ? '../node_modules' : '../node_modules.asar';
loaderConfig.paths = {
'@vscode/tree-sitter-wasm': `${baseNodeModulesPath}/@vscode/tree-sitter-wasm/wasm/tree-sitter.js`,
'vscode-textmate': `${baseNodeModulesPath}/vscode-textmate/release/main.js`,
'vscode-oniguruma': `${baseNodeModulesPath}/vscode-oniguruma/release/main.js`,
'vsda': `${baseNodeModulesPath}/vsda/index.js`,
'@xterm/xterm': `${baseNodeModulesPath}/@xterm/xterm/lib/xterm.js`,
'@xterm/addon-clipboard': `${baseNodeModulesPath}/@xterm/addon-clipboard/lib/addon-clipboard.js`,
'@xterm/addon-image': `${baseNodeModulesPath}/@xterm/addon-image/lib/addon-image.js`,
'@xterm/addon-search': `${baseNodeModulesPath}/@xterm/addon-search/lib/addon-search.js`,
'@xterm/addon-serialize': `${baseNodeModulesPath}/@xterm/addon-serialize/lib/addon-serialize.js`,
'@xterm/addon-unicode11': `${baseNodeModulesPath}/@xterm/addon-unicode11/lib/addon-unicode11.js`,
'@xterm/addon-webgl': `${baseNodeModulesPath}/@xterm/addon-webgl/lib/addon-webgl.js`,
'@vscode/iconv-lite-umd': `${baseNodeModulesPath}/@vscode/iconv-lite-umd/lib/iconv-lite-umd.js`,
'jschardet': `${baseNodeModulesPath}/jschardet/dist/jschardet.min.js`,
'@vscode/vscode-languagedetection': `${baseNodeModulesPath}/@vscode/vscode-languagedetection/dist/lib/index.js`,
'vscode-regexp-languagedetection': `${baseNodeModulesPath}/vscode-regexp-languagedetection/dist/index.js`,
'tas-client-umd': `${baseNodeModulesPath}/tas-client-umd/lib/tas-client-umd.js`
};
// Signal before require.config()
if (typeof options?.beforeLoaderConfig === 'function') {
options.beforeLoaderConfig(loaderConfig);
}
// Configure loader
require.config(loaderConfig);
// Signal before require()
if (typeof options?.beforeRequire === 'function') {
options.beforeRequire(configuration);
}
// Actually require the main module as specified
require(modulePaths, invokeResult, onUnexpectedError);
const baseUrl = new URL(`${fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out/`);
globalThis._VSCODE_FILE_ROOT = baseUrl.toString();
// DEV ---------------------------------------------------------------------------------------
// DEV: This is for development and enables loading CSS via import-statements via import-maps.
// DEV: For each CSS modules that we have we defined an entry in the import map that maps to
// DEV: a blob URL that loads the CSS via a dynamic @import-rule.
// DEV ---------------------------------------------------------------------------------------
if (Array.isArray(configuration.cssModules) && configuration.cssModules.length > 0) {
performance.mark('code/willAddCssLoader');
const style = document.createElement('style');
style.type = 'text/css';
style.media = 'screen';
style.id = 'vscode-css-loading';
document.head.appendChild(style);
globalThis._VSCODE_CSS_LOAD = function (url) {
style.textContent += `@import url(${url});\n`;
};
/**
* @type { { imports: Record<string, string> }}
*/
const importMap = { imports: {} };
for (const cssModule of configuration.cssModules) {
const cssUrl = new URL(cssModule, baseUrl).href;
const jsSrc = `globalThis._VSCODE_CSS_LOAD('${cssUrl}');\n`;
const blob = new Blob([jsSrc], { type: 'application/javascript' });
importMap.imports[cssUrl] = URL.createObjectURL(blob);
}
const ttp = window.trustedTypes?.createPolicy('vscode-bootstrapImportMap', { createScript(value) { return value; }, });
const importMapSrc = JSON.stringify(importMap, undefined, 2);
const importMapScript = document.createElement('script');
importMapScript.type = 'importmap';
importMapScript.setAttribute('nonce', '0c6a828f1297');
// @ts-ignore
importMapScript.textContent = ttp?.createScript(importMapSrc) ?? importMapSrc;
document.head.appendChild(importMapScript);
performance.mark('code/didAddCssLoader');
}
const result = Promise.all(modulePaths.map(modulePath => {
if (modulePath.includes('vs/css!')) {
// ESM/CSS when seeing the old `vs/css!` prefix we use that as a signal to
// load CSS via a <link> tag
const cssModule = modulePath.replace('vs/css!', '');
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = new URL(`${cssModule}.css`, baseUrl).href;
document.head.appendChild(link);
return Promise.resolve();
} else {
// ESM/JS module loading
return import(new URL(`${modulePath}.js`, baseUrl).href);
}
}));
result.then((res) => invokeResult(res[0]), onUnexpectedError);
// ESM-uncomment-end
// ESM-comment-begin
// /** @type {LoaderConfig} */
// const loaderConfig = {
// baseUrl: `${fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out`,
// preferScriptTags: true
// };
//
// // use a trusted types policy when loading via script tags
// loaderConfig.trustedTypesPolicy = window.trustedTypes?.createPolicy('amdLoader', {
// createScriptURL(value) {
// if (value.startsWith(window.location.origin)) {
// return value;
// }
// throw new Error(`Invalid script url: ${value}`);
// }
// });
//
// // Teach the loader the location of the node modules we use in renderers
// // This will enable to load these modules via <script> tags instead of
// // using a fallback such as node.js require which does not exist in sandbox
// const baseNodeModulesPath = isDev ? '../node_modules' : '../node_modules.asar';
// loaderConfig.paths = {
// '@vscode/tree-sitter-wasm': `${baseNodeModulesPath}/@vscode/tree-sitter-wasm/wasm/tree-sitter.js`,
// 'vscode-textmate': `${baseNodeModulesPath}/vscode-textmate/release/main.js`,
// 'vscode-oniguruma': `${baseNodeModulesPath}/vscode-oniguruma/release/main.js`,
// 'vsda': `${baseNodeModulesPath}/vsda/index.js`,
// '@xterm/xterm': `${baseNodeModulesPath}/@xterm/xterm/lib/xterm.js`,
// '@xterm/addon-clipboard': `${baseNodeModulesPath}/@xterm/addon-clipboard/lib/addon-clipboard.js`,
// '@xterm/addon-image': `${baseNodeModulesPath}/@xterm/addon-image/lib/addon-image.js`,
// '@xterm/addon-search': `${baseNodeModulesPath}/@xterm/addon-search/lib/addon-search.js`,
// '@xterm/addon-serialize': `${baseNodeModulesPath}/@xterm/addon-serialize/lib/addon-serialize.js`,
// '@xterm/addon-unicode11': `${baseNodeModulesPath}/@xterm/addon-unicode11/lib/addon-unicode11.js`,
// '@xterm/addon-webgl': `${baseNodeModulesPath}/@xterm/addon-webgl/lib/addon-webgl.js`,
// '@vscode/iconv-lite-umd': `${baseNodeModulesPath}/@vscode/iconv-lite-umd/lib/iconv-lite-umd.js`,
// 'jschardet': `${baseNodeModulesPath}/jschardet/dist/jschardet.min.js`,
// '@vscode/vscode-languagedetection': `${baseNodeModulesPath}/@vscode/vscode-languagedetection/dist/lib/index.js`,
// 'vscode-regexp-languagedetection': `${baseNodeModulesPath}/vscode-regexp-languagedetection/dist/index.js`,
// 'tas-client-umd': `${baseNodeModulesPath}/tas-client-umd/lib/tas-client-umd.js`
// };
//
// // Signal before require.config()
// if (typeof options?.beforeLoaderConfig === 'function') {
// options.beforeLoaderConfig(loaderConfig);
// }
//
// // Configure loader
// require.config(loaderConfig);
//
// // Signal before require()
// if (typeof options?.beforeRequire === 'function') {
// options.beforeRequire(configuration);
// }
//
// // Actually require the main module as specified
// require(modulePaths, invokeResult, onUnexpectedError);
// ESM-comment-end
/**

View File

@ -7,27 +7,27 @@
'use strict';
// ESM-comment-begin
// Delete `VSCODE_CWD` very early. We have seen
// reports where `code .` would use the wrong
// current working directory due to our variable
// somehow escaping to the parent shell
// (https://github.com/microsoft/vscode/issues/126399)
delete process.env['VSCODE_CWD'];
const bootstrapNode = require('./bootstrap-node');
const bootstrapAmd = require('./bootstrap-amd');
const { resolveNLSConfiguration } = require('./vs/base/node/nls');
const product = require('./bootstrap-meta').product;
// // Delete `VSCODE_CWD` very early. We have seen
// // reports where `code .` would use the wrong
// // current working directory due to our variable
// // somehow escaping to the parent shell
// // (https://github.com/microsoft/vscode/issues/126399)
// delete process.env['VSCODE_CWD'];
// const bootstrapNode = require('./bootstrap-node');
// const bootstrapAmd = require('./bootstrap-amd');
// const { resolveNLSConfiguration } = require('./vs/base/node/nls');
// const product = require('./bootstrap-meta').product;
// ESM-comment-end
// ESM-uncomment-begin
// import './bootstrap-cli.js'; // this MUST come before other imports as it changes global state
// import * as path from 'path';
// import { fileURLToPath } from 'url';
// import * as bootstrapNode from './bootstrap-node.js';
// import * as bootstrapAmd from './bootstrap-amd.js';
// import { resolveNLSConfiguration } from './vs/base/node/nls.js';
// import { product } from './bootstrap-meta.js';
//
// const __dirname = path.dirname(fileURLToPath(import.meta.url));
import './bootstrap-cli.js'; // this MUST come before other imports as it changes global state
import * as path from 'path';
import { fileURLToPath } from 'url';
import * as bootstrapNode from './bootstrap-node.js';
import * as bootstrapAmd from './bootstrap-amd.js';
import { resolveNLSConfiguration } from './vs/base/node/nls.js';
import { product } from './bootstrap-meta.js';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// ESM-uncomment-end
async function start() {

View File

@ -12,36 +12,36 @@
*/
// ESM-comment-begin
const path = require('path');
const fs = require('original-fs');
const os = require('os');
const bootstrapNode = require('./bootstrap-node');
const bootstrapAmd = require('./bootstrap-amd');
const { getUserDataPath } = require(`./vs/platform/environment/node/userDataPath`);
const { parse } = require('./vs/base/common/jsonc');
const perf = require('./vs/base/common/performance');
const { resolveNLSConfiguration } = require('./vs/base/node/nls');
const { getUNCHost, addUNCHostToAllowlist } = require('./vs/base/node/unc');
const product = require('./bootstrap-meta').product;
const { app, protocol, crashReporter, Menu, contentTracing } = require('electron');
// const path = require('path');
// const fs = require('original-fs');
// const os = require('os');
// const bootstrapNode = require('./bootstrap-node');
// const bootstrapAmd = require('./bootstrap-amd');
// const { getUserDataPath } = require(`./vs/platform/environment/node/userDataPath`);
// const { parse } = require('./vs/base/common/jsonc');
// const perf = require('./vs/base/common/performance');
// const { resolveNLSConfiguration } = require('./vs/base/node/nls');
// const { getUNCHost, addUNCHostToAllowlist } = require('./vs/base/node/unc');
// const product = require('./bootstrap-meta').product;
// const { app, protocol, crashReporter, Menu, contentTracing } = require('electron');
// ESM-comment-end
// ESM-uncomment-begin
// import * as path from 'path';
// import * as fs from 'original-fs';
// import * as os from 'os';
// import * as bootstrapNode from './bootstrap-node.js';
// import * as bootstrapAmd from './bootstrap-amd.js';
// import { fileURLToPath } from 'url';
// import { app, protocol, crashReporter, Menu, contentTracing } from 'electron';
// import minimist from 'minimist';
// import { product } from './bootstrap-meta.js';
// import { parse } from './vs/base/common/jsonc.js';
// import { getUserDataPath } from './vs/platform/environment/node/userDataPath.js';
// import * as perf from './vs/base/common/performance.js';
// import { resolveNLSConfiguration } from './vs/base/node/nls.js';
// import { getUNCHost, addUNCHostToAllowlist } from './vs/base/node/unc.js';
//
// const __dirname = path.dirname(fileURLToPath(import.meta.url));
import * as path from 'path';
import * as fs from 'original-fs';
import * as os from 'os';
import * as bootstrapNode from './bootstrap-node.js';
import * as bootstrapAmd from './bootstrap-amd.js';
import { fileURLToPath } from 'url';
import { app, protocol, crashReporter, Menu, contentTracing } from 'electron';
import minimist from 'minimist';
import { product } from './bootstrap-meta.js';
import { parse } from './vs/base/common/jsonc.js';
import { getUserDataPath } from './vs/platform/environment/node/userDataPath.js';
import * as perf from './vs/base/common/performance.js';
import { resolveNLSConfiguration } from './vs/base/node/nls.js';
import { getUNCHost, addUNCHostToAllowlist } from './vs/base/node/unc.js';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// ESM-uncomment-end
perf.mark('code/didStartMain');
@ -53,7 +53,7 @@ const portable = bootstrapNode.configurePortable(product);
bootstrapNode.enableASARSupport();
// ESM-comment-begin
const minimist = require('minimist'); // !!! IMPORTANT: MUST come after bootstrap#enableASARSupport
// const minimist = require('minimist'); // !!! IMPORTANT: MUST come after bootstrap#enableASARSupport
// ESM-comment-end
const args = parseCLIArgs();

3
src/package.json Normal file
View File

@ -0,0 +1,3 @@
{
"type": "module"
}

View File

@ -7,24 +7,24 @@
'use strict';
// ESM-comment-begin
// Keep bootstrap-amd.js from redefining 'fs'.
delete process.env['ELECTRON_RUN_AS_NODE'];
const path = require('path');
const bootstrapNode = require('./bootstrap-node');
const bootstrapAmd = require('./bootstrap-amd');
const { resolveNLSConfiguration } = require('./vs/base/node/nls');
const product = require('./bootstrap-meta').product;
// // Keep bootstrap-amd.js from redefining 'fs'.
// delete process.env['ELECTRON_RUN_AS_NODE'];
// const path = require('path');
// const bootstrapNode = require('./bootstrap-node');
// const bootstrapAmd = require('./bootstrap-amd');
// const { resolveNLSConfiguration } = require('./vs/base/node/nls');
// const product = require('./bootstrap-meta').product;
// ESM-comment-end
// ESM-uncomment-begin
// import './bootstrap-server.js'; // this MUST come before other imports as it changes global state
// import * as path from 'path';
// import { fileURLToPath } from 'url';
// import * as bootstrapNode from './bootstrap-node.js';
// import * as bootstrapAmd from './bootstrap-amd.js';
// import { resolveNLSConfiguration } from './vs/base/node/nls.js';
// import { product } from './bootstrap-meta.js';
//
// const __dirname = path.dirname(fileURLToPath(import.meta.url));
import './bootstrap-server.js'; // this MUST come before other imports as it changes global state
import * as path from 'path';
import { fileURLToPath } from 'url';
import * as bootstrapNode from './bootstrap-node.js';
import * as bootstrapAmd from './bootstrap-amd.js';
import { resolveNLSConfiguration } from './vs/base/node/nls.js';
import { product } from './bootstrap-meta.js';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// ESM-uncomment-end
async function start() {

View File

@ -12,37 +12,37 @@
*/
// ESM-comment-begin
// Keep bootstrap-amd.js from redefining 'fs'.
delete process.env['ELECTRON_RUN_AS_NODE'];
const path = require('path');
const http = require('http');
const os = require('os');
const readline = require('readline');
const performance = require('perf_hooks').performance;
const bootstrapNode = require('./bootstrap-node');
const bootstrapAmd = require('./bootstrap-amd');
const { resolveNLSConfiguration } = require('./vs/base/node/nls');
const product = require('./bootstrap-meta').product;
const perf = require(`./vs/base/common/performance`);
const minimist = require('minimist');
// // Keep bootstrap-amd.js from redefining 'fs'.
// delete process.env['ELECTRON_RUN_AS_NODE'];
//
// const path = require('path');
// const http = require('http');
// const os = require('os');
// const readline = require('readline');
// const performance = require('perf_hooks').performance;
// const bootstrapNode = require('./bootstrap-node');
// const bootstrapAmd = require('./bootstrap-amd');
// const { resolveNLSConfiguration } = require('./vs/base/node/nls');
// const product = require('./bootstrap-meta').product;
// const perf = require(`./vs/base/common/performance`);
// const minimist = require('minimist');
// ESM-comment-end
// ESM-uncomment-begin
// import './bootstrap-server.js'; // this MUST come before other imports as it changes global state
// import * as path from 'path';
// import * as http from 'http';
// import * as os from 'os';
// import * as readline from 'readline';
// import { performance }from 'perf_hooks';
// import { fileURLToPath } from 'url';
// import minimist from 'minimist';
// import * as bootstrapNode from './bootstrap-node.js';
// import * as bootstrapAmd from './bootstrap-amd.js';
// import { resolveNLSConfiguration } from './vs/base/node/nls.js';
// import { product } from './bootstrap-meta.js';
// import * as perf from './vs/base/common/performance.js';
//
// const __dirname = path.dirname(fileURLToPath(import.meta.url));
import './bootstrap-server.js'; // this MUST come before other imports as it changes global state
import * as path from 'path';
import * as http from 'http';
import * as os from 'os';
import * as readline from 'readline';
import { performance } from 'perf_hooks';
import { fileURLToPath } from 'url';
import minimist from 'minimist';
import * as bootstrapNode from './bootstrap-node.js';
import * as bootstrapAmd from './bootstrap-amd.js';
import { resolveNLSConfiguration } from './vs/base/node/nls.js';
import { product } from './bootstrap-meta.js';
import * as perf from './vs/base/common/performance.js';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// ESM-uncomment-end
perf.mark('code/server/start');

View File

@ -1,6 +1,6 @@
{
"compilerOptions": {
"module": "amd",
"module": "es2022",
"moduleResolution": "node",
"experimentalDecorators": true,
"noImplicitReturns": true,
@ -24,6 +24,7 @@
"DOM",
"DOM.Iterable",
"WebWorker.ImportScripts"
]
],
"allowSyntheticDefaultImports": true
}
}
}

View File

@ -3,12 +3,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { isESM, canASAR } from 'vs/base/common/amd';
import { AppResourcePath, FileAccess, nodeModulesAsarPath, nodeModulesPath, Schemas, VSCODE_AUTHORITY } from 'vs/base/common/network';
import * as platform from 'vs/base/common/platform';
import { IProductConfiguration } from 'vs/base/common/product';
import { assertType } from 'vs/base/common/types';
import { URI } from 'vs/base/common/uri';
import { isESM, canASAR } from './base/common/amd.js';
import { AppResourcePath, FileAccess, nodeModulesAsarPath, nodeModulesPath, Schemas, VSCODE_AUTHORITY } from './base/common/network.js';
import * as platform from './base/common/platform.js';
import { IProductConfiguration } from './base/common/product.js';
import { assertType } from './base/common/types.js';
import { URI } from './base/common/uri.js';
class DefineCall {
constructor(

View File

@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { mainWindow } from 'vs/base/browser/window';
import { getErrorMessage } from 'vs/base/common/errors';
import { Emitter } from 'vs/base/common/event';
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
import { mainWindow } from './window.js';
import { getErrorMessage } from '../common/errors.js';
import { Emitter } from '../common/event.js';
import { Disposable, toDisposable } from '../common/lifecycle.js';
export class BroadcastDataChannel<T> extends Disposable {

View File

@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { CodeWindow, mainWindow } from 'vs/base/browser/window';
import { Emitter } from 'vs/base/common/event';
import { CodeWindow, mainWindow } from './window.js';
import { Emitter } from '../common/event.js';
class WindowManager {

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as browser from 'vs/base/browser/browser';
import { mainWindow } from 'vs/base/browser/window';
import * as platform from 'vs/base/common/platform';
import * as browser from './browser.js';
import { mainWindow } from './window.js';
import * as platform from '../common/platform.js';
export const enum KeyboardSupport {
Always,

View File

@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { IActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems';
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { AnchorAlignment, AnchorAxisAlignment, IAnchor } from 'vs/base/browser/ui/contextview/contextview';
import { IAction, IActionRunner } from 'vs/base/common/actions';
import { ResolvedKeybinding } from 'vs/base/common/keybindings';
import { OmitOptional } from 'vs/base/common/types';
import { StandardMouseEvent } from './mouseEvent.js';
import { IActionViewItemOptions } from './ui/actionbar/actionViewItems.js';
import { IActionViewItem } from './ui/actionbar/actionbar.js';
import { AnchorAlignment, AnchorAxisAlignment, IAnchor } from './ui/contextview/contextview.js';
import { IAction, IActionRunner } from '../common/actions.js';
import { ResolvedKeybinding } from '../common/keybindings.js';
import { OmitOptional } from '../common/types.js';
export interface IContextMenuEvent {
readonly shiftKey?: boolean;

View File

@ -3,20 +3,20 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createTrustedTypesPolicy } from 'vs/base/browser/trustedTypes';
import { onUnexpectedError } from 'vs/base/common/errors';
import { AppResourcePath, COI, FileAccess } from 'vs/base/common/network';
import { URI } from 'vs/base/common/uri';
import { IWorker, IWorkerCallback, IWorkerClient, IWorkerDescriptor, IWorkerFactory, logOnceWebWorkerWarning, SimpleWorkerClient } from 'vs/base/common/worker/simpleWorker';
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
import { coalesce } from 'vs/base/common/arrays';
import { getNLSLanguage, getNLSMessages } from 'vs/nls';
import { createTrustedTypesPolicy } from './trustedTypes.js';
import { onUnexpectedError } from '../common/errors.js';
import { AppResourcePath, COI, FileAccess } from '../common/network.js';
import { URI } from '../common/uri.js';
import { IWorker, IWorkerCallback, IWorkerClient, IWorkerDescriptor, IWorkerFactory, logOnceWebWorkerWarning, SimpleWorkerClient } from '../common/worker/simpleWorker.js';
import { Disposable, toDisposable } from '../common/lifecycle.js';
import { coalesce } from '../common/arrays.js';
import { getNLSLanguage, getNLSMessages } from '../../nls.js';
// ESM-comment-begin
const isESM = false;
// const isESM = false;
// ESM-comment-end
// ESM-uncomment-begin
// const isESM = true;
const isESM = true;
// ESM-uncomment-end
// Reuse the trusted types policy defined from worker bootstrap
@ -53,13 +53,13 @@ function getWorker(esmWorkerLocation: URI | undefined, label: string): Worker |
}
}
// ESM-comment-begin
if (typeof require === 'function') {
const workerMainLocation = require.toUrl('vs/base/worker/workerMain.js'); // explicitly using require.toUrl(), see https://github.com/microsoft/vscode/issues/107440#issuecomment-698982321
const factoryModuleId = 'vs/base/worker/defaultWorkerFactory.js';
const workerBaseUrl = require.toUrl(factoryModuleId).slice(0, -factoryModuleId.length); // explicitly using require.toUrl(), see https://github.com/microsoft/vscode/issues/107440#issuecomment-698982321
const workerUrl = getWorkerBootstrapUrl(label, workerMainLocation, workerBaseUrl);
return new Worker(ttPolicy ? ttPolicy.createScriptURL(workerUrl) as unknown as string : workerUrl, { name: label, type: isESM ? 'module' : undefined });
}
// if (typeof require === 'function') {
// const workerMainLocation = require.toUrl('vs/base/worker/workerMain.js'); // explicitly using require.toUrl(), see https://github.com/microsoft/vscode/issues/107440#issuecomment-698982321
// const factoryModuleId = 'vs/base/worker/defaultWorkerFactory.js';
// const workerBaseUrl = require.toUrl(factoryModuleId).slice(0, -factoryModuleId.length); // explicitly using require.toUrl(), see https://github.com/microsoft/vscode/issues/107440#issuecomment-698982321
// const workerUrl = getWorkerBootstrapUrl(label, workerMainLocation, workerBaseUrl);
// return new Worker(ttPolicy ? ttPolicy.createScriptURL(workerUrl) as unknown as string : workerUrl, { name: label, type: isESM ? 'module' : undefined });
// }
// ESM-comment-end
if (esmWorkerLocation) {
const workerUrl = getWorkerBootstrapUrl(label, esmWorkerLocation.toString(true));

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { addDisposableListener, getWindow } from 'vs/base/browser/dom';
import { Disposable } from 'vs/base/common/lifecycle';
import { Mimes } from 'vs/base/common/mime';
import { addDisposableListener, getWindow } from './dom.js';
import { Disposable } from '../common/lifecycle.js';
import { Mimes } from '../common/mime.js';
/**
* A helper that will execute a provided function when the provided HTMLElement receives

View File

@ -3,22 +3,22 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as browser from 'vs/base/browser/browser';
import { BrowserFeatures } from 'vs/base/browser/canIUse';
import { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IMouseEvent, StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { AbstractIdleValue, IntervalTimer, TimeoutTimer, _runWhenIdle, IdleDeadline } from 'vs/base/common/async';
import { onUnexpectedError } from 'vs/base/common/errors';
import * as event from 'vs/base/common/event';
import * as dompurify from 'vs/base/browser/dompurify/dompurify';
import { KeyCode } from 'vs/base/common/keyCodes';
import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { FileAccess, RemoteAuthorities, Schemas } from 'vs/base/common/network';
import * as platform from 'vs/base/common/platform';
import { URI } from 'vs/base/common/uri';
import { hash } from 'vs/base/common/hash';
import { CodeWindow, ensureCodeWindow, mainWindow } from 'vs/base/browser/window';
import { isPointWithinTriangle } from 'vs/base/common/numbers';
import * as browser from './browser.js';
import { BrowserFeatures } from './canIUse.js';
import { IKeyboardEvent, StandardKeyboardEvent } from './keyboardEvent.js';
import { IMouseEvent, StandardMouseEvent } from './mouseEvent.js';
import { AbstractIdleValue, IntervalTimer, TimeoutTimer, _runWhenIdle, IdleDeadline } from '../common/async.js';
import { onUnexpectedError } from '../common/errors.js';
import * as event from '../common/event.js';
import * as dompurify from './dompurify/dompurify.js';
import { KeyCode } from '../common/keyCodes.js';
import { Disposable, DisposableStore, IDisposable, toDisposable } from '../common/lifecycle.js';
import { FileAccess, RemoteAuthorities, Schemas } from '../common/network.js';
import * as platform from '../common/platform.js';
import { URI } from '../common/uri.js';
import { hash } from '../common/hash.js';
import { CodeWindow, ensureCodeWindow, mainWindow } from './window.js';
import { isPointWithinTriangle } from '../common/numbers.js';
export interface IRegisteredCodeWindow {
readonly window: CodeWindow;

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createStyleSheet2 } from 'vs/base/browser/dom';
import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
import { autorun, IObservable } from 'vs/base/common/observable';
import { createStyleSheet2 } from './dom.js';
import { DisposableStore, IDisposable } from '../common/lifecycle.js';
import { autorun, IObservable } from '../common/observable.js';
export function createStyleSheetFromObservable(css: IObservable<string>): IDisposable {
const store = new DisposableStore();

View File

@ -1622,19 +1622,19 @@ function createDOMPurify() {
var purify = createDOMPurify();
// ESM-comment-begin
define(function () { return purify; });
// define(function () { return purify; });
// ESM-comment-end
// ESM-uncomment-begin
// export default purify;
// export const version = purify.version;
// export const isSupported = purify.isSupported;
// export const sanitize = purify.sanitize;
// export const setConfig = purify.setConfig;
// export const clearConfig = purify.clearConfig;
// export const isValidAttribute = purify.isValidAttribute;
// export const addHook = purify.addHook;
// export const removeHook = purify.removeHook;
// export const removeHooks = purify.removeHooks;
// export const removeAllHooks = purify.removeAllHooks;
export default purify;
export const version = purify.version;
export const isSupported = purify.isSupported;
export const sanitize = purify.sanitize;
export const setConfig = purify.setConfig;
export const clearConfig = purify.clearConfig;
export const isValidAttribute = purify.isValidAttribute;
export const addHook = purify.addHook;
export const removeHook = purify.removeHook;
export const removeHooks = purify.removeHooks;
export const removeAllHooks = purify.removeAllHooks;
// ESM-uncomment-end

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { GestureEvent } from 'vs/base/browser/touch';
import { Emitter, Event as BaseEvent } from 'vs/base/common/event';
import { IDisposable } from 'vs/base/common/lifecycle';
import { GestureEvent } from './touch.js';
import { Emitter, Event as BaseEvent } from '../common/event.js';
import { IDisposable } from '../common/lifecycle.js';
export type EventHandler = HTMLElement | HTMLDocument | Window;

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { isMacintosh, isWindows } from 'vs/base/common/platform';
import { isMacintosh, isWindows } from '../common/platform.js';
/**
* The best font-family to be used in CSS based on the platform:

View File

@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as DOM from 'vs/base/browser/dom';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import { DisposableStore } from 'vs/base/common/lifecycle';
import * as DOM from './dom.js';
import { IKeyboardEvent } from './keyboardEvent.js';
import { IMouseEvent } from './mouseEvent.js';
import { DisposableStore } from '../common/lifecycle.js';
export interface IContentActionHandler {
callback: (content: string, event: IMouseEvent | IKeyboardEvent) => void;

View File

@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as dom from 'vs/base/browser/dom';
import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import * as dom from './dom.js';
import { DisposableStore, IDisposable, toDisposable } from '../common/lifecycle.js';
export interface IPointerMoveCallback {
(event: PointerEvent): void;

View File

@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { VSBuffer } from 'vs/base/common/buffer';
import { StringSHA1, toHexString } from 'vs/base/common/hash';
import { VSBuffer } from '../common/buffer.js';
import { StringSHA1, toHexString } from '../common/hash.js';
export async function sha1Hex(str: string): Promise<string> {

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Event } from 'vs/base/common/event';
import { Event } from '../common/event.js';
export interface IHistoryNavigationWidget {

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { ErrorNoTelemetry, getErrorMessage } from 'vs/base/common/errors';
import { mark } from 'vs/base/common/performance';
import { toErrorMessage } from '../common/errorMessage.js';
import { ErrorNoTelemetry, getErrorMessage } from '../common/errors.js';
import { mark } from '../common/performance.js';
class MissingStoresError extends Error {
constructor(readonly db: IDBDatabase) {

View File

@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as browser from 'vs/base/browser/browser';
import { EVENT_KEY_CODE_MAP, KeyCode, KeyCodeUtils, KeyMod } from 'vs/base/common/keyCodes';
import { KeyCodeChord } from 'vs/base/common/keybindings';
import * as platform from 'vs/base/common/platform';
import * as browser from './browser.js';
import { EVENT_KEY_CODE_MAP, KeyCode, KeyCodeUtils, KeyMod } from '../common/keyCodes.js';
import { KeyCodeChord } from '../common/keybindings.js';
import * as platform from '../common/platform.js';

View File

@ -3,28 +3,28 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as DOM from 'vs/base/browser/dom';
import * as dompurify from 'vs/base/browser/dompurify/dompurify';
import { DomEmitter } from 'vs/base/browser/event';
import { createElement, FormattedTextRenderOptions } from 'vs/base/browser/formattedTextRenderer';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
import { onUnexpectedError } from 'vs/base/common/errors';
import { Event } from 'vs/base/common/event';
import { escapeDoubleQuotes, IMarkdownString, MarkdownStringTrustedOptions, parseHrefAndDimensions, removeMarkdownEscapes } from 'vs/base/common/htmlContent';
import { markdownEscapeEscapedIcons } from 'vs/base/common/iconLabels';
import { defaultGenerator } from 'vs/base/common/idGenerator';
import { KeyCode } from 'vs/base/common/keyCodes';
import { Lazy } from 'vs/base/common/lazy';
import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import * as marked from 'vs/base/common/marked/marked';
import { parse } from 'vs/base/common/marshalling';
import { FileAccess, Schemas } from 'vs/base/common/network';
import { cloneAndChange } from 'vs/base/common/objects';
import { dirname, resolvePath } from 'vs/base/common/resources';
import { escape } from 'vs/base/common/strings';
import { URI } from 'vs/base/common/uri';
import * as DOM from './dom.js';
import * as dompurify from './dompurify/dompurify.js';
import { DomEmitter } from './event.js';
import { createElement, FormattedTextRenderOptions } from './formattedTextRenderer.js';
import { StandardKeyboardEvent } from './keyboardEvent.js';
import { StandardMouseEvent } from './mouseEvent.js';
import { renderLabelWithIcons } from './ui/iconLabel/iconLabels.js';
import { onUnexpectedError } from '../common/errors.js';
import { Event } from '../common/event.js';
import { escapeDoubleQuotes, IMarkdownString, MarkdownStringTrustedOptions, parseHrefAndDimensions, removeMarkdownEscapes } from '../common/htmlContent.js';
import { markdownEscapeEscapedIcons } from '../common/iconLabels.js';
import { defaultGenerator } from '../common/idGenerator.js';
import { KeyCode } from '../common/keyCodes.js';
import { Lazy } from '../common/lazy.js';
import { DisposableStore, IDisposable, toDisposable } from '../common/lifecycle.js';
import * as marked from '../common/marked/marked.js';
import { parse } from '../common/marshalling.js';
import { FileAccess, Schemas } from '../common/network.js';
import { cloneAndChange } from '../common/objects.js';
import { dirname, resolvePath } from '../common/resources.js';
import { escape } from '../common/strings.js';
import { URI } from '../common/uri.js';
export interface MarkedOptions extends marked.MarkedOptions {
baseUrl?: never;

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as browser from 'vs/base/browser/browser';
import { IframeUtils } from 'vs/base/browser/iframe';
import * as platform from 'vs/base/common/platform';
import * as browser from './browser.js';
import { IframeUtils } from './iframe.js';
import * as platform from '../common/platform.js';
export interface IMouseEvent {
readonly browserEvent: MouseEvent;

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { getWindowId, onDidUnregisterWindow } from 'vs/base/browser/dom';
import { Emitter, Event } from 'vs/base/common/event';
import { Disposable, markAsSingleton } from 'vs/base/common/lifecycle';
import { getWindowId, onDidUnregisterWindow } from './dom.js';
import { Emitter, Event } from '../common/event.js';
import { Disposable, markAsSingleton } from '../common/lifecycle.js';
/**
* See https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#monitoring_screen_resolution_or_zoom_level_changes

View File

@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as DomUtils from 'vs/base/browser/dom';
import { mainWindow } from 'vs/base/browser/window';
import * as arrays from 'vs/base/common/arrays';
import { memoize } from 'vs/base/common/decorators';
import { Event as EventUtils } from 'vs/base/common/event';
import { Disposable, IDisposable, markAsSingleton, toDisposable } from 'vs/base/common/lifecycle';
import { LinkedList } from 'vs/base/common/linkedList';
import * as DomUtils from './dom.js';
import { mainWindow } from './window.js';
import * as arrays from '../common/arrays.js';
import { memoize } from '../common/decorators.js';
import { Event as EventUtils } from '../common/event.js';
import { Disposable, IDisposable, markAsSingleton, toDisposable } from '../common/lifecycle.js';
import { LinkedList } from '../common/linkedList.js';
export namespace EventType {
export const Tap = '-monaco-gesturetap';

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { onUnexpectedError } from 'vs/base/common/errors';
import { onUnexpectedError } from '../common/errors.js';
export function createTrustedTypesPolicy<Options extends TrustedTypePolicyOptions>(
policyName: string,

View File

@ -3,24 +3,24 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { isFirefox } from 'vs/base/browser/browser';
import { DataTransfers } from 'vs/base/browser/dnd';
import { addDisposableListener, EventHelper, EventLike, EventType } from 'vs/base/browser/dom';
import { EventType as TouchEventType, Gesture } from 'vs/base/browser/touch';
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
import { ISelectBoxOptions, ISelectBoxStyles, ISelectOptionItem, SelectBox } from 'vs/base/browser/ui/selectBox/selectBox';
import { IToggleStyles } from 'vs/base/browser/ui/toggle/toggle';
import { Action, ActionRunner, IAction, IActionChangeEvent, IActionRunner, Separator } from 'vs/base/common/actions';
import { Disposable } from 'vs/base/common/lifecycle';
import * as platform from 'vs/base/common/platform';
import * as types from 'vs/base/common/types';
import 'vs/css!./actionbar';
import * as nls from 'vs/nls';
import type { IManagedHover } from 'vs/base/browser/ui/hover/hover';
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
import { isFirefox } from '../../browser.js';
import { DataTransfers } from '../../dnd.js';
import { addDisposableListener, EventHelper, EventLike, EventType } from '../../dom.js';
import { EventType as TouchEventType, Gesture } from '../../touch.js';
import { IActionViewItem } from './actionbar.js';
import { IContextViewProvider } from '../contextview/contextview.js';
import { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';
import { IHoverDelegate } from '../hover/hoverDelegate.js';
import { ISelectBoxOptions, ISelectBoxStyles, ISelectOptionItem, SelectBox } from '../selectBox/selectBox.js';
import { IToggleStyles } from '../toggle/toggle.js';
import { Action, ActionRunner, IAction, IActionChangeEvent, IActionRunner, Separator } from '../../../common/actions.js';
import { Disposable } from '../../../common/lifecycle.js';
import * as platform from '../../../common/platform.js';
import * as types from '../../../common/types.js';
import './actionbar.css';
import * as nls from '../../../../nls.js';
import type { IManagedHover } from '../hover/hover.js';
import { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';
export interface IBaseActionViewItemOptions {
draggable?: boolean;

View File

@ -3,17 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as DOM from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { ActionViewItem, BaseActionViewItem, IActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems';
import { createInstantHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
import { ActionRunner, IAction, IActionRunner, IRunEvent, Separator } from 'vs/base/common/actions';
import { Emitter } from 'vs/base/common/event';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { Disposable, DisposableMap, DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle';
import * as types from 'vs/base/common/types';
import 'vs/css!./actionbar';
import * as DOM from '../../dom.js';
import { StandardKeyboardEvent } from '../../keyboardEvent.js';
import { ActionViewItem, BaseActionViewItem, IActionViewItemOptions } from './actionViewItems.js';
import { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';
import { IHoverDelegate } from '../hover/hoverDelegate.js';
import { ActionRunner, IAction, IActionRunner, IRunEvent, Separator } from '../../../common/actions.js';
import { Emitter } from '../../../common/event.js';
import { KeyCode, KeyMod } from '../../../common/keyCodes.js';
import { Disposable, DisposableMap, DisposableStore, dispose, IDisposable } from '../../../common/lifecycle.js';
import * as types from '../../../common/types.js';
import './actionbar.css';
export interface IActionViewItem extends IDisposable {
action: IAction;

View File

@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as dom from 'vs/base/browser/dom';
import 'vs/css!./aria';
import * as dom from '../../dom.js';
import './aria.css';
// Use a max length since we are inserting the whole msg in the DOM and that can cause browsers to freeze for long messages #94233
const MAX_MESSAGE_LENGTH = 20000;

View File

@ -3,15 +3,15 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as dom from 'vs/base/browser/dom';
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
import { commonPrefixLength } from 'vs/base/common/arrays';
import { ThemeIcon } from 'vs/base/common/themables';
import { Emitter, Event } from 'vs/base/common/event';
import { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
import 'vs/css!./breadcrumbsWidget';
import * as dom from '../../dom.js';
import { IMouseEvent } from '../../mouseEvent.js';
import { DomScrollableElement } from '../scrollbar/scrollableElement.js';
import { commonPrefixLength } from '../../../common/arrays.js';
import { ThemeIcon } from '../../../common/themables.js';
import { Emitter, Event } from '../../../common/event.js';
import { DisposableStore, dispose, IDisposable } from '../../../common/lifecycle.js';
import { ScrollbarVisibility } from '../../../common/scrollable.js';
import './breadcrumbsWidget.css';
export abstract class BreadcrumbsItem {
abstract dispose(): void;

View File

@ -3,28 +3,28 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IContextMenuProvider } from 'vs/base/browser/contextmenu';
import { addDisposableListener, EventHelper, EventType, IFocusTracker, isActiveElement, reset, trackFocus } from 'vs/base/browser/dom';
import { sanitize } from 'vs/base/browser/dompurify/dompurify';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { renderMarkdown, renderStringAsPlaintext } from 'vs/base/browser/markdownRenderer';
import { Gesture, EventType as TouchEventType } from 'vs/base/browser/touch';
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
import { Action, IAction, IActionRunner } from 'vs/base/common/actions';
import { Codicon } from 'vs/base/common/codicons';
import { Color } from 'vs/base/common/color';
import { Event as BaseEvent, Emitter } from 'vs/base/common/event';
import { IMarkdownString, isMarkdownString, markdownStringEqual } from 'vs/base/common/htmlContent';
import { KeyCode } from 'vs/base/common/keyCodes';
import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
import { ThemeIcon } from 'vs/base/common/themables';
import 'vs/css!./button';
import { localize } from 'vs/nls';
import type { IManagedHover } from 'vs/base/browser/ui/hover/hover';
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
import { IActionProvider } from 'vs/base/browser/ui/dropdown/dropdown';
import { IContextMenuProvider } from '../../contextmenu.js';
import { addDisposableListener, EventHelper, EventType, IFocusTracker, isActiveElement, reset, trackFocus } from '../../dom.js';
import { sanitize } from '../../dompurify/dompurify.js';
import { StandardKeyboardEvent } from '../../keyboardEvent.js';
import { renderMarkdown, renderStringAsPlaintext } from '../../markdownRenderer.js';
import { Gesture, EventType as TouchEventType } from '../../touch.js';
import { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';
import { IHoverDelegate } from '../hover/hoverDelegate.js';
import { renderLabelWithIcons } from '../iconLabel/iconLabels.js';
import { Action, IAction, IActionRunner } from '../../../common/actions.js';
import { Codicon } from '../../../common/codicons.js';
import { Color } from '../../../common/color.js';
import { Event as BaseEvent, Emitter } from '../../../common/event.js';
import { IMarkdownString, isMarkdownString, markdownStringEqual } from '../../../common/htmlContent.js';
import { KeyCode } from '../../../common/keyCodes.js';
import { Disposable, DisposableStore, IDisposable } from '../../../common/lifecycle.js';
import { ThemeIcon } from '../../../common/themables.js';
import './button.css';
import { localize } from '../../../../nls.js';
import type { IManagedHover } from '../hover/hover.js';
import { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';
import { IActionProvider } from '../dropdown/dropdown.js';
export interface IButtonOptions extends Partial<IButtonStyles> {
readonly title?: boolean | string;

View File

@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { $, IDomNodePagePosition } from 'vs/base/browser/dom';
import { IView, IViewSize } from 'vs/base/browser/ui/grid/grid';
import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash';
import { DistributeSizing, ISplitViewStyles, IView as ISplitViewView, Orientation, SplitView } from 'vs/base/browser/ui/splitview/splitview';
import { Color } from 'vs/base/common/color';
import { Event } from 'vs/base/common/event';
import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
import { $, IDomNodePagePosition } from '../../dom.js';
import { IView, IViewSize } from '../grid/grid.js';
import { IBoundarySashes } from '../sash/sash.js';
import { DistributeSizing, ISplitViewStyles, IView as ISplitViewView, Orientation, SplitView } from '../splitview/splitview.js';
import { Color } from '../../../common/color.js';
import { Event } from '../../../common/event.js';
import { DisposableStore, IDisposable } from '../../../common/lifecycle.js';
export interface CenteredViewState {
// width of the fixed centered layout

View File

@ -3,5 +3,5 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./codicon/codicon';
import 'vs/css!./codicon/codicon-modifiers';
import './codicon/codicon.css';
import './codicon/codicon-modifiers.css';

View File

@ -3,14 +3,14 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { BrowserFeatures } from 'vs/base/browser/canIUse';
import * as DOM from 'vs/base/browser/dom';
import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import * as platform from 'vs/base/common/platform';
import { Range } from 'vs/base/common/range';
import { OmitOptional } from 'vs/base/common/types';
import 'vs/css!./contextview';
import { BrowserFeatures } from '../../canIUse.js';
import * as DOM from '../../dom.js';
import { StandardMouseEvent } from '../../mouseEvent.js';
import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';
import * as platform from '../../../common/platform.js';
import { Range } from '../../../common/range.js';
import { OmitOptional } from '../../../common/types.js';
import './contextview.css';
export const enum ContextViewDOMPosition {
ABSOLUTE = 1,

View File

@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { $, append } from 'vs/base/browser/dom';
import { format } from 'vs/base/common/strings';
import 'vs/css!./countBadge';
import { $, append } from '../../dom.js';
import { format } from '../../../common/strings.js';
import './countBadge.css';
export interface ICountBadgeOptions {
readonly count?: number;

View File

@ -3,21 +3,21 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { $, addDisposableListener, clearNode, EventHelper, EventType, getWindow, hide, isActiveElement, isAncestor, show } from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { ButtonBar, ButtonWithDescription, IButtonStyles } from 'vs/base/browser/ui/button/button';
import { ICheckboxStyles, Checkbox } from 'vs/base/browser/ui/toggle/toggle';
import { IInputBoxStyles, InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
import { Action } from 'vs/base/common/actions';
import { Codicon } from 'vs/base/common/codicons';
import { ThemeIcon } from 'vs/base/common/themables';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { mnemonicButtonLabel } from 'vs/base/common/labels';
import { Disposable } from 'vs/base/common/lifecycle';
import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform';
import 'vs/css!./dialog';
import * as nls from 'vs/nls';
import { $, addDisposableListener, clearNode, EventHelper, EventType, getWindow, hide, isActiveElement, isAncestor, show } from '../../dom.js';
import { StandardKeyboardEvent } from '../../keyboardEvent.js';
import { ActionBar } from '../actionbar/actionbar.js';
import { ButtonBar, ButtonWithDescription, IButtonStyles } from '../button/button.js';
import { ICheckboxStyles, Checkbox } from '../toggle/toggle.js';
import { IInputBoxStyles, InputBox } from '../inputbox/inputBox.js';
import { Action } from '../../../common/actions.js';
import { Codicon } from '../../../common/codicons.js';
import { ThemeIcon } from '../../../common/themables.js';
import { KeyCode, KeyMod } from '../../../common/keyCodes.js';
import { mnemonicButtonLabel } from '../../../common/labels.js';
import { Disposable } from '../../../common/lifecycle.js';
import { isLinux, isMacintosh, isWindows } from '../../../common/platform.js';
import './dialog.css';
import * as nls from '../../../../nls.js';
export interface IDialogInputOptions {
readonly placeholder?: string;

View File

@ -3,20 +3,20 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IContextMenuProvider } from 'vs/base/browser/contextmenu';
import { $, addDisposableListener, append, EventHelper, EventType, isMouseEvent } from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { EventType as GestureEventType, Gesture } from 'vs/base/browser/touch';
import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
import type { IManagedHover } from 'vs/base/browser/ui/hover/hover';
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import { IMenuOptions } from 'vs/base/browser/ui/menu/menu';
import { ActionRunner, IAction } from 'vs/base/common/actions';
import { Emitter } from 'vs/base/common/event';
import { KeyCode } from 'vs/base/common/keyCodes';
import { IDisposable } from 'vs/base/common/lifecycle';
import 'vs/css!./dropdown';
import { IContextMenuProvider } from '../../contextmenu.js';
import { $, addDisposableListener, append, EventHelper, EventType, isMouseEvent } from '../../dom.js';
import { StandardKeyboardEvent } from '../../keyboardEvent.js';
import { EventType as GestureEventType, Gesture } from '../../touch.js';
import { AnchorAlignment } from '../contextview/contextview.js';
import type { IManagedHover } from '../hover/hover.js';
import { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';
import { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';
import { IMenuOptions } from '../menu/menu.js';
import { ActionRunner, IAction } from '../../../common/actions.js';
import { Emitter } from '../../../common/event.js';
import { KeyCode } from '../../../common/keyCodes.js';
import { IDisposable } from '../../../common/lifecycle.js';
import './dropdown.css';
export interface ILabelRenderer {
(container: HTMLElement): IDisposable | null;

View File

@ -3,24 +3,24 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { IContextMenuProvider } from 'vs/base/browser/contextmenu';
import { $, addDisposableListener, append, EventType, h } from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
import { ActionViewItem, BaseActionViewItem, IActionViewItemOptions, IBaseActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionViewItems';
import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
import { DropdownMenu, IActionProvider, IDropdownMenuOptions, ILabelRenderer } from 'vs/base/browser/ui/dropdown/dropdown';
import { Action, IAction, IActionRunner } from 'vs/base/common/actions';
import { Codicon } from 'vs/base/common/codicons';
import { ThemeIcon } from 'vs/base/common/themables';
import { Emitter } from 'vs/base/common/event';
import { KeyCode } from 'vs/base/common/keyCodes';
import { ResolvedKeybinding } from 'vs/base/common/keybindings';
import { IDisposable } from 'vs/base/common/lifecycle';
import 'vs/css!./dropdown';
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
import * as nls from '../../../../nls.js';
import { IContextMenuProvider } from '../../contextmenu.js';
import { $, addDisposableListener, append, EventType, h } from '../../dom.js';
import { StandardKeyboardEvent } from '../../keyboardEvent.js';
import { IActionViewItemProvider } from '../actionbar/actionbar.js';
import { ActionViewItem, BaseActionViewItem, IActionViewItemOptions, IBaseActionViewItemOptions } from '../actionbar/actionViewItems.js';
import { AnchorAlignment } from '../contextview/contextview.js';
import { DropdownMenu, IActionProvider, IDropdownMenuOptions, ILabelRenderer } from './dropdown.js';
import { Action, IAction, IActionRunner } from '../../../common/actions.js';
import { Codicon } from '../../../common/codicons.js';
import { ThemeIcon } from '../../../common/themables.js';
import { Emitter } from '../../../common/event.js';
import { KeyCode } from '../../../common/keyCodes.js';
import { ResolvedKeybinding } from '../../../common/keybindings.js';
import { IDisposable } from '../../../common/lifecycle.js';
import './dropdown.css';
import { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';
import { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';
export interface IKeybindingProvider {
(action: IAction): ResolvedKeybinding | undefined;

View File

@ -3,20 +3,20 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as dom from 'vs/base/browser/dom';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import { IToggleStyles, Toggle } from 'vs/base/browser/ui/toggle/toggle';
import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
import { CaseSensitiveToggle, RegexToggle, WholeWordsToggle } from 'vs/base/browser/ui/findinput/findInputToggles';
import { HistoryInputBox, IInputBoxStyles, IInputValidator, IMessage as InputBoxMessage } from 'vs/base/browser/ui/inputbox/inputBox';
import { Widget } from 'vs/base/browser/ui/widget';
import { Emitter, Event } from 'vs/base/common/event';
import { KeyCode } from 'vs/base/common/keyCodes';
import 'vs/css!./findInput';
import * as nls from 'vs/nls';
import { DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle';
import { createInstantHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import * as dom from '../../dom.js';
import { IKeyboardEvent } from '../../keyboardEvent.js';
import { IMouseEvent } from '../../mouseEvent.js';
import { IToggleStyles, Toggle } from '../toggle/toggle.js';
import { IContextViewProvider } from '../contextview/contextview.js';
import { CaseSensitiveToggle, RegexToggle, WholeWordsToggle } from './findInputToggles.js';
import { HistoryInputBox, IInputBoxStyles, IInputValidator, IMessage as InputBoxMessage } from '../inputbox/inputBox.js';
import { Widget } from '../widget.js';
import { Emitter, Event } from '../../../common/event.js';
import { KeyCode } from '../../../common/keyCodes.js';
import './findInput.css';
import * as nls from '../../../../nls.js';
import { DisposableStore, MutableDisposable } from '../../../common/lifecycle.js';
import { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';
export interface IFindInputOptions {

View File

@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
import { Toggle } from 'vs/base/browser/ui/toggle/toggle';
import { Codicon } from 'vs/base/common/codicons';
import * as nls from 'vs/nls';
import { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';
import { IHoverDelegate } from '../hover/hoverDelegate.js';
import { Toggle } from '../toggle/toggle.js';
import { Codicon } from '../../../common/codicons.js';
import * as nls from '../../../../nls.js';
export interface IFindInputToggleOpts {
readonly appendTitle: string;

View File

@ -3,20 +3,20 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as dom from 'vs/base/browser/dom';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import { IToggleStyles, Toggle } from 'vs/base/browser/ui/toggle/toggle';
import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
import { IFindInputToggleOpts } from 'vs/base/browser/ui/findinput/findInputToggles';
import { HistoryInputBox, IInputBoxStyles, IInputValidator, IMessage as InputBoxMessage } from 'vs/base/browser/ui/inputbox/inputBox';
import { Widget } from 'vs/base/browser/ui/widget';
import { Codicon } from 'vs/base/common/codicons';
import { Emitter, Event } from 'vs/base/common/event';
import { KeyCode } from 'vs/base/common/keyCodes';
import 'vs/css!./findInput';
import * as nls from 'vs/nls';
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import * as dom from '../../dom.js';
import { IKeyboardEvent } from '../../keyboardEvent.js';
import { IMouseEvent } from '../../mouseEvent.js';
import { IToggleStyles, Toggle } from '../toggle/toggle.js';
import { IContextViewProvider } from '../contextview/contextview.js';
import { IFindInputToggleOpts } from './findInputToggles.js';
import { HistoryInputBox, IInputBoxStyles, IInputValidator, IMessage as InputBoxMessage } from '../inputbox/inputBox.js';
import { Widget } from '../widget.js';
import { Codicon } from '../../../common/codicons.js';
import { Emitter, Event } from '../../../common/event.js';
import { KeyCode } from '../../../common/keyCodes.js';
import './findInput.css';
import * as nls from '../../../../nls.js';
import { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';
export interface IReplaceInputOptions {

View File

@ -3,16 +3,16 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IBoundarySashes, Orientation } from 'vs/base/browser/ui/sash/sash';
import { equals, tail2 as tail } from 'vs/base/common/arrays';
import { Event } from 'vs/base/common/event';
import { Disposable } from 'vs/base/common/lifecycle';
import 'vs/css!./gridview';
import { Box, GridView, IGridViewOptions, IGridViewStyles, IView as IGridViewView, IViewSize, orthogonal, Sizing as GridViewSizing, GridLocation } from './gridview';
import type { SplitView, AutoSizing as SplitViewAutoSizing } from 'vs/base/browser/ui/splitview/splitview';
import { IBoundarySashes, Orientation } from '../sash/sash.js';
import { equals, tail2 as tail } from '../../../common/arrays.js';
import { Event } from '../../../common/event.js';
import { Disposable } from '../../../common/lifecycle.js';
import './gridview.css';
import { Box, GridView, IGridViewOptions, IGridViewStyles, IView as IGridViewView, IViewSize, orthogonal, Sizing as GridViewSizing, GridLocation } from './gridview.js';
import type { SplitView, AutoSizing as SplitViewAutoSizing } from '../splitview/splitview.js';
export type { IViewSize };
export { LayoutPriority, Orientation, orthogonal } from './gridview';
export { LayoutPriority, Orientation, orthogonal } from './gridview.js';
export const enum Direction {
Up,

View File

@ -3,19 +3,19 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { $ } from 'vs/base/browser/dom';
import { IBoundarySashes, Orientation, Sash } from 'vs/base/browser/ui/sash/sash';
import { DistributeSizing, ISplitViewStyles, IView as ISplitView, LayoutPriority, Sizing, AutoSizing, SplitView } from 'vs/base/browser/ui/splitview/splitview';
import { equals as arrayEquals, tail2 as tail } from 'vs/base/common/arrays';
import { Color } from 'vs/base/common/color';
import { Emitter, Event, Relay } from 'vs/base/common/event';
import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { rot } from 'vs/base/common/numbers';
import { isUndefined } from 'vs/base/common/types';
import 'vs/css!./gridview';
import { $ } from '../../dom.js';
import { IBoundarySashes, Orientation, Sash } from '../sash/sash.js';
import { DistributeSizing, ISplitViewStyles, IView as ISplitView, LayoutPriority, Sizing, AutoSizing, SplitView } from '../splitview/splitview.js';
import { equals as arrayEquals, tail2 as tail } from '../../../common/arrays.js';
import { Color } from '../../../common/color.js';
import { Emitter, Event, Relay } from '../../../common/event.js';
import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';
import { rot } from '../../../common/numbers.js';
import { isUndefined } from '../../../common/types.js';
import './gridview.css';
export { Orientation } from 'vs/base/browser/ui/sash/sash';
export { LayoutPriority, Sizing } from 'vs/base/browser/ui/splitview/splitview';
export { Orientation } from '../sash/sash.js';
export { LayoutPriority, Sizing } from '../splitview/splitview.js';
export interface IGridViewStyles extends ISplitViewStyles { }

View File

@ -3,14 +3,14 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as dom from 'vs/base/browser/dom';
import type { IManagedHover } from 'vs/base/browser/ui/hover/hover';
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
import { Disposable } from 'vs/base/common/lifecycle';
import * as objects from 'vs/base/common/objects';
import * as dom from '../../dom.js';
import type { IManagedHover } from '../hover/hover.js';
import { IHoverDelegate } from '../hover/hoverDelegate.js';
import { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';
import { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';
import { renderLabelWithIcons } from '../iconLabel/iconLabels.js';
import { Disposable } from '../../../common/lifecycle.js';
import * as objects from '../../../common/objects.js';
/**
* A range to be highlighted.

View File

@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
import type { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget';
import type { CancellationToken } from 'vs/base/common/cancellation';
import type { IMarkdownString } from 'vs/base/common/htmlContent';
import type { IDisposable } from 'vs/base/common/lifecycle';
import type { IHoverDelegate } from './hoverDelegate.js';
import type { HoverPosition } from './hoverWidget.js';
import type { CancellationToken } from '../../../common/cancellation.js';
import type { IMarkdownString } from '../../../common/htmlContent.js';
import type { IDisposable } from '../../../common/lifecycle.js';
/**
* Enables the convenient display of rich markdown-based hovers in the workbench.

View File

@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type { IHoverWidget, IManagedHoverOptions } from 'vs/base/browser/ui/hover/hover';
import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget';
import { IMarkdownString } from 'vs/base/common/htmlContent';
import { IDisposable } from 'vs/base/common/lifecycle';
import type { IHoverWidget, IManagedHoverOptions } from './hover.js';
import { HoverPosition } from './hoverWidget.js';
import { IMarkdownString } from '../../../common/htmlContent.js';
import { IDisposable } from '../../../common/lifecycle.js';
export interface IHoverDelegateTarget extends IDisposable {
readonly targetElements: readonly HTMLElement[];

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type { IHoverDelegate2 } from 'vs/base/browser/ui/hover/hover';
import type { IHoverDelegate2 } from './hover.js';
let baseHoverDelegate: IHoverDelegate2 = {
showHover: () => undefined,

View File

@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IHoverDelegate, IScopedHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
import { Lazy } from 'vs/base/common/lazy';
import { IHoverDelegate, IScopedHoverDelegate } from './hoverDelegate.js';
import { Lazy } from '../../../common/lazy.js';
const nullHoverDelegateFactory = () => ({
get delay(): number { return -1; },

View File

@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as dom from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
import { KeyCode } from 'vs/base/common/keyCodes';
import { Disposable } from 'vs/base/common/lifecycle';
import 'vs/css!./hoverWidget';
import { localize } from 'vs/nls';
import * as dom from '../../dom.js';
import { StandardKeyboardEvent } from '../../keyboardEvent.js';
import { DomScrollableElement } from '../scrollbar/scrollableElement.js';
import { KeyCode } from '../../../common/keyCodes.js';
import { Disposable } from '../../../common/lifecycle.js';
import './hoverWidget.css';
import { localize } from '../../../../nls.js';
const $ = dom.$;

View File

@ -3,20 +3,20 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./iconlabel';
import * as dom from 'vs/base/browser/dom';
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
import { IMatch } from 'vs/base/common/filters';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { equals } from 'vs/base/common/objects';
import { Range } from 'vs/base/common/range';
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
import type { IManagedHoverTooltipMarkdownString } from 'vs/base/browser/ui/hover/hover';
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
import { isString } from 'vs/base/common/types';
import { stripIcons } from 'vs/base/common/iconLabels';
import { URI } from 'vs/base/common/uri';
import './iconlabel.css';
import * as dom from '../../dom.js';
import { HighlightedLabel } from '../highlightedlabel/highlightedLabel.js';
import { IHoverDelegate } from '../hover/hoverDelegate.js';
import { IMatch } from '../../../common/filters.js';
import { Disposable, IDisposable } from '../../../common/lifecycle.js';
import { equals } from '../../../common/objects.js';
import { Range } from '../../../common/range.js';
import { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';
import type { IManagedHoverTooltipMarkdownString } from '../hover/hover.js';
import { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';
import { isString } from '../../../common/types.js';
import { stripIcons } from '../../../common/iconLabels.js';
import { URI } from '../../../common/uri.js';
export interface IIconLabelCreationOptions {
readonly supportHighlights?: boolean;

View File

@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as dom from 'vs/base/browser/dom';
import { ThemeIcon } from 'vs/base/common/themables';
import * as dom from '../../dom.js';
import { ThemeIcon } from '../../../common/themables.js';
const labelWithIconsRegex = new RegExp(`(\\\\)?\\$\\((${ThemeIcon.iconNameExpression}(?:${ThemeIcon.iconModifierExpression})?)\\)`, 'g');
export function renderLabelWithIcons(text: string): Array<HTMLSpanElement | string> {

Some files were not shown because too many files have changed in this diff Show More