Skip to content

Commit

Permalink
Move internal api file into src and make it a ts file (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexweininger authored Aug 22, 2023
1 parent e92ab90 commit cd05092
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions extension.bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export * from './src/services/AzureResourcesService';
// Export activate/deactivate for main.js
export { activate, deactivate } from './src/extension';
export * from './src/extensionVariables';
export * from './src/hostapi.v2.internal';
export * from './src/tree/BranchDataItemWrapper';
export * from './src/tree/InvalidItem';
export { ResourceGroupsItem } from './src/tree/ResourceGroupsItem';
Expand Down
4 changes: 2 additions & 2 deletions src/api/DefaultAzureResourceProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

import { GenericResource, ResourceGroup } from '@azure/arm-resources';
import { getResourceGroupFromId } from "@microsoft/vscode-azext-azureutils";
import { callWithTelemetryAndErrorHandling, getAzExtResourceType, IActionContext, nonNullProp } from '@microsoft/vscode-azext-utils';
import { IActionContext, callWithTelemetryAndErrorHandling, getAzExtResourceType, nonNullProp } from '@microsoft/vscode-azext-utils';
import * as vscode from 'vscode';
import { AzureResource, AzureSubscription } from '../../api/src/index';
import { AzureResourceProvider } from '../../hostapi.v2.internal';
import { AzureResourceProvider } from '../hostapi.v2.internal';
import { getAzureResourcesService } from '../services/AzureResourcesService';

export class DefaultAzureResourceProvider implements AzureResourceProvider {
Expand Down
2 changes: 1 addition & 1 deletion src/api/ResourceProviderManagers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import * as vscode from 'vscode';
import { AzureResource, AzureSubscription, ResourceBase, ResourceProvider, WorkspaceResource, WorkspaceResourceProvider } from '../../api/src/index';
import { AzureResourceProvider } from '../../hostapi.v2.internal';
import { AzureResourceProvider } from '../hostapi.v2.internal';

export function isArray<T>(maybeArray: T[] | null | undefined): maybeArray is T[] {
return Array.isArray(maybeArray);
Expand Down
2 changes: 1 addition & 1 deletion src/api/createAzureResourcesHostApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import { callWithTelemetryAndErrorHandling } from '@microsoft/vscode-azext-utils';
import * as vscode from 'vscode';
import { AzExtResourceType, AzureResource, BranchDataProvider, ResourceModelBase, VSCodeRevealOptions, WorkspaceResource, WorkspaceResourceProvider } from '../../api/src/index';
import { AzureResourceProvider, AzureResourcesHostApiInternal } from '../../hostapi.v2.internal';
import { revealResource } from '../commands/revealResource';
import { AzureResourceProvider, AzureResourcesHostApiInternal } from '../hostapi.v2.internal';
import { AzureResourceBranchDataProviderManager } from '../tree/azure/AzureResourceBranchDataProviderManager';
import { AzureResourceTreeDataProvider } from '../tree/azure/AzureResourceTreeDataProvider';
import { WorkspaceResourceBranchDataProviderManager } from '../tree/workspace/WorkspaceResourceBranchDataProviderManager';
Expand Down
2 changes: 1 addition & 1 deletion src/api/createWrappedAzureResourcesExtensionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { IActionContext } from '@microsoft/vscode-azext-utils';
import { AzureResourcesApiInternal } from '../../hostapi.v2.internal';
import { AzureResourcesApiInternal } from '../hostapi.v2.internal';
import { wrapFunctionsInTelemetry, wrapFunctionsInTelemetrySync } from '../utils/wrapFunctionsInTelemetry';

export function createWrappedAzureResourcesExtensionApi(api: AzureResourcesApiInternal, extensionId: string): AzureResourcesApiInternal {
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { registerAzureUtilsExtensionVariables, setupAzureLogger } from '@microso
import { AzExtTreeDataProvider, AzureExtensionApiFactory, IActionContext, callWithTelemetryAndErrorHandling, createApiProvider, createAzExtLogOutputChannel, registerUIExtensionVariables } from '@microsoft/vscode-azext-utils';
import { GetApiOptions, apiUtils } from 'api/src/utils/apiUtils';
import * as vscode from 'vscode';
import { AzureResourcesApiInternal } from '../hostapi.v2.internal';
import { ActivityLogTreeItem } from './activityLog/ActivityLogsTreeItem';
import { registerActivity } from './activityLog/registerActivity';
import { DefaultAzureResourceProvider } from './api/DefaultAzureResourceProvider';
Expand All @@ -26,6 +25,7 @@ import { registerCommands } from './commands/registerCommands';
import { TagFileSystem } from './commands/tags/TagFileSystem';
import { registerTagDiagnostics } from './commands/tags/registerTagDiagnostics';
import { ext } from './extensionVariables';
import { AzureResourcesApiInternal } from './hostapi.v2.internal';
import { createVSCodeAzureSubscriptionProviderFactory } from './services/VSCodeAzureSubscriptionProvider';
import { BranchDataItemCache } from './tree/BranchDataItemCache';
import { HelpTreeItem } from './tree/HelpTreeItem';
Expand Down
2 changes: 1 addition & 1 deletion src/extensionVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { AzureSubscriptionProvider } from "@microsoft/vscode-azext-azureauth";
import { AzExtTreeDataProvider, IAzExtLogOutputChannel } from "@microsoft/vscode-azext-utils";
import { AzExtResourceType } from "api/docs/vscode-azureresources-api";
import { DiagnosticCollection, Disposable, ExtensionContext, TreeView, UIKind, env } from "vscode";
import { AzureResourcesApiInternal } from "../hostapi.v2.internal";
import { ActivityLogTreeItem } from "./activityLog/ActivityLogsTreeItem";
import { TagFileSystem } from "./commands/tags/TagFileSystem";
import { AzureResourcesApiInternal } from "./hostapi.v2.internal";
import { AzureResourcesServiceFactory } from "./services/AzureResourcesService";
import { ResourceGroupsItem } from "./tree/ResourceGroupsItem";
import { TreeItemStateStore } from "./tree/TreeItemState";
Expand Down
2 changes: 1 addition & 1 deletion hostapi.v2.internal.d.ts → src/hostapi.v2.internal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ActivityApi } from '@microsoft/vscode-azext-utils/activity';
import * as vscode from 'vscode';
import { AzureResource, AzureResourcesExtensionApi, AzureSubscription, ResourceProvider, ResourcesApi } from "./api/src/index";
import { AzureResource, AzureResourcesExtensionApi, AzureSubscription, ResourceProvider, ResourcesApi } from "../api/src/index";

// v2 types that are internal to resource groups (for now)

Expand Down
3 changes: 1 addition & 2 deletions test/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ext } from "../../extension.bundle";
import { AzureResourcesHostApiInternal } from "../../hostapi.v2.internal";
import { AzureResourcesHostApiInternal, ext } from "../../extension.bundle";

export const api = (): AzureResourcesHostApiInternal => ext.v2.api.resources;

0 comments on commit cd05092

Please sign in to comment.