Skip to content

Commit

Permalink
Initial conversion to a v1.5 extension (#1195)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexweininger authored Jan 17, 2023
1 parent d7f22c4 commit 35878b3
Show file tree
Hide file tree
Showing 18 changed files with 90 additions and 73 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,21 @@
},
"contributes": {
"x-azResources": {
"azure": {
"branches": [
{
"type": "StorageAccounts"
}
]
},
"workspace": {
"branches": [
{
"type": "storageEmulator"
}
],
"resources": true
},
"activation": {
"onFetch": [
"microsoft.storage/storageaccounts"
Expand Down Expand Up @@ -837,7 +852,7 @@
"@azure/storage-queue": "^12.7.0",
"@microsoft/vscode-azext-azureappservice": "^0.7.0",
"@microsoft/vscode-azext-azureutils": "^0.3.4",
"@microsoft/vscode-azext-utils": "^0.3.14",
"@microsoft/vscode-azext-utils": "^0.3.26",
"glob": "^7.1.2",
"mime": "^2.4.4",
"open": "^8.0.4",
Expand Down
10 changes: 5 additions & 5 deletions src/commands/blob/blobContainerActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IActionContext, registerCommand } from '@microsoft/vscode-azext-utils';
import { IActionContext, registerCommandWithTreeNodeUnwrapping } from '@microsoft/vscode-azext-utils';
import * as path from 'path';
import * as vscode from 'vscode';
import { AzureStorageFS } from '../../AzureStorageFS';
Expand All @@ -17,10 +17,10 @@ import { localize } from '../../utils/localize';
import { deleteNode } from '../commonTreeCommands';

export function registerBlobContainerActionHandlers(): void {
registerCommand("azureStorage.openBlobContainer", openBlobContainerInStorageExplorer);
registerCommand("azureStorage.editBlob", async (context: IActionContext, treeItem: BlobTreeItem) => AzureStorageFS.showEditor(context, treeItem), 250);
registerCommand("azureStorage.deleteBlobContainer", deleteBlobContainer);
registerCommand("azureStorage.createBlockBlob", async (context: IActionContext, parent: BlobContainerTreeItem) => {
registerCommandWithTreeNodeUnwrapping("azureStorage.openBlobContainer", openBlobContainerInStorageExplorer);
registerCommandWithTreeNodeUnwrapping("azureStorage.editBlob", async (context: IActionContext, treeItem: BlobTreeItem) => AzureStorageFS.showEditor(context, treeItem), 250);
registerCommandWithTreeNodeUnwrapping("azureStorage.deleteBlobContainer", deleteBlobContainer);
registerCommandWithTreeNodeUnwrapping("azureStorage.createBlockBlob", async (context: IActionContext, parent: BlobContainerTreeItem) => {
const blobPath: string = normalizeBlobPathInput(await getBlobPath(context, parent));
const dirNames: string[] = blobPath.includes('/') ? path.dirname(blobPath).split('/') : [];
let dirParentTreeItem: BlobDirectoryTreeItem | BlobContainerTreeItem = parent;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/blob/blobContainerGroupActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IActionContext, registerCommand } from '@microsoft/vscode-azext-utils';
import { IActionContext, registerCommandWithTreeNodeUnwrapping } from '@microsoft/vscode-azext-utils';
import { BlobContainerGroupTreeItem } from '../../tree/blob/BlobContainerGroupTreeItem';
import { isAzuriteInstalled, warnAzuriteNotInstalled } from '../../utils/azuriteUtils';
import { createChildNode } from '../commonTreeCommands';

export function registerBlobContainerGroupActionHandlers(): void {
registerCommand("azureStorage.createBlobContainer", createBlobContainer);
registerCommandWithTreeNodeUnwrapping("azureStorage.createBlobContainer", createBlobContainer);
}

export async function createBlobContainer(context: IActionContext, treeItem?: BlobContainerGroupTreeItem): Promise<void> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/fileShare/directoryActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AzExtParentTreeItem, IActionContext, registerCommand } from '@microsoft/vscode-azext-utils';
import { AzExtParentTreeItem, IActionContext, registerCommandWithTreeNodeUnwrapping } from '@microsoft/vscode-azext-utils';
import { DirectoryTreeItem } from '../../tree/fileShare/DirectoryTreeItem';
import { IFileShareCreateChildContext } from '../../tree/fileShare/FileShareTreeItem';
import { deleteFilesAndDirectories } from '../deleteFilesAndDirectories';

export function registerDirectoryActionHandlers(): void {
registerCommand("azureStorage.deleteDirectory", deleteFilesAndDirectories);
registerCommand("azureStorage.createSubdirectory", async (context: IActionContext, treeItem: AzExtParentTreeItem) => await treeItem.createChild(<IFileShareCreateChildContext>{ ...context, childType: DirectoryTreeItem.contextValue }));
registerCommandWithTreeNodeUnwrapping("azureStorage.deleteDirectory", deleteFilesAndDirectories);
registerCommandWithTreeNodeUnwrapping("azureStorage.createSubdirectory", async (context: IActionContext, treeItem: AzExtParentTreeItem) => await treeItem.createChild(<IFileShareCreateChildContext>{ ...context, childType: DirectoryTreeItem.contextValue }));

// Note: azureStorage.createTextFile is registered in fileShareActionHandlers
}
4 changes: 2 additions & 2 deletions src/commands/fileShare/fileActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { registerCommand } from '@microsoft/vscode-azext-utils';
import { registerCommandWithTreeNodeUnwrapping } from '@microsoft/vscode-azext-utils';
import { deleteFilesAndDirectories } from '../deleteFilesAndDirectories';

export function registerFileActionHandlers(): void {
registerCommand("azureStorage.deleteFile", deleteFilesAndDirectories);
registerCommandWithTreeNodeUnwrapping("azureStorage.deleteFile", deleteFilesAndDirectories);
}
12 changes: 6 additions & 6 deletions src/commands/fileShare/fileShareActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IActionContext, registerCommand } from '@microsoft/vscode-azext-utils';
import { IActionContext, registerCommandWithTreeNodeUnwrapping } from '@microsoft/vscode-azext-utils';
import * as vscode from 'vscode';
import { AzureStorageFS } from '../../AzureStorageFS';
import { storageExplorerLauncher } from '../../storageExplorerLauncher/storageExplorerLauncher';
Expand All @@ -12,11 +12,11 @@ import { FileTreeItem } from '../../tree/fileShare/FileTreeItem';
import { deleteNode } from '../commonTreeCommands';

export function registerFileShareActionHandlers(): void {
registerCommand("azureStorage.openFileShare", openFileShareInStorageExplorer);
registerCommand("azureStorage.editFile", async (context: IActionContext, treeItem: FileTreeItem) => AzureStorageFS.showEditor(context, treeItem), 250);
registerCommand("azureStorage.deleteFileShare", deleteFileShare);
registerCommand("azureStorage.createDirectory", async (context: IActionContext, treeItem: FileShareTreeItem) => await treeItem.createChild(<IFileShareCreateChildContext>{ ...context, childType: DirectoryTreeItem.contextValue }));
registerCommand("azureStorage.createFile", async (context: IActionContext, treeItem: FileShareTreeItem) => {
registerCommandWithTreeNodeUnwrapping("azureStorage.openFileShare", openFileShareInStorageExplorer);
registerCommandWithTreeNodeUnwrapping("azureStorage.editFile", async (context: IActionContext, treeItem: FileTreeItem) => AzureStorageFS.showEditor(context, treeItem), 250);
registerCommandWithTreeNodeUnwrapping("azureStorage.deleteFileShare", deleteFileShare);
registerCommandWithTreeNodeUnwrapping("azureStorage.createDirectory", async (context: IActionContext, treeItem: FileShareTreeItem) => await treeItem.createChild(<IFileShareCreateChildContext>{ ...context, childType: DirectoryTreeItem.contextValue }));
registerCommandWithTreeNodeUnwrapping("azureStorage.createFile", async (context: IActionContext, treeItem: FileShareTreeItem) => {
const childTreeItem = await treeItem.createChild(<IFileShareCreateChildContext>{ ...context, childType: FileTreeItem.contextValue });
await vscode.commands.executeCommand("azureStorage.editFile", childTreeItem);
});
Expand Down
4 changes: 2 additions & 2 deletions src/commands/fileShare/fileShareGroupActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IActionContext, registerCommand } from '@microsoft/vscode-azext-utils';
import { IActionContext, registerCommandWithTreeNodeUnwrapping } from '@microsoft/vscode-azext-utils';
import { FileShareGroupTreeItem } from '../../tree/fileShare/FileShareGroupTreeItem';
import { createChildNode } from '../commonTreeCommands';

export function registerFileShareGroupActionHandlers(): void {
registerCommand("azureStorage.createFileShare", createFileShare);
registerCommandWithTreeNodeUnwrapping("azureStorage.createFileShare", createFileShare);
}

export async function createFileShare(context: IActionContext, treeItem?: FileShareGroupTreeItem): Promise<void> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/queue/queueActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IActionContext, registerCommand } from '@microsoft/vscode-azext-utils';
import { IActionContext, registerCommandWithTreeNodeUnwrapping } from '@microsoft/vscode-azext-utils';
import { storageExplorerLauncher } from '../../storageExplorerLauncher/storageExplorerLauncher';
import { QueueTreeItem } from '../../tree/queue/QueueTreeItem';
import { deleteNode } from '../commonTreeCommands';

export function registerQueueActionHandlers(): void {
registerCommand("azureStorage.openQueue", openQueueInStorageExplorer);
registerCommand("azureStorage.deleteQueue", deleteQueue);
registerCommandWithTreeNodeUnwrapping("azureStorage.openQueue", openQueueInStorageExplorer);
registerCommandWithTreeNodeUnwrapping("azureStorage.deleteQueue", deleteQueue);
}

async function openQueueInStorageExplorer(_context: IActionContext, treeItem: QueueTreeItem): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/queue/queueGroupActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IActionContext, registerCommand } from '@microsoft/vscode-azext-utils';
import { IActionContext, registerCommandWithTreeNodeUnwrapping } from '@microsoft/vscode-azext-utils';
import { QueueGroupTreeItem } from '../../tree/queue/QueueGroupTreeItem';
import { isAzuriteInstalled, warnAzuriteNotInstalled } from '../../utils/azuriteUtils';
import { createChildNode } from '../commonTreeCommands';

export function registerQueueGroupActionHandlers(): void {
registerCommand("azureStorage.createQueue", createQueue);
registerCommandWithTreeNodeUnwrapping("azureStorage.createQueue", createQueue);
}

export async function createQueue(context: IActionContext, treeItem?: QueueGroupTreeItem): Promise<void> {
Expand Down
Loading

0 comments on commit 35878b3

Please sign in to comment.