Skip to content

Commit

Permalink
Update dependencies and fix resulting issues (#3077)
Browse files Browse the repository at this point in the history
* Update dependencies, new codicons package

* Fix loads of things for new dependencies
  • Loading branch information
bwateratmsft authored Jul 19, 2021
1 parent 4a8164e commit ffd43e4
Show file tree
Hide file tree
Showing 73 changed files with 1,258 additions and 1,534 deletions.
2,239 changes: 1,044 additions & 1,195 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2758,15 +2758,15 @@
"@types/xml2js": "^0.4.8",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/parser": "^4.21.0",
"@vscode/codicons": "^0.0.20",
"@vscode/test-electron": "^1.6.1",
"copy-webpack-plugin": "^8.1.1",
"copy-webpack-plugin": "^9.0.1",
"eslint": "^7.24.0",
"mocha": "^8.2.1",
"ts-loader": "^8.0.14",
"mocha": "^9.0.2",
"ts-loader": "^9.2.3",
"typescript": "^4.2.4",
"umd-compat-loader": "^2.1.2",
"vsce": "^1.93.0",
"vscode-codicons": "^0.0.16",
"vscode-nls-dev": "^3.3.2",
"webpack": "^5.31.2",
"webpack-bundle-analyzer": "^4.4.1",
Expand All @@ -2782,7 +2782,7 @@
"dayjs": "^1.10.4",
"dockerfile-language-server-nodejs": "^0.4.1",
"dockerode": "^3.2.1",
"fs-extra": "^9.1.0",
"fs-extra": "^10.0.0",
"glob": "^7.1.6",
"gradle-to-js": "^2.0.0",
"handlebars": "^4.7.6",
Expand All @@ -2791,8 +2791,8 @@
"tar": "^6.1.0",
"tar-stream": "^2.2.0",
"uuid": "^8.3.2",
"vscode-azureappservice": "^0.80.2",
"vscode-azureextensionui": "^0.43.6",
"vscode-azureappservice": "^0.84.1",
"vscode-azureextensionui": "^0.46.0",
"vscode-languageclient": "^7.0.0",
"vscode-nls": "^5.0.0",
"vscode-tas-client": "^0.1.22",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/compose/getComposeServiceList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function getComposeServiceList(context: IActionContext, workspaceFo
}));

const subsetChoices =
await ext.ui.showQuickPick(
await context.ui.showQuickPick(
pickChoices,
{
canPickMany: true,
Expand Down
21 changes: 6 additions & 15 deletions src/commands/containers/browseContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@ import { DockerPort } from '../../docker/Containers';
import { ext } from "../../extensionVariables";
import { localize } from '../../localize';
import { ContainerTreeItem } from "../../tree/containers/ContainerTreeItem";
import { captureCancelStep } from '../../utils/captureCancelStep';

type BrowseTelemetryProperties = TelemetryProperties & { possiblePorts?: string, selectedPort?: number };

type ConfigureBrowseCancelStep = 'node' | 'port';

async function captureBrowseCancelStep<T>(cancelStep: ConfigureBrowseCancelStep, properties: BrowseTelemetryProperties, prompt: () => Promise<T>): Promise<T> {
return await captureCancelStep(cancelStep, properties, prompt)();
}

// NOTE: These ports are ordered in order of preference.
const commonWebPorts = [
443, // SSL
Expand All @@ -42,11 +35,10 @@ export async function browseContainer(context: IActionContext, node?: ContainerT

if (!node) {
await ext.containersTree.refresh(context);
node = await captureBrowseCancelStep('node', telemetryProperties, async () =>
ext.containersTree.showTreeItemPicker<ContainerTreeItem>(ContainerTreeItem.runningContainerRegExp, {
...context,
noItemFoundErrorMessage: localize('vscode-docker.commands.containers.browseContainer.noContainers', 'No running containers are available to open in a browser')
}));
node = await ext.containersTree.showTreeItemPicker<ContainerTreeItem>(ContainerTreeItem.runningContainerRegExp, {
...context,
noItemFoundErrorMessage: localize('vscode-docker.commands.containers.browseContainer.noContainers', 'No running containers are available to open in a browser')
});
}

const ports = node.ports ?? [];
Expand All @@ -57,8 +49,7 @@ export async function browseContainer(context: IActionContext, node?: ContainerT
telemetryProperties.possiblePorts = possiblePorts.map(port => port.PrivatePort).toString();

if (possiblePorts.length === 0) {
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
ext.ui.showWarningMessage(localize('vscode-docker.commands.containers.browseContainer.noPorts', 'No valid ports are available.'));
void context.ui.showWarningMessage(localize('vscode-docker.commands.containers.browseContainer.noPorts', 'No valid ports are available.'));
return;
}

Expand All @@ -80,7 +71,7 @@ export async function browseContainer(context: IActionContext, node?: ContainerT
items.sort((a, b) => a.port.PrivatePort - b.port.PrivatePort);

/* eslint-disable-next-line @typescript-eslint/promise-function-async */
const item = await captureBrowseCancelStep('port', telemetryProperties, () => ext.ui.showQuickPick(items, { placeHolder: localize('vscode-docker.commands.containers.browseContainer.selectContainerPort', 'Select the container port to browse to.') }));
const item = await context.ui.showQuickPick(items, { stepName: 'port', placeHolder: localize('vscode-docker.commands.containers.browseContainer.selectContainerPort', 'Select the container port to browse to.') });

// NOTE: If the user cancels the prompt, then a UserCancelledError exception would be thrown.

Expand Down
2 changes: 1 addition & 1 deletion src/commands/containers/confirmAllAffectedContainers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function confirmAllAffectedContainers(context: IActionContext, node
const confirm = localize('vscode-docker.commands.containers.aciContainerActionWarning.confirm', 'ACI containers can only be started or stopped in a group. This action will apply to all containers in {0}. Do you want to proceed?', groupsConfirm);

// No need to check result - cancel will throw a UserCancelledError
await ext.ui.showWarningMessage(confirm, { modal: true }, DialogResponses.yes);
await context.ui.showWarningMessage(confirm, { modal: true }, DialogResponses.yes);

return groupsList;
}
2 changes: 1 addition & 1 deletion src/commands/containers/pruneContainers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { convertToMB } from '../../utils/convertToMB';
export async function pruneContainers(context: IActionContext): Promise<void> {
const confirmPrune: string = localize('vscode-docker.commands.containers.prune.confirm', 'Are you sure you want to remove all stopped containers?');
// no need to check result - cancel will throw a UserCancelledError
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.containers.prune.remove', 'Remove') });
await context.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.containers.prune.remove', 'Remove') });

await vscode.window.withProgress(
{ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.containers.pruning', 'Pruning containers...') },
Expand Down
2 changes: 1 addition & 1 deletion src/commands/containers/removeContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function removeContainer(context: IActionContext, node?: ContainerT
}

// no need to check result - cancel will throw a UserCancelledError
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: localize('vscode-docker.commands.containers.remove.remove', 'Remove') });
await context.ui.showWarningMessage(confirmRemove, { modal: true }, { title: localize('vscode-docker.commands.containers.remove.remove', 'Remove') });

const removing: string = localize('vscode-docker.commands.containers.remove.removing', 'Removing container(s)...');
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: removing }, async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/context/removeDockerContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function removeDockerContext(actionContext: IActionContext, node?:
const removeConfirmationMessage = localize('vscode-docker.commands.context.remove.confirmSingle', 'Are you sure you want to remove Docker context \'{0}\'?', node.name);

// no need to check result - cancel will throw a UserCancelledError
await ext.ui.showWarningMessage(removeConfirmationMessage, { modal: true }, { title: localize('vscode-docker.commands.context.remove', 'Remove') });
await actionContext.ui.showWarningMessage(removeConfirmationMessage, { modal: true }, { title: localize('vscode-docker.commands.context.remove', 'Remove') });

const removingMessage: string = localize('vscode-docker.commands.context.remove.removing', 'Removing Docker context(s)...');
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: removingMessage }, async () => {
Expand Down
4 changes: 1 addition & 3 deletions src/commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

import * as vscode from 'vscode';
import { IActionContext, IAzureQuickPickOptions } from 'vscode-azureextensionui';

import { extensionId } from '../constants';
import { ext } from '../extensionVariables';
import { localize } from '../localize';

interface HelpMenuItem extends vscode.QuickPickItem {
Expand All @@ -24,7 +22,7 @@ export async function help(context: IActionContext): Promise<void> {
];

const options: IAzureQuickPickOptions = { canPickMany: false, suppressPersistence: true };
const selectedItem: HelpMenuItem = await ext.ui.showQuickPick(items, options);
const selectedItem: HelpMenuItem = await context.ui.showQuickPick(items, options);
context.telemetry.properties.helpItem = selectedItem.telemetryID;
await selectedItem.handler();
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/images/buildImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function buildImage(context: IActionContext, dockerFileUri: vscode.
rootFolder = rootFolder || await quickPickWorkspaceFolder(context, localize('vscode-docker.commands.images.build.workspaceFolder', 'To build Docker files you must first open a folder or workspace in VS Code.'));

const dockerFileItem = await quickPickDockerFileItem(context, dockerFileUri, rootFolder);
const task = await getOfficialBuildTaskForDockerfile(dockerFileItem.absoluteFilePath, rootFolder);
const task = await getOfficialBuildTaskForDockerfile(context, dockerFileItem.absoluteFilePath, rootFolder);

if (task) {
await vscode.tasks.executeTask(task);
Expand All @@ -58,7 +58,7 @@ export async function buildImage(context: IActionContext, dockerFileUri: vscode.
await delay(500);

addImageTaggingTelemetry(context, suggestedImageName, '.before');
const imageName: string = await getTagFromUserInput(suggestedImageName);
const imageName: string = await getTagFromUserInput(context, suggestedImageName);
addImageTaggingTelemetry(context, imageName, '.after');

await ext.context.globalState.update(dockerFileKey, imageName);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/images/pruneImages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { convertToMB } from '../../utils/convertToMB';
export async function pruneImages(context: IActionContext): Promise<void> {
const confirmPrune: string = localize('vscode-docker.commands.images.prune.confirm', 'Are you sure you want to remove all dangling images?');
// no need to check result - cancel will throw a UserCancelledError
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.images.prune.remove', 'Remove') });
await context.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.images.prune.remove', 'Remove') });

await vscode.window.withProgress(
{ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.images.pruning', 'Pruning images...') },
Expand Down
2 changes: 1 addition & 1 deletion src/commands/images/pullImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function pullImage(context: IActionContext, node?: ImageTreeItem, n
if (/:<none>/i.test(n.fullTag)) {
// Warn only once
if (!noneTagWarningShown) {
void ext.ui.showWarningMessage(localize('vscode-docker.commands.images.pull.noneTag', 'Images without tags will be skipped.'));
void context.ui.showWarningMessage(localize('vscode-docker.commands.images.pull.noneTag', 'Images without tags will be skipped.'));
noneTagWarningShown = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/images/removeImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function removeImage(context: IActionContext, node?: ImageTreeItem,
}

// no need to check result - cancel will throw a UserCancelledError
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: 'Remove' });
await context.ui.showWarningMessage(confirmRemove, { modal: true }, { title: 'Remove' });

const removing: string = localize('vscode-docker.commands.images.remove.removing', 'Removing image(s)...');
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: removing }, async () => {
Expand Down
8 changes: 6 additions & 2 deletions src/commands/images/showDanglingImages.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { ext } from "../../extensionVariables";
import { ext } from '../../extensionVariables';
import { IActionContext } from 'vscode-azureextensionui';

export async function showDanglingImages(context: IActionContext): Promise<void> {
const conf: boolean = await ext.context.globalState.get('vscode-docker.images.showDanglingImages', false);
const conf: boolean = ext.context.globalState.get('vscode-docker.images.showDanglingImages', false);
await ext.context.globalState.update('vscode-docker.images.showDanglingImages', !conf);
}
6 changes: 3 additions & 3 deletions src/commands/images/tagImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ export async function tagImage(context: IActionContext, node?: ImageTreeItem, re
}

addImageTaggingTelemetry(context, node.fullTag, '.before');
const newTaggedName: string = await getTagFromUserInput(node.fullTag, registry?.baseImagePath);
const newTaggedName: string = await getTagFromUserInput(context, node.fullTag, registry?.baseImagePath);
addImageTaggingTelemetry(context, newTaggedName, '.after');

await ext.dockerClient.tagImage(context, node.imageId, newTaggedName);
return newTaggedName;
}

export async function getTagFromUserInput(fullTag: string, baseImagePath?: string): Promise<string> {
export async function getTagFromUserInput(context: IActionContext, fullTag: string, baseImagePath?: string): Promise<string> {
const opt: vscode.InputBoxOptions = {
ignoreFocusOut: true,
prompt: localize('vscode-docker.commands.images.tag.tagAs', 'Tag image as...'),
Expand All @@ -42,7 +42,7 @@ export async function getTagFromUserInput(fullTag: string, baseImagePath?: strin

opt.value = fullTag;

return await ext.ui.showInputBox(opt);
return await context.ui.showInputBox(opt);
}

const KnownRegistries: { type: string, regex: RegExp }[] = [
Expand Down
4 changes: 2 additions & 2 deletions src/commands/networks/createNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getDockerOSType } from '../../utils/osUtils';

export async function createNetwork(context: IActionContext): Promise<void> {

const name = await ext.ui.showInputBox({
const name = await context.ui.showInputBox({
value: '',
prompt: localize('vscode-docker.commands.networks.create.promptName', 'Name of the network')
});
Expand All @@ -29,7 +29,7 @@ export async function createNetwork(context: IActionContext): Promise<void> {
{ label: 'macvlan' }
];

const driverSelection = await ext.ui.showQuickPick(
const driverSelection = await context.ui.showQuickPick(
drivers,
{
canPickMany: false,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/networks/pruneNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { localize } from '../../localize';
export async function pruneNetworks(context: IActionContext): Promise<void> {
const confirmPrune: string = localize('vscode-docker.commands.networks.prune.confirm', 'Are you sure you want to remove all unused networks?');
// no need to check result - cancel will throw a UserCancelledError
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.networks.prune.remove', 'Remove') });
await context.ui.showWarningMessage(confirmPrune, { modal: true }, { title: localize('vscode-docker.commands.networks.prune.remove', 'Remove') });

await vscode.window.withProgress(
{ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.networks.pruning', 'Pruning networks...') },
Expand Down
2 changes: 1 addition & 1 deletion src/commands/networks/removeNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function removeNetwork(context: IActionContext, node?: NetworkTreeI
}

// no need to check result - cancel will throw a UserCancelledError
await ext.ui.showWarningMessage(confirmRemove, { modal: true }, { title: localize('vscode-docker.commands.networks.remove.remove', 'Remove') });
await context.ui.showWarningMessage(confirmRemove, { modal: true }, { title: localize('vscode-docker.commands.networks.remove.remove', 'Remove') });

const removing: string = localize('vscode-docker.commands.networks.remove.removing', 'Removing network(s)...');
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: removing }, async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/pruneSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { convertToMB } from '../utils/convertToMB';
export async function pruneSystem(context: IActionContext): Promise<void> {
const confirmPrune: string = localize('vscode-docker.commands.pruneSystem.confirm', 'Are you sure you want to remove all stopped containers, dangling images, unused networks, and unused volumes? Removing volumes may result in data loss!');
// no need to check result - cancel will throw a UserCancelledError
await ext.ui.showWarningMessage(confirmPrune, { modal: true }, { title: 'Remove' });
await context.ui.showWarningMessage(confirmPrune, { modal: true }, { title: 'Remove' });

await vscode.window.withProgress(
{ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.pruneSystem.pruning', 'Pruning system...') },
Expand Down
10 changes: 3 additions & 7 deletions src/commands/registerWorkspaceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { commands, ConfigurationTarget, MessageItem, workspace, WorkspaceConfiguration } from 'vscode';
import { callWithTelemetryAndErrorHandling, IActionContext, UserCancelledError } from 'vscode-azureextensionui';
import { extensionId } from '../constants';
import { ext } from '../extensionVariables';
import { localize } from '../localize';
import { DockerExtensionKind, getVSCodeRemoteInfo, IVSCodeRemoteInfo, RemoteKind } from '../utils/getVSCodeRemoteInfo';
import { registerCommand } from './registerCommands';
Expand Down Expand Up @@ -57,15 +56,13 @@ async function verifyIsRunningInWorkspace(context: IActionContext): Promise<void
return;
}

context.telemetry.properties.cancelStep = 'switchExtensionKind';
const switchBtn: MessageItem = { title: switchTitle };
await ext.ui.showWarningMessage(message, { learnMoreLink }, switchBtn);
await context.ui.showWarningMessage(message, { learnMoreLink, stepName: 'switchExtensionKind' }, switchBtn);
updateExtensionKind('workspace');

context.telemetry.properties.cancelStep = 'requiresReload';
const reloadMessage: string = localize('vscode-docker.commands.registerWorkspaceCommands.reloadRequired', 'This change to the Docker extension requires reloading VS Code to take effect.');
const reload: MessageItem = { title: localize('vscode-docker.commands.registerWorkspaceCommands.reload', 'Reload Now') };
await ext.ui.showWarningMessage(reloadMessage, reload);
await context.ui.showWarningMessage(reloadMessage, { stepName: 'requiresReload' }, reload);

// Add a one-off event here before reloading the window otherwise we'll lose telemetry for this code path
await callWithTelemetryAndErrorHandling('verifyIsWorkspaceExtension', (newContext: IActionContext) => {
Expand All @@ -74,9 +71,8 @@ async function verifyIsRunningInWorkspace(context: IActionContext): Promise<void

await commands.executeCommand('workbench.action.reloadWindow');

context.telemetry.properties.cancelStep = 'reloading';
// throw an exception just to make sure we don't try to continue the command before the window is fully reloaded
throw new UserCancelledError();
throw new UserCancelledError('reloading');
}
}
}
Expand Down
Loading

0 comments on commit ffd43e4

Please sign in to comment.