Skip to content

Commit 1e462f9

Browse files
refactor(deps): remove unnecessary code (#5707)
We dont need this code anymore --- <!--- REMINDER: Ensure that your PR meets the guidelines in CONTRIBUTING.md --> License: I confirm that my contribution is made under the terms of the Apache 2.0 license. Signed-off-by: nkomonen-amazon <[email protected]>
1 parent f27ddbe commit 1e462f9

File tree

8 files changed

+2
-339
lines changed

8 files changed

+2
-339
lines changed

package-lock.json

Lines changed: 1 addition & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,6 @@
502502
"mime-types": "^2.1.32",
503503
"node-fetch": "^2.7.0",
504504
"portfinder": "^1.0.32",
505-
"proper-lockfile": "^4.1.2",
506-
"ps-list": "^8.1.1",
507505
"semver": "^7.5.4",
508506
"stream-buffers": "^3.0.2",
509507
"strip-ansi": "^5.2.0",

packages/core/src/shared/fs/node/fs.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

packages/core/src/shared/utilities/processUtils.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as proc from 'child_process'
77
import * as crossSpawn from 'cross-spawn'
88
import * as logger from '../logger'
99
import { Timeout, CancellationError, waitUntil } from './timeoutUtils'
10-
import { isWeb } from '../extensionGlobals'
1110

1211
export interface RunParameterContext {
1312
/** Reports an error parsed from the stdin/stdout streams. */
@@ -369,17 +368,3 @@ export class ChildProcess {
369368
return `${pid} [${this.#command} ${noparams ? '...' : this.#args.join(' ')}]`
370369
}
371370
}
372-
373-
/**
374-
* Returns a sorted list of all PIDs currently running
375-
*/
376-
export async function getPids(): Promise<number[]> {
377-
if (isWeb()) {
378-
throw new Error('getPids() is not supported in web mode')
379-
}
380-
// Note: This is an ESM module, which is why we cannot import it the standard way
381-
// Note: This module is explicitly excluded in the web mode webpack since this breaks the bundling.
382-
const psList = (await import('ps-list')).default
383-
const pids = (await psList()).map((p) => p.pid)
384-
return pids.sort((a, b) => a - b)
385-
}

packages/core/src/shared/utilities/searchUtils.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/core/src/test/shared/fs/node/fs.test.ts

Lines changed: 0 additions & 119 deletions
This file was deleted.

packages/core/src/test/shared/utilities/processUtils.test.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { fs as fs2 } from '../../../shared'
99
import * as os from 'os'
1010
import * as path from 'path'
1111
import { makeTemporaryToolkitFolder, tryRemoveFolder } from '../../../shared/filesystemUtilities'
12-
import { ChildProcess, eof, getPids } from '../../../shared/utilities/processUtils'
12+
import { ChildProcess, eof } from '../../../shared/utilities/processUtils'
1313
import { sleep } from '../../../shared/utilities/timeoutUtils'
1414
import { Timeout, waitUntil } from '../../../shared/utilities/timeoutUtils'
1515

@@ -348,16 +348,3 @@ describe('ChildProcess', async function () {
348348
await writeShellFile(filename, file)
349349
}
350350
})
351-
352-
describe('getPids', function () {
353-
it('returns pids sorted in ascending order', async function () {
354-
const pids = await getPids()
355-
assert.ok(pids.length > 0)
356-
assert.deepStrictEqual(
357-
pids.some((pid) => typeof pid !== 'number'),
358-
false
359-
)
360-
const sortedPids = [...pids].sort((a, b) => a - b)
361-
assert.deepStrictEqual(pids, sortedPids)
362-
})
363-
})

0 commit comments

Comments
 (0)