Skip to content

Commit

Permalink
Merge branch 'main' into users/amitjoshi/@powerpagesCreateSiteRecords…
Browse files Browse the repository at this point in the history
…OnDV
  • Loading branch information
amitjoshi committed Dec 16, 2024
2 parents d596ee9 + c115f29 commit e900b16
Show file tree
Hide file tree
Showing 13 changed files with 232 additions and 99 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ telemetry-generated
# tasks copy them to the correct location, but leave the originals where
# we do not want them checked in
l10n/package.nls.*.json

# Code Coverage Output
.nyc_output/
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log - Power Platform Extension

## 2.0.76
- pac CLI 1.37.4, (November 2024 refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/))

## 2.0.74
- pac CLI 1.35.1, (September 2024 refresh, see release notes on [nuget.org](https://www.nuget.org/packages/Microsoft.PowerApps.CLI/))
- Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ async function snapshot() {
}
}

const cliVersion = '1.35.1';
const cliVersion = '1.37.4';

const recompile = gulp.series(
clean,
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@
"title": "Open in Power Pages",
"when": "never"
},
{
"command": "extension.createChatView",
"title": "Create Chat View"
},
{
"command": "pacCLI.openDocumentation",
"category": "Power Platform CLI",
Expand Down
71 changes: 2 additions & 69 deletions src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import * as vscode from "vscode";
import { AppTelemetryConfigUtility } from "../common/pp-tooling-telemetry-node";
import { vscodeExtAppInsightsResourceProvider } from "../common/telemetry-generated/telemetryConfiguration";
import { ITelemetryData } from "../common/TelemetryData";
import { CliAcquisition, ICliAcquisitionContext } from "./lib/CliAcquisition";
import { CliAcquisition } from "./lib/CliAcquisition";
import { PacTerminal } from "./lib/PacTerminal";
import { PortalWebView } from "./PortalWebView";
import { ITelemetry } from "../common/OneDSLoggerTelemetry/telemetry/ITelemetry";

import {
LanguageClient,
Expand Down Expand Up @@ -46,6 +45,7 @@ import { AadIdKey, EnvIdKey, TenantIdKey } from "../common/OneDSLoggerTelemetry/
import { PowerPagesAppName, PowerPagesClientName } from "../common/ecs-features/constants";
import { ECSFeaturesClient } from "../common/ecs-features/ecsFeatureClient";
import { getECSOrgLocationValue } from "../common/utilities/Utils";
import { CliAcquisitionContext } from "./lib/CliAcquisitionContext";

let client: LanguageClient;
let _context: vscode.ExtensionContext;
Expand Down Expand Up @@ -473,70 +473,3 @@ function showNotificationForCopilot(telemetry: TelemetryReporter, telemetryData:
}

}

// allow for DI without direct reference to vscode's d.ts file: that definintions file is being generated at VS Code runtime
class CliAcquisitionContext implements ICliAcquisitionContext {
public constructor(
private readonly _context: vscode.ExtensionContext,
private readonly _telemetry: ITelemetry
) { }

public get extensionPath(): string {
return this._context.extensionPath;
}
public get globalStorageLocalPath(): string {
return this._context.globalStorageUri.fsPath;
}
public get telemetry(): ITelemetry {
return this._telemetry;
}

showInformationMessage(message: string, ...items: string[]): void {
vscode.window.showInformationMessage(message, ...items);
}

showErrorMessage(message: string, ...items: string[]): void {
vscode.window.showErrorMessage(message, ...items);
}

showCliPreparingMessage(version: string): void {
vscode.window.showInformationMessage(
vscode.l10n.t({
message: "Preparing pac CLI (v{0})...",
args: [version],
comment: ["{0} represents the version number"]
})
);
}

showCliReadyMessage(): void {
vscode.window.showInformationMessage(
vscode.l10n.t('The pac CLI is ready for use in your VS Code terminal!'));
}

showCliInstallFailedError(err: string): void {
vscode.window.showErrorMessage(
vscode.l10n.t({
message: "Cannot install pac CLI: {0}",
args: [err],
comment: ["{0} represents the error message returned from the exception"]
})
);
}

showGeneratorInstallingMessage(version: string): void {
vscode.window.showInformationMessage(
vscode.l10n.t({
message: "Installing Power Pages generator(v{0})...",
args: [version],
comment: ["{0} represents the version number"]
}))
}

locDotnetNotInstalledOrInsufficient(): string {
return vscode.l10n.t({
message: "dotnet sdk 6.0 or greater must be installed",
comment: ["Do not translate 'dotnet' or 'sdk'"]
});
}
}
17 changes: 1 addition & 16 deletions src/client/lib/CliAcquisition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,17 @@ import * as fs from 'fs-extra';
import * as glob from 'glob';
import * as os from 'os';
import { Extract } from 'unzip-stream'
import { ITelemetry } from '../../common/OneDSLoggerTelemetry/telemetry/ITelemetry';
import find from 'find-process';
import { spawnSync } from 'child_process';
import commandExists from 'command-exists';
import { oneDSLoggerWrapper } from '../../common/OneDSLoggerTelemetry/oneDSLoggerWrapper';

// allow for DI without direct reference to vscode's d.ts file: that definintions file is being generated at VS Code runtime
export interface ICliAcquisitionContext {
readonly extensionPath: string;
readonly globalStorageLocalPath: string;
readonly telemetry: ITelemetry;
showInformationMessage(message: string, ...items: string[]): void;
showErrorMessage(message: string, ...items: string[]): void;
showCliPreparingMessage(version: string): void;
showCliReadyMessage(): void;
showCliInstallFailedError(err: string): void;
locDotnetNotInstalledOrInsufficient(): string;
}
import { ICliAcquisitionContext } from './CliAcquisitionContext';

export interface IDisposable {
dispose(): void;
}

export class CliAcquisition implements IDisposable {

private readonly _context: ICliAcquisitionContext;
private readonly _cliPath: string;
private readonly _cliVersion: string;
Expand Down Expand Up @@ -241,4 +227,3 @@ export class CliAcquisition implements IDisposable {
}
}
}

86 changes: 86 additions & 0 deletions src/client/lib/CliAcquisitionContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import * as vscode from 'vscode';
import { ITelemetry } from '../../common/OneDSLoggerTelemetry/telemetry/ITelemetry';

export interface ICliAcquisitionContext {
readonly extensionPath: string;
readonly globalStorageLocalPath: string;
readonly telemetry: ITelemetry;
showInformationMessage(message: string, ...items: string[]): void;
showErrorMessage(message: string, ...items: string[]): void;
showCliPreparingMessage(version: string): void;
showCliReadyMessage(): void;
showCliInstallFailedError(err: string): void;
locDotnetNotInstalledOrInsufficient(): string;
}

// allow for DI without direct reference to vscode's d.ts file: that definintions file is being generated at VS Code runtime
export class CliAcquisitionContext implements ICliAcquisitionContext {
public constructor(
private readonly _context: vscode.ExtensionContext,
private readonly _telemetry: ITelemetry
) { }

public get extensionPath(): string {
return this._context.extensionPath;
}
public get globalStorageLocalPath(): string {
return this._context.globalStorageUri.fsPath;
}
public get telemetry(): ITelemetry {
return this._telemetry;
}

showInformationMessage(message: string, ...items: string[]): void {
vscode.window.showInformationMessage(message, ...items);
}

showErrorMessage(message: string, ...items: string[]): void {
vscode.window.showErrorMessage(message, ...items);
}

showCliPreparingMessage(version: string): void {
vscode.window.showInformationMessage(
vscode.l10n.t({
message: "Preparing pac CLI (v{0})...",
args: [version],
comment: ["{0} represents the version number"]
})
);
}

showCliReadyMessage(): void {
vscode.window.showInformationMessage(
vscode.l10n.t('The pac CLI is ready for use in your VS Code terminal!'));
}

showCliInstallFailedError(err: string): void {
vscode.window.showErrorMessage(
vscode.l10n.t({
message: "Cannot install pac CLI: {0}",
args: [err],
comment: ["{0} represents the error message returned from the exception"]
})
);
}

showGeneratorInstallingMessage(version: string): void {
vscode.window.showInformationMessage(
vscode.l10n.t({
message: "Installing Power Pages generator(v{0})...",
args: [version],
comment: ["{0} represents the version number"]
}))
}

locDotnetNotInstalledOrInsufficient(): string {
return vscode.l10n.t({
message: "dotnet sdk 6.0 or greater must be installed",
comment: ["Do not translate 'dotnet' or 'sdk'"]
});
}
}
2 changes: 1 addition & 1 deletion src/client/lib/GeneratorAcquisition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as fs from 'fs-extra';
import * as os from 'os';
import * as path from 'path';
import { PORTAL_YEOMAN_GENERATOR_PACKAGE_NAME, PORTAL_YEOMAN_GENERATOR_PACKAGE_TARBALL_NAME } from '../../common/constants';
import { ICliAcquisitionContext } from './CliAcquisition';
import { ICliAcquisitionContext } from './CliAcquisitionContext';
import { glob } from 'glob';
import commandExists from 'command-exists';
import { oneDSLoggerWrapper } from '../../common/OneDSLoggerTelemetry/oneDSLoggerWrapper';
Expand Down
3 changes: 2 additions & 1 deletion src/client/test/Integration/CliAcquisition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import * as fs from 'fs-extra';
import * as path from 'path';
import { CliAcquisition, ICliAcquisitionContext } from '../../lib/CliAcquisition';
import { CliAcquisition } from '../../lib/CliAcquisition';
import { ICliAcquisitionContext } from '../../lib/CliAcquisitionContext';
import { expect } from 'chai';
import { ITelemetry } from '../../../common/OneDSLoggerTelemetry/telemetry/ITelemetry';
import { NoopTelemetryInstance } from '../../telemetry/NoopTelemetry';
Expand Down
Loading

0 comments on commit e900b16

Please sign in to comment.