Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune and upgrade npm package dependencies #1265

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ jobs:
- name: Use node.js
uses: actions/setup-node@v4
with:
version: 20
node-version: 20
- name: Install dependencies
run: npm install
- name: Prepare environment
run: |
npm install -g typescript
npm install -g gulp
npm install -g vsce
- name: Build
run: npm run compile
- name: Lint extension source
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
# Run install dependencies
- name: Install dependencies
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
Expand Down
28,533 changes: 6,273 additions & 22,260 deletions package-lock.json

Large diffs are not rendered by default.

126 changes: 57 additions & 69 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "1.3.16",
"publisher": "ms-kubernetes-tools",
"engines": {
"vscode": "^1.82.0"
"vscode": "^1.87.0"
},
"license": "Apache-2.0",
"categories": [
Expand Down Expand Up @@ -1316,90 +1316,78 @@
"compile:view": "webpack --mode none --config src/components/logs/webpack.config.js",
"watch": "webpack --mode development --watch --info-verbosity verbose",
"test-compile": "tsc -p ./",
"test": "npm run test-compile && node ./out/test/runTest.js"
"test": "npm run test-compile && node ./out/test/runTest.js",
"package": "vsce package"
},
"extensionDependencies": [
"redhat.vscode-yaml"
],
"dependencies": {
"@kubernetes/client-node": "^0.14.0",
"@vscode/test-electron": "^2.3.8",
"ajv": "^6.9.1",
"@kubernetes/client-node": "^0.20.0",
"@vscode/test-electron": "^2.3.9",
"ansi-to-html": "^0.7.2",
"await-notify": "^1.0.1",
"clipboardy": "^1.2.3",
"compare-versions": "^3.1.0",
"debug": "^3.1.0",
"docker-file-parser": "^1.0.3",
"clipboardy": "^4.0.0",
"compare-versions": "^6.1.0",
"docker-file-parser": "^1.0.7",
"dockerfile-parse": "^0.2.0",
"download": "^7.1.0",
"download": "^8.0.0",
"fuzzysearch": "^1.0.3",
"got": "^11.8.2",
"graceful-fs": "^4.1.11",
"js-yaml": "^3.13.1",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"mixin-deep": "^1.3.2",
"mkdirp": "^0.5.1",
"moment": "^2.29.1",
"natives": "^1.1.3",
"mkdirp": "^3.0.1",
"moment": "^2.30.1",
"node-yaml-parser": "^0.0.9",
"opn": "^5.2.0",
"pluralize": "^4.0.0",
"portfinder": "^1.0.13",
"rxjs": "^6.5.4",
"semver": "^5.5.1",
"shelljs": "^0.7.7",
"opn": "^5.5.0",
"pluralize": "^8.0.0",
"portfinder": "^1.0.32",
"request": "^2.88.2",
"rxjs": "^7.8.1",
"semver": "^7.6.0",
"shelljs": "^0.8.5",
"spawn-rx": "^3.0.0",
"sshpk": "^1.13.2",
"tar": "^4.4.1",
"tmp": "^0.0.31",
"unzipper": "^0.10.5",
"url-parse": "^1.5.1",
"uuid": "^3.1.0",
"vscode-debugadapter": "1.27.0",
"vscode-debugprotocol": "1.27.0",
"tar": "^6.2.1",
"tmp": "^0.2.3",
"unzipper": "^0.10.14",
"vscode-extension-telemetry": "^0.1.1",
"vscode-uri": "^1.0.1",
"yaml-ast-parser": "^0.0.40",
"vscode-uri": "^3.0.8",
"yaml-ast-parser": "^0.0.43",
"yamljs": "^0.3.0"
},
"devDependencies": {
"@bendera/vscode-webview-elements": "^0.2.0",
"@types/clipboardy": "^1.1.0",
"@types/js-yaml": "^3.12.0",
"@types/lodash": "^4.14.113",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "^8.0.4",
"@types/node": "^10.2.0",
"@types/opn": "^5.1.0",
"@types/pluralize": "^0.0.29",
"@types/request": "^2.48.1",
"@types/semver": "^5.5.0",
"@types/shelljs": "^0.7.8",
"@types/sinon": "^7.0.0",
"@types/tar": "^4.0.0",
"@types/tmp": "^0.0.33",
"@types/unzipper": "^0.10.0",
"@types/uuid": "^3.4.4",
"@types/vscode": "^1.52.0",
"@types/websocket": "^0.0.40",
"@types/yamljs": "^0.2.30",
"@typescript-eslint/eslint-plugin": "^4.28.1",
"@typescript-eslint/eslint-plugin-tslint": "4.28.1",
"@typescript-eslint/parser": "^4.28.1",
"electron": "^13.1.4",
"eslint": "^7.29.0",
"@bendera/vscode-webview-elements": "^0.17.2",
"@types/glob": "^8.1.0",
"@types/js-yaml": "^4.0.9",
"@types/lodash": "^4.17.0",
"@types/mkdirp": "^1.0.2",
"@types/mocha": "^10.0.6",
"@types/node": "^20.12.2",
"@types/pluralize": "^0.0.33",
"@types/semver": "^7.5.8",
"@types/shelljs": "^0.8.15",
"@types/sinon": "^17.0.3",
"@types/tar": "^6.1.11",
"@types/tmp": "^0.2.6",
"@types/unzipper": "^0.10.9",
"@types/vscode": "^1.87.0",
"@types/websocket": "^1.0.10",
"@types/yamljs": "^0.2.34",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/eslint-plugin-tslint": "7.0.2",
"@typescript-eslint/parser": "^7.5.0",
"@vscode/vsce": "^2.24.0",
"eslint": "^8.57.0",
"file-loader": "^6.2.0",
"gulp": "^4.0.2",
"gulp-tslint": "^8.1.2",
"html-webpack-plugin": "^4.2.0",
"mocha": "^8.1.3",
"sinon": "^6.3.5",
"ts-loader": "^6.0.4",
"tslint": "^5.18.0",
"typescript": "^3.5.2",
"webpack": "^4.35.2",
"webpack-cli": "^3.3.5"
"glob": "^10.3.12",
"gulp": "^5.0.0",
"gulp-tslint": "^8.1.4",
"html-webpack-plugin": "^5.6.0",
"mocha": "^10.4.0",
"sinon": "^17.0.1",
"ts-loader": "^9.5.1",
"tslint": "^5.20.1",
"typescript": "^5.4.3",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/api/implementation/kubectl/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class KubectlV1Impl implements KubectlV1 {
const forwarding = await waitForOutput(pfProcess, /Forwarding\s+from\s+127\.0\.0\.1:/);

if (forwarding === WaitForOutputResult.Success) {
const onTerminate = [ () => pfProcess.kill() ];
const onTerminate: (() => (void | boolean))[] = [ () => pfProcess.kill() ];
const terminator = { dispose: () => { for (const action of onTerminate) { action(); } } };
if (options && options.showInUI && options.showInUI.location === 'status-bar') {
const session = {
Expand Down Expand Up @@ -61,7 +61,7 @@ function waitForOutput(process: ChildProcess, pattern: RegExp): Promise<WaitForO
return new Promise<WaitForOutputResult>((resolve) => {
let didOutput = false;

process.stdout.on('data', async (data) => {
process.stdout?.on('data', async (data) => {
const message = `${data}`;
if (pattern.test(message)) {
didOutput = true;
Expand Down
2 changes: 1 addition & 1 deletion src/components/clusterexplorer/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class KubernetesExplorer implements vscode.TreeDataProvider<ClusterExplor

private readonly extenders = Array.of<ExplorerExtender<ClusterExplorerNode>>();
private readonly customisers = Array.of<ExplorerUICustomizer<ClusterExplorerNode>>();
private refreshTimer: NodeJS.Timer;
private refreshTimer: NodeJS.Timeout;
private readonly refreshQueue = Array<ClusterExplorerNode>();

constructor(private readonly kubectl: Kubectl, private readonly host: Host) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/clusterprovider/azure/azure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Shell } from '../../../shell';
import { FS } from '../../../fs';
import { ActionResult, fromShellJson, fromShellExitCodeAndStandardError, fromShellExitCodeOnly, Diagnostic } from '../../../wizard';
import { Errorable, failed } from '../../../errorable';
import * as compareVersions from 'compare-versions';
import { compareVersions } from 'compare-versions';
import { sleep } from '../../../sleep';
import { getKubeconfigPath } from '../../kubectl/kubeconfig';
import { Dictionary } from '../../../utils/dictionary';
Expand Down
4 changes: 2 additions & 2 deletions src/components/kubectl/autoversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { FileBacked } from '../../utils/filebacked';
import { getKubeconfigPath } from '../kubectl/kubeconfig';
import { getToolPath } from '../config/config';
import { Host } from '../../host';
import { mkdirpAsync } from '../../utils/mkdirp';
import { mkdirp } from 'mkdirp';
import { platformUrlString, formatBin, platformArch, vsKubernetesFolder } from '../installer/installationlayout';
import * as installer from '../installer/installer';
import { ExecResult } from '../../binutilplusplus';
Expand All @@ -28,7 +28,7 @@ interface ClusterVersionCache {

export async function ensureSuitableKubectl(kubectl: Kubectl, shell: Shell, host: Host): Promise<string | undefined> {
if (!(await fs.existsAsync(getBasePath(shell)))) {
await mkdirpAsync(getBasePath(shell));
await mkdirp(getBasePath(shell));
}

const bootstrapperKubectl = await ensureBootstrapperKubectl(kubectl, shell, host);
Expand Down
19 changes: 13 additions & 6 deletions src/components/kubectl/kubeconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ import * as shelljs from 'shelljs';
import { refreshExplorer } from '../clusterprovider/common/explorer';
import { getActiveKubeconfig, getUseWsl } from '../config/config';
import * as kubernetes from '@kubernetes/client-node';
import { mkdirpAsync } from '../../utils/mkdirp';
import { mkdirp } from 'mkdirp';

interface Named {
readonly name: string;
}

interface Config {
clusters?: Named[];
contexts?: Named[];
users?: Named[];
"current-context"?: string;
}

export interface HostKubeconfigPath {
readonly pathType: 'host';
readonly hostPath: string;
Expand Down Expand Up @@ -96,10 +103,10 @@ export async function mergeToKubeconfig(newConfigText: string): Promise<void> {
const kcfileExists = await fs.existsAsync(kcfile);

const kubeconfigText = kcfileExists ? await fs.readTextFile(kcfile) : '';
const kubeconfig = yaml.safeLoad(kubeconfigText) || {};
const newConfig = yaml.safeLoad(newConfigText);
const kubeconfig = (yaml.load(kubeconfigText) || {}) as Config;
const newConfig = yaml.load(newConfigText) as Config;

for (const section of ['clusters', 'contexts', 'users']) {
for (const section of ['clusters', 'contexts', 'users'] as (keyof Omit<Config, "current-context">)[]) {
const existing: Named[] | undefined = kubeconfig[section];
const toMerge: Named[] | undefined = newConfig[section];
if (!toMerge) {
Expand All @@ -116,7 +123,7 @@ export async function mergeToKubeconfig(newConfigText: string): Promise<void> {
kubeconfig['current-context'] = newConfig.contexts[0].name;
}

const merged = yaml.safeDump(kubeconfig, { lineWidth: 1000000, noArrayIndent: true });
const merged = yaml.dump(kubeconfig, { lineWidth: 1000000, noArrayIndent: true });

if (kcfileExists) {
const backupFile = kcfile + '.vscode-k8s-tools-backup';
Expand All @@ -125,7 +132,7 @@ export async function mergeToKubeconfig(newConfigText: string): Promise<void> {
}
await fs.renameAsync(kcfile, backupFile);
} else {
await mkdirpAsync(path.dirname(kcfile));
await mkdirp(path.dirname(kcfile));
}
await fs.writeTextFile(kcfile, merged);

Expand Down
2 changes: 1 addition & 1 deletion src/components/kubectl/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async function logsForPod(kubectl: Kubectl): Promise<void> {
async function logsForPodFromOpenDocument(kubectl: Kubectl, editor: vscode.TextEditor) {
const text = editor.document.getText();
try {
const obj: {} = yaml.safeLoad(text);
const obj: unknown = yaml.load(text);
if (isPod(obj)) {
// document describes a pod.
const podSummary = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/kubectl/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function waitForOutput(process: ChildProcess, pattern: RegExp): Promise<WaitForO
return new Promise<WaitForOutputResult>((resolve) => {
let didOutput = false;

process.stdout.on('data', async (data) => {
process.stdout?.on('data', async (data) => {
const message = `${data}`;
const matchResult = pattern.exec(message);
if (matchResult && matchResult.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/lint/linter.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const jsonSyntax: Syntax = {
};

const yamlSyntax: Syntax = {
load(text: string) { return yaml.safeLoadAll(text); },
load(text: string) { return yaml.loadAll(text); },
async symbolise(document: vscode.TextDocument) { return await jsonalikeYamlSymboliser.provideDocumentSymbols(document, new vscode.CancellationTokenSource().token); }
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/platform/clipboard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as clipboard from 'clipboardy';
import clipboard from 'clipboardy';
import * as vscode from 'vscode';

export async function write(text: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/debug/debugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,15 @@ export class DebugSession implements IDebugSession {
return new Promise<void>((resolve, reject) => {
let isProxyReady = false;

proxyProcess.stdout.on('data', async (data) => {
proxyProcess.stdout?.on('data', async (data) => {
const message = `${data}`;
if (!isProxyReady && this.isForwardingCompleteMessage(message)) {
isProxyReady = true;
resolve();
}
});

proxyProcess.stderr.on('data', (data) => {
proxyProcess.stderr?.on('data', (data) => {
kubeChannel.showOutput(`${data}`, "port-forward");
});

Expand Down
4 changes: 2 additions & 2 deletions src/docker/dockerfileParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RawDockerfile {
return args;
}

public searchInArgs(regularExpression: RegExp, commands?: string[]): RegExpMatchArray {
public searchInArgs(regularExpression: RegExp, commands?: string[]): RegExpMatchArray | [] {
const commandEntries = (commands ? this.getCommandsOfType(...commands) : this.commandEntries);
for (const entry of commandEntries) {
const args = Array.isArray(entry.args) ? entry.args : [ String(entry.args) ];
Expand Down Expand Up @@ -77,7 +77,7 @@ class Dockerfile implements IDockerfile {
return String(workDirEntry[0].args);
}

searchLaunchArgs(regularExpression: RegExp): RegExpMatchArray {
searchLaunchArgs(regularExpression: RegExp): RegExpMatchArray | [] {
return this.dockerfile.searchInArgs(regularExpression, ["run", "cmd", "entrypoint"]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/docker/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface IDockerfile {
/**
* Search the debug options from the launch command.
*/
searchLaunchArgs(regularExpression: RegExp): RegExpMatchArray;
searchLaunchArgs(regularExpression: RegExp): RegExpMatchArray | [];
}

export interface IDockerParser {
Expand Down