Revert "Bump windows-process-tree" (#179508)

Revert "Bump windows-process-tree (#179176)"

This reverts commit 15cb6b36f8.
This commit is contained in:
Raymond Zhao 2023-04-07 16:47:57 -07:00 committed by GitHub
parent d80ca556bd
commit 84ac780186
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 38 additions and 111 deletions

View file

@ -222,7 +222,6 @@
"@vscode/iconv-lite-umd",
"@vscode/policy-watcher",
"@vscode/proxy-agent",
"@vscode/windows-process-tree",
"assert",
"child_process",
"console",
@ -252,6 +251,7 @@
"v8-inspect-profiler",
"vscode-regexpp",
"vscode-textmate",
"windows-process-tree",
"worker_threads",
"xterm",
"xterm-addon-canvas",

View file

@ -26,11 +26,6 @@ fsevents/test/**
@vscode/windows-mutex/src/**
!@vscode/windows-mutex/**/*.node
@vscode/windows-process-tree/binding.gyp
@vscode/windows-process-tree/build/**
@vscode/windows-process-tree/src/**
!@vscode/windows-process-tree/**/*.node
@vscode/windows-registry/binding.gyp
@vscode/windows-registry/src/**
@vscode/windows-registry/build/**
@ -71,6 +66,11 @@ windows-foreground-love/build/**
windows-foreground-love/src/**
!windows-foreground-love/**/*.node
windows-process-tree/binding.gyp
windows-process-tree/build/**
windows-process-tree/src/**
!windows-process-tree/**/*.node
keytar/binding.gyp
keytar/build/**
keytar/src/**

View file

@ -120,6 +120,7 @@
"@types/webpack": "^5.28.1",
"@types/wicg-file-system-access": "^2020.9.5",
"@types/windows-foreground-love": "^0.3.0",
"@types/windows-process-tree": "^0.2.0",
"@types/winreg": "^1.2.30",
"@types/yauzl": "^2.9.1",
"@types/yazl": "^2.4.2",
@ -224,9 +225,9 @@
},
"optionalDependencies": {
"@vscode/windows-mutex": "0.4.2",
"@vscode/windows-process-tree": "0.4.2",
"@vscode/windows-registry": "1.0.10",
"windows-foreground-love": "0.5.0"
"windows-foreground-love": "0.5.0",
"windows-process-tree": "0.4.0"
},
"resolutions": {
"elliptic": "^6.5.3",

View file

@ -35,7 +35,7 @@
"yazl": "^2.4.3"
},
"optionalDependencies": {
"@vscode/windows-process-tree": "0.4.2",
"@vscode/windows-registry": "1.0.10"
"@vscode/windows-registry": "1.0.10",
"windows-process-tree": "0.4.0"
}
}

View file

@ -92,13 +92,6 @@
dependencies:
node-addon-api "^3.0.2"
"@vscode/windows-process-tree@0.4.2":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@vscode/windows-process-tree/-/windows-process-tree-0.4.2.tgz#54d010fdeb06dfe3a9c6d58fcb3ed9acfc962f33"
integrity sha512-b20865s1HG1VtGt887KrB1blwFS6p4L1Fl1o/WplO9j7sGBle8sLqkNnGXbCaRNgdIgfXtitmzG366FVynJZdQ==
dependencies:
nan "^2.17.0"
"@vscode/windows-registry@1.0.10":
version "1.0.10"
resolved "https://registry.yarnpkg.com/@vscode/windows-registry/-/windows-registry-1.0.10.tgz#17e4e2f8fdd41990206d1bab2daf99c803206247"
@ -831,6 +824,13 @@ wide-align@^1.1.0:
dependencies:
string-width "^1.0.2 || 2 || 3 || 4"
windows-process-tree@0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/windows-process-tree/-/windows-process-tree-0.4.0.tgz#31ac49c5da557e628ce7e37a5800972173d3349a"
integrity sha512-9LunDnc1WwuhyLeTAXMFX8wbActGJtDCBaiapQXFYk/nO4W4X9YxOKV5g/lQL3XX69QYxveDbjVVrdnTt1qqCQ==
dependencies:
nan "^2.17.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"

View file

@ -1,79 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Copied from the `@vscode/windows-process-tree` package.
// The dependency is an optional dependency that is only used on Windows,
// but we need the typings to compile on all platforms.
// The `@types/windows-process-tree` package has also been deprecated.
declare module '@vscode/windows-process-tree' {
export enum ProcessDataFlag {
None = 0,
Memory = 1,
CommandLine = 2
}
export interface IProcessInfo {
pid: number;
ppid: number;
name: string;
/**
* The working set size of the process, in bytes.
*/
memory?: number;
/**
* The string returned is at most 512 chars, strings exceeding this length are truncated.
*/
commandLine?: string;
}
export interface IProcessCpuInfo extends IProcessInfo {
cpu?: number;
}
export interface IProcessTreeNode {
pid: number;
name: string;
memory?: number;
commandLine?: string;
children: IProcessTreeNode[];
}
/**
* Returns a tree of processes with the rootPid process as the root.
* @param rootPid - The pid of the process that will be the root of the tree.
* @param callback - The callback to use with the returned list of processes.
* @param flags - The flags for what process data should be included.
*/
export function getProcessTree(rootPid: number, callback: (tree: IProcessTreeNode | undefined) => void, flags?: ProcessDataFlag): void;
namespace getProcessTree {
function __promisify__(rootPid: number, flags?: ProcessDataFlag): Promise<IProcessTreeNode>;
}
/**
* Returns a list of processes containing the rootPid process and all of its descendants.
* @param rootPid - The pid of the process of interest.
* @param callback - The callback to use with the returned set of processes.
* @param flags - The flags for what process data should be included.
*/
export function getProcessList(rootPid: number, callback: (processList: IProcessInfo[] | undefined) => void, flags?: ProcessDataFlag): void;
namespace getProcessList {
function __promisify__(rootPid: number, flags?: ProcessDataFlag): Promise<IProcessInfo[]>;
}
/**
* Returns the list of processes annotated with cpu usage information.
* @param processList - The list of processes.
* @param callback - The callback to use with the returned list of processes.
*/
export function getProcessCpuUsage(processList: IProcessInfo[], callback: (processListWithCpu: IProcessCpuInfo[]) => void): void;
namespace getProcessCpuUsage {
function __promisify__(processList: IProcessInfo[]): Promise<IProcessCpuInfo[]>;
}
}

View file

@ -127,7 +127,7 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
}
};
(import('@vscode/windows-process-tree')).then(windowsProcessTree => {
(import('windows-process-tree')).then(windowsProcessTree => {
windowsProcessTree.getProcessList(rootPid, (processList) => {
if (!processList) {
reject(new Error(`Root process ${rootPid} not found`));

View file

@ -123,16 +123,16 @@ flakySuite('Native Modules (all platforms)', () => {
assert.ok(typeof result === 'boolean', testErrorMessage('windows-foreground-love'));
});
test('@vscode/windows-process-tree', async () => {
const processTree = await import('@vscode/windows-process-tree');
assert.ok(typeof processTree.getProcessTree === 'function', testErrorMessage('@vscode/windows-process-tree'));
test('windows-process-tree', async () => {
const processTree = await import('windows-process-tree');
assert.ok(typeof processTree.getProcessTree === 'function', testErrorMessage('windows-process-tree'));
return new Promise((resolve, reject) => {
processTree.getProcessTree(process.pid, tree => {
if (tree) {
resolve();
} else {
reject(new Error(testErrorMessage('@vscode/windows-process-tree')));
reject(new Error(testErrorMessage('windows-process-tree')));
}
});
});

View file

@ -9,7 +9,7 @@ import { Emitter, Event } from 'vs/base/common/event';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { isWindows, platform } from 'vs/base/common/platform';
import { TerminalShellType, WindowsShellType } from 'vs/platform/terminal/common/terminal';
import type * as WindowsProcessTreeType from '@vscode/windows-process-tree';
import type * as WindowsProcessTreeType from 'windows-process-tree';
export interface IWindowsShellHelper extends IDisposable {
readonly onShellNameChanged: Event<string>;
@ -129,7 +129,7 @@ export class WindowsShellHelper extends Disposable implements IWindowsShellHelpe
return this._currentRequest;
}
if (!windowsProcessTree) {
windowsProcessTree = await import('@vscode/windows-process-tree');
windowsProcessTree = await import('windows-process-tree');
}
this._currentRequest = new Promise<string>(resolve => {
windowsProcessTree.getProcessTree(this._rootProcessId, tree => {

View file

@ -30,7 +30,7 @@ export async function hasChildProcesses(processId: number | undefined): Promise<
// if shell has at least one child process, assume that shell is busy
if (platform.isWindows) {
const windowsProcessTree = await import('@vscode/windows-process-tree');
const windowsProcessTree = await import('windows-process-tree');
return new Promise<boolean>(resolve => {
windowsProcessTree.getProcessTree(processId, processTree => {
resolve(!!processTree && processTree.children.length > 0);

View file

@ -1153,6 +1153,11 @@
resolved "https://registry.yarnpkg.com/@types/windows-foreground-love/-/windows-foreground-love-0.3.0.tgz#26bc230b2568aa7ab7c56d35bb5653c0a6965a42"
integrity sha512-tFUVA/fiofNqOh6lZlymvQiQYPY+cZXZPR9mn9wN6/KS8uwx0zgH4Ij/jmFyRYr+x+DGZWEIeknS2BMi7FZJAQ==
"@types/windows-process-tree@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@types/windows-process-tree/-/windows-process-tree-0.2.0.tgz#2fa205c838a8ef0a07697cd747c954653978d22c"
integrity sha512-vQAnkWpMX4HUPjubkxKta4Rfh2EDy2ksalnr37gFHNrmk+uxx50PRH+/fM5nTsEBCi4ESFT/7t7Za3jGqyTZ4g==
"@types/winreg@^1.2.30":
version "1.2.30"
resolved "https://registry.yarnpkg.com/@types/winreg/-/winreg-1.2.30.tgz#91d6710e536d345b9c9b017c574cf6a8da64c518"
@ -1397,13 +1402,6 @@
bindings "^1.2.1"
nan "^2.14.0"
"@vscode/windows-process-tree@0.4.2":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@vscode/windows-process-tree/-/windows-process-tree-0.4.2.tgz#54d010fdeb06dfe3a9c6d58fcb3ed9acfc962f33"
integrity sha512-b20865s1HG1VtGt887KrB1blwFS6p4L1Fl1o/WplO9j7sGBle8sLqkNnGXbCaRNgdIgfXtitmzG366FVynJZdQ==
dependencies:
nan "^2.17.0"
"@vscode/windows-registry@1.0.10":
version "1.0.10"
resolved "https://registry.yarnpkg.com/@vscode/windows-registry/-/windows-registry-1.0.10.tgz#17e4e2f8fdd41990206d1bab2daf99c803206247"
@ -10629,6 +10627,13 @@ windows-foreground-love@0.5.0:
resolved "https://registry.yarnpkg.com/windows-foreground-love/-/windows-foreground-love-0.5.0.tgz#7672b04eb05f934a6543cacdc3cd16ff34e3cb10"
integrity sha512-yjBwmKEmQBDk3Z7yg/U9hizGWat8C6Pe4MQWl5bN6mvPU81Bt6HV2k/6mGlK3ETJLW1hCLhYx2wcGh+ykUUCyA==
windows-process-tree@0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/windows-process-tree/-/windows-process-tree-0.4.0.tgz#31ac49c5da557e628ce7e37a5800972173d3349a"
integrity sha512-9LunDnc1WwuhyLeTAXMFX8wbActGJtDCBaiapQXFYk/nO4W4X9YxOKV5g/lQL3XX69QYxveDbjVVrdnTt1qqCQ==
dependencies:
nan "^2.17.0"
word-wrap@^1.2.3, word-wrap@~1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"