Move to Track 2 SDKs (#386)
* Move to Track 2 SDKs * Fixups * Use Node 16 * Set webpack target to node
This commit is contained in:
Родитель
952d52d337
Коммит
20ceb7ea63
|
@ -1,8 +1,8 @@
|
|||
steps:
|
||||
- task: NodeTool@0
|
||||
displayName: 'Use Node 14.x'
|
||||
displayName: 'Use Node 16.x'
|
||||
inputs:
|
||||
versionSpec: 14.x
|
||||
versionSpec: 16.x
|
||||
|
||||
- task: Npm@1
|
||||
displayName: 'npm ci'
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
15
package.json
15
package.json
|
@ -7,7 +7,7 @@
|
|||
"icon": "resources/azure-vm.png",
|
||||
"aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",
|
||||
"engines": {
|
||||
"vscode": "^1.66.0"
|
||||
"vscode": "^1.78.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -211,12 +211,12 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/eslint-config-azuretools": "^0.1.0",
|
||||
"@microsoft/vscode-azext-dev": "^0.1.4",
|
||||
"@microsoft/vscode-azext-dev": "^2.0.0",
|
||||
"@types/fs-extra": "^8.1.1",
|
||||
"@types/gulp": "^4.0.8",
|
||||
"@types/mocha": "^8.2.2",
|
||||
"@types/node": "^14.0.0",
|
||||
"@types/vscode": "1.66.0",
|
||||
"@types/vscode": "1.78.0",
|
||||
"@types/which": "^1.3.2",
|
||||
"@typescript-eslint/eslint-plugin": "^4.28.3",
|
||||
"@vscode/test-electron": "^2.1.5",
|
||||
|
@ -237,11 +237,12 @@
|
|||
"dependencies": {
|
||||
"@azure/arm-compute": "^17.1.0",
|
||||
"@azure/arm-network": "^26.0.0",
|
||||
"@azure/arm-network-profile-2020-09-01-hybrid": "^1.0.0",
|
||||
"@azure/arm-network-profile-2020-09-01-hybrid": "^2.1.0",
|
||||
"@azure/arm-resources": "^5.0.0",
|
||||
"@azure/arm-resources-profile-2020-09-01-hybrid": "^1.0.0",
|
||||
"@microsoft/vscode-azext-azureutils": "^0.3.4",
|
||||
"@microsoft/vscode-azext-utils": "^0.3.26",
|
||||
"@azure/arm-resources-profile-2020-09-01-hybrid": "^2.1.0",
|
||||
"@microsoft/vscode-azext-azureutils": "^2.0.0",
|
||||
"@microsoft/vscode-azext-utils": "^2.0.0",
|
||||
"@microsoft/vscode-azureresources-api": "^2.0.4",
|
||||
"fs-extra": "^8.1.0",
|
||||
"open": "^8.0.4",
|
||||
"semver": "^5.7.0",
|
||||
|
|
|
@ -7,9 +7,13 @@ import { ImageReference, OperatingSystemType, OperatingSystemTypes, VirtualMachi
|
|||
import { AzExtRequestPrepareOptions, sendRequestWithTimeout } from "@microsoft/vscode-azext-azureutils";
|
||||
import { AzureWizardPromptStep, IActionContext, IAzureQuickPickItem } from "@microsoft/vscode-azext-utils";
|
||||
import { localize } from '../../localize';
|
||||
import { createRequestUrl } from "../../utils/requestUtils";
|
||||
import { IVirtualMachineWizardContext } from './IVirtualMachineWizardContext';
|
||||
|
||||
export const apiVersion = '2018-08-01-beta';
|
||||
const apiVersionQueryParam = {
|
||||
'api-version': apiVersion,
|
||||
}
|
||||
|
||||
export class ImageListStep extends AzureWizardPromptStep<IVirtualMachineWizardContext> {
|
||||
public async prompt(context: IVirtualMachineWizardContext): Promise<void> {
|
||||
|
@ -56,12 +60,11 @@ export class ImageListStep extends AzureWizardPromptStep<IVirtualMachineWizardCo
|
|||
|
||||
const options: AzExtRequestPrepareOptions = {
|
||||
method: 'GET',
|
||||
url: 'https://catalogapi.azure.com/catalog/curationgrouplisting',
|
||||
queryParameters: {
|
||||
"api-version": { value: apiVersion },
|
||||
"group": { value: 'Marketplace.FeaturedItems' },
|
||||
"returnedProperties": { value: 'operatingSystem.family,id,image,freeTierEligible,legacyPlanId' }
|
||||
}
|
||||
url: createRequestUrl('https://catalogapi.azure.com/catalog/curationgrouplisting', {
|
||||
...apiVersionQueryParam,
|
||||
"group": 'Marketplace.FeaturedItems',
|
||||
"returnedProperties": 'operatingSystem.family,id,image,freeTierEligible,legacyPlanId',
|
||||
}),
|
||||
};
|
||||
|
||||
const images = <FeaturedImage[]>(await sendRequestWithTimeout(context, options, 5 * 1000, undefined)).parsedBody;
|
||||
|
@ -71,10 +74,7 @@ export class ImageListStep extends AzureWizardPromptStep<IVirtualMachineWizardCo
|
|||
private async getPlanFromLegacyPlanId(context: IActionContext, featuredImage: FeaturedImage): Promise<PlanFromLegacyPlanId> {
|
||||
const getOfferOptions: AzExtRequestPrepareOptions = {
|
||||
method: 'GET',
|
||||
url: `https://euap.catalogapi.azure.com/view/offers/${featuredImage.legacyPlanId}`,
|
||||
queryParameters: {
|
||||
"api-version": { value: apiVersion }
|
||||
}
|
||||
url: createRequestUrl(`https://euap.catalogapi.azure.com/view/offers/${featuredImage.legacyPlanId}`, apiVersionQueryParam),
|
||||
};
|
||||
|
||||
const offer = <OfferFromLegacyPlanId>(await sendRequestWithTimeout(context, getOfferOptions, 5 * 1000, undefined)).parsedBody;
|
||||
|
@ -92,13 +92,9 @@ export class ImageListStep extends AzureWizardPromptStep<IVirtualMachineWizardCo
|
|||
if (!uiDefUri) {
|
||||
throw new Error(localize('noUiDefUri', 'Could not find image reference from featured offer.'))
|
||||
}
|
||||
|
||||
const getUiDefOptions: AzExtRequestPrepareOptions = {
|
||||
method: 'GET',
|
||||
url: uiDefUri,
|
||||
queryParameters: {
|
||||
"api-version": { value: apiVersion }
|
||||
}
|
||||
url: createRequestUrl(uiDefUri, apiVersionQueryParam),
|
||||
};
|
||||
|
||||
const createdUiDefintion = <UiDefinition>(await sendRequestWithTimeout(context, getUiDefOptions, 5 * 1000, undefined)).parsedBody;
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
'use strict';
|
||||
|
||||
import { registerAzureUtilsExtensionVariables } from '@microsoft/vscode-azext-azureutils';
|
||||
import { AzExtResourceType, callWithTelemetryAndErrorHandling, createApiProvider, createAzExtOutputChannel, getExtensionExports, IActionContext, registerUIExtensionVariables } from '@microsoft/vscode-azext-utils';
|
||||
import { AzureExtensionApi, AzureExtensionApiProvider } from '@microsoft/vscode-azext-utils/api';
|
||||
import { apiUtils, AzureExtensionApi, callWithTelemetryAndErrorHandling, createApiProvider, createAzExtOutputChannel, IActionContext, registerUIExtensionVariables } from '@microsoft/vscode-azext-utils';
|
||||
import { AzureHostExtensionApi } from '@microsoft/vscode-azext-utils/hostapi';
|
||||
import { AzExtResourceType } from '@microsoft/vscode-azureresources-api';
|
||||
import * as vscode from 'vscode';
|
||||
import { revealTreeItem } from './commands/api/revealTreeItem';
|
||||
import { registerCommands } from './commands/registerCommands';
|
||||
import { ext } from './extensionVariables';
|
||||
import { VirtualMachineResolver } from './VirtualMachineTreeItemResolver';
|
||||
|
||||
export async function activateInternal(context: vscode.ExtensionContext, perfStats: { loadStartTime: number; loadEndTime: number }, ignoreBundle?: boolean): Promise<AzureExtensionApiProvider> {
|
||||
export async function activateInternal(context: vscode.ExtensionContext, perfStats: { loadStartTime: number; loadEndTime: number }, ignoreBundle?: boolean): Promise<apiUtils.AzureExtensionApiProvider> {
|
||||
ext.context = context;
|
||||
ext.ignoreBundle = ignoreBundle;
|
||||
ext.outputChannel = createAzExtOutputChannel('Azure Virtual Machines', ext.prefix);
|
||||
|
@ -30,7 +30,7 @@ export async function activateInternal(context: vscode.ExtensionContext, perfSta
|
|||
|
||||
registerCommands();
|
||||
|
||||
const rgApiProvider = await getExtensionExports<AzureExtensionApiProvider>('ms-azuretools.vscode-azureresourcegroups');
|
||||
const rgApiProvider = await apiUtils.getExtensionExports<apiUtils.AzureExtensionApiProvider>('ms-azuretools.vscode-azureresourcegroups');
|
||||
if (rgApiProvider) {
|
||||
const api = rgApiProvider.getApi<AzureHostExtensionApi>('0.0.1');
|
||||
ext.rgApi = api;
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export function createRequestUrl(base: string, queryParams: Record<string, string>): string {
|
||||
const queryString = new URLSearchParams(queryParams).toString();
|
||||
return `${base}?${queryString}`;
|
||||
}
|
|
@ -16,6 +16,7 @@ let DEBUG_WEBPACK = !/^(false|0)?$/i.test(process.env.DEBUG_WEBPACK || '');
|
|||
|
||||
let config = dev.getDefaultWebpackConfig({
|
||||
projectRoot: __dirname,
|
||||
target: 'node',
|
||||
verbosity: DEBUG_WEBPACK ? 'debug' : 'normal',
|
||||
externals:
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче