mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-21 13:36:49 +01:00
Merge remote-tracking branch 'origin/main' into copilot/fix-250770
This commit is contained in:
@@ -99,7 +99,7 @@ Next, let's try debugging.
|
||||
|
||||
2. Go to your local VS Code client, and use the **Run / Debug** view to launch the **VS Code** configuration. (Typically the default, so you can likely just press <kbd>F5</kbd>).
|
||||
|
||||
> **Note:** If launching times out, you can increase the value of `timeout` in the "VS Code", "Attach Main Process", "Attach Extension Host", and "Attach to Shared Process" configurations in [launch.json](../../.vscode/launch.json). However, running `./scripts/code.sh` first will set up Electron which will usually solve timeout issues.
|
||||
> **Note:** If launching times out, you can increase the value of `timeout` in the "VS Code", "Attach Main Process", "Attach Extension Host", and "Attach to Shared Process" configurations in [launch.json](../.vscode/launch.json). However, running `./scripts/code.sh` first will set up Electron which will usually solve timeout issues.
|
||||
|
||||
3. After a bit, Code - OSS will appear with the debugger attached!
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ interface ConditionalPattern {
|
||||
|
||||
interface RawImportPatternsConfig {
|
||||
target: string;
|
||||
layer?: 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-utility' | 'electron-main';
|
||||
layer?: 'common' | 'worker' | 'browser' | 'electron-browser' | 'node' | 'electron-utility' | 'electron-main';
|
||||
test?: boolean;
|
||||
restrictions: string | (string | ConditionalPattern)[];
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export = new class implements eslint.Rule.RuleModule {
|
||||
return this._optionsCache.get(options)!;
|
||||
}
|
||||
|
||||
type Layer = 'common' | 'worker' | 'browser' | 'electron-sandbox' | 'node' | 'electron-utility' | 'electron-main';
|
||||
type Layer = 'common' | 'worker' | 'browser' | 'electron-browser' | 'node' | 'electron-utility' | 'electron-main';
|
||||
|
||||
interface ILayerRule {
|
||||
layer: Layer;
|
||||
@@ -98,7 +98,7 @@ export = new class implements eslint.Rule.RuleModule {
|
||||
{ layer: 'common', deps: orSegment(['common']) },
|
||||
{ layer: 'worker', deps: orSegment(['common', 'worker']) },
|
||||
{ layer: 'browser', deps: orSegment(['common', 'browser']), isBrowser: true },
|
||||
{ layer: 'electron-sandbox', deps: orSegment(['common', 'browser', 'electron-sandbox']), isBrowser: true },
|
||||
{ layer: 'electron-browser', deps: orSegment(['common', 'browser', 'electron-browser']), isBrowser: true },
|
||||
{ layer: 'node', deps: orSegment(['common', 'node']), isNode: true },
|
||||
{ layer: 'electron-utility', deps: orSegment(['common', 'node', 'electron-utility']), isNode: true, isElectron: true },
|
||||
{ layer: 'electron-main', deps: orSegment(['common', 'node', 'electron-utility', 'electron-main']), isNode: true, isElectron: true },
|
||||
|
||||
@@ -538,5 +538,62 @@
|
||||
"addLabel": "info-needed",
|
||||
"removeLabel": "~confirmation-needed",
|
||||
"comment": "Please diagnose the root cause of the issue by running the command `F1 > Help: Troubleshoot Issue` and following the instructions. Once you have done that, please update the issue with the results.\n\nHappy Coding!"
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~chat-rate-limiting",
|
||||
"removeLabel": "~chat-rate-limiting",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "This issue is a duplicate of https://github.com/microsoft/vscode-copilot-release/issues/2627. Please refer to that issue for updates and discussions. Feel free to open a new issue if you think this is a different problem."
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~chat-request-failed",
|
||||
"removeLabel": "~chat-request-failed",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "This issue is a duplicate of https://github.com/microsoft/vscode-copilot-release/issues/4332. Please refer to that issue for updates and discussions. Feel free to open a new issue if you think this is a different problem."
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~chat-rai-content-filters",
|
||||
"removeLabel": "~chat-rai-content-filters",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "This issue is a duplicate of https://github.com/microsoft/vscode-copilot-release/issues/2625. Please refer to that issue for updates and discussions. Feel free to open a new issue if you think this is a different problem."
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~chat-public-code-blocking",
|
||||
"removeLabel": "~chat-public-code-blocking",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "This issue is a duplicate of https://github.com/microsoft/vscode-copilot-release/issues/2626. Please refer to that issue for updates and discussions. Feel free to open a new issue if you think this is a different problem."
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~chat-lm-unavailable",
|
||||
"removeLabel": "~chat-lm-unavailable",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "This issue is a duplicate of https://github.com/microsoft/vscode-copilot-release/issues/2116. Please refer to that issue for updates and discussions. Feel free to open a new issue if you think this is a different problem."
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~chat-authentication",
|
||||
"removeLabel": "~chat-authentication",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "Please look at the following meta issue: https://github.com/microsoft/vscode-copilot-release/issues/11078, if the bug you are experiencing is not there, please comment on this closed issue thread so we can re-open it.",
|
||||
"assign": ["TylerLeonhardt"]
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "~chat-no-response-returned",
|
||||
"removeLabel": "~chat-no-response-returned",
|
||||
"action": "close",
|
||||
"reason": "not_planned",
|
||||
"comment": "Please look at the following meta issue: https://github.com/microsoft/vscode-copilot-release/issues/7034. Please refer to that issue for updates and discussions. Feel free to open a new issue if you think this is a different problem."
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
disturl="https://electronjs.org/headers"
|
||||
target="35.5.1"
|
||||
ms_build_id="11708675"
|
||||
ms_build_id="11727614"
|
||||
runtime="electron"
|
||||
build_from_source="true"
|
||||
legacy-peer-deps="true"
|
||||
timeout=180000
|
||||
npm_config_node_gyp="node build/npm/gyp/node_modules/node-gyp/bin/node-gyp.js"
|
||||
|
||||
Vendored
+1
@@ -254,6 +254,7 @@
|
||||
"VSCODE_SKIP_PRELAUNCH": "1",
|
||||
},
|
||||
"cleanUp": "wholeBrowser",
|
||||
"killBehavior": "polite",
|
||||
"runtimeArgs": [
|
||||
"--inspect-brk=5875",
|
||||
"--no-cached-data",
|
||||
|
||||
Vendored
+1
-1
@@ -7,7 +7,7 @@
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$REPO=repo:microsoft/vscode\n$MILESTONE=milestone:\"May 2025\""
|
||||
"value": "$REPO=repo:microsoft/vscode\n$MILESTONE=milestone:\"June 2025\""
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
2025-05-14T16:33:46.494Z
|
||||
2025-06-09T07:16:15.626Z
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ exports.workerExtensionHost = createModuleDescription('vs/workbench/api/worker/e
|
||||
exports.workerNotebook = createModuleDescription('vs/workbench/contrib/notebook/common/services/notebookWebWorkerMain');
|
||||
exports.workerLanguageDetection = createModuleDescription('vs/workbench/services/languageDetection/browser/languageDetectionWebWorkerMain');
|
||||
exports.workerLocalFileSearch = createModuleDescription('vs/workbench/services/search/worker/localFileSearchMain');
|
||||
exports.workerProfileAnalysis = createModuleDescription('vs/platform/profiling/electron-sandbox/profileAnalysisWorkerMain');
|
||||
exports.workerProfileAnalysis = createModuleDescription('vs/platform/profiling/electron-browser/profileAnalysisWorkerMain');
|
||||
exports.workerOutputLinks = createModuleDescription('vs/workbench/contrib/output/common/outputLinkComputerMain');
|
||||
exports.workerBackgroundTokenization = createModuleDescription('vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.workerMain');
|
||||
|
||||
@@ -43,7 +43,7 @@ exports.code = [
|
||||
// 'vs/code/node/cli' is not included here because it comes in via ./src/cli.js
|
||||
createModuleDescription('vs/code/node/cliProcessMain'),
|
||||
createModuleDescription('vs/code/electron-utility/sharedProcess/sharedProcessMain'),
|
||||
createModuleDescription('vs/code/electron-sandbox/workbench/workbench'),
|
||||
createModuleDescription('vs/code/electron-browser/workbench/workbench'),
|
||||
createModuleDescription('vs/workbench/contrib/webview/browser/pre/service-worker')
|
||||
];
|
||||
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const typescript_1 = __importDefault(require("typescript"));
|
||||
const fs_1 = require("fs");
|
||||
const path_1 = require("path");
|
||||
const minimatch_1 = require("minimatch");
|
||||
//
|
||||
// #############################################################################################
|
||||
//
|
||||
// A custom typescript checker for the specific task of detecting the use of certain types in a
|
||||
// layer that does not allow such use.
|
||||
//
|
||||
// Make changes to below RULES to lift certain files from these checks only if absolutely needed
|
||||
//
|
||||
// NOTE: Most layer checks are done via tsconfig.<layer>.json files.
|
||||
//
|
||||
// #############################################################################################
|
||||
//
|
||||
// Types that are defined in a common layer but are known to be only
|
||||
// available in native environments should not be allowed in browser
|
||||
const NATIVE_TYPES = [
|
||||
'NativeParsedArgs',
|
||||
'INativeEnvironmentService',
|
||||
'AbstractNativeEnvironmentService',
|
||||
'INativeWindowConfiguration',
|
||||
'ICommonNativeHostService',
|
||||
'INativeHostService',
|
||||
'IMainProcessService',
|
||||
'INativeBrowserElementsService',
|
||||
];
|
||||
const RULES = [
|
||||
// Tests: skip
|
||||
{
|
||||
target: '**/vs/**/test/**',
|
||||
skip: true // -> skip all test files
|
||||
},
|
||||
// Common: vs/platform services that can access native types
|
||||
{
|
||||
target: `**/vs/platform/{${[
|
||||
'environment/common/*.ts',
|
||||
'window/common/window.ts',
|
||||
'native/common/native.ts',
|
||||
'native/common/nativeHostService.ts',
|
||||
'browserElements/common/browserElements.ts',
|
||||
'browserElements/common/nativeBrowserElementsService.ts'
|
||||
].join(',')}}`,
|
||||
disallowedTypes: [ /* Ignore native types that are defined from here */],
|
||||
},
|
||||
// Common: vs/base/parts/sandbox/electron-browser/preload{,-aux}.ts
|
||||
{
|
||||
target: '**/vs/base/parts/sandbox/electron-browser/preload{,-aux}.ts',
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
},
|
||||
// Common
|
||||
{
|
||||
target: '**/vs/**/common/**',
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
},
|
||||
// Common
|
||||
{
|
||||
target: '**/vs/**/worker/**',
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
},
|
||||
// Browser
|
||||
{
|
||||
target: '**/vs/**/browser/**',
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
},
|
||||
// Electron (main, utility)
|
||||
{
|
||||
target: '**/vs/**/{electron-main,electron-utility}/**',
|
||||
disallowedTypes: [
|
||||
'ipcMain' // not allowed, use validatedIpcMain instead
|
||||
]
|
||||
}
|
||||
];
|
||||
const TS_CONFIG_PATH = (0, path_1.join)(__dirname, '../../', 'src', 'tsconfig.json');
|
||||
let hasErrors = false;
|
||||
function checkFile(program, sourceFile, rule) {
|
||||
checkNode(sourceFile);
|
||||
function checkNode(node) {
|
||||
if (node.kind !== typescript_1.default.SyntaxKind.Identifier) {
|
||||
return typescript_1.default.forEachChild(node, checkNode); // recurse down
|
||||
}
|
||||
const checker = program.getTypeChecker();
|
||||
const symbol = checker.getSymbolAtLocation(node);
|
||||
if (!symbol) {
|
||||
return;
|
||||
}
|
||||
let text = symbol.getName();
|
||||
let _parentSymbol = symbol;
|
||||
while (_parentSymbol.parent) {
|
||||
_parentSymbol = _parentSymbol.parent;
|
||||
}
|
||||
const parentSymbol = _parentSymbol;
|
||||
text = parentSymbol.getName();
|
||||
if (rule.disallowedTypes?.some(disallowed => disallowed === text)) {
|
||||
const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
||||
console.log(`[build/checker/layersChecker.ts]: Reference to type '${text}' violates layer '${rule.target}' (${sourceFile.fileName} (${line + 1},${character + 1}). Learn more about our source code organization at https://github.com/microsoft/vscode/wiki/Source-Code-Organization.`);
|
||||
hasErrors = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
function createProgram(tsconfigPath) {
|
||||
const tsConfig = typescript_1.default.readConfigFile(tsconfigPath, typescript_1.default.sys.readFile);
|
||||
const configHostParser = { fileExists: fs_1.existsSync, readDirectory: typescript_1.default.sys.readDirectory, readFile: file => (0, fs_1.readFileSync)(file, 'utf8'), useCaseSensitiveFileNames: process.platform === 'linux' };
|
||||
const tsConfigParsed = typescript_1.default.parseJsonConfigFileContent(tsConfig.config, configHostParser, (0, path_1.resolve)((0, path_1.dirname)(tsconfigPath)), { noEmit: true });
|
||||
const compilerHost = typescript_1.default.createCompilerHost(tsConfigParsed.options, true);
|
||||
return typescript_1.default.createProgram(tsConfigParsed.fileNames, tsConfigParsed.options, compilerHost);
|
||||
}
|
||||
//
|
||||
// Create program and start checking
|
||||
//
|
||||
const program = createProgram(TS_CONFIG_PATH);
|
||||
for (const sourceFile of program.getSourceFiles()) {
|
||||
for (const rule of RULES) {
|
||||
if ((0, minimatch_1.match)([sourceFile.fileName], rule.target).length > 0) {
|
||||
if (!rule.skip) {
|
||||
checkFile(program, sourceFile, rule);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasErrors) {
|
||||
process.exit(1);
|
||||
}
|
||||
//# sourceMappingURL=layersChecker.js.map
|
||||
@@ -0,0 +1,166 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import ts from 'typescript';
|
||||
import { readFileSync, existsSync } from 'fs';
|
||||
import { resolve, dirname, join } from 'path';
|
||||
import { match } from 'minimatch';
|
||||
|
||||
//
|
||||
// #############################################################################################
|
||||
//
|
||||
// A custom typescript checker for the specific task of detecting the use of certain types in a
|
||||
// layer that does not allow such use.
|
||||
//
|
||||
// Make changes to below RULES to lift certain files from these checks only if absolutely needed
|
||||
//
|
||||
// NOTE: Most layer checks are done via tsconfig.<layer>.json files.
|
||||
//
|
||||
// #############################################################################################
|
||||
//
|
||||
|
||||
// Types that are defined in a common layer but are known to be only
|
||||
// available in native environments should not be allowed in browser
|
||||
const NATIVE_TYPES = [
|
||||
'NativeParsedArgs',
|
||||
'INativeEnvironmentService',
|
||||
'AbstractNativeEnvironmentService',
|
||||
'INativeWindowConfiguration',
|
||||
'ICommonNativeHostService',
|
||||
'INativeHostService',
|
||||
'IMainProcessService',
|
||||
'INativeBrowserElementsService',
|
||||
];
|
||||
|
||||
const RULES: IRule[] = [
|
||||
|
||||
// Tests: skip
|
||||
{
|
||||
target: '**/vs/**/test/**',
|
||||
skip: true // -> skip all test files
|
||||
},
|
||||
|
||||
// Common: vs/platform services that can access native types
|
||||
{
|
||||
target: `**/vs/platform/{${[
|
||||
'environment/common/*.ts',
|
||||
'window/common/window.ts',
|
||||
'native/common/native.ts',
|
||||
'native/common/nativeHostService.ts',
|
||||
'browserElements/common/browserElements.ts',
|
||||
'browserElements/common/nativeBrowserElementsService.ts'
|
||||
].join(',')}}`,
|
||||
disallowedTypes: [/* Ignore native types that are defined from here */],
|
||||
},
|
||||
|
||||
// Common: vs/base/parts/sandbox/electron-browser/preload{,-aux}.ts
|
||||
{
|
||||
target: '**/vs/base/parts/sandbox/electron-browser/preload{,-aux}.ts',
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
},
|
||||
|
||||
// Common
|
||||
{
|
||||
target: '**/vs/**/common/**',
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
},
|
||||
|
||||
// Common
|
||||
{
|
||||
target: '**/vs/**/worker/**',
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
},
|
||||
|
||||
// Browser
|
||||
{
|
||||
target: '**/vs/**/browser/**',
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
},
|
||||
|
||||
// Electron (main, utility)
|
||||
{
|
||||
target: '**/vs/**/{electron-main,electron-utility}/**',
|
||||
disallowedTypes: [
|
||||
'ipcMain' // not allowed, use validatedIpcMain instead
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
const TS_CONFIG_PATH = join(__dirname, '../../', 'src', 'tsconfig.json');
|
||||
|
||||
interface IRule {
|
||||
target: string;
|
||||
skip?: boolean;
|
||||
disallowedTypes?: string[];
|
||||
}
|
||||
|
||||
let hasErrors = false;
|
||||
|
||||
function checkFile(program: ts.Program, sourceFile: ts.SourceFile, rule: IRule) {
|
||||
checkNode(sourceFile);
|
||||
|
||||
function checkNode(node: ts.Node): void {
|
||||
if (node.kind !== ts.SyntaxKind.Identifier) {
|
||||
return ts.forEachChild(node, checkNode); // recurse down
|
||||
}
|
||||
|
||||
const checker = program.getTypeChecker();
|
||||
const symbol = checker.getSymbolAtLocation(node);
|
||||
|
||||
if (!symbol) {
|
||||
return;
|
||||
}
|
||||
|
||||
let text = symbol.getName();
|
||||
let _parentSymbol: any = symbol;
|
||||
|
||||
while (_parentSymbol.parent) {
|
||||
_parentSymbol = _parentSymbol.parent;
|
||||
}
|
||||
|
||||
const parentSymbol = _parentSymbol as ts.Symbol;
|
||||
text = parentSymbol.getName();
|
||||
|
||||
if (rule.disallowedTypes?.some(disallowed => disallowed === text)) {
|
||||
const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
||||
console.log(`[build/checker/layersChecker.ts]: Reference to type '${text}' violates layer '${rule.target}' (${sourceFile.fileName} (${line + 1},${character + 1}). Learn more about our source code organization at https://github.com/microsoft/vscode/wiki/Source-Code-Organization.`);
|
||||
|
||||
hasErrors = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createProgram(tsconfigPath: string): ts.Program {
|
||||
const tsConfig = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
|
||||
|
||||
const configHostParser: ts.ParseConfigHost = { fileExists: existsSync, readDirectory: ts.sys.readDirectory, readFile: file => readFileSync(file, 'utf8'), useCaseSensitiveFileNames: process.platform === 'linux' };
|
||||
const tsConfigParsed = ts.parseJsonConfigFileContent(tsConfig.config, configHostParser, resolve(dirname(tsconfigPath)), { noEmit: true });
|
||||
|
||||
const compilerHost = ts.createCompilerHost(tsConfigParsed.options, true);
|
||||
|
||||
return ts.createProgram(tsConfigParsed.fileNames, tsConfigParsed.options, compilerHost);
|
||||
}
|
||||
|
||||
//
|
||||
// Create program and start checking
|
||||
//
|
||||
const program = createProgram(TS_CONFIG_PATH);
|
||||
|
||||
for (const sourceFile of program.getSourceFiles()) {
|
||||
for (const rule of RULES) {
|
||||
if (match([sourceFile.fileName], rule.target).length > 0) {
|
||||
if (!rule.skip) {
|
||||
checkFile(program, sourceFile, rule);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hasErrors) {
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"extends": "../../src/tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"lib": [
|
||||
"ES2022",
|
||||
"DOM",
|
||||
"DOM.Iterable"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": [
|
||||
"../../src/*.ts",
|
||||
"../../src/**/common/**/*.ts",
|
||||
"../../src/**/browser/**/*.ts",
|
||||
"../../src/typings/*.d.ts",
|
||||
"../../src/vs/monaco.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.*.d.ts",
|
||||
"../../src/vscode-dts/vscode.d.ts",
|
||||
"../../node_modules/@webgpu/types/dist/index.d.ts",
|
||||
"../../node_modules/@types/trusted-types/index.d.ts",
|
||||
"../../node_modules/@types/wicg-file-system-access/index.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"../../src/**/test/**",
|
||||
"../../src/**/fixtures/**"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"extends": "./tsconfig.browser.json",
|
||||
"include": [
|
||||
"../../src/**/common/**/*.ts",
|
||||
"../../src/**/browser/**/*.ts",
|
||||
"../../src/**/electron-browser/**/*.ts",
|
||||
"../../src/typings/*.d.ts",
|
||||
"../../src/vs/monaco.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.*.d.ts",
|
||||
"../../src/vscode-dts/vscode.d.ts",
|
||||
"../../node_modules/@webgpu/types/dist/index.d.ts",
|
||||
"../../node_modules/@types/trusted-types/index.d.ts",
|
||||
"../../node_modules/@types/wicg-file-system-access/index.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"../../src/**/test/**",
|
||||
"../../src/**/fixtures/**",
|
||||
"../../src/vs/base/parts/sandbox/electron-browser/preload.ts", // Preload scripts for Electron sandbox
|
||||
"../../src/vs/base/parts/sandbox/electron-browser/preload-aux.ts" // have limited access to node.js APIs
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": "./tsconfig.node.json",
|
||||
"include": [
|
||||
"../../src/**/common/**/*.ts",
|
||||
"../../src/**/node/**/*.ts",
|
||||
"../../src/**/electron-main/**/*.ts",
|
||||
"../../src/typings/*.d.ts",
|
||||
"../../src/vs/monaco.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.*.d.ts",
|
||||
"../../src/vscode-dts/vscode.d.ts",
|
||||
"../../node_modules/@types/trusted-types/index.d.ts",
|
||||
],
|
||||
"exclude": [
|
||||
"../../src/**/test/**",
|
||||
"../../src/**/fixtures/**",
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": "./tsconfig.node.json",
|
||||
"include": [
|
||||
"../../src/**/common/**/*.ts",
|
||||
"../../src/**/node/**/*.ts",
|
||||
"../../src/**/electron-utility/**/*.ts",
|
||||
"../../src/typings/*.d.ts",
|
||||
"../../src/vs/monaco.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.*.d.ts",
|
||||
"../../src/vscode-dts/vscode.d.ts",
|
||||
"../../node_modules/@types/trusted-types/index.d.ts",
|
||||
],
|
||||
"exclude": [
|
||||
"../../src/**/test/**",
|
||||
"../../src/**/fixtures/**",
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"extends": "../../src/tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"lib": [
|
||||
"ES2022"
|
||||
],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": [
|
||||
"../../src/*.ts",
|
||||
"../../src/**/common/**/*.ts",
|
||||
"../../src/**/node/**/*.ts",
|
||||
"../../src/typings/*.d.ts",
|
||||
"../../src/vs/monaco.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.*.d.ts",
|
||||
"../../src/vscode-dts/vscode.d.ts",
|
||||
"../../node_modules/@types/trusted-types/index.d.ts",
|
||||
],
|
||||
"exclude": [
|
||||
"../../src/**/test/**",
|
||||
"../../src/**/fixtures/**"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"extends": "../../src/tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"lib": [
|
||||
"ES2022",
|
||||
"WebWorker",
|
||||
"Webworker.Iterable",
|
||||
"WebWorker.AsyncIterable"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": [
|
||||
"../../src/**/common/**/*.ts",
|
||||
"../../src/**/worker/**/*.ts",
|
||||
"../../src/typings/*.d.ts",
|
||||
"../../src/vs/monaco.d.ts",
|
||||
"../../src/vscode-dts/vscode.proposed.*.d.ts",
|
||||
"../../src/vscode-dts/vscode.d.ts",
|
||||
"../../node_modules/@types/trusted-types/index.d.ts",
|
||||
"../../node_modules/@types/wicg-file-system-access/index.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"../../src/**/test/**",
|
||||
"../../src/**/fixtures/**"
|
||||
]
|
||||
}
|
||||
@@ -103,6 +103,7 @@ module.exports.indentationFilter = [
|
||||
'!extensions/vscode-api-tests/testWorkspace2/**',
|
||||
'!build/monaco/**',
|
||||
'!build/win32/**',
|
||||
'!build/checker/**',
|
||||
|
||||
// except multiple specific files
|
||||
'!**/package.json',
|
||||
|
||||
@@ -80,7 +80,7 @@ const serverResourceIncludes = [
|
||||
];
|
||||
|
||||
const serverResourceExcludes = [
|
||||
'!out-build/vs/**/{electron-sandbox,electron-main,electron-utility}/**',
|
||||
'!out-build/vs/**/{electron-browser,electron-main,electron-utility}/**',
|
||||
'!out-build/vs/editor/standalone/**',
|
||||
'!out-build/vs/workbench/**/*-tb.png',
|
||||
'!**/test/**'
|
||||
@@ -257,7 +257,7 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
|
||||
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
||||
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
||||
.pipe(util.setExecutableBit(['**/*.sh']))
|
||||
.pipe(filter(['**', '!**/*.js.map']));
|
||||
.pipe(filter(['**', '!**/*.{js,css}.map']));
|
||||
|
||||
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
||||
const isUIExtension = (manifest) => {
|
||||
@@ -298,7 +298,7 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
|
||||
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
||||
const extensionsCommonDependencies = gulp.src('.build/extensions/node_modules/**', { base: '.build', dot: true });
|
||||
const sources = es.merge(src, extensions, extensionsCommonDependencies)
|
||||
.pipe(filter(['**', '!**/*.js.map'], { dot: true }));
|
||||
.pipe(filter(['**', '!**/*.{js,css}.map'], { dot: true }));
|
||||
|
||||
let version = packageJson.version;
|
||||
const quality = product.quality;
|
||||
@@ -333,7 +333,7 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
|
||||
const dependenciesSrc = productionDependencies.map(d => path.relative(REPO_ROOT, d)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`, `!${d}/.bin/**`]).flat();
|
||||
const deps = gulp.src(dependenciesSrc, { base: 'remote', dot: true })
|
||||
// filter out unnecessary files, no source maps in server build
|
||||
.pipe(filter(['**', '!**/package-lock.json', '!**/*.js.map']))
|
||||
.pipe(filter(['**', '!**/package-lock.json', '!**/*.{js,css}.map']))
|
||||
.pipe(util.cleanNodeModules(path.join(__dirname, '.moduleignore')))
|
||||
.pipe(util.cleanNodeModules(path.join(__dirname, `.moduleignore.${process.platform}`)))
|
||||
.pipe(jsFilter)
|
||||
|
||||
@@ -57,11 +57,11 @@ const vscodeResourceIncludes = [
|
||||
'out-build/nls.keys.json',
|
||||
|
||||
// Workbench
|
||||
'out-build/vs/code/electron-sandbox/workbench/workbench.html',
|
||||
'out-build/vs/code/electron-browser/workbench/workbench.html',
|
||||
|
||||
// Electron Preload
|
||||
'out-build/vs/base/parts/sandbox/electron-sandbox/preload.js',
|
||||
'out-build/vs/base/parts/sandbox/electron-sandbox/preload-aux.js',
|
||||
'out-build/vs/base/parts/sandbox/electron-browser/preload.js',
|
||||
'out-build/vs/base/parts/sandbox/electron-browser/preload-aux.js',
|
||||
|
||||
// Node Scripts
|
||||
'out-build/vs/base/node/{terminateProcess.sh,cpuUsage.sh,ps.sh}',
|
||||
@@ -138,7 +138,7 @@ const bundleVSCodeTask = task.define('bundle-vscode', task.series(
|
||||
...bootstrapEntryPoints
|
||||
],
|
||||
resources: vscodeResources,
|
||||
skipTSBoilerplateRemoval: entryPoint => entryPoint === 'vs/code/electron-sandbox/workbench/workbench'
|
||||
skipTSBoilerplateRemoval: entryPoint => entryPoint === 'vs/code/electron-browser/workbench/workbench'
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -220,12 +220,12 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
const out = sourceFolderName;
|
||||
|
||||
const checksums = computeChecksums(out, [
|
||||
'vs/base/parts/sandbox/electron-sandbox/preload.js',
|
||||
'vs/base/parts/sandbox/electron-browser/preload.js',
|
||||
'vs/workbench/workbench.desktop.main.js',
|
||||
'vs/workbench/workbench.desktop.main.css',
|
||||
'vs/workbench/api/node/extensionHostProcess.js',
|
||||
'vs/code/electron-sandbox/workbench/workbench.html',
|
||||
'vs/code/electron-sandbox/workbench/workbench.js'
|
||||
'vs/code/electron-browser/workbench/workbench.html',
|
||||
'vs/code/electron-browser/workbench/workbench.js'
|
||||
]);
|
||||
|
||||
const src = gulp.src(out + '/**', { base: '.' })
|
||||
@@ -244,7 +244,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
const extensions = gulp.src(['.build/extensions/**', ...platformSpecificBuiltInExtensionsExclusions], { base: '.build', dot: true });
|
||||
|
||||
const sources = es.merge(src, extensions)
|
||||
.pipe(filter(['**', '!**/*.js.map'], { dot: true }));
|
||||
.pipe(filter(['**', '!**/*.{js,css}.map'], { dot: true }));
|
||||
|
||||
let version = packageJson.version;
|
||||
const quality = product.quality;
|
||||
@@ -289,7 +289,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
const dependenciesSrc = productionDependencies.map(d => path.relative(root, d)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`]).flat().concat('!**/*.mk');
|
||||
|
||||
const deps = gulp.src(dependenciesSrc, { base: '.', dot: true })
|
||||
.pipe(filter(['**', `!**/${config.version}/**`, '!**/bin/darwin-arm64-87/**', '!**/package-lock.json', '!**/yarn.lock', '!**/*.js.map']))
|
||||
.pipe(filter(['**', `!**/${config.version}/**`, '!**/bin/darwin-arm64-87/**', '!**/package-lock.json', '!**/yarn.lock', '!**/*.{js,css}.map']))
|
||||
.pipe(util.cleanNodeModules(path.join(__dirname, '.moduleignore')))
|
||||
.pipe(util.cleanNodeModules(path.join(__dirname, `.moduleignore.${process.platform}`)))
|
||||
.pipe(jsFilter)
|
||||
|
||||
@@ -66,7 +66,7 @@ const vscodeWebResources = [
|
||||
...vscodeWebResourceIncludes,
|
||||
|
||||
// Excludes
|
||||
'!out-build/vs/**/{node,electron-sandbox,electron-main,electron-utility}/**',
|
||||
'!out-build/vs/**/{node,electron-browser,electron-main,electron-utility}/**',
|
||||
'!out-build/vs/editor/standalone/**',
|
||||
'!out-build/vs/workbench/**/*-tb.png',
|
||||
'!out-build/vs/code/**/*-dev.html',
|
||||
@@ -152,7 +152,7 @@ function packageTask(sourceFolderName, destinationFolderName) {
|
||||
const loader = gulp.src('build/loader.min', { base: 'build', dot: true }).pipe(rename('out/vs/loader.js')); // TODO@esm remove line when we stop supporting web-amd-esm-bridge
|
||||
|
||||
const sources = es.merge(src, extensions, loader)
|
||||
.pipe(filter(['**', '!**/*.js.map'], { dot: true }))
|
||||
.pipe(filter(['**', '!**/*.{js,css}.map'], { dot: true }))
|
||||
// TODO@esm remove me once we stop supporting our web-esm-bridge
|
||||
.pipe(es.through(function (file) {
|
||||
if (file.relative === 'out/vs/workbench/workbench.web.main.internal.css') {
|
||||
|
||||
@@ -59,7 +59,6 @@ const os_1 = __importDefault(require("os"));
|
||||
const vinyl_1 = __importDefault(require("vinyl"));
|
||||
const task = __importStar(require("./task"));
|
||||
const index_1 = require("./mangle/index");
|
||||
const postcss_1 = require("./postcss");
|
||||
const ts = require("typescript");
|
||||
const watch = require('./watch');
|
||||
// --- gulp-tsb: compile and transpile --------------------------------
|
||||
@@ -96,14 +95,11 @@ function createCompile(src, { build, emitError, transpileOnly, preserveEnglish }
|
||||
const tsFilter = util.filter(data => /\.ts$/.test(data.path));
|
||||
const isUtf8Test = (f) => /(\/|\\)test(\/|\\).*utf8/.test(f.path);
|
||||
const isRuntimeJs = (f) => f.path.endsWith('.js') && !f.path.includes('fixtures');
|
||||
const isCSS = (f) => f.path.endsWith('.css') && !f.path.includes('fixtures');
|
||||
const noDeclarationsFilter = util.filter(data => !(/\.d\.ts$/.test(data.path)));
|
||||
const postcssNesting = require('postcss-nesting');
|
||||
const input = event_stream_1.default.through();
|
||||
const output = input
|
||||
.pipe(util.$if(isUtf8Test, bom())) // this is required to preserve BOM in test files that loose it otherwise
|
||||
.pipe(util.$if(!build && isRuntimeJs, util.appendOwnPathSourceURL()))
|
||||
.pipe(util.$if(isCSS, (0, postcss_1.gulpPostcss)([postcssNesting()], err => reporter(String(err)))))
|
||||
.pipe(tsFilter)
|
||||
.pipe(util.loadSourcemaps())
|
||||
.pipe(compilation(token))
|
||||
|
||||
@@ -18,7 +18,6 @@ import File from 'vinyl';
|
||||
import * as task from './task';
|
||||
import { Mangler } from './mangle/index';
|
||||
import { RawSourceMap } from 'source-map';
|
||||
import { gulpPostcss } from './postcss';
|
||||
import ts = require('typescript');
|
||||
const watch = require('./watch');
|
||||
|
||||
@@ -72,16 +71,12 @@ export function createCompile(src: string, { build, emitError, transpileOnly, pr
|
||||
const tsFilter = util.filter(data => /\.ts$/.test(data.path));
|
||||
const isUtf8Test = (f: File) => /(\/|\\)test(\/|\\).*utf8/.test(f.path);
|
||||
const isRuntimeJs = (f: File) => f.path.endsWith('.js') && !f.path.includes('fixtures');
|
||||
const isCSS = (f: File) => f.path.endsWith('.css') && !f.path.includes('fixtures');
|
||||
const noDeclarationsFilter = util.filter(data => !(/\.d\.ts$/.test(data.path)));
|
||||
|
||||
const postcssNesting = require('postcss-nesting');
|
||||
|
||||
const input = es.through();
|
||||
const output = input
|
||||
.pipe(util.$if(isUtf8Test, bom())) // this is required to preserve BOM in test files that loose it otherwise
|
||||
.pipe(util.$if(!build && isRuntimeJs, util.appendOwnPathSourceURL()))
|
||||
.pipe(util.$if(isCSS, gulpPostcss([postcssNesting()], err => reporter(String(err)))))
|
||||
.pipe(tsFilter)
|
||||
.pipe(util.loadSourcemaps())
|
||||
.pipe(compilation(token))
|
||||
|
||||
@@ -1,343 +0,0 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const typescript_1 = __importDefault(require("typescript"));
|
||||
const fs_1 = require("fs");
|
||||
const path_1 = require("path");
|
||||
const minimatch_1 = require("minimatch");
|
||||
//
|
||||
// #############################################################################################
|
||||
//
|
||||
// A custom typescript checker for the specific task of detecting the use of certain types in a
|
||||
// layer that does not allow such use. For example:
|
||||
// - using DOM globals in common/node/electron-main layer (e.g. HTMLElement)
|
||||
// - using node.js globals in common/browser layer (e.g. process)
|
||||
//
|
||||
// Make changes to below RULES to lift certain files from these checks only if absolutely needed
|
||||
//
|
||||
// #############################################################################################
|
||||
//
|
||||
// Types we assume are present in all implementations of JS VMs (node.js, browsers)
|
||||
// Feel free to add more core types as you see needed if present in node.js and browsers
|
||||
const CORE_TYPES = [
|
||||
'setTimeout',
|
||||
'clearTimeout',
|
||||
'setInterval',
|
||||
'clearInterval',
|
||||
'console',
|
||||
'Console',
|
||||
'Error',
|
||||
'ErrorConstructor',
|
||||
'String',
|
||||
'TextDecoder',
|
||||
'TextEncoder',
|
||||
'self',
|
||||
'queueMicrotask',
|
||||
'Array',
|
||||
'Uint8Array',
|
||||
'Uint16Array',
|
||||
'Uint32Array',
|
||||
'Int8Array',
|
||||
'Int16Array',
|
||||
'Int32Array',
|
||||
'Float32Array',
|
||||
'Float64Array',
|
||||
'Uint8ClampedArray',
|
||||
'BigUint64Array',
|
||||
'BigInt64Array',
|
||||
'btoa',
|
||||
'atob',
|
||||
'AbortController',
|
||||
'AbortSignal',
|
||||
'MessageChannel',
|
||||
'MessagePort',
|
||||
'URL',
|
||||
'URLSearchParams',
|
||||
'ReadonlyArray',
|
||||
'Event',
|
||||
'EventTarget',
|
||||
'BroadcastChannel',
|
||||
'performance',
|
||||
'Blob',
|
||||
'crypto',
|
||||
'File',
|
||||
'fetch',
|
||||
'RequestInit',
|
||||
'Headers',
|
||||
'Request',
|
||||
'Response',
|
||||
'Body',
|
||||
'any',
|
||||
'timeout',
|
||||
'Performance',
|
||||
'PerformanceMark',
|
||||
'PerformanceObserver',
|
||||
'ImportMeta',
|
||||
'structuredClone',
|
||||
'stackTraceLimit',
|
||||
'captureStackTrace',
|
||||
// webcrypto has been available since Node.js 19, but still live in dom.d.ts
|
||||
'Crypto',
|
||||
'SubtleCrypto',
|
||||
'JsonWebKey',
|
||||
'MessageEvent',
|
||||
// node web types
|
||||
'ReadableStream',
|
||||
'ReadableStreamReadResult',
|
||||
'ReadableStreamGenericReader',
|
||||
'ReadableStreamDefaultReader',
|
||||
'value',
|
||||
'done',
|
||||
'DOMException',
|
||||
'WebSocket',
|
||||
];
|
||||
// Types that are defined in a common layer but are known to be only
|
||||
// available in native environments should not be allowed in browser
|
||||
const NATIVE_TYPES = [
|
||||
'NativeParsedArgs',
|
||||
'INativeEnvironmentService',
|
||||
'AbstractNativeEnvironmentService',
|
||||
'INativeWindowConfiguration',
|
||||
'ICommonNativeHostService',
|
||||
'INativeHostService',
|
||||
'IMainProcessService',
|
||||
'INativeBrowserElementsService',
|
||||
];
|
||||
const RULES = [
|
||||
// Tests: skip
|
||||
{
|
||||
target: '**/vs/**/test/**',
|
||||
skip: true // -> skip all test files
|
||||
},
|
||||
// Common: vs/base/common/async.ts
|
||||
{
|
||||
target: '**/vs/base/common/async.ts',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
// Safe access to requestIdleCallback & cancelIdleCallback
|
||||
'requestIdleCallback',
|
||||
'cancelIdleCallback'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
// Common: vs/base/common/performance.ts
|
||||
{
|
||||
target: '**/vs/base/common/performance.ts',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
// Safe access to Performance
|
||||
'Performance',
|
||||
'PerformanceEntry',
|
||||
'PerformanceTiming'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
// Common: vs/platform services that can access native types
|
||||
{
|
||||
target: `**/vs/platform/{${[
|
||||
'environment/common/*.ts',
|
||||
'window/common/window.ts',
|
||||
'native/common/native.ts',
|
||||
'native/common/nativeHostService.ts',
|
||||
'browserElements/common/browserElements.ts',
|
||||
'browserElements/common/nativeBrowserElementsService.ts'
|
||||
].join(',')}}`,
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedTypes: [ /* Ignore native types that are defined from here */],
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
// Common: vs/workbench/api/common/extHostExtensionService.ts
|
||||
{
|
||||
target: '**/vs/workbench/api/common/extHostExtensionService.ts',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
// Safe access to global
|
||||
'global'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
// Common: vs/base/parts/sandbox/electron-sandbox/preload{,-aux}.ts
|
||||
{
|
||||
target: '**/vs/base/parts/sandbox/electron-sandbox/preload{,-aux}.ts',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
// Safe access to a very small subset of node.js
|
||||
'process',
|
||||
'NodeJS',
|
||||
'__global'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
// Common
|
||||
{
|
||||
target: '**/vs/**/common/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
// Browser
|
||||
{
|
||||
target: '**/vs/**/browser/**',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
'localStorage'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
// Browser (editor contrib)
|
||||
{
|
||||
target: '**/src/vs/editor/contrib/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
// node.js
|
||||
{
|
||||
target: '**/vs/**/node/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts' // no DOM
|
||||
]
|
||||
},
|
||||
// Electron (sandbox)
|
||||
{
|
||||
target: '**/vs/**/electron-sandbox/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
// Electron (main, utility)
|
||||
{
|
||||
target: '**/vs/**/{electron-main,electron-utility}/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedTypes: [
|
||||
'ipcMain' // not allowed, use validatedIpcMain instead
|
||||
],
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts' // no DOM
|
||||
]
|
||||
}
|
||||
];
|
||||
const TS_CONFIG_PATH = (0, path_1.join)(__dirname, '../../', 'src', 'tsconfig.json');
|
||||
let hasErrors = false;
|
||||
function checkFile(program, sourceFile, rule) {
|
||||
checkNode(sourceFile);
|
||||
function checkNode(node) {
|
||||
if (node.kind !== typescript_1.default.SyntaxKind.Identifier) {
|
||||
return typescript_1.default.forEachChild(node, checkNode); // recurse down
|
||||
}
|
||||
const checker = program.getTypeChecker();
|
||||
const symbol = checker.getSymbolAtLocation(node);
|
||||
if (!symbol) {
|
||||
return;
|
||||
}
|
||||
let text = symbol.getName();
|
||||
if (rule.allowedTypes?.some(allowed => allowed === text)) {
|
||||
return; // override
|
||||
}
|
||||
let _parentSymbol = symbol;
|
||||
while (_parentSymbol.parent) {
|
||||
_parentSymbol = _parentSymbol.parent;
|
||||
}
|
||||
const parentSymbol = _parentSymbol;
|
||||
text = parentSymbol.getName();
|
||||
if (rule.allowedTypes?.some(allowed => allowed === text)) {
|
||||
return; // override
|
||||
}
|
||||
if (rule.disallowedTypes?.some(disallowed => disallowed === text)) {
|
||||
const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
||||
console.log(`[build/lib/layersChecker.ts]: Reference to type '${text}' violates layer '${rule.target}' (${sourceFile.fileName} (${line + 1},${character + 1}). Learn more about our source code organization at https://github.com/microsoft/vscode/wiki/Source-Code-Organization.`);
|
||||
hasErrors = true;
|
||||
return;
|
||||
}
|
||||
const declarations = symbol.declarations;
|
||||
if (Array.isArray(declarations)) {
|
||||
DeclarationLoop: for (const declaration of declarations) {
|
||||
if (declaration) {
|
||||
const parent = declaration.parent;
|
||||
if (parent) {
|
||||
const parentSourceFile = parent.getSourceFile();
|
||||
if (parentSourceFile) {
|
||||
const definitionFileName = parentSourceFile.fileName;
|
||||
if (rule.allowedDefinitions) {
|
||||
for (const allowedDefinition of rule.allowedDefinitions) {
|
||||
if (definitionFileName.indexOf(allowedDefinition) >= 0) {
|
||||
continue DeclarationLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rule.disallowedDefinitions) {
|
||||
for (const disallowedDefinition of rule.disallowedDefinitions) {
|
||||
if (definitionFileName.indexOf(disallowedDefinition) >= 0) {
|
||||
const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
||||
console.log(`[build/lib/layersChecker.ts]: Reference to symbol '${text}' from '${disallowedDefinition}' violates layer '${rule.target}' (${sourceFile.fileName} (${line + 1},${character + 1}) Learn more about our source code organization at https://github.com/microsoft/vscode/wiki/Source-Code-Organization.`);
|
||||
hasErrors = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function createProgram(tsconfigPath) {
|
||||
const tsConfig = typescript_1.default.readConfigFile(tsconfigPath, typescript_1.default.sys.readFile);
|
||||
const configHostParser = { fileExists: fs_1.existsSync, readDirectory: typescript_1.default.sys.readDirectory, readFile: file => (0, fs_1.readFileSync)(file, 'utf8'), useCaseSensitiveFileNames: process.platform === 'linux' };
|
||||
const tsConfigParsed = typescript_1.default.parseJsonConfigFileContent(tsConfig.config, configHostParser, (0, path_1.resolve)((0, path_1.dirname)(tsconfigPath)), { noEmit: true });
|
||||
const compilerHost = typescript_1.default.createCompilerHost(tsConfigParsed.options, true);
|
||||
return typescript_1.default.createProgram(tsConfigParsed.fileNames, tsConfigParsed.options, compilerHost);
|
||||
}
|
||||
//
|
||||
// Create program and start checking
|
||||
//
|
||||
const program = createProgram(TS_CONFIG_PATH);
|
||||
for (const sourceFile of program.getSourceFiles()) {
|
||||
for (const rule of RULES) {
|
||||
if ((0, minimatch_1.match)([sourceFile.fileName], rule.target).length > 0) {
|
||||
if (!rule.skip) {
|
||||
checkFile(program, sourceFile, rule);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasErrors) {
|
||||
process.exit(1);
|
||||
}
|
||||
//# sourceMappingURL=layersChecker.js.map
|
||||
@@ -1,393 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import ts from 'typescript';
|
||||
import { readFileSync, existsSync } from 'fs';
|
||||
import { resolve, dirname, join } from 'path';
|
||||
import { match } from 'minimatch';
|
||||
|
||||
//
|
||||
// #############################################################################################
|
||||
//
|
||||
// A custom typescript checker for the specific task of detecting the use of certain types in a
|
||||
// layer that does not allow such use. For example:
|
||||
// - using DOM globals in common/node/electron-main layer (e.g. HTMLElement)
|
||||
// - using node.js globals in common/browser layer (e.g. process)
|
||||
//
|
||||
// Make changes to below RULES to lift certain files from these checks only if absolutely needed
|
||||
//
|
||||
// #############################################################################################
|
||||
//
|
||||
|
||||
// Types we assume are present in all implementations of JS VMs (node.js, browsers)
|
||||
// Feel free to add more core types as you see needed if present in node.js and browsers
|
||||
const CORE_TYPES = [
|
||||
'setTimeout',
|
||||
'clearTimeout',
|
||||
'setInterval',
|
||||
'clearInterval',
|
||||
'console',
|
||||
'Console',
|
||||
'Error',
|
||||
'ErrorConstructor',
|
||||
'String',
|
||||
'TextDecoder',
|
||||
'TextEncoder',
|
||||
'self',
|
||||
'queueMicrotask',
|
||||
'Array',
|
||||
'Uint8Array',
|
||||
'Uint16Array',
|
||||
'Uint32Array',
|
||||
'Int8Array',
|
||||
'Int16Array',
|
||||
'Int32Array',
|
||||
'Float32Array',
|
||||
'Float64Array',
|
||||
'Uint8ClampedArray',
|
||||
'BigUint64Array',
|
||||
'BigInt64Array',
|
||||
'btoa',
|
||||
'atob',
|
||||
'AbortController',
|
||||
'AbortSignal',
|
||||
'MessageChannel',
|
||||
'MessagePort',
|
||||
'URL',
|
||||
'URLSearchParams',
|
||||
'ReadonlyArray',
|
||||
'Event',
|
||||
'EventTarget',
|
||||
'BroadcastChannel',
|
||||
'performance',
|
||||
'Blob',
|
||||
'crypto',
|
||||
'File',
|
||||
'fetch',
|
||||
'RequestInit',
|
||||
'Headers',
|
||||
'Request',
|
||||
'Response',
|
||||
'Body',
|
||||
'any',
|
||||
'timeout',
|
||||
'Performance',
|
||||
'PerformanceMark',
|
||||
'PerformanceObserver',
|
||||
'ImportMeta',
|
||||
'structuredClone',
|
||||
'stackTraceLimit',
|
||||
'captureStackTrace',
|
||||
|
||||
// webcrypto has been available since Node.js 19, but still live in dom.d.ts
|
||||
'Crypto',
|
||||
'SubtleCrypto',
|
||||
'JsonWebKey',
|
||||
'MessageEvent',
|
||||
|
||||
// node web types
|
||||
'ReadableStream',
|
||||
'ReadableStreamReadResult',
|
||||
'ReadableStreamGenericReader',
|
||||
'ReadableStreamDefaultReader',
|
||||
'value',
|
||||
'done',
|
||||
'DOMException',
|
||||
'WebSocket',
|
||||
];
|
||||
|
||||
// Types that are defined in a common layer but are known to be only
|
||||
// available in native environments should not be allowed in browser
|
||||
const NATIVE_TYPES = [
|
||||
'NativeParsedArgs',
|
||||
'INativeEnvironmentService',
|
||||
'AbstractNativeEnvironmentService',
|
||||
'INativeWindowConfiguration',
|
||||
'ICommonNativeHostService',
|
||||
'INativeHostService',
|
||||
'IMainProcessService',
|
||||
'INativeBrowserElementsService',
|
||||
];
|
||||
|
||||
const RULES: IRule[] = [
|
||||
|
||||
// Tests: skip
|
||||
{
|
||||
target: '**/vs/**/test/**',
|
||||
skip: true // -> skip all test files
|
||||
},
|
||||
|
||||
// Common: vs/base/common/async.ts
|
||||
{
|
||||
target: '**/vs/base/common/async.ts',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
|
||||
// Safe access to requestIdleCallback & cancelIdleCallback
|
||||
'requestIdleCallback',
|
||||
'cancelIdleCallback'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
|
||||
// Common: vs/base/common/performance.ts
|
||||
{
|
||||
target: '**/vs/base/common/performance.ts',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
|
||||
// Safe access to Performance
|
||||
'Performance',
|
||||
'PerformanceEntry',
|
||||
'PerformanceTiming'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
|
||||
// Common: vs/platform services that can access native types
|
||||
{
|
||||
target: `**/vs/platform/{${[
|
||||
'environment/common/*.ts',
|
||||
'window/common/window.ts',
|
||||
'native/common/native.ts',
|
||||
'native/common/nativeHostService.ts',
|
||||
'browserElements/common/browserElements.ts',
|
||||
'browserElements/common/nativeBrowserElementsService.ts'
|
||||
].join(',')}}`,
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedTypes: [/* Ignore native types that are defined from here */],
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
|
||||
// Common: vs/workbench/api/common/extHostExtensionService.ts
|
||||
{
|
||||
target: '**/vs/workbench/api/common/extHostExtensionService.ts',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
|
||||
// Safe access to global
|
||||
'global'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
|
||||
// Common: vs/base/parts/sandbox/electron-sandbox/preload{,-aux}.ts
|
||||
{
|
||||
target: '**/vs/base/parts/sandbox/electron-sandbox/preload{,-aux}.ts',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
|
||||
// Safe access to a very small subset of node.js
|
||||
'process',
|
||||
'NodeJS',
|
||||
'__global'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
|
||||
// Common
|
||||
{
|
||||
target: '**/vs/**/common/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts', // no DOM
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
|
||||
// Browser
|
||||
{
|
||||
target: '**/vs/**/browser/**',
|
||||
allowedTypes: [
|
||||
...CORE_TYPES,
|
||||
'localStorage'
|
||||
],
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
|
||||
// Browser (editor contrib)
|
||||
{
|
||||
target: '**/src/vs/editor/contrib/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedTypes: NATIVE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
|
||||
// node.js
|
||||
{
|
||||
target: '**/vs/**/node/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts' // no DOM
|
||||
]
|
||||
},
|
||||
|
||||
// Electron (sandbox)
|
||||
{
|
||||
target: '**/vs/**/electron-sandbox/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedDefinitions: [
|
||||
'@types/node' // no node.js
|
||||
]
|
||||
},
|
||||
|
||||
// Electron (main, utility)
|
||||
{
|
||||
target: '**/vs/**/{electron-main,electron-utility}/**',
|
||||
allowedTypes: CORE_TYPES,
|
||||
disallowedTypes: [
|
||||
'ipcMain' // not allowed, use validatedIpcMain instead
|
||||
],
|
||||
disallowedDefinitions: [
|
||||
'lib.dom.d.ts' // no DOM
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
const TS_CONFIG_PATH = join(__dirname, '../../', 'src', 'tsconfig.json');
|
||||
|
||||
interface IRule {
|
||||
target: string;
|
||||
skip?: boolean;
|
||||
allowedTypes?: string[];
|
||||
allowedDefinitions?: string[];
|
||||
disallowedDefinitions?: string[];
|
||||
disallowedTypes?: string[];
|
||||
}
|
||||
|
||||
let hasErrors = false;
|
||||
|
||||
function checkFile(program: ts.Program, sourceFile: ts.SourceFile, rule: IRule) {
|
||||
checkNode(sourceFile);
|
||||
|
||||
function checkNode(node: ts.Node): void {
|
||||
if (node.kind !== ts.SyntaxKind.Identifier) {
|
||||
return ts.forEachChild(node, checkNode); // recurse down
|
||||
}
|
||||
|
||||
const checker = program.getTypeChecker();
|
||||
const symbol = checker.getSymbolAtLocation(node);
|
||||
|
||||
if (!symbol) {
|
||||
return;
|
||||
}
|
||||
|
||||
let text = symbol.getName();
|
||||
if (rule.allowedTypes?.some(allowed => allowed === text)) {
|
||||
return; // override
|
||||
}
|
||||
|
||||
let _parentSymbol: any = symbol;
|
||||
|
||||
while (_parentSymbol.parent) {
|
||||
_parentSymbol = _parentSymbol.parent;
|
||||
}
|
||||
|
||||
const parentSymbol = _parentSymbol as ts.Symbol;
|
||||
text = parentSymbol.getName();
|
||||
|
||||
if (rule.allowedTypes?.some(allowed => allowed === text)) {
|
||||
return; // override
|
||||
}
|
||||
|
||||
if (rule.disallowedTypes?.some(disallowed => disallowed === text)) {
|
||||
const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
||||
console.log(`[build/lib/layersChecker.ts]: Reference to type '${text}' violates layer '${rule.target}' (${sourceFile.fileName} (${line + 1},${character + 1}). Learn more about our source code organization at https://github.com/microsoft/vscode/wiki/Source-Code-Organization.`);
|
||||
|
||||
hasErrors = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const declarations = symbol.declarations;
|
||||
if (Array.isArray(declarations)) {
|
||||
DeclarationLoop: for (const declaration of declarations) {
|
||||
if (declaration) {
|
||||
const parent = declaration.parent;
|
||||
if (parent) {
|
||||
const parentSourceFile = parent.getSourceFile();
|
||||
if (parentSourceFile) {
|
||||
const definitionFileName = parentSourceFile.fileName;
|
||||
if (rule.allowedDefinitions) {
|
||||
for (const allowedDefinition of rule.allowedDefinitions) {
|
||||
if (definitionFileName.indexOf(allowedDefinition) >= 0) {
|
||||
continue DeclarationLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rule.disallowedDefinitions) {
|
||||
for (const disallowedDefinition of rule.disallowedDefinitions) {
|
||||
if (definitionFileName.indexOf(disallowedDefinition) >= 0) {
|
||||
const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
||||
|
||||
console.log(`[build/lib/layersChecker.ts]: Reference to symbol '${text}' from '${disallowedDefinition}' violates layer '${rule.target}' (${sourceFile.fileName} (${line + 1},${character + 1}) Learn more about our source code organization at https://github.com/microsoft/vscode/wiki/Source-Code-Organization.`);
|
||||
|
||||
hasErrors = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createProgram(tsconfigPath: string): ts.Program {
|
||||
const tsConfig = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
|
||||
|
||||
const configHostParser: ts.ParseConfigHost = { fileExists: existsSync, readDirectory: ts.sys.readDirectory, readFile: file => readFileSync(file, 'utf8'), useCaseSensitiveFileNames: process.platform === 'linux' };
|
||||
const tsConfigParsed = ts.parseJsonConfigFileContent(tsConfig.config, configHostParser, resolve(dirname(tsconfigPath)), { noEmit: true });
|
||||
|
||||
const compilerHost = ts.createCompilerHost(tsConfigParsed.options, true);
|
||||
|
||||
return ts.createProgram(tsConfigParsed.fileNames, tsConfigParsed.options, compilerHost);
|
||||
}
|
||||
|
||||
//
|
||||
// Create program and start checking
|
||||
//
|
||||
const program = createProgram(TS_CONFIG_PATH);
|
||||
|
||||
for (const sourceFile of program.getSourceFiles()) {
|
||||
for (const rule of RULES) {
|
||||
if (match([sourceFile.fileName], rule.target).length > 0) {
|
||||
if (!rule.skip) {
|
||||
checkFile(program, sourceFile, rule);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hasErrors) {
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -251,8 +251,6 @@ function isNameTakenInFile(node, name) {
|
||||
return false;
|
||||
}
|
||||
const skippedExportMangledFiles = [
|
||||
// Build
|
||||
'css.build',
|
||||
// Monaco
|
||||
'editorCommon',
|
||||
'editorOptions',
|
||||
|
||||
@@ -280,8 +280,6 @@ function isNameTakenInFile(node: ts.Node, name: string): boolean {
|
||||
}
|
||||
|
||||
const skippedExportMangledFiles = [
|
||||
// Build
|
||||
'css.build',
|
||||
|
||||
// Monaco
|
||||
'editorCommon',
|
||||
|
||||
+7
-10
@@ -50,7 +50,6 @@ const fs_1 = __importDefault(require("fs"));
|
||||
const pump_1 = __importDefault(require("pump"));
|
||||
const vinyl_1 = __importDefault(require("vinyl"));
|
||||
const bundle = __importStar(require("./bundle"));
|
||||
const postcss_1 = require("./postcss");
|
||||
const esbuild_1 = __importDefault(require("esbuild"));
|
||||
const gulp_sourcemaps_1 = __importDefault(require("gulp-sourcemaps"));
|
||||
const fancy_log_1 = __importDefault(require("fancy-log"));
|
||||
@@ -187,12 +186,10 @@ function bundleTask(opts) {
|
||||
function minifyTask(src, sourceMapBaseUrl) {
|
||||
const sourceMappingURL = sourceMapBaseUrl ? ((f) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined;
|
||||
return cb => {
|
||||
const cssnano = require('cssnano');
|
||||
const svgmin = require('gulp-svgmin');
|
||||
const jsFilter = (0, gulp_filter_1.default)('**/*.js', { restore: true });
|
||||
const cssFilter = (0, gulp_filter_1.default)('**/*.css', { restore: true });
|
||||
const esbuildFilter = (0, gulp_filter_1.default)('**/*.{js,css}', { restore: true });
|
||||
const svgFilter = (0, gulp_filter_1.default)('**/*.svg', { restore: true });
|
||||
(0, pump_1.default)(gulp_1.default.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, gulp_sourcemaps_1.default.init({ loadMaps: true }), event_stream_1.default.map((f, cb) => {
|
||||
(0, pump_1.default)(gulp_1.default.src([src + '/**', '!' + src + '/**/*.map']), esbuildFilter, gulp_sourcemaps_1.default.init({ loadMaps: true }), event_stream_1.default.map((f, cb) => {
|
||||
esbuild_1.default.build({
|
||||
entryPoints: [f.path],
|
||||
minify: true,
|
||||
@@ -201,11 +198,11 @@ function minifyTask(src, sourceMapBaseUrl) {
|
||||
packages: 'external', // "external all the things", see https://esbuild.github.io/api/#packages
|
||||
platform: 'neutral', // makes esm
|
||||
target: ['es2022'],
|
||||
write: false
|
||||
write: false,
|
||||
}).then(res => {
|
||||
const jsFile = res.outputFiles.find(f => /\.js$/.test(f.path));
|
||||
const sourceMapFile = res.outputFiles.find(f => /\.js\.map$/.test(f.path));
|
||||
const contents = Buffer.from(jsFile.contents);
|
||||
const jsOrCSSFile = res.outputFiles.find(f => /\.(js|css)$/.test(f.path));
|
||||
const sourceMapFile = res.outputFiles.find(f => /\.(js|css)\.map$/.test(f.path));
|
||||
const contents = Buffer.from(jsOrCSSFile.contents);
|
||||
const unicodeMatch = contents.toString().match(/[^\x00-\xFF]+/g);
|
||||
if (unicodeMatch) {
|
||||
cb(new Error(`Found non-ascii character ${unicodeMatch[0]} in the minified output of ${f.path}. Non-ASCII characters in the output can cause performance problems when loading. Please review if you have introduced a regular expression that esbuild is not automatically converting and convert it to using unicode escape sequences.`));
|
||||
@@ -216,7 +213,7 @@ function minifyTask(src, sourceMapBaseUrl) {
|
||||
cb(undefined, f);
|
||||
}
|
||||
}, cb);
|
||||
}), jsFilter.restore, cssFilter, (0, postcss_1.gulpPostcss)([cssnano({ preset: 'default' })]), cssFilter.restore, svgFilter, svgmin(), svgFilter.restore, gulp_sourcemaps_1.default.write('./', {
|
||||
}), esbuildFilter.restore, svgFilter, svgmin(), svgFilter.restore, gulp_sourcemaps_1.default.write('./', {
|
||||
sourceMappingURL,
|
||||
sourceRoot: undefined,
|
||||
includeContent: true,
|
||||
|
||||
+7
-13
@@ -11,7 +11,6 @@ import fs from 'fs';
|
||||
import pump from 'pump';
|
||||
import VinylFile from 'vinyl';
|
||||
import * as bundle from './bundle';
|
||||
import { gulpPostcss } from './postcss';
|
||||
import esbuild from 'esbuild';
|
||||
import sourcemaps from 'gulp-sourcemaps';
|
||||
import fancyLog from 'fancy-log';
|
||||
@@ -213,16 +212,14 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
||||
const sourceMappingURL = sourceMapBaseUrl ? ((f: any) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined;
|
||||
|
||||
return cb => {
|
||||
const cssnano = require('cssnano') as typeof import('cssnano');
|
||||
const svgmin = require('gulp-svgmin') as typeof import('gulp-svgmin');
|
||||
|
||||
const jsFilter = filter('**/*.js', { restore: true });
|
||||
const cssFilter = filter('**/*.css', { restore: true });
|
||||
const esbuildFilter = filter('**/*.{js,css}', { restore: true });
|
||||
const svgFilter = filter('**/*.svg', { restore: true });
|
||||
|
||||
pump(
|
||||
gulp.src([src + '/**', '!' + src + '/**/*.map']),
|
||||
jsFilter,
|
||||
esbuildFilter,
|
||||
sourcemaps.init({ loadMaps: true }),
|
||||
es.map((f: any, cb) => {
|
||||
esbuild.build({
|
||||
@@ -233,12 +230,12 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
||||
packages: 'external', // "external all the things", see https://esbuild.github.io/api/#packages
|
||||
platform: 'neutral', // makes esm
|
||||
target: ['es2022'],
|
||||
write: false
|
||||
write: false,
|
||||
}).then(res => {
|
||||
const jsFile = res.outputFiles.find(f => /\.js$/.test(f.path))!;
|
||||
const sourceMapFile = res.outputFiles.find(f => /\.js\.map$/.test(f.path))!;
|
||||
const jsOrCSSFile = res.outputFiles.find(f => /\.(js|css)$/.test(f.path))!;
|
||||
const sourceMapFile = res.outputFiles.find(f => /\.(js|css)\.map$/.test(f.path))!;
|
||||
|
||||
const contents = Buffer.from(jsFile.contents);
|
||||
const contents = Buffer.from(jsOrCSSFile.contents);
|
||||
const unicodeMatch = contents.toString().match(/[^\x00-\xFF]+/g);
|
||||
if (unicodeMatch) {
|
||||
cb(new Error(`Found non-ascii character ${unicodeMatch[0]} in the minified output of ${f.path}. Non-ASCII characters in the output can cause performance problems when loading. Please review if you have introduced a regular expression that esbuild is not automatically converting and convert it to using unicode escape sequences.`));
|
||||
@@ -250,10 +247,7 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
||||
}
|
||||
}, cb);
|
||||
}),
|
||||
jsFilter.restore,
|
||||
cssFilter,
|
||||
gulpPostcss([cssnano({ preset: 'default' })]),
|
||||
cssFilter.restore,
|
||||
esbuildFilter.restore,
|
||||
svgFilter,
|
||||
svgmin(),
|
||||
svgFilter.restore,
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.gulpPostcss = gulpPostcss;
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
const postcss_1 = __importDefault(require("postcss"));
|
||||
const event_stream_1 = __importDefault(require("event-stream"));
|
||||
function gulpPostcss(plugins, handleError) {
|
||||
const instance = (0, postcss_1.default)(plugins);
|
||||
return event_stream_1.default.map((file, callback) => {
|
||||
if (file.isNull()) {
|
||||
return callback(null, file);
|
||||
}
|
||||
if (file.isStream()) {
|
||||
return callback(new Error('Streaming not supported'));
|
||||
}
|
||||
instance
|
||||
.process(file.contents.toString(), { from: file.path })
|
||||
.then((result) => {
|
||||
file.contents = Buffer.from(result.css);
|
||||
callback(null, file);
|
||||
})
|
||||
.catch((error) => {
|
||||
if (handleError) {
|
||||
handleError(error);
|
||||
callback();
|
||||
}
|
||||
else {
|
||||
callback(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=postcss.js.map
|
||||
@@ -1,36 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import postcss from 'postcss';
|
||||
import File from 'vinyl';
|
||||
import es from 'event-stream';
|
||||
|
||||
export function gulpPostcss(plugins: postcss.AcceptedPlugin[], handleError?: (err: Error) => void) {
|
||||
const instance = postcss(plugins);
|
||||
|
||||
return es.map((file: File, callback: (error?: any, file?: any) => void) => {
|
||||
if (file.isNull()) {
|
||||
return callback(null, file);
|
||||
}
|
||||
|
||||
if (file.isStream()) {
|
||||
return callback(new Error('Streaming not supported'));
|
||||
}
|
||||
|
||||
instance
|
||||
.process(file.contents.toString(), { from: file.path })
|
||||
.then((result) => {
|
||||
file.contents = Buffer.from(result.css);
|
||||
callback(null, file);
|
||||
})
|
||||
.catch((error) => {
|
||||
if (handleError) {
|
||||
handleError(error);
|
||||
callback();
|
||||
} else {
|
||||
callback(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -59,6 +59,8 @@
|
||||
"--vscode-chat-requestCodeBorder",
|
||||
"--vscode-chat-slashCommandBackground",
|
||||
"--vscode-chat-slashCommandForeground",
|
||||
"--vscode-chat-linesAddedForeground",
|
||||
"--vscode-chat-linesRemovedForeground",
|
||||
"--vscode-checkbox-background",
|
||||
"--vscode-checkbox-border",
|
||||
"--vscode-checkbox-disabled-background",
|
||||
@@ -318,6 +320,7 @@
|
||||
"--vscode-editorPane-background",
|
||||
"--vscode-editorRuler-foreground",
|
||||
"--vscode-editorStickyScroll-background",
|
||||
"--vscode-editorStickyScrollGutter-background",
|
||||
"--vscode-editorStickyScroll-border",
|
||||
"--vscode-editorStickyScroll-shadow",
|
||||
"--vscode-editorStickyScrollHover-background",
|
||||
@@ -560,6 +563,7 @@
|
||||
"--vscode-peekViewEditor-matchHighlightBorder",
|
||||
"--vscode-peekViewEditorGutter-background",
|
||||
"--vscode-peekViewEditorStickyScroll-background",
|
||||
"--vscode-peekViewEditorStickyScrollGutter-background",
|
||||
"--vscode-peekViewResult-background",
|
||||
"--vscode-peekViewResult-fileForeground",
|
||||
"--vscode-peekViewResult-lineForeground",
|
||||
@@ -957,4 +961,4 @@
|
||||
"--animation-opacity",
|
||||
"--chat-setup-dialog-glow-angle"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+24
-24
@@ -63,7 +63,7 @@ function createTypeScriptBuilder(config, projectFile, cmd) {
|
||||
const _log = config.logFn;
|
||||
const host = new LanguageServiceHost(cmd, projectFile, _log);
|
||||
const outHost = new LanguageServiceHost({ ...cmd, options: { ...cmd.options, sourceRoot: cmd.options.outDir } }, cmd.options.outDir ?? '', _log);
|
||||
let lastCycleCheckVersion;
|
||||
const toBeCheckedForCycles = [];
|
||||
const service = typescript_1.default.createLanguageService(host, typescript_1.default.createDocumentRegistry());
|
||||
const lastBuildVersion = Object.create(null);
|
||||
const lastDtsHash = Object.create(null);
|
||||
@@ -294,6 +294,7 @@ function createTypeScriptBuilder(config, projectFile, cmd) {
|
||||
const jsValue = value.files.find(candidate => candidate.basename.endsWith('.js'));
|
||||
if (jsValue) {
|
||||
outHost.addScriptSnapshot(jsValue.path, new ScriptSnapshot(String(jsValue.contents), new Date()));
|
||||
toBeCheckedForCycles.push(normalize(jsValue.path));
|
||||
}
|
||||
}).catch(e => {
|
||||
// can't just skip this or make a result up..
|
||||
@@ -387,24 +388,21 @@ function createTypeScriptBuilder(config, projectFile, cmd) {
|
||||
workOnNext();
|
||||
}).then(() => {
|
||||
// check for cyclic dependencies
|
||||
const thisCycleCheckVersion = outHost.getProjectVersion();
|
||||
if (thisCycleCheckVersion === lastCycleCheckVersion) {
|
||||
return;
|
||||
}
|
||||
const oneCycle = outHost.hasCyclicDependency();
|
||||
lastCycleCheckVersion = thisCycleCheckVersion;
|
||||
delete oldErrors[projectFile];
|
||||
if (oneCycle) {
|
||||
const cycleError = {
|
||||
category: typescript_1.default.DiagnosticCategory.Error,
|
||||
code: 1,
|
||||
file: undefined,
|
||||
start: undefined,
|
||||
length: undefined,
|
||||
messageText: `CYCLIC dependency between ${oneCycle}`
|
||||
};
|
||||
onError(cycleError);
|
||||
newErrors[projectFile] = [cycleError];
|
||||
const cycles = outHost.getCyclicDependencies(toBeCheckedForCycles);
|
||||
toBeCheckedForCycles.length = 0;
|
||||
for (const [filename, error] of cycles) {
|
||||
const cyclicDepErrors = [];
|
||||
if (error) {
|
||||
cyclicDepErrors.push({
|
||||
category: typescript_1.default.DiagnosticCategory.Error,
|
||||
code: 1,
|
||||
file: undefined,
|
||||
start: undefined,
|
||||
length: undefined,
|
||||
messageText: `CYCLIC dependency: ${error}`
|
||||
});
|
||||
}
|
||||
newErrors[filename] = cyclicDepErrors;
|
||||
}
|
||||
}).then(() => {
|
||||
// store the build versions to not rebuilt the next time
|
||||
@@ -588,15 +586,17 @@ class LanguageServiceHost {
|
||||
node.incoming.forEach(entry => target.push(entry.data));
|
||||
}
|
||||
}
|
||||
hasCyclicDependency() {
|
||||
getCyclicDependencies(filenames) {
|
||||
// Ensure dependencies are up to date
|
||||
while (this._dependenciesRecomputeList.length) {
|
||||
this._processFile(this._dependenciesRecomputeList.pop());
|
||||
}
|
||||
const cycle = this._dependencies.findCycle();
|
||||
return cycle
|
||||
? cycle.join(' -> ')
|
||||
: undefined;
|
||||
const cycles = this._dependencies.findCycles(filenames.sort((a, b) => a.localeCompare(b)));
|
||||
const result = new Map();
|
||||
for (const [key, value] of cycles) {
|
||||
result.set(key, value?.join(' -> '));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
_processFile(filename) {
|
||||
if (filename.match(/.*\.d\.ts$/)) {
|
||||
|
||||
+24
-24
@@ -44,7 +44,7 @@ export function createTypeScriptBuilder(config: IConfiguration, projectFile: str
|
||||
const host = new LanguageServiceHost(cmd, projectFile, _log);
|
||||
|
||||
const outHost = new LanguageServiceHost({ ...cmd, options: { ...cmd.options, sourceRoot: cmd.options.outDir } }, cmd.options.outDir ?? '', _log);
|
||||
let lastCycleCheckVersion: string;
|
||||
const toBeCheckedForCycles: string[] = [];
|
||||
|
||||
const service = ts.createLanguageService(host, ts.createDocumentRegistry());
|
||||
const lastBuildVersion: { [path: string]: string } = Object.create(null);
|
||||
@@ -315,6 +315,7 @@ export function createTypeScriptBuilder(config: IConfiguration, projectFile: str
|
||||
const jsValue = value.files.find(candidate => candidate.basename.endsWith('.js'));
|
||||
if (jsValue) {
|
||||
outHost.addScriptSnapshot(jsValue.path, new ScriptSnapshot(String(jsValue.contents), new Date()));
|
||||
toBeCheckedForCycles.push(normalize(jsValue.path));
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
@@ -424,25 +425,22 @@ export function createTypeScriptBuilder(config: IConfiguration, projectFile: str
|
||||
|
||||
}).then(() => {
|
||||
// check for cyclic dependencies
|
||||
const thisCycleCheckVersion = outHost.getProjectVersion();
|
||||
if (thisCycleCheckVersion === lastCycleCheckVersion) {
|
||||
return;
|
||||
}
|
||||
const oneCycle = outHost.hasCyclicDependency();
|
||||
lastCycleCheckVersion = thisCycleCheckVersion;
|
||||
delete oldErrors[projectFile];
|
||||
const cycles = outHost.getCyclicDependencies(toBeCheckedForCycles);
|
||||
toBeCheckedForCycles.length = 0;
|
||||
|
||||
if (oneCycle) {
|
||||
const cycleError: ts.Diagnostic = {
|
||||
category: ts.DiagnosticCategory.Error,
|
||||
code: 1,
|
||||
file: undefined,
|
||||
start: undefined,
|
||||
length: undefined,
|
||||
messageText: `CYCLIC dependency between ${oneCycle}`
|
||||
};
|
||||
onError(cycleError);
|
||||
newErrors[projectFile] = [cycleError];
|
||||
for (const [filename, error] of cycles) {
|
||||
const cyclicDepErrors: ts.Diagnostic[] = [];
|
||||
if (error) {
|
||||
cyclicDepErrors.push({
|
||||
category: ts.DiagnosticCategory.Error,
|
||||
code: 1,
|
||||
file: undefined,
|
||||
start: undefined,
|
||||
length: undefined,
|
||||
messageText: `CYCLIC dependency: ${error}`
|
||||
});
|
||||
}
|
||||
newErrors[filename] = cyclicDepErrors;
|
||||
}
|
||||
|
||||
}).then(() => {
|
||||
@@ -666,15 +664,17 @@ class LanguageServiceHost implements ts.LanguageServiceHost {
|
||||
}
|
||||
}
|
||||
|
||||
hasCyclicDependency(): string | undefined {
|
||||
getCyclicDependencies(filenames: string[]): Map<string, string | undefined> {
|
||||
// Ensure dependencies are up to date
|
||||
while (this._dependenciesRecomputeList.length) {
|
||||
this._processFile(this._dependenciesRecomputeList.pop()!);
|
||||
}
|
||||
const cycle = this._dependencies.findCycle();
|
||||
return cycle
|
||||
? cycle.join(' -> ')
|
||||
: undefined;
|
||||
const cycles = this._dependencies.findCycles(filenames.sort((a, b) => a.localeCompare(b)));
|
||||
const result = new Map<string, string | undefined>();
|
||||
for (const [key, value] of cycles) {
|
||||
result.set(key, value?.join(' -> '));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
_processFile(filename: string): void {
|
||||
|
||||
+26
-31
@@ -55,44 +55,39 @@ var graph;
|
||||
lookup(data) {
|
||||
return this._nodes.get(data) ?? null;
|
||||
}
|
||||
findCycle() {
|
||||
let result;
|
||||
let foundStartNodes = false;
|
||||
findCycles(allData) {
|
||||
const result = new Map();
|
||||
const checked = new Set();
|
||||
for (const [_start, value] of this._nodes) {
|
||||
if (Object.values(value.incoming).length > 0) {
|
||||
for (const data of allData) {
|
||||
const node = this.lookup(data);
|
||||
if (!node) {
|
||||
continue;
|
||||
}
|
||||
foundStartNodes = true;
|
||||
const dfs = (node, visited) => {
|
||||
if (checked.has(node)) {
|
||||
return;
|
||||
}
|
||||
if (visited.has(node)) {
|
||||
result = [...visited, node].map(n => n.data);
|
||||
const idx = result.indexOf(node.data);
|
||||
result = result.slice(idx);
|
||||
return;
|
||||
}
|
||||
visited.add(node);
|
||||
for (const child of Object.values(node.outgoing)) {
|
||||
dfs(child, visited);
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
visited.delete(node);
|
||||
checked.add(node);
|
||||
};
|
||||
dfs(value, new Set());
|
||||
const r = this._findCycle(node, checked, new Set());
|
||||
result.set(node.data, r);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
_findCycle(node, checked, seen) {
|
||||
if (checked.has(node.data)) {
|
||||
return undefined;
|
||||
}
|
||||
let result;
|
||||
for (const child of node.outgoing.values()) {
|
||||
if (seen.has(child.data)) {
|
||||
const seenArr = Array.from(seen);
|
||||
const idx = seenArr.indexOf(child.data);
|
||||
seenArr.push(child.data);
|
||||
return idx > 0 ? seenArr.slice(idx) : seenArr;
|
||||
}
|
||||
seen.add(child.data);
|
||||
result = this._findCycle(child, checked, seen);
|
||||
seen.delete(child.data);
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!foundStartNodes) {
|
||||
// everything is a cycle
|
||||
return Array.from(this._nodes.keys());
|
||||
}
|
||||
checked.add(node.data);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+27
-38
@@ -63,53 +63,42 @@ export namespace graph {
|
||||
return this._nodes.get(data) ?? null;
|
||||
}
|
||||
|
||||
findCycle(): T[] | undefined {
|
||||
|
||||
let result: T[] | undefined;
|
||||
let foundStartNodes = false;
|
||||
const checked = new Set<Node<T>>();
|
||||
|
||||
for (const [_start, value] of this._nodes) {
|
||||
|
||||
if (Object.values(value.incoming).length > 0) {
|
||||
findCycles(allData: T[]): Map<T, T[] | undefined> {
|
||||
const result = new Map<T, T[] | undefined>();
|
||||
const checked = new Set<T>();
|
||||
for (const data of allData) {
|
||||
const node = this.lookup(data);
|
||||
if (!node) {
|
||||
continue;
|
||||
}
|
||||
const r = this._findCycle(node, checked, new Set());
|
||||
result.set(node.data, r);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
foundStartNodes = true;
|
||||
private _findCycle(node: Node<T>, checked: Set<T>, seen: Set<T>): T[] | undefined {
|
||||
|
||||
const dfs = (node: Node<T>, visited: Set<Node<T>>) => {
|
||||
if (checked.has(node.data)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (checked.has(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (visited.has(node)) {
|
||||
result = [...visited, node].map(n => n.data);
|
||||
const idx = result.indexOf(node.data);
|
||||
result = result.slice(idx);
|
||||
return;
|
||||
}
|
||||
visited.add(node);
|
||||
for (const child of Object.values(node.outgoing)) {
|
||||
dfs(child, visited);
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
visited.delete(node);
|
||||
checked.add(node);
|
||||
};
|
||||
dfs(value, new Set());
|
||||
let result: T[] | undefined;
|
||||
for (const child of node.outgoing.values()) {
|
||||
if (seen.has(child.data)) {
|
||||
const seenArr = Array.from(seen);
|
||||
const idx = seenArr.indexOf(child.data);
|
||||
seenArr.push(child.data);
|
||||
return idx > 0 ? seenArr.slice(idx) : seenArr;
|
||||
}
|
||||
seen.add(child.data);
|
||||
result = this._findCycle(child, checked, seen);
|
||||
seen.delete(child.data);
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundStartNodes) {
|
||||
// everything is a cycle
|
||||
return Array.from(this._nodes.keys());
|
||||
}
|
||||
|
||||
checked.add(node.data);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+236
-284
@@ -9,7 +9,7 @@
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"node-gyp": "^10.1.0"
|
||||
"node-gyp": "^11.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/cliui": {
|
||||
@@ -30,10 +30,23 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/fs-minipass": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
|
||||
"integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"minipass": "^7.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@npmcli/agent": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-2.2.2.tgz",
|
||||
"integrity": "sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz",
|
||||
"integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
@@ -44,20 +57,20 @@
|
||||
"socks-proxy-agent": "^8.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.14.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@npmcli/fs": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.1.tgz",
|
||||
"integrity": "sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg==",
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-4.0.0.tgz",
|
||||
"integrity": "sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"semver": "^7.3.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@pkgjs/parseargs": {
|
||||
@@ -72,46 +85,29 @@
|
||||
}
|
||||
},
|
||||
"node_modules/abbrev": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz",
|
||||
"integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==",
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz",
|
||||
"integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz",
|
||||
"integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==",
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz",
|
||||
"integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/aggregate-error": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
|
||||
"integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"clean-stack": "^2.0.0",
|
||||
"indent-string": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
|
||||
"integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
|
||||
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -152,13 +148,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cacache": {
|
||||
"version": "18.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.3.tgz",
|
||||
"integrity": "sha512-qXCd4rh6I07cnDqh8V48/94Tc/WSfj+o3Gn6NZ0aZovS255bUx8O13uKxRFd2eWG0xgsco7+YItQNPaa5E85hg==",
|
||||
"version": "19.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz",
|
||||
"integrity": "sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@npmcli/fs": "^3.1.0",
|
||||
"@npmcli/fs": "^4.0.0",
|
||||
"fs-minipass": "^3.0.0",
|
||||
"glob": "^10.2.2",
|
||||
"lru-cache": "^10.0.1",
|
||||
@@ -166,33 +162,23 @@
|
||||
"minipass-collect": "^2.0.1",
|
||||
"minipass-flush": "^1.0.5",
|
||||
"minipass-pipeline": "^1.2.4",
|
||||
"p-map": "^4.0.0",
|
||||
"ssri": "^10.0.0",
|
||||
"tar": "^6.1.11",
|
||||
"unique-filename": "^3.0.0"
|
||||
"p-map": "^7.0.2",
|
||||
"ssri": "^12.0.0",
|
||||
"tar": "^7.4.3",
|
||||
"unique-filename": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.14.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/chownr": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
|
||||
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",
|
||||
"integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/clean-stack": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
|
||||
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
@@ -216,9 +202,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -254,13 +240,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.5",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz",
|
||||
"integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==",
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
|
||||
"integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.1.2"
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
@@ -320,14 +306,29 @@
|
||||
"dev": true,
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/fdir": {
|
||||
"version": "6.4.5",
|
||||
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.5.tgz",
|
||||
"integrity": "sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"picomatch": "^3 || ^4"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"picomatch": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/foreground-child": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz",
|
||||
"integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==",
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",
|
||||
"integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.0",
|
||||
"cross-spawn": "^7.0.6",
|
||||
"signal-exit": "^4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
@@ -351,9 +352,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "10.4.2",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz",
|
||||
"integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==",
|
||||
"version": "10.4.5",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz",
|
||||
"integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
@@ -367,9 +368,6 @@
|
||||
"bin": {
|
||||
"glob": "dist/esm/bin.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
@@ -382,9 +380,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/http-cache-semantics": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz",
|
||||
"integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==",
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz",
|
||||
"integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
@@ -403,13 +401,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/https-proxy-agent": {
|
||||
"version": "7.0.5",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz",
|
||||
"integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
|
||||
"integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "^7.0.2",
|
||||
"agent-base": "^7.1.2",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -440,16 +438,6 @@
|
||||
"node": ">=0.8.19"
|
||||
}
|
||||
},
|
||||
"node_modules/indent-string": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
|
||||
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ip-address": {
|
||||
"version": "9.0.5",
|
||||
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz",
|
||||
@@ -474,13 +462,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-lambda": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz",
|
||||
"integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/isexe": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
|
||||
@@ -492,17 +473,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jackspeak": {
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz",
|
||||
"integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==",
|
||||
"version": "3.4.3",
|
||||
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
|
||||
"integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/cliui": "^8.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
},
|
||||
@@ -518,47 +496,33 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lru-cache": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz",
|
||||
"integrity": "sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==",
|
||||
"version": "10.4.3",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
|
||||
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "14 || >=16.14"
|
||||
}
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/make-fetch-happen": {
|
||||
"version": "13.0.1",
|
||||
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.1.tgz",
|
||||
"integrity": "sha512-cKTUFc/rbKUd/9meOvgrpJ2WrNzymt6jfRDdwg5UCnVzv9dTpEj9JS5m3wtziXVCjluIXyL8pcaukYqezIzZQA==",
|
||||
"version": "14.0.3",
|
||||
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz",
|
||||
"integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@npmcli/agent": "^2.0.0",
|
||||
"cacache": "^18.0.0",
|
||||
"@npmcli/agent": "^3.0.0",
|
||||
"cacache": "^19.0.1",
|
||||
"http-cache-semantics": "^4.1.1",
|
||||
"is-lambda": "^1.0.1",
|
||||
"minipass": "^7.0.2",
|
||||
"minipass-fetch": "^3.0.0",
|
||||
"minipass-fetch": "^4.0.0",
|
||||
"minipass-flush": "^1.0.5",
|
||||
"minipass-pipeline": "^1.2.4",
|
||||
"negotiator": "^0.6.3",
|
||||
"proc-log": "^4.2.0",
|
||||
"negotiator": "^1.0.0",
|
||||
"proc-log": "^5.0.0",
|
||||
"promise-retry": "^2.0.1",
|
||||
"ssri": "^10.0.0"
|
||||
"ssri": "^12.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.14.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/make-fetch-happen/node_modules/proc-log": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz",
|
||||
"integrity": "sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
@@ -601,18 +565,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minipass-fetch": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.5.tgz",
|
||||
"integrity": "sha512-2N8elDQAtSnFV0Dk7gt15KHsS0Fyz6CbYZ360h0WTYV1Ty46li3rAXVOQj1THMNLdmrD9Vt5pBPtWtVkpwGBqg==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.1.tgz",
|
||||
"integrity": "sha512-j7U11C5HXigVuutxebFadoYBbd7VSdZWggSe64NVdvWNBqGAiXPL2QVCehjmw7lY1oF9gOllYbORh+hiNgfPgQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minipass": "^7.0.3",
|
||||
"minipass-sized": "^1.0.3",
|
||||
"minizlib": "^2.1.2"
|
||||
"minizlib": "^3.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"encoding": "^0.1.13"
|
||||
@@ -644,6 +608,13 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/minipass-flush/node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/minipass-pipeline": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz",
|
||||
@@ -670,6 +641,13 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/minipass-pipeline/node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/minipass-sized": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz",
|
||||
@@ -696,57 +674,53 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/minipass-sized/node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/minizlib": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
|
||||
"integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz",
|
||||
"integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minipass": "^3.0.0",
|
||||
"yallist": "^4.0.0"
|
||||
"minipass": "^7.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/minizlib/node_modules/minipass": {
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
|
||||
"integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/mkdirp": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
||||
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz",
|
||||
"integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"mkdirp": "bin/cmd.js"
|
||||
"mkdirp": "dist/cjs/src/bin.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/negotiator": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
|
||||
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
|
||||
"integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -754,66 +728,63 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-gyp": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-10.1.0.tgz",
|
||||
"integrity": "sha512-B4J5M1cABxPc5PwfjhbV5hoy2DP9p8lFXASnEN6hugXOa61416tnTZ29x9sSwAd0o99XNIcpvDDy1swAExsVKA==",
|
||||
"version": "11.2.0",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.2.0.tgz",
|
||||
"integrity": "sha512-T0S1zqskVUSxcsSTkAsLc7xCycrRYmtDHadDinzocrThjyQCn5kMlEBSj6H4qDbgsIOSLmmlRIeb0lZXj+UArA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"env-paths": "^2.2.0",
|
||||
"exponential-backoff": "^3.1.1",
|
||||
"glob": "^10.3.10",
|
||||
"graceful-fs": "^4.2.6",
|
||||
"make-fetch-happen": "^13.0.0",
|
||||
"nopt": "^7.0.0",
|
||||
"proc-log": "^3.0.0",
|
||||
"make-fetch-happen": "^14.0.3",
|
||||
"nopt": "^8.0.0",
|
||||
"proc-log": "^5.0.0",
|
||||
"semver": "^7.3.5",
|
||||
"tar": "^6.1.2",
|
||||
"which": "^4.0.0"
|
||||
"tar": "^7.4.3",
|
||||
"tinyglobby": "^0.2.12",
|
||||
"which": "^5.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"node-gyp": "bin/node-gyp.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.14.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nopt": {
|
||||
"version": "7.2.1",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz",
|
||||
"integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==",
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz",
|
||||
"integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"abbrev": "^2.0.0"
|
||||
"abbrev": "^3.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"nopt": "bin/nopt.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/p-map": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
|
||||
"integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz",
|
||||
"integrity": "sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"aggregate-error": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/package-json-from-dist": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz",
|
||||
"integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==",
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
|
||||
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0"
|
||||
},
|
||||
@@ -844,14 +815,27 @@
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
|
||||
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/proc-log": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz",
|
||||
"integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz",
|
||||
"integrity": "sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/promise-retry": {
|
||||
@@ -887,14 +871,11 @@
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"version": "7.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
|
||||
"integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
@@ -902,19 +883,6 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/semver/node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/shebang-command": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||
@@ -963,9 +931,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/socks": {
|
||||
"version": "2.8.3",
|
||||
"resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz",
|
||||
"integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==",
|
||||
"version": "2.8.4",
|
||||
"resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz",
|
||||
"integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -978,13 +946,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/socks-proxy-agent": {
|
||||
"version": "8.0.4",
|
||||
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz",
|
||||
"integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==",
|
||||
"version": "8.0.5",
|
||||
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz",
|
||||
"integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "^7.1.1",
|
||||
"agent-base": "^7.1.2",
|
||||
"debug": "^4.3.4",
|
||||
"socks": "^2.8.3"
|
||||
},
|
||||
@@ -1000,16 +968,16 @@
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/ssri": {
|
||||
"version": "10.0.6",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.6.tgz",
|
||||
"integrity": "sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ==",
|
||||
"version": "12.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-12.0.0.tgz",
|
||||
"integrity": "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"minipass": "^7.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
@@ -1117,89 +1085,70 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tar": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",
|
||||
"integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==",
|
||||
"version": "7.4.3",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz",
|
||||
"integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"chownr": "^2.0.0",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"minipass": "^5.0.0",
|
||||
"minizlib": "^2.1.1",
|
||||
"mkdirp": "^1.0.3",
|
||||
"yallist": "^4.0.0"
|
||||
"@isaacs/fs-minipass": "^4.0.0",
|
||||
"chownr": "^3.0.0",
|
||||
"minipass": "^7.1.2",
|
||||
"minizlib": "^3.0.1",
|
||||
"mkdirp": "^3.0.1",
|
||||
"yallist": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/tar/node_modules/fs-minipass": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
|
||||
"integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
|
||||
"node_modules/tinyglobby": {
|
||||
"version": "0.2.14",
|
||||
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz",
|
||||
"integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minipass": "^3.0.0"
|
||||
"fdir": "^6.4.4",
|
||||
"picomatch": "^4.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/tar/node_modules/fs-minipass/node_modules/minipass": {
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
|
||||
"integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/tar/node_modules/minipass": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
|
||||
"integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/SuperchupuDev"
|
||||
}
|
||||
},
|
||||
"node_modules/unique-filename": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz",
|
||||
"integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==",
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz",
|
||||
"integrity": "sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"unique-slug": "^4.0.0"
|
||||
"unique-slug": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/unique-slug": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz",
|
||||
"integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-5.0.0.tgz",
|
||||
"integrity": "sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"imurmurhash": "^0.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
|
||||
"integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz",
|
||||
"integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
@@ -1209,7 +1158,7 @@
|
||||
"node-which": "bin/which.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.13.0 || >=18.0.0"
|
||||
"node": "^18.17.0 || >=20.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
@@ -1311,11 +1260,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
|
||||
"integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
"license": "BlueOak-1.0.0",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"node-gyp": "^10.1.0"
|
||||
"node-gyp": "^11.2.0"
|
||||
},
|
||||
"scripts": {}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,12 @@ function setNpmrcConfig(dir, env) {
|
||||
}
|
||||
}
|
||||
|
||||
// Use our bundled node-gyp version
|
||||
env['npm_config_node_gyp'] =
|
||||
process.platform === 'win32'
|
||||
? path.join(__dirname, 'gyp', 'node_modules', '.bin', 'node-gyp.cmd')
|
||||
: path.join(__dirname, 'gyp', 'node_modules', '.bin', 'node-gyp');
|
||||
|
||||
// Force node-gyp to use process.config on macOS
|
||||
// which defines clang variable as expected. Otherwise we
|
||||
// run into compilation errors due to incorrect compiler
|
||||
|
||||
Generated
+4
-986
File diff suppressed because it is too large
Load Diff
+1
-4
@@ -36,10 +36,9 @@
|
||||
"@types/workerpool": "^6.4.0",
|
||||
"@types/xml2js": "0.0.33",
|
||||
"@vscode/iconv-lite-umd": "0.7.0",
|
||||
"@vscode/ripgrep": "^1.15.10",
|
||||
"@vscode/ripgrep": "^1.15.13",
|
||||
"@vscode/vsce": "2.20.1",
|
||||
"byline": "^5.0.0",
|
||||
"cssnano": "^7.0.7",
|
||||
"debug": "^4.3.2",
|
||||
"electron-osx-sign": "^0.4.16",
|
||||
"esbuild": "0.25.0",
|
||||
@@ -49,8 +48,6 @@
|
||||
"jsonc-parser": "^2.3.0",
|
||||
"jws": "^4.0.0",
|
||||
"mime": "^1.4.1",
|
||||
"postcss": "^8.5.3",
|
||||
"postcss-nesting": "^13.0.1",
|
||||
"source-map": "0.6.1",
|
||||
"ternary-stream": "^3.0.0",
|
||||
"through2": "^4.0.2",
|
||||
|
||||
+8
-8
@@ -99,7 +99,7 @@ export default tseslint.config(
|
||||
'browser': [
|
||||
'common'
|
||||
],
|
||||
'electron-sandbox': [
|
||||
'electron-browser': [
|
||||
'common',
|
||||
'browser'
|
||||
],
|
||||
@@ -406,10 +406,10 @@ export default tseslint.config(
|
||||
]
|
||||
}
|
||||
},
|
||||
// browser/electron-sandbox layer
|
||||
// browser/electron-browser layer
|
||||
{
|
||||
files: [
|
||||
'src/**/{browser,electron-sandbox}/**/*.ts'
|
||||
'src/**/{browser,electron-browser}/**/*.ts'
|
||||
],
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
@@ -770,7 +770,7 @@ export default tseslint.config(
|
||||
{
|
||||
// imports that are allowed in all files of layers:
|
||||
// - browser
|
||||
// - electron-sandbox
|
||||
// - electron-browser
|
||||
'when': 'hasBrowser',
|
||||
'allow': []
|
||||
},
|
||||
@@ -866,18 +866,18 @@ export default tseslint.config(
|
||||
// - src/vs/base/common
|
||||
// - src/vs/base/worker
|
||||
// - src/vs/base/browser
|
||||
// - src/vs/base/electron-sandbox
|
||||
// - src/vs/base/electron-browser
|
||||
// - src/vs/base/node
|
||||
// - src/vs/base/electron-main
|
||||
// - src/vs/base/test/common
|
||||
// - src/vs/base/test/worker
|
||||
// - src/vs/base/test/browser
|
||||
// - src/vs/base/test/electron-sandbox
|
||||
// - src/vs/base/test/electron-browser
|
||||
// - src/vs/base/test/node
|
||||
// - src/vs/base/test/electron-main
|
||||
//
|
||||
// When /~ is used in the restrictions, it will be replaced with the correct
|
||||
// layers that can be used e.g. 'src/vs/base/electron-sandbox' will be able
|
||||
// layers that can be used e.g. 'src/vs/base/electron-browser' will be able
|
||||
// to import '{common,browser,electron-sanbox}', etc.
|
||||
//
|
||||
// It is possible to use /~ in the restrictions property even without using it in
|
||||
@@ -1203,7 +1203,7 @@ export default tseslint.config(
|
||||
},
|
||||
{
|
||||
'target': 'src/vs/workbench/workbench.desktop.main.ts',
|
||||
'layer': 'electron-sandbox',
|
||||
'layer': 'electron-browser',
|
||||
'restrictions': [
|
||||
'vs/base/*/~',
|
||||
'vs/base/parts/*/~',
|
||||
|
||||
@@ -16,7 +16,6 @@ import { CancellationError, CancellationToken, ConfigurationChangeEvent, LogOutp
|
||||
import { Commit as ApiCommit, Ref, RefType, Branch, Remote, ForcePushMode, GitErrorCodes, LogOptions, Change, Status, CommitOptions, RefQuery as ApiRefQuery, InitOptions } from './api/git';
|
||||
import * as byline from 'byline';
|
||||
import { StringDecoder } from 'string_decoder';
|
||||
import { sequentialize } from './decorators';
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/65693
|
||||
const MAX_CLI_LENGTH = 30000;
|
||||
@@ -1242,7 +1241,6 @@ export class Repository {
|
||||
return this.git.spawn(args, options);
|
||||
}
|
||||
|
||||
@sequentialize
|
||||
async config(command: string, scope: string, key: string, value: any = null, options: SpawnOptions = {}): Promise<string> {
|
||||
const args = ['config', `--${command}`];
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import { emojify, ensureEmojis } from './emoji';
|
||||
import { Commit } from './git';
|
||||
import { OperationKind, OperationResult } from './operation';
|
||||
import { ISourceControlHistoryItemDetailsProviderRegistry, provideSourceControlHistoryItemAvatar, provideSourceControlHistoryItemMessageLinks } from './historyItemDetailsProvider';
|
||||
import { throttle } from './decorators';
|
||||
|
||||
function compareSourceControlHistoryItemRef(ref1: SourceControlHistoryItemRef, ref2: SourceControlHistoryItemRef): number {
|
||||
const getOrder = (ref: SourceControlHistoryItemRef): number => {
|
||||
@@ -87,6 +88,7 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
this.commitShortHashLength = config.get<number>('commitShortHashLength', 7);
|
||||
}
|
||||
|
||||
@throttle
|
||||
private async onDidRunWriteOperation(result: OperationResult): Promise<void> {
|
||||
if (!this.repository.HEAD) {
|
||||
this.logger.trace('[GitHistoryProvider][onDidRunWriteOperation] repository.HEAD is undefined');
|
||||
|
||||
@@ -13,7 +13,7 @@ import { ApiRepository } from './api/api1';
|
||||
import { Branch, BranchQuery, Change, CommitOptions, FetchOptions, ForcePushMode, GitErrorCodes, LogOptions, Ref, RefType, Remote, Status } from './api/git';
|
||||
import { AutoFetcher } from './autofetch';
|
||||
import { GitBranchProtectionProvider, IBranchProtectionProviderRegistry } from './branchProtection';
|
||||
import { debounce, memoize, throttle } from './decorators';
|
||||
import { debounce, memoize, sequentialize, throttle } from './decorators';
|
||||
import { Repository as BaseRepository, BlameInformation, Commit, GitError, LogFileOptions, LsTreeElement, PullOptions, RefQuery, Stash, Submodule } from './git';
|
||||
import { GitHistoryProvider } from './historyProvider';
|
||||
import { Operation, OperationKind, OperationManager, OperationResult } from './operation';
|
||||
@@ -1554,6 +1554,7 @@ export class Repository implements Disposable {
|
||||
});
|
||||
}
|
||||
|
||||
@sequentialize
|
||||
async getBranchBase(ref: string): Promise<Branch | undefined> {
|
||||
const branch = await this.getBranch(ref);
|
||||
|
||||
|
||||
@@ -23,13 +23,17 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var search = window.location.search;
|
||||
var error = (/[?&^]error=([^&]+)/.exec(search) || [])[1];
|
||||
var urlParams = new URLSearchParams(window.location.search);
|
||||
var error = urlParams.get('error');
|
||||
if (error) {
|
||||
document.querySelector('.error-text')
|
||||
.textContent = decodeURIComponent(error);
|
||||
.textContent = error;
|
||||
document.querySelector('body')
|
||||
.classList.add('error');
|
||||
} else if (urlParams.get('redirect_uri')) {
|
||||
setTimeout(() => {
|
||||
window.location = urlParams.get('redirect_uri');
|
||||
}, 1000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -121,356 +121,365 @@ async function exchangeCodeForToken(
|
||||
}
|
||||
}
|
||||
|
||||
const allFlows: IFlow[] = [
|
||||
new class UrlHandlerFlow implements IFlow {
|
||||
label = l10n.t('url handler');
|
||||
options: IFlowOptions = {
|
||||
supportsGitHubDotCom: true,
|
||||
// Supporting GHES would be challenging because different versions
|
||||
// used a different client ID. We could try to detect the version
|
||||
// and use the right one, but that's a lot of work when we have
|
||||
// other flows that work well.
|
||||
supportsGitHubEnterpriseServer: false,
|
||||
supportsHostedGitHubEnterprise: true,
|
||||
supportsRemoteExtensionHost: true,
|
||||
supportsWebWorkerExtensionHost: true,
|
||||
// exchanging a code for a token requires a client secret
|
||||
supportsNoClientSecret: false,
|
||||
supportsSupportedClients: true,
|
||||
supportsUnsupportedClients: false
|
||||
};
|
||||
class UrlHandlerFlow implements IFlow {
|
||||
label = l10n.t('url handler');
|
||||
options: IFlowOptions = {
|
||||
supportsGitHubDotCom: true,
|
||||
// Supporting GHES would be challenging because different versions
|
||||
// used a different client ID. We could try to detect the version
|
||||
// and use the right one, but that's a lot of work when we have
|
||||
// other flows that work well.
|
||||
supportsGitHubEnterpriseServer: false,
|
||||
supportsHostedGitHubEnterprise: true,
|
||||
supportsRemoteExtensionHost: true,
|
||||
supportsWebWorkerExtensionHost: true,
|
||||
// exchanging a code for a token requires a client secret
|
||||
supportsNoClientSecret: false,
|
||||
supportsSupportedClients: true,
|
||||
supportsUnsupportedClients: false
|
||||
};
|
||||
|
||||
async trigger({
|
||||
scopes,
|
||||
baseUri,
|
||||
redirectUri,
|
||||
logger,
|
||||
nonce,
|
||||
callbackUri,
|
||||
uriHandler,
|
||||
enterpriseUri,
|
||||
existingLogin
|
||||
}: IFlowTriggerOptions): Promise<string> {
|
||||
logger.info(`Trying without local server... (${scopes})`);
|
||||
return await window.withProgress<string>({
|
||||
location: ProgressLocation.Notification,
|
||||
title: l10n.t({
|
||||
message: 'Signing in to {0}...',
|
||||
args: [baseUri.authority],
|
||||
comment: ['The {0} will be a url, e.g. github.com']
|
||||
}),
|
||||
cancellable: true
|
||||
}, async (_, token) => {
|
||||
const promise = uriHandler.waitForCode(logger, scopes, nonce, token);
|
||||
async trigger({
|
||||
scopes,
|
||||
baseUri,
|
||||
redirectUri,
|
||||
logger,
|
||||
nonce,
|
||||
callbackUri,
|
||||
uriHandler,
|
||||
enterpriseUri,
|
||||
existingLogin
|
||||
}: IFlowTriggerOptions): Promise<string> {
|
||||
logger.info(`Trying without local server... (${scopes})`);
|
||||
return await window.withProgress<string>({
|
||||
location: ProgressLocation.Notification,
|
||||
title: l10n.t({
|
||||
message: 'Signing in to {0}...',
|
||||
args: [baseUri.authority],
|
||||
comment: ['The {0} will be a url, e.g. github.com']
|
||||
}),
|
||||
cancellable: true
|
||||
}, async (_, token) => {
|
||||
const promise = uriHandler.waitForCode(logger, scopes, nonce, token);
|
||||
|
||||
const searchParams = new URLSearchParams([
|
||||
['client_id', Config.gitHubClientId],
|
||||
['redirect_uri', redirectUri.toString(true)],
|
||||
['scope', scopes],
|
||||
['state', encodeURIComponent(callbackUri.toString(true))]
|
||||
]);
|
||||
if (existingLogin) {
|
||||
searchParams.append('login', existingLogin);
|
||||
} else {
|
||||
searchParams.append('prompt', 'select_account');
|
||||
}
|
||||
|
||||
// The extra toString, parse is apparently needed for env.openExternal
|
||||
// to open the correct URL.
|
||||
const uri = Uri.parse(baseUri.with({
|
||||
path: '/login/oauth/authorize',
|
||||
query: searchParams.toString()
|
||||
}).toString(true));
|
||||
await env.openExternal(uri);
|
||||
|
||||
const code = await promise;
|
||||
|
||||
const proxyEndpoints: { [providerId: string]: string } | undefined = await commands.executeCommand('workbench.getCodeExchangeProxyEndpoints');
|
||||
const endpointUrl = proxyEndpoints?.github
|
||||
? Uri.parse(`${proxyEndpoints.github}login/oauth/access_token`)
|
||||
: baseUri.with({ path: '/login/oauth/access_token' });
|
||||
|
||||
const accessToken = await exchangeCodeForToken(logger, endpointUrl, redirectUri, code, enterpriseUri);
|
||||
return accessToken;
|
||||
});
|
||||
}
|
||||
},
|
||||
new class LocalServerFlow implements IFlow {
|
||||
label = l10n.t('local server');
|
||||
options: IFlowOptions = {
|
||||
supportsGitHubDotCom: true,
|
||||
// Supporting GHES would be challenging because different versions
|
||||
// used a different client ID. We could try to detect the version
|
||||
// and use the right one, but that's a lot of work when we have
|
||||
// other flows that work well.
|
||||
supportsGitHubEnterpriseServer: false,
|
||||
supportsHostedGitHubEnterprise: true,
|
||||
// Opening a port on the remote side can't be open in the browser on
|
||||
// the client side so this flow won't work in remote extension hosts
|
||||
supportsRemoteExtensionHost: false,
|
||||
// Web worker can't open a port to listen for the redirect
|
||||
supportsWebWorkerExtensionHost: false,
|
||||
// exchanging a code for a token requires a client secret
|
||||
supportsNoClientSecret: false,
|
||||
supportsSupportedClients: true,
|
||||
supportsUnsupportedClients: true
|
||||
};
|
||||
async trigger({
|
||||
scopes,
|
||||
baseUri,
|
||||
redirectUri,
|
||||
logger,
|
||||
enterpriseUri,
|
||||
existingLogin
|
||||
}: IFlowTriggerOptions): Promise<string> {
|
||||
logger.info(`Trying with local server... (${scopes})`);
|
||||
return await window.withProgress<string>({
|
||||
location: ProgressLocation.Notification,
|
||||
title: l10n.t({
|
||||
message: 'Signing in to {0}...',
|
||||
args: [baseUri.authority],
|
||||
comment: ['The {0} will be a url, e.g. github.com']
|
||||
}),
|
||||
cancellable: true
|
||||
}, async (_, token) => {
|
||||
const searchParams = new URLSearchParams([
|
||||
['client_id', Config.gitHubClientId],
|
||||
['redirect_uri', redirectUri.toString(true)],
|
||||
['scope', scopes],
|
||||
]);
|
||||
if (existingLogin) {
|
||||
searchParams.append('login', existingLogin);
|
||||
} else {
|
||||
searchParams.append('prompt', 'select_account');
|
||||
}
|
||||
|
||||
const loginUrl = baseUri.with({
|
||||
path: '/login/oauth/authorize',
|
||||
query: searchParams.toString()
|
||||
});
|
||||
const server = new LoopbackAuthServer(path.join(__dirname, '../media'), loginUrl.toString(true));
|
||||
const port = await server.start();
|
||||
|
||||
let codeToExchange;
|
||||
try {
|
||||
env.openExternal(Uri.parse(`http://127.0.0.1:${port}/signin?nonce=${encodeURIComponent(server.nonce)}`));
|
||||
const { code } = await Promise.race([
|
||||
server.waitForOAuthResponse(),
|
||||
new Promise<any>((_, reject) => setTimeout(() => reject(TIMED_OUT_ERROR), 300_000)), // 5min timeout
|
||||
promiseFromEvent<any, any>(token.onCancellationRequested, (_, __, reject) => { reject(USER_CANCELLATION_ERROR); }).promise
|
||||
]);
|
||||
codeToExchange = code;
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
void server.stop();
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
const accessToken = await exchangeCodeForToken(
|
||||
logger,
|
||||
baseUri.with({ path: '/login/oauth/access_token' }),
|
||||
redirectUri,
|
||||
codeToExchange,
|
||||
enterpriseUri);
|
||||
return accessToken;
|
||||
});
|
||||
}
|
||||
},
|
||||
new class DeviceCodeFlow implements IFlow {
|
||||
label = l10n.t('device code');
|
||||
options: IFlowOptions = {
|
||||
supportsGitHubDotCom: true,
|
||||
supportsGitHubEnterpriseServer: true,
|
||||
supportsHostedGitHubEnterprise: true,
|
||||
supportsRemoteExtensionHost: true,
|
||||
// CORS prevents this from working in web workers
|
||||
supportsWebWorkerExtensionHost: false,
|
||||
supportsNoClientSecret: true,
|
||||
supportsSupportedClients: true,
|
||||
supportsUnsupportedClients: true
|
||||
};
|
||||
async trigger({ scopes, baseUri, logger }: IFlowTriggerOptions) {
|
||||
logger.info(`Trying device code flow... (${scopes})`);
|
||||
|
||||
// Get initial device code
|
||||
const uri = baseUri.with({
|
||||
path: '/login/device/code',
|
||||
query: `client_id=${Config.gitHubClientId}&scope=${scopes}`
|
||||
});
|
||||
const result = await fetching(uri.toString(true), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Accept: 'application/json'
|
||||
}
|
||||
});
|
||||
if (!result.ok) {
|
||||
throw new Error(`Failed to get one-time code: ${await result.text()}`);
|
||||
const searchParams = new URLSearchParams([
|
||||
['client_id', Config.gitHubClientId],
|
||||
['redirect_uri', redirectUri.toString(true)],
|
||||
['scope', scopes],
|
||||
['state', encodeURIComponent(callbackUri.toString(true))]
|
||||
]);
|
||||
if (existingLogin) {
|
||||
searchParams.append('login', existingLogin);
|
||||
} else {
|
||||
searchParams.append('prompt', 'select_account');
|
||||
}
|
||||
|
||||
const json = await result.json() as IGitHubDeviceCodeResponse;
|
||||
// The extra toString, parse is apparently needed for env.openExternal
|
||||
// to open the correct URL.
|
||||
const uri = Uri.parse(baseUri.with({
|
||||
path: '/login/oauth/authorize',
|
||||
query: searchParams.toString()
|
||||
}).toString(true));
|
||||
await env.openExternal(uri);
|
||||
|
||||
const button = l10n.t('Copy & Continue to GitHub');
|
||||
const modalResult = await window.showInformationMessage(
|
||||
l10n.t({ message: 'Your Code: {0}', args: [json.user_code], comment: ['The {0} will be a code, e.g. 123-456'] }),
|
||||
{
|
||||
modal: true,
|
||||
detail: l10n.t('To finish authenticating, navigate to GitHub and paste in the above one-time code.')
|
||||
}, button);
|
||||
const code = await promise;
|
||||
|
||||
if (modalResult !== button) {
|
||||
throw new Error(USER_CANCELLATION_ERROR);
|
||||
const proxyEndpoints: { [providerId: string]: string } | undefined = await commands.executeCommand('workbench.getCodeExchangeProxyEndpoints');
|
||||
const endpointUrl = proxyEndpoints?.github
|
||||
? Uri.parse(`${proxyEndpoints.github}login/oauth/access_token`)
|
||||
: baseUri.with({ path: '/login/oauth/access_token' });
|
||||
|
||||
const accessToken = await exchangeCodeForToken(logger, endpointUrl, redirectUri, code, enterpriseUri);
|
||||
return accessToken;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class LocalServerFlow implements IFlow {
|
||||
label = l10n.t('local server');
|
||||
options: IFlowOptions = {
|
||||
supportsGitHubDotCom: true,
|
||||
// Supporting GHES would be challenging because different versions
|
||||
// used a different client ID. We could try to detect the version
|
||||
// and use the right one, but that's a lot of work when we have
|
||||
// other flows that work well.
|
||||
supportsGitHubEnterpriseServer: false,
|
||||
supportsHostedGitHubEnterprise: true,
|
||||
// Opening a port on the remote side can't be open in the browser on
|
||||
// the client side so this flow won't work in remote extension hosts
|
||||
supportsRemoteExtensionHost: false,
|
||||
// Web worker can't open a port to listen for the redirect
|
||||
supportsWebWorkerExtensionHost: false,
|
||||
// exchanging a code for a token requires a client secret
|
||||
supportsNoClientSecret: false,
|
||||
supportsSupportedClients: true,
|
||||
supportsUnsupportedClients: true
|
||||
};
|
||||
async trigger({
|
||||
scopes,
|
||||
baseUri,
|
||||
redirectUri,
|
||||
logger,
|
||||
callbackUri,
|
||||
enterpriseUri,
|
||||
existingLogin
|
||||
}: IFlowTriggerOptions): Promise<string> {
|
||||
logger.info(`Trying with local server... (${scopes})`);
|
||||
return await window.withProgress<string>({
|
||||
location: ProgressLocation.Notification,
|
||||
title: l10n.t({
|
||||
message: 'Signing in to {0}...',
|
||||
args: [baseUri.authority],
|
||||
comment: ['The {0} will be a url, e.g. github.com']
|
||||
}),
|
||||
cancellable: true
|
||||
}, async (_, token) => {
|
||||
const searchParams = new URLSearchParams([
|
||||
['client_id', Config.gitHubClientId],
|
||||
['redirect_uri', redirectUri.toString(true)],
|
||||
['scope', scopes],
|
||||
]);
|
||||
if (existingLogin) {
|
||||
searchParams.append('login', existingLogin);
|
||||
} else {
|
||||
searchParams.append('prompt', 'select_account');
|
||||
}
|
||||
|
||||
await env.clipboard.writeText(json.user_code);
|
||||
|
||||
const uriToOpen = await env.asExternalUri(Uri.parse(json.verification_uri));
|
||||
await env.openExternal(uriToOpen);
|
||||
|
||||
return await this.waitForDeviceCodeAccessToken(baseUri, json);
|
||||
}
|
||||
|
||||
private async waitForDeviceCodeAccessToken(
|
||||
baseUri: Uri,
|
||||
json: IGitHubDeviceCodeResponse,
|
||||
): Promise<string> {
|
||||
return await window.withProgress<string>({
|
||||
location: ProgressLocation.Notification,
|
||||
cancellable: true,
|
||||
title: l10n.t({
|
||||
message: 'Open [{0}]({0}) in a new tab and paste your one-time code: {1}',
|
||||
args: [json.verification_uri, json.user_code],
|
||||
comment: [
|
||||
'The [{0}]({0}) will be a url and the {1} will be a code, e.g. 123-456',
|
||||
'{Locked="[{0}]({0})"}'
|
||||
]
|
||||
})
|
||||
}, async (_, token) => {
|
||||
const refreshTokenUri = baseUri.with({
|
||||
path: '/login/oauth/access_token',
|
||||
query: `client_id=${Config.gitHubClientId}&device_code=${json.device_code}&grant_type=urn:ietf:params:oauth:grant-type:device_code`
|
||||
});
|
||||
|
||||
// Try for 2 minutes
|
||||
const attempts = 120 / json.interval;
|
||||
for (let i = 0; i < attempts; i++) {
|
||||
await new Promise(resolve => setTimeout(resolve, json.interval * 1000));
|
||||
if (token.isCancellationRequested) {
|
||||
throw new Error(USER_CANCELLATION_ERROR);
|
||||
}
|
||||
let accessTokenResult;
|
||||
try {
|
||||
accessTokenResult = await fetching(refreshTokenUri.toString(true), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Accept: 'application/json'
|
||||
}
|
||||
});
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!accessTokenResult.ok) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const accessTokenJson = await accessTokenResult.json();
|
||||
|
||||
if (accessTokenJson.error === 'authorization_pending') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (accessTokenJson.error) {
|
||||
throw new Error(accessTokenJson.error_description);
|
||||
}
|
||||
|
||||
return accessTokenJson.access_token;
|
||||
}
|
||||
|
||||
throw new Error(TIMED_OUT_ERROR);
|
||||
const loginUrl = baseUri.with({
|
||||
path: '/login/oauth/authorize',
|
||||
query: searchParams.toString()
|
||||
});
|
||||
}
|
||||
},
|
||||
new class PatFlow implements IFlow {
|
||||
label = l10n.t('personal access token');
|
||||
options: IFlowOptions = {
|
||||
supportsGitHubDotCom: true,
|
||||
supportsGitHubEnterpriseServer: true,
|
||||
supportsHostedGitHubEnterprise: true,
|
||||
supportsRemoteExtensionHost: true,
|
||||
supportsWebWorkerExtensionHost: true,
|
||||
supportsNoClientSecret: true,
|
||||
// PATs can't be used with Settings Sync so we don't enable this flow
|
||||
// for supported clients
|
||||
supportsSupportedClients: false,
|
||||
supportsUnsupportedClients: true
|
||||
};
|
||||
const server = new LoopbackAuthServer(path.join(__dirname, '../media'), loginUrl.toString(true), callbackUri.toString(true));
|
||||
const port = await server.start();
|
||||
|
||||
async trigger({ scopes, baseUri, logger, enterpriseUri }: IFlowTriggerOptions) {
|
||||
logger.info(`Trying to retrieve PAT... (${scopes})`);
|
||||
|
||||
const button = l10n.t('Continue to GitHub');
|
||||
const modalResult = await window.showInformationMessage(
|
||||
l10n.t('Continue to GitHub to create a Personal Access Token (PAT)'),
|
||||
{
|
||||
modal: true,
|
||||
detail: l10n.t('To finish authenticating, navigate to GitHub to create a PAT then paste the PAT into the input box.')
|
||||
}, button);
|
||||
|
||||
if (modalResult !== button) {
|
||||
throw new Error(USER_CANCELLATION_ERROR);
|
||||
}
|
||||
|
||||
const description = `${env.appName} (${scopes})`;
|
||||
const uriToOpen = await env.asExternalUri(baseUri.with({ path: '/settings/tokens/new', query: `description=${description}&scopes=${scopes.split(' ').join(',')}` }));
|
||||
await env.openExternal(uriToOpen);
|
||||
const token = await window.showInputBox({ placeHolder: `ghp_1a2b3c4...`, prompt: `GitHub Personal Access Token - ${scopes}`, ignoreFocusOut: true });
|
||||
if (!token) { throw new Error(USER_CANCELLATION_ERROR); }
|
||||
|
||||
const appUri = !enterpriseUri || isHostedGitHubEnterprise(enterpriseUri)
|
||||
? Uri.parse(`${baseUri.scheme}://api.${baseUri.authority}`)
|
||||
: Uri.parse(`${baseUri.scheme}://${baseUri.authority}/api/v3`);
|
||||
|
||||
const tokenScopes = await this.getScopes(token, appUri, logger); // Example: ['repo', 'user']
|
||||
const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
|
||||
if (!scopesList.every(scope => {
|
||||
const included = tokenScopes.includes(scope);
|
||||
if (included || !scope.includes(':')) {
|
||||
return included;
|
||||
}
|
||||
|
||||
return scope.split(':').some(splitScopes => {
|
||||
return tokenScopes.includes(splitScopes);
|
||||
});
|
||||
})) {
|
||||
throw new Error(`The provided token does not match the requested scopes: ${scopes}`);
|
||||
}
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
private async getScopes(token: string, serverUri: Uri, logger: Log): Promise<string[]> {
|
||||
let codeToExchange;
|
||||
try {
|
||||
logger.info('Getting token scopes...');
|
||||
const result = await fetching(serverUri.toString(), {
|
||||
headers: {
|
||||
Authorization: `token ${token}`,
|
||||
'User-Agent': `${env.appName} (${env.appHost})`
|
||||
}
|
||||
});
|
||||
|
||||
if (result.ok) {
|
||||
const scopes = result.headers.get('X-OAuth-Scopes');
|
||||
return scopes ? scopes.split(',').map(scope => scope.trim()) : [];
|
||||
} else {
|
||||
logger.error(`Getting scopes failed: ${result.statusText}`);
|
||||
throw new Error(result.statusText);
|
||||
}
|
||||
} catch (ex) {
|
||||
logger.error(ex.message);
|
||||
throw new Error(NETWORK_ERROR);
|
||||
env.openExternal(Uri.parse(`http://127.0.0.1:${port}/signin?nonce=${encodeURIComponent(server.nonce)}`));
|
||||
const { code } = await Promise.race([
|
||||
server.waitForOAuthResponse(),
|
||||
new Promise<any>((_, reject) => setTimeout(() => reject(TIMED_OUT_ERROR), 300_000)), // 5min timeout
|
||||
promiseFromEvent<any, any>(token.onCancellationRequested, (_, __, reject) => { reject(USER_CANCELLATION_ERROR); }).promise
|
||||
]);
|
||||
codeToExchange = code;
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
void server.stop();
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
const accessToken = await exchangeCodeForToken(
|
||||
logger,
|
||||
baseUri.with({ path: '/login/oauth/access_token' }),
|
||||
redirectUri,
|
||||
codeToExchange,
|
||||
enterpriseUri);
|
||||
return accessToken;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class DeviceCodeFlow implements IFlow {
|
||||
label = l10n.t('device code');
|
||||
options: IFlowOptions = {
|
||||
supportsGitHubDotCom: true,
|
||||
supportsGitHubEnterpriseServer: true,
|
||||
supportsHostedGitHubEnterprise: true,
|
||||
supportsRemoteExtensionHost: true,
|
||||
// CORS prevents this from working in web workers
|
||||
supportsWebWorkerExtensionHost: false,
|
||||
supportsNoClientSecret: true,
|
||||
supportsSupportedClients: true,
|
||||
supportsUnsupportedClients: true
|
||||
};
|
||||
async trigger({ scopes, baseUri, logger }: IFlowTriggerOptions) {
|
||||
logger.info(`Trying device code flow... (${scopes})`);
|
||||
|
||||
// Get initial device code
|
||||
const uri = baseUri.with({
|
||||
path: '/login/device/code',
|
||||
query: `client_id=${Config.gitHubClientId}&scope=${scopes}`
|
||||
});
|
||||
const result = await fetching(uri.toString(true), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Accept: 'application/json'
|
||||
}
|
||||
});
|
||||
if (!result.ok) {
|
||||
throw new Error(`Failed to get one-time code: ${await result.text()}`);
|
||||
}
|
||||
|
||||
const json = await result.json() as IGitHubDeviceCodeResponse;
|
||||
|
||||
const button = l10n.t('Copy & Continue to GitHub');
|
||||
const modalResult = await window.showInformationMessage(
|
||||
l10n.t({ message: 'Your Code: {0}', args: [json.user_code], comment: ['The {0} will be a code, e.g. 123-456'] }),
|
||||
{
|
||||
modal: true,
|
||||
detail: l10n.t('To finish authenticating, navigate to GitHub and paste in the above one-time code.')
|
||||
}, button);
|
||||
|
||||
if (modalResult !== button) {
|
||||
throw new Error(USER_CANCELLATION_ERROR);
|
||||
}
|
||||
|
||||
await env.clipboard.writeText(json.user_code);
|
||||
|
||||
const uriToOpen = await env.asExternalUri(Uri.parse(json.verification_uri));
|
||||
await env.openExternal(uriToOpen);
|
||||
|
||||
return await this.waitForDeviceCodeAccessToken(baseUri, json);
|
||||
}
|
||||
|
||||
private async waitForDeviceCodeAccessToken(
|
||||
baseUri: Uri,
|
||||
json: IGitHubDeviceCodeResponse,
|
||||
): Promise<string> {
|
||||
return await window.withProgress<string>({
|
||||
location: ProgressLocation.Notification,
|
||||
cancellable: true,
|
||||
title: l10n.t({
|
||||
message: 'Open [{0}]({0}) in a new tab and paste your one-time code: {1}',
|
||||
args: [json.verification_uri, json.user_code],
|
||||
comment: [
|
||||
'The [{0}]({0}) will be a url and the {1} will be a code, e.g. 123-456',
|
||||
'{Locked="[{0}]({0})"}'
|
||||
]
|
||||
})
|
||||
}, async (_, token) => {
|
||||
const refreshTokenUri = baseUri.with({
|
||||
path: '/login/oauth/access_token',
|
||||
query: `client_id=${Config.gitHubClientId}&device_code=${json.device_code}&grant_type=urn:ietf:params:oauth:grant-type:device_code`
|
||||
});
|
||||
|
||||
// Try for 2 minutes
|
||||
const attempts = 120 / json.interval;
|
||||
for (let i = 0; i < attempts; i++) {
|
||||
await new Promise(resolve => setTimeout(resolve, json.interval * 1000));
|
||||
if (token.isCancellationRequested) {
|
||||
throw new Error(USER_CANCELLATION_ERROR);
|
||||
}
|
||||
let accessTokenResult;
|
||||
try {
|
||||
accessTokenResult = await fetching(refreshTokenUri.toString(true), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Accept: 'application/json'
|
||||
}
|
||||
});
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!accessTokenResult.ok) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const accessTokenJson = await accessTokenResult.json();
|
||||
|
||||
if (accessTokenJson.error === 'authorization_pending') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (accessTokenJson.error) {
|
||||
throw new Error(accessTokenJson.error_description);
|
||||
}
|
||||
|
||||
return accessTokenJson.access_token;
|
||||
}
|
||||
|
||||
throw new Error(TIMED_OUT_ERROR);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class PatFlow implements IFlow {
|
||||
label = l10n.t('personal access token');
|
||||
options: IFlowOptions = {
|
||||
supportsGitHubDotCom: true,
|
||||
supportsGitHubEnterpriseServer: true,
|
||||
supportsHostedGitHubEnterprise: true,
|
||||
supportsRemoteExtensionHost: true,
|
||||
supportsWebWorkerExtensionHost: true,
|
||||
supportsNoClientSecret: true,
|
||||
// PATs can't be used with Settings Sync so we don't enable this flow
|
||||
// for supported clients
|
||||
supportsSupportedClients: false,
|
||||
supportsUnsupportedClients: true
|
||||
};
|
||||
|
||||
async trigger({ scopes, baseUri, logger, enterpriseUri }: IFlowTriggerOptions) {
|
||||
logger.info(`Trying to retrieve PAT... (${scopes})`);
|
||||
|
||||
const button = l10n.t('Continue to GitHub');
|
||||
const modalResult = await window.showInformationMessage(
|
||||
l10n.t('Continue to GitHub to create a Personal Access Token (PAT)'),
|
||||
{
|
||||
modal: true,
|
||||
detail: l10n.t('To finish authenticating, navigate to GitHub to create a PAT then paste the PAT into the input box.')
|
||||
}, button);
|
||||
|
||||
if (modalResult !== button) {
|
||||
throw new Error(USER_CANCELLATION_ERROR);
|
||||
}
|
||||
|
||||
const description = `${env.appName} (${scopes})`;
|
||||
const uriToOpen = await env.asExternalUri(baseUri.with({ path: '/settings/tokens/new', query: `description=${description}&scopes=${scopes.split(' ').join(',')}` }));
|
||||
await env.openExternal(uriToOpen);
|
||||
const token = await window.showInputBox({ placeHolder: `ghp_1a2b3c4...`, prompt: `GitHub Personal Access Token - ${scopes}`, ignoreFocusOut: true });
|
||||
if (!token) { throw new Error(USER_CANCELLATION_ERROR); }
|
||||
|
||||
const appUri = !enterpriseUri || isHostedGitHubEnterprise(enterpriseUri)
|
||||
? Uri.parse(`${baseUri.scheme}://api.${baseUri.authority}`)
|
||||
: Uri.parse(`${baseUri.scheme}://${baseUri.authority}/api/v3`);
|
||||
|
||||
const tokenScopes = await this.getScopes(token, appUri, logger); // Example: ['repo', 'user']
|
||||
const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
|
||||
if (!scopesList.every(scope => {
|
||||
const included = tokenScopes.includes(scope);
|
||||
if (included || !scope.includes(':')) {
|
||||
return included;
|
||||
}
|
||||
|
||||
return scope.split(':').some(splitScopes => {
|
||||
return tokenScopes.includes(splitScopes);
|
||||
});
|
||||
})) {
|
||||
throw new Error(`The provided token does not match the requested scopes: ${scopes}`);
|
||||
}
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
private async getScopes(token: string, serverUri: Uri, logger: Log): Promise<string[]> {
|
||||
try {
|
||||
logger.info('Getting token scopes...');
|
||||
const result = await fetching(serverUri.toString(), {
|
||||
headers: {
|
||||
Authorization: `token ${token}`,
|
||||
'User-Agent': `${env.appName} (${env.appHost})`
|
||||
}
|
||||
});
|
||||
|
||||
if (result.ok) {
|
||||
const scopes = result.headers.get('X-OAuth-Scopes');
|
||||
return scopes ? scopes.split(',').map(scope => scope.trim()) : [];
|
||||
} else {
|
||||
logger.error(`Getting scopes failed: ${result.statusText}`);
|
||||
throw new Error(result.statusText);
|
||||
}
|
||||
} catch (ex) {
|
||||
logger.error(ex.message);
|
||||
throw new Error(NETWORK_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const allFlows: IFlow[] = [
|
||||
new LocalServerFlow(),
|
||||
new UrlHandlerFlow(),
|
||||
new DeviceCodeFlow(),
|
||||
new PatFlow()
|
||||
];
|
||||
|
||||
export function getFlows(query: IFlowQuery) {
|
||||
|
||||
@@ -82,7 +82,7 @@ export class LoopbackAuthServer implements ILoopbackServer {
|
||||
return this._startingRedirect.searchParams.get('state') ?? undefined;
|
||||
}
|
||||
|
||||
constructor(serveRoot: string, startingRedirect: string) {
|
||||
constructor(serveRoot: string, startingRedirect: string, callbackUri: string) {
|
||||
if (!serveRoot) {
|
||||
throw new Error('serveRoot must be defined');
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export class LoopbackAuthServer implements ILoopbackServer {
|
||||
throw new Error('Nonce does not match.');
|
||||
}
|
||||
deferred.resolve({ code, state });
|
||||
res.writeHead(302, { location: '/' });
|
||||
res.writeHead(302, { location: `/?redirect_uri=${encodeURIComponent(callbackUri)}` });
|
||||
res.end();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ suite('getFlows', () => {
|
||||
target: GitHubTarget.DotCom
|
||||
},
|
||||
expectedFlows: [
|
||||
Flows.UrlHandlerFlow,
|
||||
Flows.LocalServerFlow,
|
||||
Flows.UrlHandlerFlow,
|
||||
Flows.DeviceCodeFlow
|
||||
]
|
||||
},
|
||||
@@ -47,8 +47,8 @@ suite('getFlows', () => {
|
||||
target: GitHubTarget.HostedEnterprise
|
||||
},
|
||||
expectedFlows: [
|
||||
Flows.UrlHandlerFlow,
|
||||
Flows.LocalServerFlow,
|
||||
Flows.UrlHandlerFlow,
|
||||
Flows.DeviceCodeFlow,
|
||||
Flows.PatFlow
|
||||
]
|
||||
|
||||
@@ -11,7 +11,7 @@ suite('LoopbackAuthServer', () => {
|
||||
let port: number;
|
||||
|
||||
setup(async () => {
|
||||
server = new LoopbackAuthServer(__dirname, 'http://localhost:8080');
|
||||
server = new LoopbackAuthServer(__dirname, 'http://localhost:8080', 'https://code.visualstudio.com');
|
||||
port = await server.start();
|
||||
});
|
||||
|
||||
@@ -53,7 +53,7 @@ suite('LoopbackAuthServer', () => {
|
||||
{ redirect: 'manual' }
|
||||
);
|
||||
assert.strictEqual(response.status, 302);
|
||||
assert.strictEqual(response.headers.get('location'), '/');
|
||||
assert.strictEqual(response.headers.get('location'), '/?redirect_uri=https%3A%2F%2Fcode.visualstudio.com');
|
||||
await Promise.race([
|
||||
server.waitForOAuthResponse().then(result => {
|
||||
assert.strictEqual(result.code, 'valid-code');
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { AuthenticationSession, authentication, window } from 'vscode';
|
||||
import { AuthenticationSession, EventEmitter, authentication, window } from 'vscode';
|
||||
import { Agent, globalAgent } from 'https';
|
||||
import { graphql } from '@octokit/graphql/types';
|
||||
import { Octokit } from '@octokit/rest';
|
||||
import { httpsOverHttp } from 'tunnel';
|
||||
import { URL } from 'url';
|
||||
import { DisposableStore, sequentialize } from './util.js';
|
||||
|
||||
export class AuthenticationError extends Error { }
|
||||
|
||||
@@ -57,35 +58,58 @@ export function getOctokit(): Promise<Octokit> {
|
||||
return _octokit;
|
||||
}
|
||||
|
||||
let _octokitGraphql: graphql | undefined;
|
||||
export class OctokitService {
|
||||
private _octokitGraphql: graphql | undefined;
|
||||
|
||||
export async function getOctokitGraphql(): Promise<graphql> {
|
||||
if (!_octokitGraphql) {
|
||||
try {
|
||||
const session = await authentication.getSession('github', scopes, { silent: true });
|
||||
private readonly _onDidChangeSessions = new EventEmitter<void>();
|
||||
readonly onDidChangeSessions = this._onDidChangeSessions.event;
|
||||
|
||||
if (!session) {
|
||||
throw new AuthenticationError('No GitHub authentication session available.');
|
||||
private readonly _disposables = new DisposableStore();
|
||||
|
||||
constructor() {
|
||||
this._disposables.add(this._onDidChangeSessions);
|
||||
this._disposables.add(authentication.onDidChangeSessions(e => {
|
||||
if (e.provider.id === 'github') {
|
||||
this._octokitGraphql = undefined;
|
||||
this._onDidChangeSessions.fire();
|
||||
}
|
||||
|
||||
const token = session.accessToken;
|
||||
const { graphql } = await import('@octokit/graphql');
|
||||
|
||||
_octokitGraphql = graphql.defaults({
|
||||
headers: {
|
||||
authorization: `token ${token}`
|
||||
},
|
||||
request: {
|
||||
agent: getAgent()
|
||||
}
|
||||
});
|
||||
|
||||
return _octokitGraphql;
|
||||
} catch (err) {
|
||||
_octokitGraphql = undefined;
|
||||
throw new AuthenticationError(err.message);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
return _octokitGraphql;
|
||||
@sequentialize
|
||||
public async getOctokitGraphql(): Promise<graphql> {
|
||||
if (!this._octokitGraphql) {
|
||||
try {
|
||||
const session = await authentication.getSession('github', scopes, { silent: true });
|
||||
|
||||
if (!session) {
|
||||
throw new AuthenticationError('No GitHub authentication session available.');
|
||||
}
|
||||
|
||||
const token = session.accessToken;
|
||||
const { graphql } = await import('@octokit/graphql');
|
||||
|
||||
this._octokitGraphql = graphql.defaults({
|
||||
headers: {
|
||||
authorization: `token ${token}`
|
||||
},
|
||||
request: {
|
||||
agent: getAgent()
|
||||
}
|
||||
});
|
||||
|
||||
return this._octokitGraphql;
|
||||
} catch (err) {
|
||||
this._octokitGraphql = undefined;
|
||||
throw new AuthenticationError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
return this._octokitGraphql;
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this._octokitGraphql = undefined;
|
||||
this._disposables.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { authentication, EventEmitter, LogOutputChannel, Memento, Uri, workspace } from 'vscode';
|
||||
import { EventEmitter, LogOutputChannel, Memento, Uri, workspace } from 'vscode';
|
||||
import { Repository as GitHubRepository, RepositoryRuleset } from '@octokit/graphql-schema';
|
||||
import { AuthenticationError, getOctokitGraphql } from './auth.js';
|
||||
import { AuthenticationError, OctokitService } from './auth.js';
|
||||
import { API, BranchProtection, BranchProtectionProvider, BranchProtectionRule, Repository } from './typings/git.js';
|
||||
import { DisposableStore, getRepositoryFromUrl } from './util.js';
|
||||
import { TelemetryReporter } from '@vscode/extension-telemetry';
|
||||
@@ -61,7 +61,7 @@ export class GitHubBranchProtectionProviderManager {
|
||||
|
||||
if (enabled) {
|
||||
for (const repository of this.gitAPI.repositories) {
|
||||
this.providerDisposables.add(this.gitAPI.registerBranchProtectionProvider(repository.rootUri, new GitHubBranchProtectionProvider(repository, this.globalState, this.logger, this.telemetryReporter)));
|
||||
this.providerDisposables.add(this.gitAPI.registerBranchProtectionProvider(repository.rootUri, new GitHubBranchProtectionProvider(repository, this.globalState, this.octokitService, this.logger, this.telemetryReporter)));
|
||||
}
|
||||
} else {
|
||||
this.providerDisposables.dispose();
|
||||
@@ -73,11 +73,13 @@ export class GitHubBranchProtectionProviderManager {
|
||||
constructor(
|
||||
private readonly gitAPI: API,
|
||||
private readonly globalState: Memento,
|
||||
private readonly octokitService: OctokitService,
|
||||
private readonly logger: LogOutputChannel,
|
||||
private readonly telemetryReporter: TelemetryReporter) {
|
||||
this.disposables.add(this.gitAPI.onDidOpenRepository(repository => {
|
||||
if (this._enabled) {
|
||||
this.providerDisposables.add(gitAPI.registerBranchProtectionProvider(repository.rootUri, new GitHubBranchProtectionProvider(repository, this.globalState, this.logger, this.telemetryReporter)));
|
||||
this.providerDisposables.add(gitAPI.registerBranchProtectionProvider(repository.rootUri,
|
||||
new GitHubBranchProtectionProvider(repository, this.globalState, this.octokitService, this.logger, this.telemetryReporter)));
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -109,20 +111,24 @@ export class GitHubBranchProtectionProvider implements BranchProtectionProvider
|
||||
private branchProtection: BranchProtection[];
|
||||
private readonly globalStateKey = `branchProtection:${this.repository.rootUri.toString()}`;
|
||||
|
||||
private readonly disposables = new DisposableStore();
|
||||
|
||||
constructor(
|
||||
private readonly repository: Repository,
|
||||
private readonly globalState: Memento,
|
||||
private readonly octokitService: OctokitService,
|
||||
private readonly logger: LogOutputChannel,
|
||||
private readonly telemetryReporter: TelemetryReporter) {
|
||||
private readonly telemetryReporter: TelemetryReporter
|
||||
) {
|
||||
this.disposables.add(this._onDidChangeBranchProtection);
|
||||
|
||||
// Restore branch protection from global state
|
||||
this.branchProtection = this.globalState.get<BranchProtection[]>(this.globalStateKey, []);
|
||||
|
||||
repository.status().then(() => {
|
||||
authentication.onDidChangeSessions(e => {
|
||||
if (e.provider.id === 'github') {
|
||||
this.updateRepositoryBranchProtection();
|
||||
}
|
||||
});
|
||||
this.disposables.add(this.octokitService.onDidChangeSessions(() => {
|
||||
this.updateRepositoryBranchProtection();
|
||||
}));
|
||||
this.updateRepositoryBranchProtection();
|
||||
});
|
||||
}
|
||||
@@ -132,7 +138,7 @@ export class GitHubBranchProtectionProvider implements BranchProtectionProvider
|
||||
}
|
||||
|
||||
private async getRepositoryDetails(owner: string, repo: string): Promise<GitHubRepository> {
|
||||
const graphql = await getOctokitGraphql();
|
||||
const graphql = await this.octokitService.getOctokitGraphql();
|
||||
const { repository } = await graphql<{ repository: GitHubRepository }>(REPOSITORY_QUERY, { owner, repo });
|
||||
|
||||
return repository;
|
||||
@@ -142,7 +148,7 @@ export class GitHubBranchProtectionProvider implements BranchProtectionProvider
|
||||
const rulesets: RepositoryRuleset[] = [];
|
||||
|
||||
let cursor: string | undefined = undefined;
|
||||
const graphql = await getOctokitGraphql();
|
||||
const graphql = await this.octokitService.getOctokitGraphql();
|
||||
|
||||
while (true) {
|
||||
const { repository } = await graphql<{ repository: GitHubRepository }>(REPOSITORY_RULESETS_QUERY, { owner, repo, cursor });
|
||||
@@ -241,4 +247,8 @@ export class GitHubBranchProtectionProvider implements BranchProtectionProvider
|
||||
return refName;
|
||||
}
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.disposables.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import { GitHubBranchProtectionProviderManager } from './branchProtection.js';
|
||||
import { GitHubCanonicalUriProvider } from './canonicalUriProvider.js';
|
||||
import { VscodeDevShareProvider } from './shareProviders.js';
|
||||
import { GitHubSourceControlHistoryItemDetailsProvider } from './historyItemDetailsProvider.js';
|
||||
import { OctokitService } from './auth.js';
|
||||
|
||||
export function activate(context: ExtensionContext): void {
|
||||
const disposables: Disposable[] = [];
|
||||
@@ -35,8 +36,11 @@ export function activate(context: ExtensionContext): void {
|
||||
const telemetryReporter = new TelemetryReporter(aiKey);
|
||||
disposables.push(telemetryReporter);
|
||||
|
||||
const octokitService = new OctokitService();
|
||||
disposables.push(octokitService);
|
||||
|
||||
disposables.push(initializeGitBaseExtension());
|
||||
disposables.push(initializeGitExtension(context, telemetryReporter, logger));
|
||||
disposables.push(initializeGitExtension(context, octokitService, telemetryReporter, logger));
|
||||
}
|
||||
|
||||
function initializeGitBaseExtension(): Disposable {
|
||||
@@ -84,7 +88,7 @@ function setGitHubContext(gitAPI: API, disposables: DisposableStore) {
|
||||
}
|
||||
}
|
||||
|
||||
function initializeGitExtension(context: ExtensionContext, telemetryReporter: TelemetryReporter, logger: LogOutputChannel): Disposable {
|
||||
function initializeGitExtension(context: ExtensionContext, octokitService: OctokitService, telemetryReporter: TelemetryReporter, logger: LogOutputChannel): Disposable {
|
||||
const disposables = new DisposableStore();
|
||||
|
||||
let gitExtension = extensions.getExtension<GitExtension>('vscode.git');
|
||||
@@ -98,10 +102,10 @@ function initializeGitExtension(context: ExtensionContext, telemetryReporter: Te
|
||||
|
||||
disposables.add(registerCommands(gitAPI));
|
||||
disposables.add(new GithubCredentialProviderManager(gitAPI));
|
||||
disposables.add(new GitHubBranchProtectionProviderManager(gitAPI, context.globalState, logger, telemetryReporter));
|
||||
disposables.add(new GitHubBranchProtectionProviderManager(gitAPI, context.globalState, octokitService, logger, telemetryReporter));
|
||||
disposables.add(gitAPI.registerPushErrorHandler(new GithubPushErrorHandler(telemetryReporter)));
|
||||
disposables.add(gitAPI.registerRemoteSourcePublisher(new GithubRemoteSourcePublisher(gitAPI)));
|
||||
disposables.add(gitAPI.registerSourceControlHistoryItemDetailsProvider(new GitHubSourceControlHistoryItemDetailsProvider(gitAPI, logger)));
|
||||
disposables.add(gitAPI.registerSourceControlHistoryItemDetailsProvider(new GitHubSourceControlHistoryItemDetailsProvider(gitAPI, octokitService, logger)));
|
||||
disposables.add(new GitHubCanonicalUriProvider(gitAPI));
|
||||
disposables.add(new VscodeDevShareProvider(gitAPI));
|
||||
setGitHubContext(gitAPI, disposables);
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { authentication, Command, l10n, LogOutputChannel, workspace } from 'vscode';
|
||||
import { Command, l10n, LogOutputChannel, workspace } from 'vscode';
|
||||
import { Commit, Repository as GitHubRepository, Maybe } from '@octokit/graphql-schema';
|
||||
import { API, AvatarQuery, AvatarQueryCommit, Repository, SourceControlHistoryItemDetailsProvider } from './typings/git.js';
|
||||
import { DisposableStore, getRepositoryDefaultRemote, getRepositoryDefaultRemoteUrl, getRepositoryFromUrl, groupBy, sequentialize } from './util.js';
|
||||
import { AuthenticationError, getOctokitGraphql } from './auth.js';
|
||||
import { AuthenticationError, OctokitService } from './auth.js';
|
||||
import { getAvatarLink } from './links.js';
|
||||
|
||||
const ISSUE_EXPRESSION = /(([A-Za-z0-9_.\-]+)\/([A-Za-z0-9_.\-]+))?(#|GH-)([1-9][0-9]*)($|\b)/g;
|
||||
@@ -82,13 +82,16 @@ export class GitHubSourceControlHistoryItemDetailsProvider implements SourceCont
|
||||
private readonly _store = new Map<string, GitHubRepositoryStore>();
|
||||
private readonly _disposables = new DisposableStore();
|
||||
|
||||
constructor(private readonly _gitAPI: API, private readonly _logger: LogOutputChannel) {
|
||||
constructor(
|
||||
private readonly _gitAPI: API,
|
||||
private readonly _octokitService: OctokitService,
|
||||
private readonly _logger: LogOutputChannel
|
||||
) {
|
||||
this._disposables.add(this._gitAPI.onDidCloseRepository(repository => this._onDidCloseRepository(repository)));
|
||||
|
||||
this._disposables.add(authentication.onDidChangeSessions(e => {
|
||||
if (e.provider.id === 'github') {
|
||||
this._isUserAuthenticated = true;
|
||||
}
|
||||
this._disposables.add(this._octokitService.onDidChangeSessions(() => {
|
||||
this._isUserAuthenticated = true;
|
||||
this._store.clear();
|
||||
}));
|
||||
|
||||
this._disposables.add(workspace.onDidChangeConfiguration(e => {
|
||||
@@ -264,7 +267,7 @@ export class GitHubSourceControlHistoryItemDetailsProvider implements SourceCont
|
||||
this._logger.trace(`[GitHubSourceControlHistoryItemDetailsProvider][_loadAssignableUsers] Querying assignable user(s) for ${descriptor.owner}/${descriptor.repo}.`);
|
||||
|
||||
try {
|
||||
const graphql = await getOctokitGraphql();
|
||||
const graphql = await this._octokitService.getOctokitGraphql();
|
||||
const { repository } = await graphql<{ repository: GitHubRepository }>(ASSIGNABLE_USERS_QUERY, descriptor);
|
||||
|
||||
const users: GitHubUser[] = [];
|
||||
@@ -294,7 +297,7 @@ export class GitHubSourceControlHistoryItemDetailsProvider implements SourceCont
|
||||
this._logger.trace(`[GitHubSourceControlHistoryItemDetailsProvider][_getCommitAuthor] Querying commit author for ${descriptor.owner}/${descriptor.repo}/${commit}.`);
|
||||
|
||||
try {
|
||||
const graphql = await getOctokitGraphql();
|
||||
const graphql = await this._octokitService.getOctokitGraphql();
|
||||
const { repository } = await graphql<{ repository: GitHubRepository }>(COMMIT_AUTHOR_QUERY, { ...descriptor, commit });
|
||||
|
||||
const commitAuthor = (repository.object as Commit).author;
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"comments": {
|
||||
"lineComment": "#"
|
||||
"lineComment": {
|
||||
"comment": "#",
|
||||
"noIndent": true
|
||||
}
|
||||
},
|
||||
"brackets": [
|
||||
[
|
||||
|
||||
@@ -156,7 +156,6 @@ export function scrollToRevealSourceLine(line: number, documentVersion: number,
|
||||
const progressInElement = line - Math.floor(line);
|
||||
scrollTo = previousTop + (rect.height * progressInElement);
|
||||
}
|
||||
scrollTo = Math.abs(scrollTo) < 1 ? Math.sign(scrollTo) : scrollTo;
|
||||
window.scroll(window.scrollX, Math.max(1, window.scrollY + scrollTo));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,12 +31,11 @@ export async function getFigSuggestions(
|
||||
specs: Fig.Spec[],
|
||||
terminalContext: { commandLine: string; cursorPosition: number },
|
||||
availableCommands: ICompletionResource[],
|
||||
prefix: string,
|
||||
currentCommandAndArgString: string,
|
||||
tokenType: TokenType,
|
||||
shellIntegrationCwd: vscode.Uri | undefined,
|
||||
env: Record<string, string>,
|
||||
name: string,
|
||||
precedingText: string,
|
||||
executeExternals: IFigExecuteExternals,
|
||||
token?: vscode.CancellationToken,
|
||||
): Promise<IFigSpecSuggestionsResult> {
|
||||
@@ -46,6 +45,7 @@ export async function getFigSuggestions(
|
||||
hasCurrentArg: false,
|
||||
items: [],
|
||||
};
|
||||
const currentCommand = currentCommandAndArgString.split(' ')[0];
|
||||
for (const spec of specs) {
|
||||
const specLabels = getFigSuggestionLabel(spec);
|
||||
|
||||
@@ -66,7 +66,7 @@ export async function getFigSuggestions(
|
||||
const description = getFixSuggestionDescription(spec);
|
||||
result.items.push(createCompletionItem(
|
||||
terminalContext.cursorPosition,
|
||||
prefix,
|
||||
currentCommandAndArgString,
|
||||
{
|
||||
label: { label: specLabel, description },
|
||||
kind: vscode.TerminalCompletionItemKind.Method
|
||||
@@ -83,8 +83,8 @@ export async function getFigSuggestions(
|
||||
: availableCommands.filter(command => specLabel === (command.definitionCommand ?? (typeof command.label === 'string' ? command.label : command.label.label))));
|
||||
if (
|
||||
!(osIsWindows()
|
||||
? commandAndAliases.some(e => precedingText.startsWith(`${removeAnyFileExtension((typeof e.label === 'string' ? e.label : e.label.label))} `))
|
||||
: commandAndAliases.some(e => precedingText.startsWith(`${typeof e.label === 'string' ? e.label : e.label.label} `)))
|
||||
? commandAndAliases.some(e => currentCommand.startsWith(removeAnyFileExtension((typeof e.label === 'string' ? e.label : e.label.label))))
|
||||
: commandAndAliases.some(e => currentCommand.startsWith(typeof e.label === 'string' ? e.label : e.label.label)))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ export async function getFigSuggestions(
|
||||
if (!actualSpec) {
|
||||
continue;
|
||||
}
|
||||
const completionItemResult = await getFigSpecSuggestions(actualSpec, terminalContext, prefix, shellIntegrationCwd, env, name, executeExternals, token);
|
||||
const completionItemResult = await getFigSpecSuggestions(actualSpec, terminalContext, currentCommandAndArgString, shellIntegrationCwd, env, name, executeExternals, token);
|
||||
result.hasCurrentArg ||= !!completionItemResult?.hasCurrentArg;
|
||||
if (completionItemResult) {
|
||||
result.filesRequested ||= completionItemResult.filesRequested;
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
import * as vscode from 'vscode';
|
||||
import type { ICompletionResource } from '../types';
|
||||
|
||||
export function createCompletionItem(cursorPosition: number, prefix: string, commandResource: ICompletionResource, detail?: string, documentation?: string | vscode.MarkdownString, kind?: vscode.TerminalCompletionItemKind): vscode.TerminalCompletionItem {
|
||||
const endsWithSpace = prefix.endsWith(' ');
|
||||
const lastWord = endsWithSpace ? '' : prefix.split(' ').at(-1) ?? '';
|
||||
export function createCompletionItem(cursorPosition: number, currentCommandString: string, commandResource: ICompletionResource, detail?: string, documentation?: string | vscode.MarkdownString, kind?: vscode.TerminalCompletionItemKind): vscode.TerminalCompletionItem {
|
||||
const endsWithSpace = currentCommandString.endsWith(' ');
|
||||
const lastWord = endsWithSpace ? '' : currentCommandString.split(' ').at(-1) ?? '';
|
||||
return {
|
||||
label: commandResource.label,
|
||||
detail: detail ?? commandResource.detail ?? '',
|
||||
|
||||
@@ -20,7 +20,7 @@ import { getBashGlobals } from './shell/bash';
|
||||
import { getFishGlobals } from './shell/fish';
|
||||
import { getPwshGlobals } from './shell/pwsh';
|
||||
import { getZshGlobals } from './shell/zsh';
|
||||
import { getTokenType, TokenType } from './tokens';
|
||||
import { getTokenType, TokenType, shellTypeResetChars, defaultShellTypeResetChars } from './tokens';
|
||||
import type { ICompletionResource } from './types';
|
||||
import { createCompletionItem } from './helpers/completionItem';
|
||||
import { getFigSuggestions } from './fig/figInterface';
|
||||
@@ -58,6 +58,7 @@ for (const spec of upstreamSpecs) {
|
||||
const getShellSpecificGlobals: Map<TerminalShellType, (options: ExecOptionsWithStringEncoding, existingCommands?: Set<string>) => Promise<(string | ICompletionResource)[]>> = new Map([
|
||||
[TerminalShellType.Bash, getBashGlobals],
|
||||
[TerminalShellType.Zsh, getZshGlobals],
|
||||
[TerminalShellType.GitBash, getBashGlobals], // Git Bash is a bash shell
|
||||
// TODO: Ghost text in the command line prevents completions from working ATM for fish
|
||||
[TerminalShellType.Fish, getFishGlobals],
|
||||
[TerminalShellType.PowerShell, getPwshGlobals],
|
||||
@@ -72,7 +73,11 @@ async function getShellGlobals(shellType: TerminalShellType, existingCommands?:
|
||||
if (!shellType) {
|
||||
return;
|
||||
}
|
||||
const options: ExecOptionsWithStringEncoding = { encoding: 'utf-8', shell: shellType };
|
||||
let execShellType = shellType;
|
||||
if (shellType === TerminalShellType.GitBash) {
|
||||
execShellType = TerminalShellType.Bash; // Git Bash is a bash shell
|
||||
}
|
||||
const options: ExecOptionsWithStringEncoding = { encoding: 'utf-8', shell: execShellType, windowsHide: true };
|
||||
const mixedCommands: (string | ICompletionResource)[] | undefined = await getShellSpecificGlobals.get(shellType)?.(options, existingCommands);
|
||||
const normalizedCommands = mixedCommands?.map(command => typeof command === 'string' ? ({ label: command }) : command);
|
||||
cachedGlobals.set(shellType, normalizedCommands);
|
||||
@@ -113,7 +118,7 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
// Order is important here, add shell globals first so they are prioritized over path commands
|
||||
const commands = [...shellGlobals, ...commandsInPath.completionResources];
|
||||
const prefix = getPrefix(terminalContext.commandLine, terminalContext.cursorPosition);
|
||||
const currentCommandString = getCurrentCommandAndArgs(terminalContext.commandLine, terminalContext.cursorPosition, terminalShellType);
|
||||
const pathSeparator = isWindows ? '\\' : '/';
|
||||
const tokenType = getTokenType(terminalContext, terminalShellType);
|
||||
const result = await Promise.race([
|
||||
@@ -121,7 +126,7 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
availableSpecs,
|
||||
terminalContext,
|
||||
commands,
|
||||
prefix,
|
||||
currentCommandString,
|
||||
tokenType,
|
||||
terminal.shellIntegration?.cwd,
|
||||
getEnvAsRecord(currentTerminalEnv),
|
||||
@@ -143,7 +148,13 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
|
||||
if (terminal.shellIntegration?.cwd && (result.filesRequested || result.foldersRequested)) {
|
||||
return new vscode.TerminalCompletionList(result.items, { filesRequested: result.filesRequested, foldersRequested: result.foldersRequested, fileExtensions: result.fileExtensions, cwd: result.cwd ?? terminal.shellIntegration.cwd, env: terminal.shellIntegration?.env?.value, });
|
||||
return new vscode.TerminalCompletionList(result.items, {
|
||||
filesRequested: result.filesRequested,
|
||||
foldersRequested: result.foldersRequested,
|
||||
fileExtensions: result.fileExtensions,
|
||||
cwd: result.cwd ?? terminal.shellIntegration.cwd,
|
||||
env: terminal.shellIntegration?.env?.value,
|
||||
});
|
||||
}
|
||||
return result.items;
|
||||
}
|
||||
@@ -152,12 +163,14 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts the current working directory based on a given prefix if it is a folder.
|
||||
* @param prefix - The folder path prefix.
|
||||
* Adjusts the current working directory based on a given current command string if it is a folder.
|
||||
* @param currentCommandString - The current command string, which might contain a folder path prefix.
|
||||
* @param currentCwd - The current working directory.
|
||||
* @returns The new working directory.
|
||||
*/
|
||||
export async function resolveCwdFromPrefix(prefix: string, currentCwd?: vscode.Uri): Promise<vscode.Uri | undefined> {
|
||||
export async function resolveCwdFromCurrentCommandString(currentCommandString: string, currentCwd?: vscode.Uri): Promise<vscode.Uri | undefined> {
|
||||
const prefix = currentCommandString.split(/\s+/).pop()?.trim() ?? '';
|
||||
|
||||
if (!currentCwd) {
|
||||
return;
|
||||
}
|
||||
@@ -195,7 +208,10 @@ export async function resolveCwdFromPrefix(prefix: string, currentCwd?: vscode.U
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getPrefix(commandLine: string, cursorPosition: number): string {
|
||||
// Retrurns the string that represents the current command and its arguments up to the cursor position.
|
||||
// Uses shell specific separators to determine the current command and its arguments.
|
||||
export function getCurrentCommandAndArgs(commandLine: string, cursorPosition: number, shellType: TerminalShellType | undefined): string {
|
||||
|
||||
// Return an empty string if the command line is empty after trimming
|
||||
if (commandLine.trim() === '') {
|
||||
return '';
|
||||
@@ -209,11 +225,21 @@ function getPrefix(commandLine: string, cursorPosition: number): string {
|
||||
// Extract the part of the line up to the cursor position
|
||||
const beforeCursor = commandLine.slice(0, cursorPosition);
|
||||
|
||||
// Find the last sequence of non-whitespace characters before the cursor
|
||||
const match = beforeCursor.match(/(\S+)\s*$/);
|
||||
const resetChars = shellType ? shellTypeResetChars.get(shellType) ?? defaultShellTypeResetChars : defaultShellTypeResetChars;
|
||||
// Find the last reset character before the cursor
|
||||
let lastResetIndex = -1;
|
||||
for (const char of resetChars) {
|
||||
const idx = beforeCursor.lastIndexOf(char);
|
||||
if (idx > lastResetIndex) {
|
||||
lastResetIndex = idx;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the match if found, otherwise undefined
|
||||
return match ? match[0] : '';
|
||||
// The start of the current command string is after the last reset char (plus one for the char itself)
|
||||
const currentCommandStart = lastResetIndex + 1;
|
||||
const currentCommandString = beforeCursor.slice(currentCommandStart).replace(/^\s+/, '');
|
||||
|
||||
return currentCommandString;
|
||||
}
|
||||
|
||||
export function asArray<T>(x: T | T[]): T[];
|
||||
@@ -226,7 +252,7 @@ export async function getCompletionItemsFromSpecs(
|
||||
specs: Fig.Spec[],
|
||||
terminalContext: vscode.TerminalCompletionContext,
|
||||
availableCommands: ICompletionResource[],
|
||||
prefix: string,
|
||||
currentCommandString: string,
|
||||
tokenType: TokenType,
|
||||
shellIntegrationCwd: vscode.Uri | undefined,
|
||||
env: Record<string, string>,
|
||||
@@ -240,17 +266,16 @@ export async function getCompletionItemsFromSpecs(
|
||||
let hasCurrentArg = false;
|
||||
let fileExtensions: string[] | undefined;
|
||||
|
||||
let precedingText = terminalContext.commandLine.slice(0, terminalContext.cursorPosition + 1);
|
||||
if (isWindows) {
|
||||
const spaceIndex = precedingText.indexOf(' ');
|
||||
const commandEndIndex = spaceIndex === -1 ? precedingText.length : spaceIndex;
|
||||
const lastDotIndex = precedingText.lastIndexOf('.', commandEndIndex);
|
||||
const spaceIndex = currentCommandString.indexOf(' ');
|
||||
const commandEndIndex = spaceIndex === -1 ? currentCommandString.length : spaceIndex;
|
||||
const lastDotIndex = currentCommandString.lastIndexOf('.', commandEndIndex);
|
||||
if (lastDotIndex > 0) { // Don't treat dotfiles as extensions
|
||||
precedingText = precedingText.substring(0, lastDotIndex) + precedingText.substring(spaceIndex);
|
||||
currentCommandString = currentCommandString.substring(0, lastDotIndex) + currentCommandString.substring(spaceIndex);
|
||||
}
|
||||
}
|
||||
|
||||
const result = await getFigSuggestions(specs, terminalContext, availableCommands, prefix, tokenType, shellIntegrationCwd, env, name, precedingText, executeExternals ?? { executeCommand, executeCommandTimeout }, token);
|
||||
const result = await getFigSuggestions(specs, terminalContext, availableCommands, currentCommandString, tokenType, shellIntegrationCwd, env, name, executeExternals ?? { executeCommand, executeCommandTimeout }, token);
|
||||
if (result) {
|
||||
hasCurrentArg ||= result.hasCurrentArg;
|
||||
filesRequested ||= result.filesRequested;
|
||||
@@ -266,10 +291,12 @@ export async function getCompletionItemsFromSpecs(
|
||||
const labels = new Set(items.map((i) => typeof i.label === 'string' ? i.label : i.label.label));
|
||||
for (const command of availableCommands) {
|
||||
const commandTextLabel = typeof command.label === 'string' ? command.label : command.label.label;
|
||||
if (!labels.has(commandTextLabel)) {
|
||||
// Remove any file extension for matching on Windows
|
||||
const labelWithoutExtension = isWindows ? commandTextLabel.replace(/\.[^ ]+$/, '') : commandTextLabel;
|
||||
if (!labels.has(labelWithoutExtension)) {
|
||||
items.push(createCompletionItem(
|
||||
terminalContext.cursorPosition,
|
||||
prefix,
|
||||
currentCommandString,
|
||||
command,
|
||||
command.detail,
|
||||
command.documentation,
|
||||
@@ -300,7 +327,7 @@ export async function getCompletionItemsFromSpecs(
|
||||
|
||||
let cwd: vscode.Uri | undefined;
|
||||
if (shellIntegrationCwd && (filesRequested || foldersRequested)) {
|
||||
cwd = await resolveCwdFromPrefix(prefix, shellIntegrationCwd);
|
||||
cwd = await resolveCwdFromCurrentCommandString(currentCommandString, shellIntegrationCwd);
|
||||
}
|
||||
|
||||
return { items, filesRequested, foldersRequested, fileExtensions, cwd };
|
||||
@@ -361,3 +388,4 @@ export function sanitizeProcessEnvironment(env: Record<string, string>, ...prese
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { deepStrictEqual, strictEqual } from 'assert';
|
||||
import 'mocha';
|
||||
import { basename } from 'path';
|
||||
import { asArray, getCompletionItemsFromSpecs } from '../terminalSuggestMain';
|
||||
import { asArray, getCompletionItemsFromSpecs, getCurrentCommandAndArgs } from '../terminalSuggestMain';
|
||||
import { getTokenType } from '../tokens';
|
||||
import { cdTestSuiteSpec as cdTestSuite } from './completions/cd.test';
|
||||
import { codeSpecOptionsAndSubcommands, codeTestSuite, codeTunnelTestSuite } from './completions/code.test';
|
||||
@@ -92,7 +92,7 @@ suite('Terminal Suggest', () => {
|
||||
test(`'${testSpec.input}' -> ${expectedString}`, async () => {
|
||||
const commandLine = testSpec.input.split('|')[0];
|
||||
const cursorPosition = testSpec.input.indexOf('|');
|
||||
const prefix = commandLine.slice(0, cursorPosition).split(' ').at(-1) || '';
|
||||
const currentCommandString = getCurrentCommandAndArgs(commandLine, cursorPosition, undefined);
|
||||
const filesRequested = testSpec.expectedResourceRequests?.type === 'files' || testSpec.expectedResourceRequests?.type === 'both';
|
||||
const foldersRequested = testSpec.expectedResourceRequests?.type === 'folders' || testSpec.expectedResourceRequests?.type === 'both';
|
||||
const terminalContext = { commandLine, cursorPosition, allowFallbackCompletions: true };
|
||||
@@ -100,7 +100,7 @@ suite('Terminal Suggest', () => {
|
||||
completionSpecs,
|
||||
terminalContext,
|
||||
availableCommands.map(c => { return { label: c }; }),
|
||||
prefix,
|
||||
currentCommandString,
|
||||
getTokenType(terminalContext, undefined),
|
||||
testPaths.cwd,
|
||||
{},
|
||||
|
||||
@@ -48,5 +48,54 @@ suite('Terminal Suggest', () => {
|
||||
test('arguments after reset char', () => {
|
||||
strictEqual(getTokenType({ commandLine: `Write-Host hello -and $true `, cursorPosition: `Write-Host hello -and $true `.length }, TerminalShellType.PowerShell), TokenType.Argument);
|
||||
});
|
||||
test('; reset char', () => {
|
||||
strictEqual(getTokenType({ commandLine: `Write-Host hello; `, cursorPosition: `Write-Host hello; `.length }, TerminalShellType.PowerShell), TokenType.Command);
|
||||
});
|
||||
suite('multiple commands on the line', () => {
|
||||
test('multiple commands, cursor at end', () => {
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world', cursorPosition: 'echo hello && ech'.length }, undefined), TokenType.Command);
|
||||
// Bash
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world', cursorPosition: 'echo hello && ech'.length }, TerminalShellType.Bash), TokenType.Command);
|
||||
// Zsh
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world', cursorPosition: 'echo hello && ech'.length }, TerminalShellType.Zsh), TokenType.Command);
|
||||
// Fish (use ';' as separator)
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello; echo world', cursorPosition: 'echo hello; ech'.length }, TerminalShellType.Fish), TokenType.Command);
|
||||
// PowerShell (use ';' as separator)
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello; echo world', cursorPosition: 'echo hello; ech'.length }, TerminalShellType.PowerShell), TokenType.Command);
|
||||
});
|
||||
test('multiple commands, cursor mid text', () => {
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world', cursorPosition: 'echo hello && echo w'.length }, undefined), TokenType.Argument);
|
||||
// Bash
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world', cursorPosition: 'echo hello && echo w'.length }, TerminalShellType.Bash), TokenType.Argument);
|
||||
// Zsh
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world', cursorPosition: 'echo hello && echo w'.length }, TerminalShellType.Zsh), TokenType.Argument);
|
||||
// Fish (use ';' as separator)
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello; echo world', cursorPosition: 'echo hello; echo w'.length }, TerminalShellType.Fish), TokenType.Argument);
|
||||
// PowerShell (use ';' as separator)
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello; echo world', cursorPosition: 'echo hello; echo w'.length }, TerminalShellType.PowerShell), TokenType.Argument);
|
||||
});
|
||||
test('multiple commands, cursor at end with reset char', () => {
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world; ', cursorPosition: 'echo hello && echo world; '.length }, undefined), TokenType.Command);
|
||||
// Bash
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world; ', cursorPosition: 'echo hello && echo world; '.length }, TerminalShellType.Bash), TokenType.Command);
|
||||
// Zsh
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world; ', cursorPosition: 'echo hello && echo world; '.length }, TerminalShellType.Zsh), TokenType.Command);
|
||||
// Fish (use ';' as separator)
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello; echo world; ', cursorPosition: 'echo hello; echo world; '.length }, TerminalShellType.Fish), TokenType.Command);
|
||||
// PowerShell (use ';' as separator)
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello; echo world; ', cursorPosition: 'echo hello; echo world; '.length }, TerminalShellType.PowerShell), TokenType.Command);
|
||||
});
|
||||
test('multiple commands, cursor mid text with reset char', () => {
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world; ', cursorPosition: 'echo hello && echo worl'.length }, undefined), TokenType.Argument);
|
||||
// Bash
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world; ', cursorPosition: 'echo hello && echo worl'.length }, TerminalShellType.Bash), TokenType.Argument);
|
||||
// Zsh
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello && echo world; ', cursorPosition: 'echo hello && echo worl'.length }, TerminalShellType.Zsh), TokenType.Argument);
|
||||
// Fish (use ';' as separator)
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello; echo world; ', cursorPosition: 'echo hello; echo worl'.length }, TerminalShellType.Fish), TokenType.Argument);
|
||||
// PowerShell (use ';' as separator)
|
||||
strictEqual(getTokenType({ commandLine: 'echo hello; echo world; ', cursorPosition: 'echo hello; echo worl'.length }, TerminalShellType.PowerShell), TokenType.Argument);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,21 +11,38 @@ export const enum TokenType {
|
||||
Argument,
|
||||
}
|
||||
|
||||
const shellTypeResetChars = new Map<TerminalShellType, string[]>([
|
||||
export const shellTypeResetChars = new Map<TerminalShellType, string[]>([
|
||||
[TerminalShellType.Bash, ['>', '>>', '<', '2>', '2>>', '&>', '&>>', '|', '|&', '&&', '||', '&', ';', '(', '{', '<<']],
|
||||
[TerminalShellType.Zsh, ['>', '>>', '<', '2>', '2>>', '&>', '&>>', '<>', '|', '|&', '&&', '||', '&', ';', '(', '{', '<<', '<<<', '<(']],
|
||||
[TerminalShellType.PowerShell, ['>', '>>', '<', '2>', '2>>', '*>', '*>>', '|', '-and', '-or', '-not', '!', '&', '-eq', '-ne', '-gt', '-lt', '-ge', '-le', '-like', '-notlike', '-match', '-notmatch', '-contains', '-notcontains', '-in', '-notin']]
|
||||
[TerminalShellType.PowerShell, ['>', '>>', '<', '2>', '2>>', '*>', '*>>', '|', ';', '-and', '-or', '-not', '!', '&', '-eq', '-ne', '-gt', '-lt', '-ge', '-le', '-like', '-notlike', '-match', '-notmatch', '-contains', '-notcontains', '-in', '-notin']]
|
||||
]);
|
||||
|
||||
const defaultShellTypeResetChars = shellTypeResetChars.get(TerminalShellType.Bash)!;
|
||||
export const defaultShellTypeResetChars = shellTypeResetChars.get(TerminalShellType.Bash)!;
|
||||
|
||||
export function getTokenType(ctx: { commandLine: string; cursorPosition: number }, shellType: TerminalShellType | undefined): TokenType {
|
||||
const spaceIndex = ctx.commandLine.substring(0, ctx.cursorPosition).lastIndexOf(' ');
|
||||
const commandLine = ctx.commandLine;
|
||||
const cursorPosition = ctx.cursorPosition;
|
||||
const commandResetChars = shellType === undefined ? defaultShellTypeResetChars : shellTypeResetChars.get(shellType) ?? defaultShellTypeResetChars;
|
||||
|
||||
// Check for reset char before the current word
|
||||
const beforeCursor = commandLine.substring(0, cursorPosition);
|
||||
const wordStart = beforeCursor.lastIndexOf(' ') + 1;
|
||||
const beforeWord = commandLine.substring(0, wordStart);
|
||||
|
||||
// Look for " <reset char> " before the word
|
||||
for (const resetChar of commandResetChars) {
|
||||
const pattern = ` ${resetChar} `;
|
||||
if (beforeWord.endsWith(pattern)) {
|
||||
return TokenType.Command;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to original logic for the very first command
|
||||
const spaceIndex = beforeCursor.lastIndexOf(' ');
|
||||
if (spaceIndex === -1) {
|
||||
return TokenType.Command;
|
||||
}
|
||||
const previousTokens = ctx.commandLine.substring(0, spaceIndex + 1).trim();
|
||||
const commandResetChars = shellType === undefined ? defaultShellTypeResetChars : shellTypeResetChars.get(shellType) ?? defaultShellTypeResetChars;
|
||||
const previousTokens = beforeCursor.substring(0, spaceIndex + 1).trim();
|
||||
if (commandResetChars.some(e => previousTokens.endsWith(e))) {
|
||||
return TokenType.Command;
|
||||
}
|
||||
|
||||
@@ -295,4 +295,19 @@ suite('vscode API - editors', () => {
|
||||
|
||||
assert.strictEqual(document.getText(), Buffer.from(await workspace.fs.readFile(file)).toString());
|
||||
}
|
||||
|
||||
test('extEditor.selection can be empty #18075', async function () {
|
||||
await withRandomFileEditor('foo', async editor => {
|
||||
|
||||
assert.ok(editor.selections.length > 0);
|
||||
|
||||
editor.selections = [];
|
||||
|
||||
assert.strictEqual(editor.selections.length, 1);
|
||||
assert.strictEqual(editor.selections[0].start.line, 0);
|
||||
assert.strictEqual(editor.selections[0].start.character, 0);
|
||||
assert.strictEqual(editor.selections[0].end.line, 0);
|
||||
assert.strictEqual(editor.selections[0].end.character, 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1399,6 +1399,14 @@ suite('vscode API - workspace', () => {
|
||||
assert.strictEqual(doc2.encoding, 'cp1252');
|
||||
});
|
||||
|
||||
test('encoding: openTextDocument - can change the encoding of an existing untitled document', async () => {
|
||||
const doc = await vscode.workspace.openTextDocument({ content: 'Hello World' });
|
||||
assert.strictEqual(doc.encoding, 'utf8');
|
||||
|
||||
await vscode.workspace.openTextDocument(doc.uri, { encoding: 'windows1252' });
|
||||
assert.strictEqual(doc.encoding, 'windows1252');
|
||||
});
|
||||
|
||||
test('encoding: decode', async function () {
|
||||
const uri = root.with({ path: posix.join(root.path, 'file.txt') });
|
||||
|
||||
|
||||
Generated
+160
-77
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.101.0",
|
||||
"version": "1.102.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.101.0",
|
||||
"version": "1.102.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -18,7 +18,7 @@
|
||||
"@vscode/iconv-lite-umd": "0.7.0",
|
||||
"@vscode/policy-watcher": "^1.3.2",
|
||||
"@vscode/proxy-agent": "^0.32.0",
|
||||
"@vscode/ripgrep": "^1.15.11",
|
||||
"@vscode/ripgrep": "^1.15.13",
|
||||
"@vscode/spdlog": "^0.15.2",
|
||||
"@vscode/sqlite3": "5.1.8-vscode",
|
||||
"@vscode/sudo-prompt": "9.3.1",
|
||||
@@ -27,26 +27,26 @@
|
||||
"@vscode/windows-mutex": "^0.5.0",
|
||||
"@vscode/windows-process-tree": "^0.6.0",
|
||||
"@vscode/windows-registry": "^1.1.0",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.90",
|
||||
"@xterm/addon-image": "^0.9.0-beta.107",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.107",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.13",
|
||||
"@xterm/addon-search": "^0.16.0-beta.107",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.107",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.107",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.107",
|
||||
"@xterm/headless": "^5.6.0-beta.107",
|
||||
"@xterm/xterm": "^5.6.0-beta.107",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.93",
|
||||
"@xterm/addon-image": "^0.9.0-beta.110",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.110",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.16",
|
||||
"@xterm/addon-search": "^0.16.0-beta.110",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.110",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.110",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.110",
|
||||
"@xterm/headless": "^5.6.0-beta.110",
|
||||
"@xterm/xterm": "^5.6.0-beta.110",
|
||||
"http-proxy-agent": "^7.0.0",
|
||||
"https-proxy-agent": "^7.0.2",
|
||||
"jschardet": "3.1.4",
|
||||
"kerberos": "2.1.1",
|
||||
"minimist": "^1.2.6",
|
||||
"minimist": "^1.2.8",
|
||||
"native-is-elevated": "0.7.0",
|
||||
"native-keymap": "^3.3.5",
|
||||
"native-watchdog": "^1.4.1",
|
||||
"node-pty": "^1.1.0-beta33",
|
||||
"open": "^8.4.2",
|
||||
"open": "^10.1.2",
|
||||
"tas-client-umd": "0.2.0",
|
||||
"v8-inspect-profiler": "^0.1.1",
|
||||
"vscode-oniguruma": "1.7.0",
|
||||
@@ -131,7 +131,6 @@
|
||||
"merge-options": "^1.0.1",
|
||||
"mime": "^1.4.1",
|
||||
"minimatch": "^3.0.4",
|
||||
"minimist": "^1.2.6",
|
||||
"mocha": "^10.8.2",
|
||||
"mocha-junit-reporter": "^2.2.1",
|
||||
"mocha-multi-reporters": "^1.5.1",
|
||||
@@ -2713,9 +2712,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vscode/ripgrep": {
|
||||
"version": "1.15.11",
|
||||
"resolved": "https://registry.npmjs.org/@vscode/ripgrep/-/ripgrep-1.15.11.tgz",
|
||||
"integrity": "sha512-G/VqtA6kR50mJkIH4WA+I2Q78V5blovgPPq0VPYM0QIRp57lYMkdV+U9VrY80b3AvaC72A1z8STmyxc8ZKiTsw==",
|
||||
"version": "1.15.13",
|
||||
"resolved": "https://registry.npmjs.org/@vscode/ripgrep/-/ripgrep-1.15.13.tgz",
|
||||
"integrity": "sha512-c62On5sLEIMv9yfetIZ8c0Mg0s6lvq54G0YLW2zY/XiPsJPyBBgrP54MR1s0hK3gsPy423cY+e2BDU6mOB2Yaw==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -3287,30 +3286,30 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-clipboard": {
|
||||
"version": "0.2.0-beta.90",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.90.tgz",
|
||||
"integrity": "sha512-2i7qtACRBYRTRba831ufEjQMeAvK4uuVPYPBkSXzKJ/dIAvhws5B6OOmxqZzR97OsmzUC/SrjHSujgwyD0MVVw==",
|
||||
"version": "0.2.0-beta.93",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.93.tgz",
|
||||
"integrity": "sha512-A+XZnJgROYtvcIVGGYM6lH5PbXdVoMz/c140Pq9wu0jq++z3zHkcfTIMWO8E/xrvCO9Op3LTv9fu5NEhOI2l3A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"js-base64": "^3.7.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-image": {
|
||||
"version": "0.9.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.9.0-beta.107.tgz",
|
||||
"integrity": "sha512-/vqb2BhVjJeCcOIDSpjWrfXbhNTCse95qkKbpmzFkQJJEh0CyaqjSUBIAM+Qcl9f/x6H//O2wADnn3Wsn5qYsg==",
|
||||
"version": "0.9.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.9.0-beta.110.tgz",
|
||||
"integrity": "sha512-mzs2nIWqVay/1q3H74UQZwE0/MU4pNTEIkle3n+sYYbFJh8ZVOPKQfnl5ze7DWnQnqm3hqg2FDXZKfXj8fkdEA==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-ligatures": {
|
||||
"version": "0.10.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-ligatures/-/addon-ligatures-0.10.0-beta.107.tgz",
|
||||
"integrity": "sha512-3qQZz6dPS8XlGGwz1p5Bqjoosah6Km1GwGeNv7YxkCVU2kpTOymFH8BMUEOFC5WHdYseDXnz8hIEleexF9Pa2g==",
|
||||
"version": "0.10.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-ligatures/-/addon-ligatures-0.10.0-beta.110.tgz",
|
||||
"integrity": "sha512-k8ILGtdbmUTJURGX0h857C3F6KXxIwrOpsfEC5v1k3ffW3mJn6qkKOTmOyS89QcpWXXbbqvLJRLQ7FWGKYvlgg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"font-finder": "^1.1.0",
|
||||
@@ -3320,64 +3319,64 @@
|
||||
"node": ">8.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-progress": {
|
||||
"version": "0.2.0-beta.13",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-progress/-/addon-progress-0.2.0-beta.13.tgz",
|
||||
"integrity": "sha512-BLmX+JdA+LLOMbVLQm+gPqieeKaVMiugBFpCtQtBus3kCs/2/F8pU/XNGV31CnXxDdRjptyOGrPVRreF/rDdcg==",
|
||||
"version": "0.2.0-beta.16",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-progress/-/addon-progress-0.2.0-beta.16.tgz",
|
||||
"integrity": "sha512-VqxaYIMx8TjeL9s4CYxMP8kFOQPEhcjEzrSLqYmpvhY2RpCJrDjf0HPh/wy9HDADJIWLZE6Gjcva7yub02fJXg==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-search": {
|
||||
"version": "0.16.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.16.0-beta.107.tgz",
|
||||
"integrity": "sha512-poHjeKjnTKtS6rHyu3r5lhW/0rdLcRMSJLDmT9xo9lfTuyhfcUl8gro44iPtscKY+LEtrhZcortTlElMewy/Bw==",
|
||||
"version": "0.16.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.16.0-beta.110.tgz",
|
||||
"integrity": "sha512-f7pi12E/7lD5Oz/Wrt3DL6kXOU7jVjA6ZAXisznBQTH1M4vxY3agvgUYVHWYFHyY1uWwheL1K089nzfjT5A1Lg==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-serialize": {
|
||||
"version": "0.14.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.107.tgz",
|
||||
"integrity": "sha512-MGaoO2zlNuSGofX5Xfbw+MU2wgAApEsDOPeYoEBSQyLf5BR7Z2rGVCxFyF5zNsIhNDov7ptQIVpCfonMVAgUvg==",
|
||||
"version": "0.14.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.110.tgz",
|
||||
"integrity": "sha512-uCHdHwwp2HWTCSMavkmYylgebiCGW+P76XJp04uVJnMBIPTSLGKygiCRQbxDsRB6mblsYislMEw4P9egKl/eqA==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-unicode11": {
|
||||
"version": "0.9.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.107.tgz",
|
||||
"integrity": "sha512-XTfJ1G7u+8zOT6faCfEB49AbVFAX4XWUoiLtyXCfRvbrVuv5wv53T03dLtBtpwjWoFaveLKGl3ZiU7t3dpl0RA==",
|
||||
"version": "0.9.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.110.tgz",
|
||||
"integrity": "sha512-HMfvm7ZaUgN2I78Lk/YXazfnLTntCwZidi25BtVNJWy+ibgSM9EUfs/AsnDx8JbeTPqGpHxvybWaIUC3maNurQ==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-webgl": {
|
||||
"version": "0.19.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.107.tgz",
|
||||
"integrity": "sha512-wdUkYiV4PnR9+7+1giJoFm5xrguCOKTH4xdQ/6lYuSbgMS0y1ykpcQjDNshwHy0TyUuh4o4z1+rd48qNjqGM6Q==",
|
||||
"version": "0.19.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.110.tgz",
|
||||
"integrity": "sha512-1fVHcG5lKdencCBI6b6ZZwlTs54Ax3EtbngkgwVHnqVR4jMmHQ5E8G/AH6Vk+OpVNANW+//oArDtosFUIDFKWw==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/headless": {
|
||||
"version": "5.6.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/headless/-/headless-5.6.0-beta.107.tgz",
|
||||
"integrity": "sha512-jFoJEPXjffcSzQyf/fTh3eZsXuHP/xQmkezkKbmrkzxw5h40NPbTPQbhTrsUCea2M12Mun1BrT8ScSYMjUCH3w==",
|
||||
"version": "5.6.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/headless/-/headless-5.6.0-beta.110.tgz",
|
||||
"integrity": "sha512-3oT+fvaQ8kr6kBIuBhH28Npg0KYSCcR6Jz/nJ1f23N0ANBqDJV2Ou0VDqfX+KsxdReG5moYKcYzhlccpdoy34A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@xterm/xterm": {
|
||||
"version": "5.6.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.6.0-beta.107.tgz",
|
||||
"integrity": "sha512-7cuJFZtc7Rv9BEpf9UsvErfXhLKkEmogI0mizgri+nNjEENnpQcFOpx84GFTjax/Zta8MAxOMUP1XU5Guju80A==",
|
||||
"version": "5.6.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.6.0-beta.110.tgz",
|
||||
"integrity": "sha512-FPIKLySxbyWaXoBVbnc1KtbJe6CUV9DxZ9LHSs2gNHMN2jPmBhtdpDppeMqWwdmuCDBk9OcMSTPQNHT+mI4gSw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@xtuc/ieee754": {
|
||||
@@ -4324,6 +4323,21 @@
|
||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/bundle-name": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz",
|
||||
"integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"run-applescript": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
@@ -5513,6 +5527,34 @@
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/default-browser": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz",
|
||||
"integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bundle-name": "^4.1.0",
|
||||
"default-browser-id": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/default-browser-id": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz",
|
||||
"integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/default-compare": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz",
|
||||
@@ -5561,11 +5603,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/define-lazy-prop": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
|
||||
"integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz",
|
||||
"integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/define-properties": {
|
||||
@@ -10144,14 +10190,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/is-docker": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
|
||||
"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz",
|
||||
"integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"is-docker": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
@@ -10230,6 +10277,24 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-inside-container": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
|
||||
"integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-docker": "^3.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"is-inside-container": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.16"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-interactive": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
|
||||
@@ -10419,14 +10484,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/is-wsl": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
|
||||
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz",
|
||||
"integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-docker": "^2.0.0"
|
||||
"is-inside-container": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": ">=16"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
@@ -12877,16 +12946,18 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/open": {
|
||||
"version": "8.4.2",
|
||||
"resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz",
|
||||
"integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==",
|
||||
"version": "10.1.2",
|
||||
"resolved": "https://registry.npmjs.org/open/-/open-10.1.2.tgz",
|
||||
"integrity": "sha512-cxN6aIDPz6rm8hbebcP7vrQNhvRcveZoJU72Y7vskh4oIm+BZwBECnx5nTmrlres1Qapvx27Qo1Auukpf8PKXw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"define-lazy-prop": "^2.0.0",
|
||||
"is-docker": "^2.1.1",
|
||||
"is-wsl": "^2.2.0"
|
||||
"default-browser": "^5.2.1",
|
||||
"define-lazy-prop": "^3.0.0",
|
||||
"is-inside-container": "^1.0.0",
|
||||
"is-wsl": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
@@ -14624,6 +14695,18 @@
|
||||
"node": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/run-applescript": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz",
|
||||
"integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/run-parallel": {
|
||||
"version": "1.1.10",
|
||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz",
|
||||
|
||||
+16
-17
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.101.0",
|
||||
"distro": "0110618df4664082ca0cb597c5f9bf66aeed2e35",
|
||||
"version": "1.102.0",
|
||||
"distro": "3c2b3776c5752c7f7dd69d3f1a9b6079ae890a16",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
@@ -44,7 +44,7 @@
|
||||
"monaco-compile-check": "tsc -p src/tsconfig.monaco.json --noEmit",
|
||||
"tsec-compile-check": "node node_modules/tsec/bin/tsec -p src/tsconfig.tsec.json",
|
||||
"vscode-dts-compile-check": "tsc -p src/tsconfig.vscode-dts.json && tsc -p src/tsconfig.vscode-proposed-dts.json",
|
||||
"valid-layers-check": "node build/lib/layersChecker.js",
|
||||
"valid-layers-check": "node build/checker/layersChecker.js && tsc -p build/checker/tsconfig.browser.json && tsc -p build/checker/tsconfig.worker.json && tsc -p build/checker/tsconfig.node.json && tsc -p build/checker/tsconfig.electron-browser.json && tsc -p build/checker/tsconfig.electron-main.json && tsc -p build/checker/tsconfig.electron-utility.json",
|
||||
"define-class-fields-check": "node build/lib/propertyInitOrderChecker.js && tsc -p src/tsconfig.defineClassFields.json",
|
||||
"update-distro": "node build/npm/update-distro.mjs",
|
||||
"web": "echo 'npm run web' is replaced by './scripts/code-server' or './scripts/code-web'",
|
||||
@@ -77,7 +77,7 @@
|
||||
"@vscode/iconv-lite-umd": "0.7.0",
|
||||
"@vscode/policy-watcher": "^1.3.2",
|
||||
"@vscode/proxy-agent": "^0.32.0",
|
||||
"@vscode/ripgrep": "^1.15.11",
|
||||
"@vscode/ripgrep": "^1.15.13",
|
||||
"@vscode/spdlog": "^0.15.2",
|
||||
"@vscode/sqlite3": "5.1.8-vscode",
|
||||
"@vscode/sudo-prompt": "9.3.1",
|
||||
@@ -86,26 +86,26 @@
|
||||
"@vscode/windows-mutex": "^0.5.0",
|
||||
"@vscode/windows-process-tree": "^0.6.0",
|
||||
"@vscode/windows-registry": "^1.1.0",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.90",
|
||||
"@xterm/addon-image": "^0.9.0-beta.107",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.107",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.13",
|
||||
"@xterm/addon-search": "^0.16.0-beta.107",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.107",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.107",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.107",
|
||||
"@xterm/headless": "^5.6.0-beta.107",
|
||||
"@xterm/xterm": "^5.6.0-beta.107",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.93",
|
||||
"@xterm/addon-image": "^0.9.0-beta.110",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.110",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.16",
|
||||
"@xterm/addon-search": "^0.16.0-beta.110",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.110",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.110",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.110",
|
||||
"@xterm/headless": "^5.6.0-beta.110",
|
||||
"@xterm/xterm": "^5.6.0-beta.110",
|
||||
"http-proxy-agent": "^7.0.0",
|
||||
"https-proxy-agent": "^7.0.2",
|
||||
"jschardet": "3.1.4",
|
||||
"kerberos": "2.1.1",
|
||||
"minimist": "^1.2.6",
|
||||
"minimist": "^1.2.8",
|
||||
"native-is-elevated": "0.7.0",
|
||||
"native-keymap": "^3.3.5",
|
||||
"native-watchdog": "^1.4.1",
|
||||
"node-pty": "^1.1.0-beta33",
|
||||
"open": "^8.4.2",
|
||||
"open": "^10.1.2",
|
||||
"tas-client-umd": "0.2.0",
|
||||
"v8-inspect-profiler": "^0.1.1",
|
||||
"vscode-oniguruma": "1.7.0",
|
||||
@@ -190,7 +190,6 @@
|
||||
"merge-options": "^1.0.1",
|
||||
"mime": "^1.4.1",
|
||||
"minimatch": "^3.0.4",
|
||||
"minimist": "^1.2.6",
|
||||
"mocha": "^10.8.2",
|
||||
"mocha-junit-reporter": "^2.2.1",
|
||||
"mocha-multi-reporters": "^1.5.1",
|
||||
|
||||
Generated
+60
-56
@@ -14,28 +14,28 @@
|
||||
"@vscode/deviceid": "^0.1.1",
|
||||
"@vscode/iconv-lite-umd": "0.7.0",
|
||||
"@vscode/proxy-agent": "^0.32.0",
|
||||
"@vscode/ripgrep": "^1.15.11",
|
||||
"@vscode/ripgrep": "^1.15.13",
|
||||
"@vscode/spdlog": "^0.15.2",
|
||||
"@vscode/tree-sitter-wasm": "^0.1.4",
|
||||
"@vscode/vscode-languagedetection": "1.0.21",
|
||||
"@vscode/windows-process-tree": "^0.6.0",
|
||||
"@vscode/windows-registry": "^1.1.0",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.90",
|
||||
"@xterm/addon-image": "^0.9.0-beta.107",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.107",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.13",
|
||||
"@xterm/addon-search": "^0.16.0-beta.107",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.107",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.107",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.107",
|
||||
"@xterm/headless": "^5.6.0-beta.107",
|
||||
"@xterm/xterm": "^5.6.0-beta.107",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.93",
|
||||
"@xterm/addon-image": "^0.9.0-beta.110",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.110",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.16",
|
||||
"@xterm/addon-search": "^0.16.0-beta.110",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.110",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.110",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.110",
|
||||
"@xterm/headless": "^5.6.0-beta.110",
|
||||
"@xterm/xterm": "^5.6.0-beta.110",
|
||||
"cookie": "^0.7.0",
|
||||
"http-proxy-agent": "^7.0.0",
|
||||
"https-proxy-agent": "^7.0.2",
|
||||
"jschardet": "3.1.4",
|
||||
"kerberos": "2.1.1",
|
||||
"minimist": "^1.2.6",
|
||||
"minimist": "^1.2.8",
|
||||
"native-watchdog": "^1.4.1",
|
||||
"node-pty": "^1.1.0-beta33",
|
||||
"tas-client-umd": "0.2.0",
|
||||
@@ -437,9 +437,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vscode/ripgrep": {
|
||||
"version": "1.15.11",
|
||||
"resolved": "https://registry.npmjs.org/@vscode/ripgrep/-/ripgrep-1.15.11.tgz",
|
||||
"integrity": "sha512-G/VqtA6kR50mJkIH4WA+I2Q78V5blovgPPq0VPYM0QIRp57lYMkdV+U9VrY80b3AvaC72A1z8STmyxc8ZKiTsw==",
|
||||
"version": "1.15.13",
|
||||
"resolved": "https://registry.npmjs.org/@vscode/ripgrep/-/ripgrep-1.15.13.tgz",
|
||||
"integrity": "sha512-c62On5sLEIMv9yfetIZ8c0Mg0s6lvq54G0YLW2zY/XiPsJPyBBgrP54MR1s0hK3gsPy423cY+e2BDU6mOB2Yaw==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -523,30 +523,30 @@
|
||||
"hasInstallScript": true
|
||||
},
|
||||
"node_modules/@xterm/addon-clipboard": {
|
||||
"version": "0.2.0-beta.90",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.90.tgz",
|
||||
"integrity": "sha512-2i7qtACRBYRTRba831ufEjQMeAvK4uuVPYPBkSXzKJ/dIAvhws5B6OOmxqZzR97OsmzUC/SrjHSujgwyD0MVVw==",
|
||||
"version": "0.2.0-beta.93",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.93.tgz",
|
||||
"integrity": "sha512-A+XZnJgROYtvcIVGGYM6lH5PbXdVoMz/c140Pq9wu0jq++z3zHkcfTIMWO8E/xrvCO9Op3LTv9fu5NEhOI2l3A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"js-base64": "^3.7.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-image": {
|
||||
"version": "0.9.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.9.0-beta.107.tgz",
|
||||
"integrity": "sha512-/vqb2BhVjJeCcOIDSpjWrfXbhNTCse95qkKbpmzFkQJJEh0CyaqjSUBIAM+Qcl9f/x6H//O2wADnn3Wsn5qYsg==",
|
||||
"version": "0.9.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.9.0-beta.110.tgz",
|
||||
"integrity": "sha512-mzs2nIWqVay/1q3H74UQZwE0/MU4pNTEIkle3n+sYYbFJh8ZVOPKQfnl5ze7DWnQnqm3hqg2FDXZKfXj8fkdEA==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-ligatures": {
|
||||
"version": "0.10.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-ligatures/-/addon-ligatures-0.10.0-beta.107.tgz",
|
||||
"integrity": "sha512-3qQZz6dPS8XlGGwz1p5Bqjoosah6Km1GwGeNv7YxkCVU2kpTOymFH8BMUEOFC5WHdYseDXnz8hIEleexF9Pa2g==",
|
||||
"version": "0.10.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-ligatures/-/addon-ligatures-0.10.0-beta.110.tgz",
|
||||
"integrity": "sha512-k8ILGtdbmUTJURGX0h857C3F6KXxIwrOpsfEC5v1k3ffW3mJn6qkKOTmOyS89QcpWXXbbqvLJRLQ7FWGKYvlgg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"font-finder": "^1.1.0",
|
||||
@@ -556,64 +556,64 @@
|
||||
"node": ">8.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-progress": {
|
||||
"version": "0.2.0-beta.13",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-progress/-/addon-progress-0.2.0-beta.13.tgz",
|
||||
"integrity": "sha512-BLmX+JdA+LLOMbVLQm+gPqieeKaVMiugBFpCtQtBus3kCs/2/F8pU/XNGV31CnXxDdRjptyOGrPVRreF/rDdcg==",
|
||||
"version": "0.2.0-beta.16",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-progress/-/addon-progress-0.2.0-beta.16.tgz",
|
||||
"integrity": "sha512-VqxaYIMx8TjeL9s4CYxMP8kFOQPEhcjEzrSLqYmpvhY2RpCJrDjf0HPh/wy9HDADJIWLZE6Gjcva7yub02fJXg==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-search": {
|
||||
"version": "0.16.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.16.0-beta.107.tgz",
|
||||
"integrity": "sha512-poHjeKjnTKtS6rHyu3r5lhW/0rdLcRMSJLDmT9xo9lfTuyhfcUl8gro44iPtscKY+LEtrhZcortTlElMewy/Bw==",
|
||||
"version": "0.16.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.16.0-beta.110.tgz",
|
||||
"integrity": "sha512-f7pi12E/7lD5Oz/Wrt3DL6kXOU7jVjA6ZAXisznBQTH1M4vxY3agvgUYVHWYFHyY1uWwheL1K089nzfjT5A1Lg==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-serialize": {
|
||||
"version": "0.14.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.107.tgz",
|
||||
"integrity": "sha512-MGaoO2zlNuSGofX5Xfbw+MU2wgAApEsDOPeYoEBSQyLf5BR7Z2rGVCxFyF5zNsIhNDov7ptQIVpCfonMVAgUvg==",
|
||||
"version": "0.14.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.110.tgz",
|
||||
"integrity": "sha512-uCHdHwwp2HWTCSMavkmYylgebiCGW+P76XJp04uVJnMBIPTSLGKygiCRQbxDsRB6mblsYislMEw4P9egKl/eqA==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-unicode11": {
|
||||
"version": "0.9.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.107.tgz",
|
||||
"integrity": "sha512-XTfJ1G7u+8zOT6faCfEB49AbVFAX4XWUoiLtyXCfRvbrVuv5wv53T03dLtBtpwjWoFaveLKGl3ZiU7t3dpl0RA==",
|
||||
"version": "0.9.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.110.tgz",
|
||||
"integrity": "sha512-HMfvm7ZaUgN2I78Lk/YXazfnLTntCwZidi25BtVNJWy+ibgSM9EUfs/AsnDx8JbeTPqGpHxvybWaIUC3maNurQ==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-webgl": {
|
||||
"version": "0.19.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.107.tgz",
|
||||
"integrity": "sha512-wdUkYiV4PnR9+7+1giJoFm5xrguCOKTH4xdQ/6lYuSbgMS0y1ykpcQjDNshwHy0TyUuh4o4z1+rd48qNjqGM6Q==",
|
||||
"version": "0.19.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.110.tgz",
|
||||
"integrity": "sha512-1fVHcG5lKdencCBI6b6ZZwlTs54Ax3EtbngkgwVHnqVR4jMmHQ5E8G/AH6Vk+OpVNANW+//oArDtosFUIDFKWw==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/headless": {
|
||||
"version": "5.6.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/headless/-/headless-5.6.0-beta.107.tgz",
|
||||
"integrity": "sha512-jFoJEPXjffcSzQyf/fTh3eZsXuHP/xQmkezkKbmrkzxw5h40NPbTPQbhTrsUCea2M12Mun1BrT8ScSYMjUCH3w==",
|
||||
"version": "5.6.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/headless/-/headless-5.6.0-beta.110.tgz",
|
||||
"integrity": "sha512-3oT+fvaQ8kr6kBIuBhH28Npg0KYSCcR6Jz/nJ1f23N0ANBqDJV2Ou0VDqfX+KsxdReG5moYKcYzhlccpdoy34A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@xterm/xterm": {
|
||||
"version": "5.6.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.6.0-beta.107.tgz",
|
||||
"integrity": "sha512-7cuJFZtc7Rv9BEpf9UsvErfXhLKkEmogI0mizgri+nNjEENnpQcFOpx84GFTjax/Zta8MAxOMUP1XU5Guju80A==",
|
||||
"version": "5.6.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.6.0-beta.110.tgz",
|
||||
"integrity": "sha512-FPIKLySxbyWaXoBVbnc1KtbJe6CUV9DxZ9LHSs2gNHMN2jPmBhtdpDppeMqWwdmuCDBk9OcMSTPQNHT+mI4gSw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
@@ -1041,9 +1041,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/mkdirp": {
|
||||
"version": "1.0.4",
|
||||
|
||||
+12
-12
@@ -9,28 +9,28 @@
|
||||
"@vscode/deviceid": "^0.1.1",
|
||||
"@vscode/iconv-lite-umd": "0.7.0",
|
||||
"@vscode/proxy-agent": "^0.32.0",
|
||||
"@vscode/ripgrep": "^1.15.11",
|
||||
"@vscode/ripgrep": "^1.15.13",
|
||||
"@vscode/spdlog": "^0.15.2",
|
||||
"@vscode/tree-sitter-wasm": "^0.1.4",
|
||||
"@vscode/vscode-languagedetection": "1.0.21",
|
||||
"@vscode/windows-process-tree": "^0.6.0",
|
||||
"@vscode/windows-registry": "^1.1.0",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.90",
|
||||
"@xterm/addon-image": "^0.9.0-beta.107",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.107",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.13",
|
||||
"@xterm/addon-search": "^0.16.0-beta.107",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.107",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.107",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.107",
|
||||
"@xterm/headless": "^5.6.0-beta.107",
|
||||
"@xterm/xterm": "^5.6.0-beta.107",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.93",
|
||||
"@xterm/addon-image": "^0.9.0-beta.110",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.110",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.16",
|
||||
"@xterm/addon-search": "^0.16.0-beta.110",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.110",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.110",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.110",
|
||||
"@xterm/headless": "^5.6.0-beta.110",
|
||||
"@xterm/xterm": "^5.6.0-beta.110",
|
||||
"cookie": "^0.7.0",
|
||||
"http-proxy-agent": "^7.0.0",
|
||||
"https-proxy-agent": "^7.0.2",
|
||||
"jschardet": "3.1.4",
|
||||
"kerberos": "2.1.1",
|
||||
"minimist": "^1.2.6",
|
||||
"minimist": "^1.2.8",
|
||||
"native-watchdog": "^1.4.1",
|
||||
"node-pty": "^1.1.0-beta33",
|
||||
"tas-client-umd": "0.2.0",
|
||||
|
||||
Generated
+44
-44
@@ -13,15 +13,15 @@
|
||||
"@vscode/iconv-lite-umd": "0.7.0",
|
||||
"@vscode/tree-sitter-wasm": "^0.1.4",
|
||||
"@vscode/vscode-languagedetection": "1.0.21",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.90",
|
||||
"@xterm/addon-image": "^0.9.0-beta.107",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.107",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.13",
|
||||
"@xterm/addon-search": "^0.16.0-beta.107",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.107",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.107",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.107",
|
||||
"@xterm/xterm": "^5.6.0-beta.107",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.93",
|
||||
"@xterm/addon-image": "^0.9.0-beta.110",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.110",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.16",
|
||||
"@xterm/addon-search": "^0.16.0-beta.110",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.110",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.110",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.110",
|
||||
"@xterm/xterm": "^5.6.0-beta.110",
|
||||
"jschardet": "3.1.4",
|
||||
"tas-client-umd": "0.2.0",
|
||||
"vscode-oniguruma": "1.7.0",
|
||||
@@ -90,30 +90,30 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-clipboard": {
|
||||
"version": "0.2.0-beta.90",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.90.tgz",
|
||||
"integrity": "sha512-2i7qtACRBYRTRba831ufEjQMeAvK4uuVPYPBkSXzKJ/dIAvhws5B6OOmxqZzR97OsmzUC/SrjHSujgwyD0MVVw==",
|
||||
"version": "0.2.0-beta.93",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.93.tgz",
|
||||
"integrity": "sha512-A+XZnJgROYtvcIVGGYM6lH5PbXdVoMz/c140Pq9wu0jq++z3zHkcfTIMWO8E/xrvCO9Op3LTv9fu5NEhOI2l3A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"js-base64": "^3.7.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-image": {
|
||||
"version": "0.9.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.9.0-beta.107.tgz",
|
||||
"integrity": "sha512-/vqb2BhVjJeCcOIDSpjWrfXbhNTCse95qkKbpmzFkQJJEh0CyaqjSUBIAM+Qcl9f/x6H//O2wADnn3Wsn5qYsg==",
|
||||
"version": "0.9.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.9.0-beta.110.tgz",
|
||||
"integrity": "sha512-mzs2nIWqVay/1q3H74UQZwE0/MU4pNTEIkle3n+sYYbFJh8ZVOPKQfnl5ze7DWnQnqm3hqg2FDXZKfXj8fkdEA==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-ligatures": {
|
||||
"version": "0.10.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-ligatures/-/addon-ligatures-0.10.0-beta.107.tgz",
|
||||
"integrity": "sha512-3qQZz6dPS8XlGGwz1p5Bqjoosah6Km1GwGeNv7YxkCVU2kpTOymFH8BMUEOFC5WHdYseDXnz8hIEleexF9Pa2g==",
|
||||
"version": "0.10.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-ligatures/-/addon-ligatures-0.10.0-beta.110.tgz",
|
||||
"integrity": "sha512-k8ILGtdbmUTJURGX0h857C3F6KXxIwrOpsfEC5v1k3ffW3mJn6qkKOTmOyS89QcpWXXbbqvLJRLQ7FWGKYvlgg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"font-finder": "^1.1.0",
|
||||
@@ -123,58 +123,58 @@
|
||||
"node": ">8.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-progress": {
|
||||
"version": "0.2.0-beta.13",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-progress/-/addon-progress-0.2.0-beta.13.tgz",
|
||||
"integrity": "sha512-BLmX+JdA+LLOMbVLQm+gPqieeKaVMiugBFpCtQtBus3kCs/2/F8pU/XNGV31CnXxDdRjptyOGrPVRreF/rDdcg==",
|
||||
"version": "0.2.0-beta.16",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-progress/-/addon-progress-0.2.0-beta.16.tgz",
|
||||
"integrity": "sha512-VqxaYIMx8TjeL9s4CYxMP8kFOQPEhcjEzrSLqYmpvhY2RpCJrDjf0HPh/wy9HDADJIWLZE6Gjcva7yub02fJXg==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-search": {
|
||||
"version": "0.16.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.16.0-beta.107.tgz",
|
||||
"integrity": "sha512-poHjeKjnTKtS6rHyu3r5lhW/0rdLcRMSJLDmT9xo9lfTuyhfcUl8gro44iPtscKY+LEtrhZcortTlElMewy/Bw==",
|
||||
"version": "0.16.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.16.0-beta.110.tgz",
|
||||
"integrity": "sha512-f7pi12E/7lD5Oz/Wrt3DL6kXOU7jVjA6ZAXisznBQTH1M4vxY3agvgUYVHWYFHyY1uWwheL1K089nzfjT5A1Lg==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-serialize": {
|
||||
"version": "0.14.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.107.tgz",
|
||||
"integrity": "sha512-MGaoO2zlNuSGofX5Xfbw+MU2wgAApEsDOPeYoEBSQyLf5BR7Z2rGVCxFyF5zNsIhNDov7ptQIVpCfonMVAgUvg==",
|
||||
"version": "0.14.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.110.tgz",
|
||||
"integrity": "sha512-uCHdHwwp2HWTCSMavkmYylgebiCGW+P76XJp04uVJnMBIPTSLGKygiCRQbxDsRB6mblsYislMEw4P9egKl/eqA==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-unicode11": {
|
||||
"version": "0.9.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.107.tgz",
|
||||
"integrity": "sha512-XTfJ1G7u+8zOT6faCfEB49AbVFAX4XWUoiLtyXCfRvbrVuv5wv53T03dLtBtpwjWoFaveLKGl3ZiU7t3dpl0RA==",
|
||||
"version": "0.9.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.110.tgz",
|
||||
"integrity": "sha512-HMfvm7ZaUgN2I78Lk/YXazfnLTntCwZidi25BtVNJWy+ibgSM9EUfs/AsnDx8JbeTPqGpHxvybWaIUC3maNurQ==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-webgl": {
|
||||
"version": "0.19.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.107.tgz",
|
||||
"integrity": "sha512-wdUkYiV4PnR9+7+1giJoFm5xrguCOKTH4xdQ/6lYuSbgMS0y1ykpcQjDNshwHy0TyUuh4o4z1+rd48qNjqGM6Q==",
|
||||
"version": "0.19.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.110.tgz",
|
||||
"integrity": "sha512-1fVHcG5lKdencCBI6b6ZZwlTs54Ax3EtbngkgwVHnqVR4jMmHQ5E8G/AH6Vk+OpVNANW+//oArDtosFUIDFKWw==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.6.0-beta.107"
|
||||
"@xterm/xterm": "^5.6.0-beta.110"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/xterm": {
|
||||
"version": "5.6.0-beta.107",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.6.0-beta.107.tgz",
|
||||
"integrity": "sha512-7cuJFZtc7Rv9BEpf9UsvErfXhLKkEmogI0mizgri+nNjEENnpQcFOpx84GFTjax/Zta8MAxOMUP1XU5Guju80A==",
|
||||
"version": "5.6.0-beta.110",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.6.0-beta.110.tgz",
|
||||
"integrity": "sha512-FPIKLySxbyWaXoBVbnc1KtbJe6CUV9DxZ9LHSs2gNHMN2jPmBhtdpDppeMqWwdmuCDBk9OcMSTPQNHT+mI4gSw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/font-finder": {
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
"@vscode/iconv-lite-umd": "0.7.0",
|
||||
"@vscode/tree-sitter-wasm": "^0.1.4",
|
||||
"@vscode/vscode-languagedetection": "1.0.21",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.90",
|
||||
"@xterm/addon-image": "^0.9.0-beta.107",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.107",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.13",
|
||||
"@xterm/addon-search": "^0.16.0-beta.107",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.107",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.107",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.107",
|
||||
"@xterm/xterm": "^5.6.0-beta.107",
|
||||
"@xterm/addon-clipboard": "^0.2.0-beta.93",
|
||||
"@xterm/addon-image": "^0.9.0-beta.110",
|
||||
"@xterm/addon-ligatures": "^0.10.0-beta.110",
|
||||
"@xterm/addon-progress": "^0.2.0-beta.16",
|
||||
"@xterm/addon-search": "^0.16.0-beta.110",
|
||||
"@xterm/addon-serialize": "^0.14.0-beta.110",
|
||||
"@xterm/addon-unicode11": "^0.9.0-beta.110",
|
||||
"@xterm/addon-webgl": "^0.19.0-beta.110",
|
||||
"@xterm/xterm": "^5.6.0-beta.110",
|
||||
"jschardet": "3.1.4",
|
||||
"tas-client-umd": "0.2.0",
|
||||
"vscode-oniguruma": "1.7.0",
|
||||
|
||||
@@ -33,7 +33,7 @@ async function main() {
|
||||
const serverArgs = process.argv.slice(2).filter(v => v !== '--launch');
|
||||
const addr = await startServer(serverArgs);
|
||||
if (args['launch']) {
|
||||
open(addr);
|
||||
open.default(addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ async function main() {
|
||||
|
||||
startServer(serverArgs);
|
||||
if (openSystemBrowser) {
|
||||
open(`http://${HOST}:${PORT}/`);
|
||||
open.default(`http://${HOST}:${PORT}/`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// *********************************************************************
|
||||
// * *
|
||||
// * We need this to redirect to node_modules from the remote-folder. *
|
||||
// * This ONLY applies when running out of source. *
|
||||
// * This ONLY applies when running out of source. *
|
||||
// * *
|
||||
// *********************************************************************
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"ban-document-execcommand": [
|
||||
"vs/workbench/contrib/codeEditor/electron-sandbox/inputClipboardActions.ts",
|
||||
"vs/workbench/contrib/codeEditor/electron-browser/inputClipboardActions.ts",
|
||||
"vs/editor/contrib/clipboard/browser/clipboard.ts"
|
||||
],
|
||||
"ban-eval-calls": [
|
||||
@@ -12,7 +12,7 @@
|
||||
"vs/workbench/services/keybinding/test/node/keyboardMapperTestUtils.ts"
|
||||
],
|
||||
"ban-trustedtypes-createpolicy": [
|
||||
"vs/code/electron-sandbox/workbench/workbench.ts",
|
||||
"vs/code/electron-browser/workbench/workbench.ts",
|
||||
"vs/amdX.ts",
|
||||
"vs/base/browser/trustedTypes.ts",
|
||||
"vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts"
|
||||
@@ -37,6 +37,6 @@
|
||||
"**/*.ts"
|
||||
],
|
||||
"ban-script-content-assignments": [
|
||||
"vs/code/electron-sandbox/workbench/workbench.ts"
|
||||
"vs/code/electron-browser/workbench/workbench.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+9
@@ -17,6 +17,7 @@ declare global {
|
||||
function requestIdleCallback(callback: (args: IdleDeadline) => void, options?: { timeout: number }): number;
|
||||
function cancelIdleCallback(handle: number): void;
|
||||
|
||||
|
||||
// --- timeout / interval (available in all contexts, but different signatures in node.js vs web)
|
||||
|
||||
interface TimeoutHandle {readonly _: never; /* this is a trick that seems needed to prevent direct number assignment */}
|
||||
@@ -26,6 +27,14 @@ declare global {
|
||||
|
||||
function setInterval(callback: (...args: any[]) => void, delay?: number, ...args: any[]): Timeout;
|
||||
function clearInterval(timeout: Timeout | undefined): void;
|
||||
|
||||
|
||||
// --- error
|
||||
|
||||
interface ErrorConstructor {
|
||||
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
||||
stackTraceLimit: number;
|
||||
}
|
||||
}
|
||||
|
||||
export { }
|
||||
|
||||
+16
-11
@@ -11,6 +11,11 @@ import { generateUuid } from './base/common/uuid.js';
|
||||
|
||||
export const canASAR = false; // TODO@esm: ASAR disabled in ESM
|
||||
|
||||
declare const window: any;
|
||||
declare const document: any;
|
||||
declare const self: any;
|
||||
declare const globalThis: any;
|
||||
|
||||
class DefineCall {
|
||||
constructor(
|
||||
public readonly id: string | null | undefined,
|
||||
@@ -41,7 +46,7 @@ class AMDModuleImporter {
|
||||
|
||||
private _initialize(): void {
|
||||
if (this._state === AMDModuleImporterState.Uninitialized) {
|
||||
if ((globalThis as any).define) {
|
||||
if (globalThis.define) {
|
||||
this._state = AMDModuleImporterState.InitializedExternal;
|
||||
return;
|
||||
}
|
||||
@@ -51,7 +56,7 @@ class AMDModuleImporter {
|
||||
|
||||
this._state = AMDModuleImporterState.InitializedInternal;
|
||||
|
||||
(globalThis as any).define = (id: any, dependencies: any, callback: any) => {
|
||||
globalThis.define = (id: any, dependencies: any, callback: any) => {
|
||||
if (typeof id !== 'string') {
|
||||
callback = dependencies;
|
||||
dependencies = id;
|
||||
@@ -67,11 +72,11 @@ class AMDModuleImporter {
|
||||
this._defineCalls.push(new DefineCall(id, dependencies, callback));
|
||||
};
|
||||
|
||||
(globalThis as any).define.amd = true;
|
||||
globalThis.define.amd = true;
|
||||
|
||||
if (this._isRenderer) {
|
||||
this._amdPolicy = (globalThis as any)._VSCODE_WEB_PACKAGE_TTP ?? window.trustedTypes?.createPolicy('amdLoader', {
|
||||
createScriptURL(value) {
|
||||
this._amdPolicy = globalThis._VSCODE_WEB_PACKAGE_TTP ?? window.trustedTypes?.createPolicy('amdLoader', {
|
||||
createScriptURL(value: any) {
|
||||
if (value.startsWith(window.location.origin)) {
|
||||
return value;
|
||||
}
|
||||
@@ -82,7 +87,7 @@ class AMDModuleImporter {
|
||||
}
|
||||
});
|
||||
} else if (this._isWebWorker) {
|
||||
this._amdPolicy = (globalThis as any)._VSCODE_WEB_PACKAGE_TTP ?? (globalThis as any).trustedTypes?.createPolicy('amdLoader', {
|
||||
this._amdPolicy = globalThis._VSCODE_WEB_PACKAGE_TTP ?? globalThis.trustedTypes?.createPolicy('amdLoader', {
|
||||
createScriptURL(value: string) {
|
||||
return value;
|
||||
}
|
||||
@@ -96,7 +101,7 @@ class AMDModuleImporter {
|
||||
if (this._state === AMDModuleImporterState.InitializedExternal) {
|
||||
return new Promise<T>(resolve => {
|
||||
const tmpModuleId = generateUuid();
|
||||
(globalThis as any).define(tmpModuleId, [scriptSrc], function (moduleResult: T) {
|
||||
globalThis.define(tmpModuleId, [scriptSrc], function (moduleResult: T) {
|
||||
resolve(moduleResult);
|
||||
});
|
||||
});
|
||||
@@ -157,7 +162,7 @@ class AMDModuleImporter {
|
||||
scriptElement.addEventListener('load', loadEventListener);
|
||||
scriptElement.addEventListener('error', errorEventListener);
|
||||
if (this._amdPolicy) {
|
||||
scriptSrc = this._amdPolicy.createScriptURL(scriptSrc) as any as string;
|
||||
scriptSrc = this._amdPolicy.createScriptURL(scriptSrc) as unknown as string;
|
||||
}
|
||||
scriptElement.setAttribute('src', scriptSrc);
|
||||
window.document.getElementsByTagName('head')[0].appendChild(scriptElement);
|
||||
@@ -166,7 +171,7 @@ class AMDModuleImporter {
|
||||
|
||||
private async _workerLoadScript(scriptSrc: string): Promise<DefineCall | undefined> {
|
||||
if (this._amdPolicy) {
|
||||
scriptSrc = this._amdPolicy.createScriptURL(scriptSrc) as any as string;
|
||||
scriptSrc = this._amdPolicy.createScriptURL(scriptSrc) as unknown as string;
|
||||
}
|
||||
await import(scriptSrc);
|
||||
return this._defineCalls.pop();
|
||||
@@ -202,7 +207,7 @@ const cache = new Map<string, Promise<any>>();
|
||||
export async function importAMDNodeModule<T>(nodeModuleName: string, pathInsideNodeModule: string, isBuilt?: boolean): Promise<T> {
|
||||
if (isBuilt === undefined) {
|
||||
const product = globalThis._VSCODE_PRODUCT_JSON as unknown as IProductConfiguration;
|
||||
isBuilt = Boolean((product ?? (globalThis as any).vscode?.context?.configuration()?.product)?.commit);
|
||||
isBuilt = Boolean((product ?? globalThis.vscode?.context?.configuration()?.product)?.commit);
|
||||
}
|
||||
|
||||
const nodeModulePath = pathInsideNodeModule ? `${nodeModuleName}/${pathInsideNodeModule}` : nodeModuleName;
|
||||
@@ -227,7 +232,7 @@ export async function importAMDNodeModule<T>(nodeModuleName: string, pathInsideN
|
||||
|
||||
export function resolveAmdNodeModulePath(nodeModuleName: string, pathInsideNodeModule: string): string {
|
||||
const product = globalThis._VSCODE_PRODUCT_JSON as unknown as IProductConfiguration;
|
||||
const isBuilt = Boolean((product ?? (globalThis as any).vscode?.context?.configuration()?.product)?.commit);
|
||||
const isBuilt = Boolean((product ?? globalThis.vscode?.context?.configuration()?.product)?.commit);
|
||||
const useASAR = (canASAR && isBuilt && !platform.isWeb);
|
||||
|
||||
const nodeModulePath = `${nodeModuleName}/${pathInsideNodeModule}`;
|
||||
|
||||
+352
-3
@@ -8,7 +8,7 @@ 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 { BugIndicatingError, onUnexpectedError } from '../common/errors.js';
|
||||
import * as event from '../common/event.js';
|
||||
import dompurify from './dompurify/dompurify.js';
|
||||
import { KeyCode } from '../common/keyCodes.js';
|
||||
@@ -19,8 +19,7 @@ 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 * from './domImpl/domObservable.js';
|
||||
export * from './domImpl/n.js';
|
||||
import { IObservable, derived, derivedOpts, IReader, observableValue } from '../common/observable.js';
|
||||
|
||||
export interface IRegisteredCodeWindow {
|
||||
readonly window: CodeWindow;
|
||||
@@ -2395,3 +2394,353 @@ export class SafeTriangle {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export namespace n {
|
||||
function nodeNs<TMap extends Record<string, any>>(elementNs: string | undefined = undefined): DomTagCreateFn<TMap> {
|
||||
return (tag, attributes, children) => {
|
||||
const className = attributes.class;
|
||||
delete attributes.class;
|
||||
const ref = attributes.ref;
|
||||
delete attributes.ref;
|
||||
const obsRef = attributes.obsRef;
|
||||
delete attributes.obsRef;
|
||||
|
||||
return new ObserverNodeWithElement(tag as any, ref, obsRef, elementNs, className, attributes, children);
|
||||
};
|
||||
}
|
||||
|
||||
function node<TMap extends Record<string, any>, TKey extends keyof TMap>(tag: TKey, elementNs: string | undefined = undefined): DomCreateFn<TMap[TKey], TMap[TKey]> {
|
||||
const f = nodeNs(elementNs) as any;
|
||||
return (attributes, children) => {
|
||||
return f(tag, attributes, children);
|
||||
};
|
||||
}
|
||||
|
||||
export const div: DomCreateFn<HTMLDivElement, HTMLDivElement> = node<HTMLElementTagNameMap, 'div'>('div');
|
||||
|
||||
export const elem = nodeNs<HTMLElementTagNameMap>(undefined);
|
||||
|
||||
export const svg: DomCreateFn<SVGElementTagNameMap2['svg'], SVGElement> = node<SVGElementTagNameMap2, 'svg'>('svg', 'http://www.w3.org/2000/svg');
|
||||
|
||||
export const svgElem = nodeNs<SVGElementTagNameMap2>('http://www.w3.org/2000/svg');
|
||||
|
||||
export function ref<T = HTMLOrSVGElement>(): IRefWithVal<T> {
|
||||
let value: T | undefined = undefined;
|
||||
const result: IRef<T> = function (val: T) {
|
||||
value = val;
|
||||
};
|
||||
Object.defineProperty(result, 'element', {
|
||||
get() {
|
||||
if (!value) {
|
||||
throw new BugIndicatingError('Make sure the ref is set before accessing the element. Maybe wrong initialization order?');
|
||||
}
|
||||
return value;
|
||||
}
|
||||
});
|
||||
return result as any;
|
||||
}
|
||||
}
|
||||
type Value<T> = T | IObservable<T>;
|
||||
type ValueOrList<T> = Value<T> | ValueOrList<T>[];
|
||||
type ValueOrList2<T> = ValueOrList<T> | ValueOrList<ValueOrList<T>>;
|
||||
type HTMLOrSVGElement = HTMLElement | SVGElement;
|
||||
type SVGElementTagNameMap2 = {
|
||||
svg: SVGElement & {
|
||||
width: number;
|
||||
height: number;
|
||||
transform: string;
|
||||
viewBox: string;
|
||||
fill: string;
|
||||
};
|
||||
path: SVGElement & {
|
||||
d: string;
|
||||
stroke: string;
|
||||
fill: string;
|
||||
};
|
||||
linearGradient: SVGElement & {
|
||||
id: string;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
};
|
||||
stop: SVGElement & {
|
||||
offset: string;
|
||||
};
|
||||
rect: SVGElement & {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
fill: string;
|
||||
};
|
||||
defs: SVGElement;
|
||||
};
|
||||
type DomTagCreateFn<TMap extends Record<string, any>> = <TTag extends keyof TMap>(
|
||||
tag: TTag,
|
||||
attributes: ElementAttributeKeys<TMap[TTag]> & { class?: ValueOrList<string | false | undefined>; ref?: IRef<TMap[TTag]>; obsRef?: IRef<ObserverNodeWithElement<TMap[TTag]> | null> },
|
||||
children?: ChildNode
|
||||
) => ObserverNode<TMap[TTag]>;
|
||||
type DomCreateFn<TAttributes, TResult extends HTMLOrSVGElement> = (
|
||||
attributes: ElementAttributeKeys<TAttributes> & { class?: ValueOrList<string | false | undefined>; ref?: IRef<TResult>; obsRef?: IRef<ObserverNodeWithElement<TResult> | null> },
|
||||
children?: ChildNode
|
||||
) => ObserverNode<TResult>;
|
||||
|
||||
export type ChildNode = ValueOrList2<HTMLOrSVGElement | string | ObserverNode | undefined>;
|
||||
|
||||
export type IRef<T> = (value: T) => void;
|
||||
|
||||
export interface IRefWithVal<T> extends IRef<T> {
|
||||
readonly element: T;
|
||||
}
|
||||
|
||||
export abstract class ObserverNode<T extends HTMLOrSVGElement = HTMLOrSVGElement> {
|
||||
private readonly _deriveds: (IObservable<any>)[] = [];
|
||||
|
||||
protected readonly _element: T;
|
||||
|
||||
constructor(
|
||||
tag: string,
|
||||
ref: IRef<T> | undefined,
|
||||
obsRef: IRef<ObserverNodeWithElement<T> | null> | undefined,
|
||||
ns: string | undefined,
|
||||
className: ValueOrList<string | undefined | false> | undefined,
|
||||
attributes: ElementAttributeKeys<T>,
|
||||
children: ChildNode
|
||||
) {
|
||||
this._element = (ns ? document.createElementNS(ns, tag) : document.createElement(tag)) as unknown as T;
|
||||
if (ref) {
|
||||
ref(this._element);
|
||||
}
|
||||
if (obsRef) {
|
||||
this._deriveds.push(derived((_reader) => {
|
||||
obsRef(this as unknown as ObserverNodeWithElement<T>);
|
||||
_reader.store.add({
|
||||
dispose: () => {
|
||||
obsRef(null);
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
if (className) {
|
||||
if (hasObservable(className)) {
|
||||
this._deriveds.push(derived(this, reader => {
|
||||
/** @description set.class */
|
||||
setClassName(this._element, getClassName(className, reader));
|
||||
}));
|
||||
} else {
|
||||
setClassName(this._element, getClassName(className, undefined));
|
||||
}
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(attributes)) {
|
||||
if (key === 'style') {
|
||||
for (const [cssKey, cssValue] of Object.entries(value)) {
|
||||
const key = camelCaseToHyphenCase(cssKey);
|
||||
if (isObservable(cssValue)) {
|
||||
this._deriveds.push(derivedOpts({ owner: this, debugName: () => `set.style.${key}` }, reader => {
|
||||
this._element.style.setProperty(key, convertCssValue(cssValue.read(reader)));
|
||||
}));
|
||||
} else {
|
||||
this._element.style.setProperty(key, convertCssValue(cssValue));
|
||||
}
|
||||
}
|
||||
} else if (key === 'tabIndex') {
|
||||
if (isObservable(value)) {
|
||||
this._deriveds.push(derived(this, reader => {
|
||||
/** @description set.tabIndex */
|
||||
this._element.tabIndex = value.read(reader) as any;
|
||||
}));
|
||||
} else {
|
||||
this._element.tabIndex = value;
|
||||
}
|
||||
} else if (key.startsWith('on')) {
|
||||
(this._element as any)[key] = value;
|
||||
} else {
|
||||
if (isObservable(value)) {
|
||||
this._deriveds.push(derivedOpts({ owner: this, debugName: () => `set.${key}` }, reader => {
|
||||
setOrRemoveAttribute(this._element, key, value.read(reader));
|
||||
}));
|
||||
} else {
|
||||
setOrRemoveAttribute(this._element, key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (children) {
|
||||
function getChildren(reader: IReader | undefined, children: ValueOrList2<HTMLOrSVGElement | string | ObserverNode | undefined>): (HTMLOrSVGElement | string)[] {
|
||||
if (isObservable(children)) {
|
||||
return getChildren(reader, children.read(reader));
|
||||
}
|
||||
if (Array.isArray(children)) {
|
||||
return children.flatMap(c => getChildren(reader, c));
|
||||
}
|
||||
if (children instanceof ObserverNode) {
|
||||
if (reader) {
|
||||
children.readEffect(reader);
|
||||
}
|
||||
return [children._element];
|
||||
}
|
||||
if (children) {
|
||||
return [children];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
const d = derived(this, reader => {
|
||||
/** @description set.children */
|
||||
this._element.replaceChildren(...getChildren(reader, children));
|
||||
});
|
||||
this._deriveds.push(d);
|
||||
if (!childrenIsObservable(children)) {
|
||||
d.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
readEffect(reader: IReader | undefined): void {
|
||||
for (const d of this._deriveds) {
|
||||
d.read(reader);
|
||||
}
|
||||
}
|
||||
|
||||
keepUpdated(store: DisposableStore): ObserverNodeWithElement<T> {
|
||||
derived(reader => {
|
||||
/** update */
|
||||
this.readEffect(reader);
|
||||
}).recomputeInitiallyAndOnChange(store);
|
||||
return this as unknown as ObserverNodeWithElement<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a live element that will keep the element updated as long as the returned object is not disposed.
|
||||
*/
|
||||
toDisposableLiveElement() {
|
||||
const store = new DisposableStore();
|
||||
this.keepUpdated(store);
|
||||
return new LiveElement(this._element, store);
|
||||
}
|
||||
}
|
||||
function setClassName(domNode: HTMLOrSVGElement, className: string) {
|
||||
if (isSVGElement(domNode)) {
|
||||
domNode.setAttribute('class', className);
|
||||
} else {
|
||||
domNode.className = className;
|
||||
}
|
||||
}
|
||||
function resolve<T>(value: ValueOrList<T>, reader: IReader | undefined, cb: (val: T) => void): void {
|
||||
if (isObservable(value)) {
|
||||
cb(value.read(reader));
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
for (const v of value) {
|
||||
resolve(v, reader, cb);
|
||||
}
|
||||
return;
|
||||
}
|
||||
cb(value as any);
|
||||
}
|
||||
function getClassName(className: ValueOrList<string | undefined | false> | undefined, reader: IReader | undefined): string {
|
||||
let result = '';
|
||||
resolve(className, reader, val => {
|
||||
if (val) {
|
||||
if (result.length === 0) {
|
||||
result = val;
|
||||
} else {
|
||||
result += ' ' + val;
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function hasObservable(value: ValueOrList<unknown>): boolean {
|
||||
if (isObservable(value)) {
|
||||
return true;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
return value.some(v => hasObservable(v));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function convertCssValue(value: any): string {
|
||||
if (typeof value === 'number') {
|
||||
return value + 'px';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function childrenIsObservable(children: ValueOrList2<HTMLOrSVGElement | string | ObserverNode | undefined>): boolean {
|
||||
if (isObservable(children)) {
|
||||
return true;
|
||||
}
|
||||
if (Array.isArray(children)) {
|
||||
return children.some(c => childrenIsObservable(c));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export class LiveElement<T extends HTMLOrSVGElement = HTMLElement> {
|
||||
constructor(
|
||||
public readonly element: T,
|
||||
private readonly _disposable: IDisposable
|
||||
) { }
|
||||
|
||||
dispose() {
|
||||
this._disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
export class ObserverNodeWithElement<T extends HTMLOrSVGElement = HTMLOrSVGElement> extends ObserverNode<T> {
|
||||
public get element() {
|
||||
return this._element;
|
||||
}
|
||||
|
||||
private _isHovered: IObservable<boolean> | undefined = undefined;
|
||||
|
||||
get isHovered(): IObservable<boolean> {
|
||||
if (!this._isHovered) {
|
||||
const hovered = observableValue<boolean>('hovered', false);
|
||||
this._element.addEventListener('mouseenter', (_e) => hovered.set(true, undefined));
|
||||
this._element.addEventListener('mouseleave', (_e) => hovered.set(false, undefined));
|
||||
this._isHovered = hovered;
|
||||
}
|
||||
return this._isHovered;
|
||||
}
|
||||
|
||||
private _didMouseMoveDuringHover: IObservable<boolean> | undefined = undefined;
|
||||
|
||||
get didMouseMoveDuringHover(): IObservable<boolean> {
|
||||
if (!this._didMouseMoveDuringHover) {
|
||||
let _hovering = false;
|
||||
const hovered = observableValue<boolean>('didMouseMoveDuringHover', false);
|
||||
this._element.addEventListener('mouseenter', (_e) => {
|
||||
_hovering = true;
|
||||
});
|
||||
this._element.addEventListener('mousemove', (_e) => {
|
||||
if (_hovering) {
|
||||
hovered.set(true, undefined);
|
||||
}
|
||||
});
|
||||
this._element.addEventListener('mouseleave', (_e) => {
|
||||
_hovering = false;
|
||||
hovered.set(false, undefined);
|
||||
});
|
||||
this._didMouseMoveDuringHover = hovered;
|
||||
}
|
||||
return this._didMouseMoveDuringHover;
|
||||
}
|
||||
}
|
||||
function setOrRemoveAttribute(element: HTMLOrSVGElement, key: string, value: unknown) {
|
||||
if (value === null || value === undefined) {
|
||||
element.removeAttribute(camelCaseToHyphenCase(key));
|
||||
} else {
|
||||
element.setAttribute(camelCaseToHyphenCase(key), String(value));
|
||||
}
|
||||
}
|
||||
|
||||
function isObservable<T>(obj: unknown): obj is IObservable<T> {
|
||||
return !!obj && (<IObservable<T>>obj).read !== undefined && (<IObservable<T>>obj).reportChanges !== undefined;
|
||||
}
|
||||
type ElementAttributeKeys<T> = Partial<{
|
||||
[K in keyof T]: T[K] extends Function ? never : T[K] extends object ? ElementAttributeKeys<T[K]> : Value<number | T[K] | undefined | null>;
|
||||
}>;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { DisposableStore, IDisposable } from '../../common/lifecycle.js';
|
||||
import { autorun, IObservable } from '../../common/observable.js';
|
||||
import { createStyleSheet2 } from '../domStylesheets.js';
|
||||
|
||||
export function createStyleSheetFromObservable(css: IObservable<string>): IDisposable {
|
||||
const store = new DisposableStore();
|
||||
const w = store.add(createStyleSheet2());
|
||||
store.add(autorun(reader => {
|
||||
w.setStyle(css.read(reader));
|
||||
}));
|
||||
return store;
|
||||
}
|
||||
@@ -1,373 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { BugIndicatingError } from '../../common/errors.js';
|
||||
import { DisposableStore, IDisposable } from '../../common/lifecycle.js';
|
||||
import { derived, derivedOpts, IObservable, IReader, observableValue } from '../../common/observable.js';
|
||||
import { isSVGElement } from '../dom.js';
|
||||
|
||||
export namespace n {
|
||||
function nodeNs<TMap extends Record<string, any>>(elementNs: string | undefined = undefined): DomTagCreateFn<TMap> {
|
||||
return (tag, attributes, children) => {
|
||||
const className = attributes.class;
|
||||
delete attributes.class;
|
||||
const ref = attributes.ref;
|
||||
delete attributes.ref;
|
||||
const obsRef = attributes.obsRef;
|
||||
delete attributes.obsRef;
|
||||
|
||||
return new ObserverNodeWithElement(tag as any, ref, obsRef, elementNs, className, attributes, children);
|
||||
};
|
||||
}
|
||||
|
||||
function node<TMap extends Record<string, any>, TKey extends keyof TMap>(tag: TKey, elementNs: string | undefined = undefined): DomCreateFn<TMap[TKey], TMap[TKey]> {
|
||||
const f = nodeNs(elementNs) as any;
|
||||
return (attributes, children) => {
|
||||
return f(tag, attributes, children);
|
||||
};
|
||||
}
|
||||
|
||||
export const div: DomCreateFn<HTMLDivElement, HTMLDivElement> = node<HTMLElementTagNameMap, 'div'>('div');
|
||||
|
||||
export const elem = nodeNs<HTMLElementTagNameMap>(undefined);
|
||||
|
||||
export const svg: DomCreateFn<SVGElementTagNameMap2['svg'], SVGElement> = node<SVGElementTagNameMap2, 'svg'>('svg', 'http://www.w3.org/2000/svg');
|
||||
|
||||
export const svgElem = nodeNs<SVGElementTagNameMap2>('http://www.w3.org/2000/svg');
|
||||
|
||||
export function ref<T = Element>(): IRefWithVal<T> {
|
||||
let value: T | undefined = undefined;
|
||||
const result: IRef<T> = function (val: T) {
|
||||
value = val;
|
||||
};
|
||||
Object.defineProperty(result, 'element', {
|
||||
get() {
|
||||
if (!value) {
|
||||
throw new BugIndicatingError('Make sure the ref is set before accessing the element. Maybe wrong initialization order?');
|
||||
}
|
||||
return value;
|
||||
}
|
||||
});
|
||||
return result as any;
|
||||
}
|
||||
}
|
||||
|
||||
type Value<T> = T | IObservable<T>;
|
||||
type ValueOrList<T> = Value<T> | ValueOrList<T>[];
|
||||
type ValueOrList2<T> = ValueOrList<T> | ValueOrList<ValueOrList<T>>;
|
||||
type Element = HTMLElement | SVGElement;
|
||||
type SVGElementTagNameMap2 = {
|
||||
svg: SVGElement & {
|
||||
width: number;
|
||||
height: number;
|
||||
transform: string;
|
||||
viewBox: string;
|
||||
fill: string;
|
||||
};
|
||||
path: SVGElement & {
|
||||
d: string;
|
||||
stroke: string;
|
||||
fill: string;
|
||||
};
|
||||
linearGradient: SVGElement & {
|
||||
id: string;
|
||||
x1: string | number;
|
||||
x2: string | number;
|
||||
};
|
||||
stop: SVGElement & {
|
||||
offset: string;
|
||||
};
|
||||
rect: SVGElement & {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
fill: string;
|
||||
};
|
||||
defs: SVGElement;
|
||||
};
|
||||
|
||||
type DomTagCreateFn<TMap extends Record<string, any>> = <TTag extends keyof TMap>(
|
||||
tag: TTag,
|
||||
attributes: ElementAttributeKeys<TMap[TTag]> & { class?: ValueOrList<string | false | undefined>; ref?: IRef<TMap[TTag]>; obsRef?: IRef<ObserverNodeWithElement<TMap[TTag]> | null> },
|
||||
children?: ChildNode
|
||||
) => ObserverNode<TMap[TTag]>;
|
||||
|
||||
type DomCreateFn<TAttributes, TResult extends Element> = (
|
||||
attributes: ElementAttributeKeys<TAttributes> & { class?: ValueOrList<string | false | undefined>; ref?: IRef<TResult>; obsRef?: IRef<ObserverNodeWithElement<TResult> | null> },
|
||||
children?: ChildNode
|
||||
) => ObserverNode<TResult>;
|
||||
|
||||
export type ChildNode = ValueOrList2<Element | string | ObserverNode | undefined>;
|
||||
|
||||
export type IRef<T> = (value: T) => void;
|
||||
|
||||
export interface IRefWithVal<T> extends IRef<T> {
|
||||
readonly element: T;
|
||||
}
|
||||
|
||||
export abstract class ObserverNode<T extends Element = Element> {
|
||||
private readonly _deriveds: (IObservable<any>)[] = [];
|
||||
|
||||
protected readonly _element: T;
|
||||
|
||||
constructor(
|
||||
tag: string,
|
||||
ref: IRef<T> | undefined,
|
||||
obsRef: IRef<ObserverNodeWithElement<T> | null> | undefined,
|
||||
ns: string | undefined,
|
||||
className: ValueOrList<string | undefined | false> | undefined,
|
||||
attributes: ElementAttributeKeys<T>,
|
||||
children: ChildNode
|
||||
) {
|
||||
this._element = (ns ? document.createElementNS(ns, tag) : document.createElement(tag)) as unknown as T;
|
||||
if (ref) {
|
||||
ref(this._element);
|
||||
}
|
||||
if (obsRef) {
|
||||
this._deriveds.push(derived((_reader) => {
|
||||
obsRef(this as unknown as ObserverNodeWithElement<T>);
|
||||
_reader.store.add({
|
||||
dispose: () => {
|
||||
obsRef(null);
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
if (className) {
|
||||
if (hasObservable(className)) {
|
||||
this._deriveds.push(derived(this, reader => {
|
||||
/** @description set.class */
|
||||
setClassName(this._element, getClassName(className, reader));
|
||||
}));
|
||||
} else {
|
||||
setClassName(this._element, getClassName(className, undefined));
|
||||
}
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(attributes)) {
|
||||
if (key === 'style') {
|
||||
for (const [cssKey, cssValue] of Object.entries(value)) {
|
||||
const key = camelCaseToHyphenCase(cssKey);
|
||||
if (isObservable(cssValue)) {
|
||||
this._deriveds.push(derivedOpts({ owner: this, debugName: () => `set.style.${key}` }, reader => {
|
||||
this._element.style.setProperty(key, convertCssValue(cssValue.read(reader)));
|
||||
}));
|
||||
} else {
|
||||
this._element.style.setProperty(key, convertCssValue(cssValue));
|
||||
}
|
||||
}
|
||||
} else if (key === 'tabIndex') {
|
||||
if (isObservable(value)) {
|
||||
this._deriveds.push(derived(this, reader => {
|
||||
/** @description set.tabIndex */
|
||||
this._element.tabIndex = value.read(reader) as any;
|
||||
}));
|
||||
} else {
|
||||
this._element.tabIndex = value;
|
||||
}
|
||||
} else if (key.startsWith('on')) {
|
||||
(this._element as any)[key] = value;
|
||||
} else {
|
||||
if (isObservable(value)) {
|
||||
this._deriveds.push(derivedOpts({ owner: this, debugName: () => `set.${key}` }, reader => {
|
||||
setOrRemoveAttribute(this._element, key, value.read(reader));
|
||||
}));
|
||||
} else {
|
||||
setOrRemoveAttribute(this._element, key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (children) {
|
||||
function getChildren(reader: IReader | undefined, children: ValueOrList2<Element | string | ObserverNode | undefined>): (Element | string)[] {
|
||||
if (isObservable(children)) {
|
||||
return getChildren(reader, children.read(reader));
|
||||
}
|
||||
if (Array.isArray(children)) {
|
||||
return children.flatMap(c => getChildren(reader, c));
|
||||
}
|
||||
if (children instanceof ObserverNode) {
|
||||
if (reader) {
|
||||
children.readEffect(reader);
|
||||
}
|
||||
return [children._element];
|
||||
}
|
||||
if (children) {
|
||||
return [children];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
const d = derived(this, reader => {
|
||||
/** @description set.children */
|
||||
this._element.replaceChildren(...getChildren(reader, children));
|
||||
});
|
||||
this._deriveds.push(d);
|
||||
if (!childrenIsObservable(children)) {
|
||||
d.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
readEffect(reader: IReader | undefined): void {
|
||||
for (const d of this._deriveds) {
|
||||
d.read(reader);
|
||||
}
|
||||
}
|
||||
|
||||
keepUpdated(store: DisposableStore): ObserverNodeWithElement<T> {
|
||||
derived(reader => {
|
||||
/** update */
|
||||
this.readEffect(reader);
|
||||
}).recomputeInitiallyAndOnChange(store);
|
||||
return this as unknown as ObserverNodeWithElement<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a live element that will keep the element updated as long as the returned object is not disposed.
|
||||
*/
|
||||
toDisposableLiveElement() {
|
||||
const store = new DisposableStore();
|
||||
this.keepUpdated(store);
|
||||
return new LiveElement(this._element, store);
|
||||
}
|
||||
}
|
||||
|
||||
function setClassName(domNode: Element, className: string) {
|
||||
if (isSVGElement(domNode)) {
|
||||
domNode.setAttribute('class', className);
|
||||
} else {
|
||||
domNode.className = className;
|
||||
}
|
||||
}
|
||||
|
||||
function resolve<T>(value: ValueOrList<T>, reader: IReader | undefined, cb: (val: T) => void): void {
|
||||
if (isObservable(value)) {
|
||||
cb(value.read(reader));
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
for (const v of value) {
|
||||
resolve(v, reader, cb);
|
||||
}
|
||||
return;
|
||||
}
|
||||
cb(value as any);
|
||||
}
|
||||
|
||||
function getClassName(className: ValueOrList<string | undefined | false> | undefined, reader: IReader | undefined): string {
|
||||
let result = '';
|
||||
resolve(className, reader, val => {
|
||||
if (val) {
|
||||
if (result.length === 0) {
|
||||
result = val;
|
||||
} else {
|
||||
result += ' ' + val;
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function hasObservable(value: ValueOrList<unknown>): boolean {
|
||||
if (isObservable(value)) {
|
||||
return true;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
return value.some(v => hasObservable(v));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function convertCssValue(value: any): string {
|
||||
if (typeof value === 'number') {
|
||||
return value + 'px';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function childrenIsObservable(children: ValueOrList2<Element | string | ObserverNode | undefined>): boolean {
|
||||
if (isObservable(children)) {
|
||||
return true;
|
||||
}
|
||||
if (Array.isArray(children)) {
|
||||
return children.some(c => childrenIsObservable(c));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export class LiveElement<T extends Element = HTMLElement> {
|
||||
constructor(
|
||||
public readonly element: T,
|
||||
private readonly _disposable: IDisposable
|
||||
) { }
|
||||
|
||||
dispose() {
|
||||
this._disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
export class ObserverNodeWithElement<T extends Element = Element> extends ObserverNode<T> {
|
||||
public get element() {
|
||||
return this._element;
|
||||
}
|
||||
|
||||
private _isHovered: IObservable<boolean> | undefined = undefined;
|
||||
|
||||
get isHovered(): IObservable<boolean> {
|
||||
if (!this._isHovered) {
|
||||
const hovered = observableValue<boolean>('hovered', false);
|
||||
this._element.addEventListener('mouseenter', (_e) => hovered.set(true, undefined));
|
||||
this._element.addEventListener('mouseleave', (_e) => hovered.set(false, undefined));
|
||||
this._isHovered = hovered;
|
||||
}
|
||||
return this._isHovered;
|
||||
}
|
||||
|
||||
private _didMouseMoveDuringHover: IObservable<boolean> | undefined = undefined;
|
||||
|
||||
get didMouseMoveDuringHover(): IObservable<boolean> {
|
||||
if (!this._didMouseMoveDuringHover) {
|
||||
let _hovering = false;
|
||||
const hovered = observableValue<boolean>('didMouseMoveDuringHover', false);
|
||||
this._element.addEventListener('mouseenter', (_e) => {
|
||||
_hovering = true;
|
||||
});
|
||||
this._element.addEventListener('mousemove', (_e) => {
|
||||
if (_hovering) {
|
||||
hovered.set(true, undefined);
|
||||
}
|
||||
});
|
||||
this._element.addEventListener('mouseleave', (_e) => {
|
||||
_hovering = false;
|
||||
hovered.set(false, undefined);
|
||||
});
|
||||
this._didMouseMoveDuringHover = hovered;
|
||||
}
|
||||
return this._didMouseMoveDuringHover;
|
||||
}
|
||||
}
|
||||
|
||||
function setOrRemoveAttribute(element: Element, key: string, value: unknown) {
|
||||
if (value === null || value === undefined) {
|
||||
element.removeAttribute(camelCaseToHyphenCase(key));
|
||||
} else {
|
||||
element.setAttribute(camelCaseToHyphenCase(key), String(value));
|
||||
}
|
||||
}
|
||||
|
||||
function camelCaseToHyphenCase(str: string) {
|
||||
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
}
|
||||
|
||||
function isObservable<T>(obj: unknown): obj is IObservable<T> {
|
||||
return !!obj && (<IObservable<T>>obj).read !== undefined && (<IObservable<T>>obj).reportChanges !== undefined;
|
||||
}
|
||||
|
||||
type ElementAttributeKeys<T> = Partial<{
|
||||
[K in keyof T]: T[K] extends Function ? never : T[K] extends object ? ElementAttributeKeys<T[K]> : Value<number | T[K] | undefined | null>;
|
||||
}>;
|
||||
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { DisposableStore, toDisposable, IDisposable } from '../common/lifecycle.js';
|
||||
import { autorun, IObservable } from '../common/observable.js';
|
||||
import { getWindows, sharedMutationObserver } from './dom.js';
|
||||
import { mainWindow } from './window.js';
|
||||
|
||||
@@ -166,3 +167,12 @@ export function removeCSSRulesContainingSelector(ruleName: string, style = getSh
|
||||
function isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule {
|
||||
return typeof (rule as CSSStyleRule).selectorText === 'string';
|
||||
}
|
||||
|
||||
export function createStyleSheetFromObservable(css: IObservable<string>): IDisposable {
|
||||
const store = new DisposableStore();
|
||||
const w = store.add(createStyleSheet2());
|
||||
store.add(autorun(reader => {
|
||||
w.setStyle(css.read(reader));
|
||||
}));
|
||||
return store;
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ function activateLink(markdown: IMarkdownString, options: MarkdownRenderOptions,
|
||||
}
|
||||
|
||||
function uriMassage(markdown: IMarkdownString, part: string): string {
|
||||
let data: any;
|
||||
let data: unknown;
|
||||
try {
|
||||
data = parse(decodeURIComponent(part));
|
||||
} catch (e) {
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface IBreadcrumbsItemEvent {
|
||||
type: 'select' | 'focus';
|
||||
item: BreadcrumbsItem;
|
||||
node: HTMLElement;
|
||||
payload: any;
|
||||
payload: unknown;
|
||||
}
|
||||
|
||||
export class BreadcrumbsWidget {
|
||||
|
||||
Binary file not shown.
@@ -749,7 +749,7 @@ export interface IViewDeserializer<T extends ISerializableView> {
|
||||
|
||||
export interface ISerializedLeafNode {
|
||||
type: 'leaf';
|
||||
data: any;
|
||||
data: unknown;
|
||||
size: number;
|
||||
visible?: boolean;
|
||||
maximized?: boolean;
|
||||
|
||||
@@ -145,7 +145,7 @@ export interface IViewDeserializer<T extends ISerializableView> {
|
||||
|
||||
export interface ISerializedLeafNode {
|
||||
type: 'leaf';
|
||||
data: any;
|
||||
data: unknown;
|
||||
size: number;
|
||||
visible?: boolean;
|
||||
maximized?: boolean;
|
||||
|
||||
@@ -77,7 +77,7 @@ class PagedAccessibilityProvider<T> implements IListAccessibilityProvider<number
|
||||
private accessibilityProvider: IListAccessibilityProvider<T>
|
||||
) { }
|
||||
|
||||
getWidgetAriaLabel(): string {
|
||||
getWidgetAriaLabel() {
|
||||
return this.accessibilityProvider.getWidgetAriaLabel();
|
||||
}
|
||||
|
||||
|
||||
@@ -856,7 +856,7 @@ export interface IStyleController {
|
||||
|
||||
export interface IListAccessibilityProvider<T> extends IListViewAccessibilityProvider<T> {
|
||||
getAriaLabel(element: T): string | IObservable<string> | null;
|
||||
getWidgetAriaLabel(): string;
|
||||
getWidgetAriaLabel(): string | IObservable<string>;
|
||||
getWidgetRole?(): AriaRole;
|
||||
getAriaLevel?(element: T): number | undefined;
|
||||
onDidChangeActiveDescendant?: Event<void>;
|
||||
@@ -1530,7 +1530,12 @@ export class List<T> implements ISpliceable<T>, IDisposable {
|
||||
this.onDidChangeSelection(this._onSelectionChange, this, this.disposables);
|
||||
|
||||
if (this.accessibilityProvider) {
|
||||
this.ariaLabel = this.accessibilityProvider.getWidgetAriaLabel();
|
||||
const ariaLabel = this.accessibilityProvider.getWidgetAriaLabel();
|
||||
const observable = (ariaLabel && typeof ariaLabel !== 'string') ? ariaLabel : constObservable(ariaLabel);
|
||||
|
||||
this.disposables.add(autorun(reader => {
|
||||
this.ariaLabel = reader.readObservable(observable);
|
||||
}));
|
||||
}
|
||||
|
||||
if (this._options.multipleSelectionSupport !== false) {
|
||||
|
||||
@@ -55,10 +55,12 @@ export class ToggleActionViewItem extends BaseActionViewItem {
|
||||
constructor(context: unknown, action: IAction, options: IActionViewItemOptions) {
|
||||
super(context, action, options);
|
||||
|
||||
const title = (<IActionViewItemOptions>this.options).keybinding ?
|
||||
`${this._action.label} (${(<IActionViewItemOptions>this.options).keybinding})` : this._action.label;
|
||||
this.toggle = this._register(new Toggle({
|
||||
actionClassName: this._action.class,
|
||||
isChecked: !!this._action.checked,
|
||||
title: (<IActionViewItemOptions>this.options).keybinding ? `${this._action.label} (${(<IActionViewItemOptions>this.options).keybinding})` : this._action.label,
|
||||
title,
|
||||
notFocusable: true,
|
||||
inputActiveOptionBackground: options.toggleStyles?.inputActiveOptionBackground,
|
||||
inputActiveOptionBorder: options.toggleStyles?.inputActiveOptionBorder,
|
||||
@@ -94,6 +96,12 @@ export class ToggleActionViewItem extends BaseActionViewItem {
|
||||
this.toggle.checked = !!this._action.checked;
|
||||
}
|
||||
|
||||
protected override updateLabel(): void {
|
||||
const title = (<IActionViewItemOptions>this.options).keybinding ?
|
||||
`${this._action.label} (${(<IActionViewItemOptions>this.options).keybinding})` : this._action.label;
|
||||
this.toggle.setTitle(title);
|
||||
}
|
||||
|
||||
override focus(): void {
|
||||
this.toggle.domNode.tabIndex = 0;
|
||||
this.toggle.focus();
|
||||
|
||||
@@ -624,35 +624,7 @@ function getActualStartIndex<T>(array: T[], start: number): number {
|
||||
return start < 0 ? Math.max(start + array.length, 0) : Math.min(start, array.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility that helps to pick a property from an object.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* ```typescript
|
||||
* interface IObject = {
|
||||
* a: number,
|
||||
* b: string,
|
||||
* };
|
||||
*
|
||||
* const list: IObject[] = [
|
||||
* { a: 1, b: 'foo' },
|
||||
* { a: 2, b: 'bar' },
|
||||
* ];
|
||||
*
|
||||
* assert.deepStrictEqual(
|
||||
* list.map(pick('a')),
|
||||
* [1, 2],
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
export const pick = <TObject, TKeyName extends keyof TObject>(
|
||||
key: TKeyName,
|
||||
) => {
|
||||
return (obj: TObject): TObject[TKeyName] => {
|
||||
return obj[key];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* When comparing two values,
|
||||
|
||||
@@ -1459,7 +1459,8 @@ export let runWhenGlobalIdle: (callback: (idle: IdleDeadline) => void, timeout?:
|
||||
export let _runWhenIdle: (targetWindow: IdleApi, callback: (idle: IdleDeadline) => void, timeout?: number) => IDisposable;
|
||||
|
||||
(function () {
|
||||
if (typeof globalThis.requestIdleCallback !== 'function' || typeof globalThis.cancelIdleCallback !== 'function') {
|
||||
const safeGlobal: any = globalThis;
|
||||
if (typeof safeGlobal.requestIdleCallback !== 'function' || typeof safeGlobal.cancelIdleCallback !== 'function') {
|
||||
_runWhenIdle = (_targetWindow, runner, timeout?) => {
|
||||
setTimeout0(() => {
|
||||
if (disposed) {
|
||||
@@ -1485,7 +1486,7 @@ export let _runWhenIdle: (targetWindow: IdleApi, callback: (idle: IdleDeadline)
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_runWhenIdle = (targetWindow: IdleApi, runner, timeout?) => {
|
||||
_runWhenIdle = (targetWindow: typeof safeGlobal, runner, timeout?) => {
|
||||
const handle: number = targetWindow.requestIdleCallback(runner, typeof timeout === 'number' ? { timeout } : undefined);
|
||||
let disposed = false;
|
||||
return {
|
||||
@@ -1742,7 +1743,7 @@ export class DeferredPromise<T> {
|
||||
|
||||
private completeCallback!: ValueCallback<T>;
|
||||
private errorCallback!: (err: unknown) => void;
|
||||
private outcome?: { outcome: DeferredOutcome.Rejected; value: any } | { outcome: DeferredOutcome.Resolved; value: T };
|
||||
private outcome?: { outcome: DeferredOutcome.Rejected; value: unknown } | { outcome: DeferredOutcome.Resolved; value: T };
|
||||
|
||||
public get isRejected() {
|
||||
return this.outcome?.outcome === DeferredOutcome.Rejected;
|
||||
|
||||
@@ -6,13 +6,20 @@
|
||||
import { Lazy } from './lazy.js';
|
||||
import * as streams from './stream.js';
|
||||
|
||||
declare const Buffer: any;
|
||||
interface NodeBuffer {
|
||||
allocUnsafe(size: number): Uint8Array;
|
||||
isBuffer(obj: any): obj is NodeBuffer;
|
||||
from(arrayBuffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;
|
||||
from(data: string): Uint8Array;
|
||||
}
|
||||
|
||||
declare const Buffer: NodeBuffer;
|
||||
|
||||
const hasBuffer = (typeof Buffer !== 'undefined');
|
||||
const indexOfTable = new Lazy(() => new Uint8Array(256));
|
||||
|
||||
let textEncoder: TextEncoder | null;
|
||||
let textDecoder: TextDecoder | null;
|
||||
let textEncoder: { encode: (input: string) => Uint8Array } | null;
|
||||
let textDecoder: { decode: (input: Uint8Array) => string } | null;
|
||||
|
||||
export class VSBuffer {
|
||||
|
||||
@@ -93,6 +100,10 @@ export class VSBuffer {
|
||||
return ret;
|
||||
}
|
||||
|
||||
static isNativeBuffer(buffer: unknown): boolean {
|
||||
return hasBuffer && Buffer.isBuffer(buffer);
|
||||
}
|
||||
|
||||
readonly buffer: Uint8Array;
|
||||
readonly byteLength: number;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ export interface IDataTransferItem {
|
||||
id?: string;
|
||||
asString(): Thenable<string>;
|
||||
asFile(): IDataTransferFile | undefined;
|
||||
value: any;
|
||||
value: unknown;
|
||||
}
|
||||
|
||||
export function createStringDataTransferItem(stringOrPromise: string | Promise<string>, id?: string): IDataTransferItem {
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { assertDefined } from '../types.js';
|
||||
|
||||
/**
|
||||
* Type for a function that logs a message.
|
||||
*/
|
||||
export type TLogFunction = (message: string, ...args: any[]) => void;
|
||||
|
||||
/**
|
||||
* Type for an object that contains a `logger` property
|
||||
* with the logging methods.
|
||||
*/
|
||||
type TObjectWithLogFunction<T extends object> = T & { logTime: TLogFunction };
|
||||
|
||||
/**
|
||||
* Decorator allows to log execution time of any method of a class.
|
||||
* The class must have the `logTime` method that provides logs
|
||||
* a provided message.
|
||||
*
|
||||
* The decorated method can be asynchronous or synchronous, but
|
||||
* the timing message is logged only if it finishes *successfully*.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* ```typescript
|
||||
* class MyClass {
|
||||
* public readonly logTime: TLogFunction;
|
||||
|
||||
* constructor(
|
||||
* // because we have the interface restrictions on the class
|
||||
* // which does not support 'private'/'protected' fields, we are
|
||||
* // forced to use the 'public' modifier here
|
||||
* \@ILogService public readonly logService: ILogService,
|
||||
* ) {
|
||||
* this.logTime = logService.info.bind(logService);
|
||||
* }
|
||||
*
|
||||
* @logTime()
|
||||
* public async myMethod(): Promise<string> {
|
||||
* // some artificial delay
|
||||
* await new Promise((resolve) => setTimeout(resolve, 10));
|
||||
*
|
||||
* return 'haalou!';
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* const myObject = instantiationService.createInstance(MyClass);
|
||||
*
|
||||
* // once the method completes successfully, the information
|
||||
* // message '[MyClass.myMethod] took 10.00 ms' is logged
|
||||
* const result = await myObject.myMethod();
|
||||
*
|
||||
* assert.strictEqual(
|
||||
* result,
|
||||
* 'haalou!',
|
||||
* 'Must yield original return value',
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
export function logTime() {
|
||||
return function logExecutionTimeDecorator<
|
||||
TObject extends TObjectWithLogFunction<object>,
|
||||
>(
|
||||
_proto: TObject,
|
||||
methodName: string,
|
||||
descriptor: TypedPropertyDescriptor<(...args: any[]) => any | Promise<any>>,
|
||||
) {
|
||||
const originalMethod = descriptor.value;
|
||||
|
||||
assertDefined(
|
||||
originalMethod,
|
||||
`Method '${methodName}' is not defined.`,
|
||||
);
|
||||
|
||||
// override the decorated method with the one that logs
|
||||
// a timing message after the original method finishes execution
|
||||
descriptor.value = function (
|
||||
this: TObject,
|
||||
...args: Parameters<typeof originalMethod>
|
||||
): ReturnType<typeof originalMethod> {
|
||||
return logExecutionTime(
|
||||
`${this.constructor.name}.${methodName}`,
|
||||
originalMethod.bind(this, ...args),
|
||||
this.logTime.bind(this),
|
||||
);
|
||||
};
|
||||
|
||||
return descriptor;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper allows to log execution time of code block or function.
|
||||
*
|
||||
* The code block or function can be asynchronous or synchronous, but
|
||||
* the timing message is logged only if it finishes *successfully*.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* ```typescript
|
||||
* const result = logExecutionTime(
|
||||
* 'my asynchronous block',
|
||||
* async () => {
|
||||
* // some artificial delay
|
||||
* await new Promise((resolve) => setTimeout(resolve, 10));
|
||||
*
|
||||
* return 'haalou!';
|
||||
* },
|
||||
* this.logService.info,
|
||||
* }
|
||||
*
|
||||
* // once the callback completes successfully, the information
|
||||
* // message '[MyClass.myMethod] took 10.00 ms' is logged
|
||||
* assert.strictEqual(
|
||||
* result,
|
||||
* 'haalou!',
|
||||
* 'Must yield original return value',
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
export const logExecutionTime = <T>(
|
||||
blockName: string,
|
||||
callback: () => T | Promise<T>,
|
||||
logger: TLogFunction,
|
||||
): ReturnType<typeof callback> => {
|
||||
const startTime = performance.now();
|
||||
const result = callback();
|
||||
const syncTimeMs = performance.now() - startTime;
|
||||
|
||||
// handle asynchronous decorated methods
|
||||
if (result instanceof Promise) {
|
||||
return result.then((resolved) => {
|
||||
const asyncTimeMs = performance.now() - startTime;
|
||||
|
||||
log(
|
||||
blockName,
|
||||
asyncTimeMs,
|
||||
logger,
|
||||
);
|
||||
return resolved;
|
||||
});
|
||||
}
|
||||
|
||||
// handle synchronous decorated methods
|
||||
log(
|
||||
blockName,
|
||||
syncTimeMs,
|
||||
logger,
|
||||
);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal helper to log the timing message with
|
||||
* provided details and logger.
|
||||
*/
|
||||
const log = (
|
||||
methodName: string,
|
||||
timeMs: number,
|
||||
logger: TLogFunction,
|
||||
): void => {
|
||||
return logger(
|
||||
// allow-any-unicode-next-line
|
||||
`[⏱][${methodName}] took ${timeMs.toFixed(2)} ms`,
|
||||
);
|
||||
};
|
||||
@@ -325,7 +325,7 @@ export namespace Event {
|
||||
* event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
|
||||
* returned event causes this utility to leak a listener on the original event.
|
||||
*/
|
||||
export function accumulate<T>(event: Event<T>, delay: number = 0, disposable?: DisposableStore): Event<T[]> {
|
||||
export function accumulate<T>(event: Event<T>, delay: number | typeof MicrotaskDelay = 0, disposable?: DisposableStore): Event<T[]> {
|
||||
return Event.debounce<T, T[]>(event, (last, e) => {
|
||||
if (!last) {
|
||||
return [e];
|
||||
|
||||
@@ -311,9 +311,7 @@ const NULL = function (): string | null {
|
||||
*
|
||||
* See {@link FALSE} and {@link NULL}.
|
||||
*/
|
||||
export const isEmptyPattern = (
|
||||
pattern: ParsedPattern | ParsedExpression,
|
||||
): pattern is (typeof FALSE | typeof NULL) => {
|
||||
export function isEmptyPattern(pattern: ParsedPattern | ParsedExpression): pattern is (typeof FALSE | typeof NULL) {
|
||||
if (pattern === FALSE) {
|
||||
return true;
|
||||
}
|
||||
@@ -323,7 +321,7 @@ export const isEmptyPattern = (
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
function parsePattern(arg1: string | IRelativePattern, options: IGlobOptions): ParsedStringPattern {
|
||||
if (!arg1) {
|
||||
|
||||
@@ -11,7 +11,7 @@ export function removeProperty(text: string, path: JSONPath, formattingOptions:
|
||||
return setProperty(text, path, undefined, formattingOptions);
|
||||
}
|
||||
|
||||
export function setProperty(text: string, originalPath: JSONPath, value: any, formattingOptions: FormattingOptions, getInsertionIndex?: (properties: string[]) => number): Edit[] {
|
||||
export function setProperty(text: string, originalPath: JSONPath, value: unknown, formattingOptions: FormattingOptions, getInsertionIndex?: (properties: string[]) => number): Edit[] {
|
||||
const path = originalPath.slice();
|
||||
const errors: ParseError[] = [];
|
||||
const root = parseTree(text, errors);
|
||||
|
||||
@@ -84,6 +84,9 @@ export namespace Schemas {
|
||||
/** Scheme used for the chat input editor. */
|
||||
export const vscodeChatSesssion = 'vscode-chat-editor';
|
||||
|
||||
/** Scheme used for the chat input part */
|
||||
export const vscodeChatInput = 'chatSessionInput';
|
||||
|
||||
/**
|
||||
* Scheme used internally for webviews that aren't linked to a resource (i.e. not custom editors)
|
||||
*/
|
||||
|
||||
+53
-13
@@ -8,9 +8,44 @@ import { decodeBase64 } from './buffer.js';
|
||||
const WELL_KNOWN_ROUTE = '/.well-known';
|
||||
export const AUTH_PROTECTED_RESOURCE_METADATA_DISCOVERY_PATH = `${WELL_KNOWN_ROUTE}/oauth-protected-resource`;
|
||||
export const AUTH_SERVER_METADATA_DISCOVERY_PATH = `${WELL_KNOWN_ROUTE}/oauth-authorization-server`;
|
||||
export const AUTH_SCOPE_SEPARATOR = ' ';
|
||||
|
||||
//#region types
|
||||
|
||||
/**
|
||||
* Base OAuth 2.0 error codes as specified in RFC 6749.
|
||||
*/
|
||||
export const enum AuthorizationErrorType {
|
||||
InvalidRequest = 'invalid_request',
|
||||
InvalidClient = 'invalid_client',
|
||||
InvalidGrant = 'invalid_grant',
|
||||
UnauthorizedClient = 'unauthorized_client',
|
||||
UnsupportedGrantType = 'unsupported_grant_type',
|
||||
InvalidScope = 'invalid_scope'
|
||||
}
|
||||
|
||||
/**
|
||||
* Device authorization grant specific error codes as specified in RFC 8628 section 3.5.
|
||||
*/
|
||||
export const enum AuthorizationDeviceCodeErrorType {
|
||||
/**
|
||||
* The authorization request is still pending as the end user hasn't completed the user interaction steps.
|
||||
*/
|
||||
AuthorizationPending = 'authorization_pending',
|
||||
/**
|
||||
* A variant of "authorization_pending", polling should continue but interval must be increased by 5 seconds.
|
||||
*/
|
||||
SlowDown = 'slow_down',
|
||||
/**
|
||||
* The authorization request was denied.
|
||||
*/
|
||||
AccessDenied = 'access_denied',
|
||||
/**
|
||||
* The "device_code" has expired and the device authorization session has concluded.
|
||||
*/
|
||||
ExpiredToken = 'expired_token'
|
||||
}
|
||||
|
||||
/**
|
||||
* Metadata about a protected resource.
|
||||
*/
|
||||
@@ -395,18 +430,11 @@ export interface IAuthorizationDeviceResponse {
|
||||
* Error response from the token endpoint when using device authorization grant.
|
||||
* As defined in RFC 8628 section 3.5.
|
||||
*/
|
||||
export interface IAuthorizationDeviceTokenErrorResponse {
|
||||
export interface IAuthorizationErrorResponse {
|
||||
/**
|
||||
* REQUIRED. Error code as specified in OAuth 2.0 or in RFC 8628 section 3.5.
|
||||
* Standard OAuth 2.0 error codes plus:
|
||||
* - "authorization_pending": The authorization request is still pending as the end user hasn't completed the user interaction steps
|
||||
* - "slow_down": A variant of "authorization_pending", polling should continue but interval must be increased by 5 seconds
|
||||
* - "access_denied": The authorization request was denied
|
||||
* - "expired_token": The "device_code" has expired and the device authorization session has concluded
|
||||
*/
|
||||
error: 'invalid_request' | 'invalid_client' | 'invalid_grant' | 'unauthorized_client' |
|
||||
'unsupported_grant_type' | 'invalid_scope' | 'authorization_pending' |
|
||||
'slow_down' | 'access_denied' | 'expired_token' | string;
|
||||
error: AuthorizationErrorType | string;
|
||||
|
||||
/**
|
||||
* OPTIONAL. Human-readable description of the error.
|
||||
@@ -419,6 +447,17 @@ export interface IAuthorizationDeviceTokenErrorResponse {
|
||||
error_uri?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Error response from the token endpoint when using device authorization grant.
|
||||
* As defined in RFC 8628 section 3.5.
|
||||
*/
|
||||
export interface IAuthorizationDeviceTokenErrorResponse extends IAuthorizationErrorResponse {
|
||||
/**
|
||||
* REQUIRED. Error code as specified in OAuth 2.0 or in RFC 8628 section 3.5.
|
||||
*/
|
||||
error: AuthorizationErrorType | AuthorizationDeviceCodeErrorType | string;
|
||||
}
|
||||
|
||||
export interface IAuthorizationJWTClaims {
|
||||
/**
|
||||
* REQUIRED. JWT ID. Unique identifier for the token.
|
||||
@@ -606,12 +645,12 @@ export function isAuthorizationDeviceResponse(obj: unknown): obj is IAuthorizati
|
||||
return response.device_code !== undefined && response.user_code !== undefined && response.verification_uri !== undefined && response.expires_in !== undefined;
|
||||
}
|
||||
|
||||
export function isAuthorizationDeviceTokenErrorResponse(obj: unknown): obj is IAuthorizationDeviceTokenErrorResponse {
|
||||
export function isAuthorizationErrorResponse(obj: unknown): obj is IAuthorizationErrorResponse {
|
||||
if (typeof obj !== 'object' || obj === null) {
|
||||
return false;
|
||||
}
|
||||
const response = obj as IAuthorizationDeviceTokenErrorResponse;
|
||||
return response.error !== undefined && response.error_description !== undefined;
|
||||
const response = obj as IAuthorizationErrorResponse;
|
||||
return response.error !== undefined;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
@@ -646,7 +685,7 @@ export function getMetadataWithDefaultValues(metadata: IAuthorizationServerMetad
|
||||
* the spec and require an exact match.
|
||||
*/
|
||||
export const DEFAULT_AUTH_FLOW_PORT = 33418;
|
||||
export async function fetchDynamicRegistration(registrationEndpoint: string, clientName: string): Promise<IAuthorizationDynamicClientRegistrationResponse> {
|
||||
export async function fetchDynamicRegistration(registrationEndpoint: string, clientName: string, scopes?: string[]): Promise<IAuthorizationDynamicClientRegistrationResponse> {
|
||||
const response = await fetch(registrationEndpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -669,6 +708,7 @@ export async function fetchDynamicRegistration(registrationEndpoint: string, cli
|
||||
`http://localhost:${DEFAULT_AUTH_FLOW_PORT}/`,
|
||||
`http://127.0.0.1:${DEFAULT_AUTH_FLOW_PORT}/`
|
||||
],
|
||||
scope: scopes?.join(AUTH_SCOPE_SEPARATOR),
|
||||
token_endpoint_auth_method: 'none'
|
||||
})
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ export function latestChangedValue<T extends IObservable<any>[]>(owner: DebugOwn
|
||||
}
|
||||
|
||||
let hasLastChangedValue = false;
|
||||
let lastChangedValue: any = undefined;
|
||||
let lastChangedValue: unknown = undefined;
|
||||
|
||||
const result = observableFromEvent<any, void>(owner, cb => {
|
||||
const store = new DisposableStore();
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { observableValueOpts, IObservable, ITransaction } from '../observable.js';
|
||||
import { IObservable, ITransaction } from '../observable.js';
|
||||
import { observableValueOpts } from './observables/observableValueOpts.js';
|
||||
|
||||
|
||||
export class ObservableMap<K, V> implements Map<K, V> {
|
||||
private readonly _data = new Map<K, V>();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { observableValueOpts, IObservable, ITransaction } from '../observable.js';
|
||||
|
||||
import { IObservable, ITransaction } from '../observable.js';
|
||||
import { observableValueOpts } from './observables/observableValueOpts.js';
|
||||
|
||||
export class ObservableSet<T> implements Set<T> {
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user