Skip to content

Commit

Permalink
Merge pull request #8437 from OfficeDev/wenyt/prerelease
Browse files Browse the repository at this point in the history
build: merge prerelease back to dev
  • Loading branch information
adashen authored Apr 19, 2023
2 parents 5bdd06a + 7ab0716 commit ed8fcb5
Show file tree
Hide file tree
Showing 261 changed files with 934 additions and 650 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@
/packages/fx-core/src/component/driver/m365 @swatDong @XiaofuHuang @kuojianlu @kimizhu
/packages/fx-core/tests/component/driver/m365 @swatDong @XiaofuHuang @kuojianlu @kimizhu

/packages/fx-core/src/component/driver/prerequisite @swatDong @XiaofuHuang @kuojianlu @kimizhu
/packages/fx-core/tests/component/driver/prerequisite @swatDong @XiaofuHuang @kuojianlu @kimizhu
/packages/fx-core/src/component/driver/devTool @swatDong @XiaofuHuang @kuojianlu @kimizhu
/packages/fx-core/tests/component/driver/devTool @swatDong @XiaofuHuang @kuojianlu @kimizhu

/packages/fx-core/src/core/middleware/utils/debug @swatDong @XiaofuHuang @kuojianlu @kimizhu

Expand Down
11 changes: 7 additions & 4 deletions .github/scripts/sync-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ const repoRoot = path.join(__dirname, "../..");
function updateTemplatesDeps(templateDir, templateList) {
let depPkgs = [];
for (let subTempDir of templateList) {
const subTempPath = path.join(templateDir, subTempDir, "package.json")
if (fse.existsSync(subTempPath)) {
depPkgs.push(subTempPath)
}
packageFileCandidates = ["package.json", "package.json.tpl"];
packageFileCandidates.forEach((file) => {
const subTempPath = path.join(templateDir, subTempDir, file)
if (fse.existsSync(subTempPath)) {
depPkgs.push(subTempPath)
}
});
}
const pkgDirs = require(path.join(repoRoot, "lerna.json")).packages;
let templatesDeps = {};
Expand Down
18 changes: 1 addition & 17 deletions packages/cli/src/cmds/capability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
FeatureId,
getQuestionsForAddWebpart,
} from "@microsoft/teamsfx-core/build/component/question";
import { SPFxQuestionNames } from "@microsoft/teamsfx-core/build/component/constants";
import { Argv } from "yargs";
import activate from "../activate";
import { CLIHelpInputs, EmptyQTreeNode, RootFolderNode } from "../constants";
Expand Down Expand Up @@ -78,7 +77,7 @@ export class CapabilityAddSPFxTab extends CapabilityAddBase {
}

export class AddWebpart extends YargsCommand {
public readonly commandHead = `SPFxWebPart`;
public readonly commandHead = `spfx-web-part`;
public readonly command = `${this.commandHead}`;
public readonly description = "Auto-hosted SPFx web part tightly integrated with Microsoft Teams";

Expand Down Expand Up @@ -110,21 +109,6 @@ export class AddWebpart extends YargsCommand {
const core = resultFolder.value;
const inputs = getSystemInputs(rootFolder, args.env);
inputs.stage = Stage.addWebpart;
if (args["spfx-install-latest-package"]) {
inputs["spfx-install-latest-package"] = args["spfx-install-latest-package"];
}
if (args[SPFxQuestionNames.SPFxFolder]) {
inputs[SPFxQuestionNames.SPFxFolder] = args[SPFxQuestionNames.SPFxFolder];
}
if (args[SPFxQuestionNames.WebPartName]) {
inputs[SPFxQuestionNames.WebPartName] = args[SPFxQuestionNames.WebPartName];
}
if (args[SPFxQuestionNames.ManifestPath]) {
inputs[SPFxQuestionNames.ManifestPath] = args[SPFxQuestionNames.ManifestPath];
}
if (args[SPFxQuestionNames.LocalManifestPath]) {
inputs[SPFxQuestionNames.LocalManifestPath] = args[SPFxQuestionNames.LocalManifestPath];
}
const result = await core.addWebpart(inputs);
if (result.isErr()) {
cliTelemetry.sendTelemetryErrorEvent(TelemetryEvent.AddWebpart, result.error);
Expand Down
8 changes: 0 additions & 8 deletions packages/cli/src/cmds/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ export default class Package extends YargsCommand {
{
let result;
if (isV3Enabled()) {
inputs[CoreQuestionNames.TeamsAppManifestFilePath] =
args[ManifestFilePathParamName] ?? `${rootFolder}/${AppPackageFolderName}/manifest.json`;
inputs[CoreQuestionNames.OutputZipPathParamName] =
args[CoreQuestionNames.OutputZipPathParamName] ??
`${rootFolder}/${AppPackageFolderName}/${BuildFolderName}/appPackage.${inputs.env}.zip`;
inputs[CoreQuestionNames.OutputManifestParamName] =
args[CoreQuestionNames.OutputManifestParamName] ??
`${rootFolder}/${AppPackageFolderName}/${BuildFolderName}/manifest.${inputs.env}.json`;
result = await core.createAppPackage(inputs);
} else {
const func: Func = {
Expand Down
4 changes: 0 additions & 4 deletions packages/cli/src/cmds/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ export class ManifestValidate extends YargsCommand {
if (isV3Enabled()) {
if (args[AppPackageFilePathParamName]) {
inputs.validateMethod = "validateAgainstAppPackage";
inputs[CoreQuestionNames.TeamsAppPackageFilePath] = args[AppPackageFilePathParamName];
} else {
inputs.validateMethod = "validateAgainstSchema";
inputs[CoreQuestionNames.TeamsAppManifestFilePath] =
args[ManifestFilePathParamName] ??
`${rootFolder}/${AppPackageFolderName}/manifest.json`;
}
result = await core.validateApplication(inputs);
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const CollaboratorEmailNode = new QTreeNode({
title: "Input email address of collaborator",
});

export const ManifestFilePathParamName = "manifest-file-path";
export const ManifestFilePathParamName = "manifest-path";
export const AppPackageFilePathParamName = "app-package-file-path";
export const BuildPackageOptions: OptionsMap = {
[ManifestFilePathParamName]: {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/tests/e2e/debug/DebugCommandAndResponse.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe("Debug V3 command-and-response template", () => {
context = await readContextMultiEnvV3(projectPath, "local");
chai.assert.isDefined(context);

// validate .localSettings
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localSettings")));
// validate .localConfigs
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localConfigs")));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe("Debug V3 notification-http-trigger template", () => {
// validate func
chai.assert.isUndefined(context.FUNC_PATH); // FUNC_PATH is undefined for global func

// validate .localSettings
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localSettings")));
// validate .localConfigs
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localConfigs")));
});
});
4 changes: 2 additions & 2 deletions packages/cli/tests/e2e/debug/DebugSsoTab.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe("Debug V3 sso-tab template", () => {
chai.assert.isDefined(context.SSL_KEY_FILE);
chai.assert.isNotEmpty(context.SSL_KEY_FILE);

// validate .localSettings
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localSettings")));
// validate .localConfigs
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localConfigs")));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe("Debug V3 m365-message-extension template", () => {
context = await readContextMultiEnvV3(projectPath, "local");
chai.assert.isDefined(context);

// validate .localSettings
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localSettings")));
// validate .localConfigs
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localConfigs")));
});
});
4 changes: 2 additions & 2 deletions packages/cli/tests/e2e/m365/DebugM365Tab.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ describe("Debug V3 m365-tab template", () => {
chai.assert.isDefined(context.SSL_KEY_FILE);
chai.assert.isNotEmpty(context.SSL_KEY_FILE);

// validate .localSettings
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localSettings")));
// validate .localConfigs
chai.assert.isTrue(await fs.pathExists(path.join(projectPath, ".localConfigs")));
}
});
});
2 changes: 1 addition & 1 deletion packages/cli/tests/utils/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class Executor {
localManifestPath: string
) {
const command =
`teamsfx add SPFxWebPart --spfx-webpart-name ${webpartName}` +
`teamsfx add spfx-web-part --spfx-webpart-name ${webpartName}` +
` --spfx-folder ${spfxFolder} --manifest-path ${manifestPath}` +
` --local-manifest-path ${localManifestPath}` +
` --spfx-install-latest-package true`;
Expand Down
17 changes: 10 additions & 7 deletions packages/fx-core/resource/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"core.deploy.noCapabilityFound": "No capability found to %s. Click Get Help to learn more about how to add capabilities.",
"core.deploy.successNotice": "'%s' successfully deployed.",
"core.deploy.aadManifestSuccessNotice": "Your Azure Active Directory application has been successfully deployed. Click \"Learn more\" to check how to view your Azure Active Directory application.",
"core.deploy.aadManifestOnCLISuccessNotice": "Your Azure Active Directory application has been successfully updated.",
"core.deploy.aadManifestLearnMore": "Learn more",
"core.deploy.failNotice": "Unable to deploy '%s'!",
"core.deploy.botTroubleShoot": "To troubleshoot bot application in azure, please click learn more for documentation.",
Expand Down Expand Up @@ -86,6 +87,7 @@
"core.progress.uploadTabToStorage": "Uploading Tab front end to Azure Storage account.",
"core.progress.configureAzureStorage": "Configuring Azure Storage, enable static website setting.",
"core.progress.runCommand": "Run command %s at %s",
"core.progress.deployToAzure": "`Deploying %s to %s",
"core.log.updateFunctionAppSettings": "Updating Azure Functions app settings.",
"core.error.programmingLanguageInvalid": "Invalid programming language found in project settings.",
"core.Notification.ReadMore": "Read more",
Expand Down Expand Up @@ -171,7 +173,7 @@
"plugins.spfx.questions.packageSelect.placeholder": "Select an option for scaffolding",
"plugins.spfx.questions.packageSelect.useGlobalPackage.withVersion.label": "Use globally installed SPFx (%s)",
"plugins.spfx.questions.packageSelect.useGlobalPackage.noVersion.label": "Use globally installed SPFx",
"plugins.spfx.questions.packageSelect.useGlobalPackage.detail": "Recommend SPFx %s or later",
"plugins.spfx.questions.packageSelect.useGlobalPackage.detail": "SPFx %s or later",
"plugins.spfx.questions.packageSelect.installLocally.withVersion.label": "Install the latest SPFx (%s) locally in Teams Toolkit directory ",
"plugins.spfx.questions.packageSelect.installLocally.noVersion.label": "Install the latest SPFx locally in Teams Toolkit directory ",
"plugins.spfx.buildNotice": "SharePoint package successfully built at %s.",
Expand Down Expand Up @@ -452,7 +454,7 @@
"error.debugHandler.InvalidExistingBotArgsError": "botId and botPassword need to be set together if you use existing bot.",
"error.debugHandler.DebugArgumentEmptyError": "Debug argument '%s' is empty.",
"error.debugHandler.InvalidTabBaseUrlError": "baseUrl must be a valid https url.",
"error.m365.M365TitleNotAcquiredError": "Microsoft 365 title is not acquired yet, please use m365Title/acquire action to acquire Microsoft 365 title.",
"error.m365.NotExtendedToM365Error": "Unable to extend Teams app to Microsoft 365. Use 'teamsApp/extendToM365' action to extend your Teams app to Microsoft 365.",
"core.QuestionAppName.validation.pattern": "Application name must start with letters and contain at least two letters or digits. It can not contain some special characters.",
"core.QuestionAppName.validation.maxlength": "Application name is longer than the maximum length of 30.",
"core.QuestionAppName.validation.pathExist": "Path exists: %s. Select a different application name.",
Expand Down Expand Up @@ -584,7 +586,7 @@
"core.getUserEmailQuestion.validation1": "Email address cannot be null or empty",
"core.getUserEmailQuestion.validation2": "Please change [UserName] to the real user name",
"core.collaboration.error.failedToLoadDotEnvFile": "Unable to load your .env File. Reason: %s",
"core.collaboration.error.failedToGetTeamsAppId": "Unable to find Teams app id in your .env file. Please correctly set the value with key '%s' in your .env file.",
"core.collaboration.error.failedToGetTeamsAppId": "Unable to find Teams app id in your .env file. Make sure you have already run 'Provision' or correctly set the value with key '%s' in your .env file.",
"core.selectAadAppManifestQuestion.title": "Select Azure Active Directory manifest.json file",
"core.selectTeamsAppManifestQuestion.title": "Select Teams manifest.json file",
"core.selectTeamsAppPackageQuestion.title": "Select Teams app package file",
Expand Down Expand Up @@ -872,7 +874,7 @@
"driver.botAadApp.log.successCreateBotAad": "Created Azure Active Directory application with client id %s.",
"driver.botAadApp.log.useExistingBotAad": "Used existing Azure Active Directory application with client id %s.",
"driver.botAadApp.error.unexpectedEmptyBotPassword": "Bot password is empty. Add it in env file or clear bot id to have bot id/password pair regenerated. action: %s.",
"driver.arm.description.deploy": "Deploy the given ARM templates to Azure",
"driver.arm.description.deploy": "Deploy the given ARM templates to Azure.",
"driver.arm.deploy.progressBar.message": "Deploying the ARM templates to Azure...",
"debug.warningMessage": "To debug applications in Teams, your localhost server must be on HTTPS.\nFor Teams to trust the self-signed SSL certificate used by the toolkit, a self-signed certificate must be added to your certificate store.\n You may skip this step, but you'll have to manually trust the secure connection in a new browser window when debugging your apps in Teams.\nFor more information \"https://aka.ms/teamsfx-ca-certificate\".",
"debug.warningMessage2": " You may be asked for your account credentials when installing the certificate.",
Expand All @@ -894,7 +896,7 @@
"driver.prerequisite.error.funcInstallationError": "Unable to check and install Azure Functions Core Tools.",
"driver.prerequisite.error.dotnetInstallationError": "Unable to check and install .NET Core SDK.",
"driver.prerequisite.description": "installing dependencies",
"driver.prerequisite.progressBar": "Checking and installing dependencies.",
"driver.prerequisite.progressBar": "Checking and installing development tool(s).",
"driver.prerequisite.summary.devCert.trusted.succuss": "Development certificate for localhost is installed.",
"driver.prerequisite.summary.devCert.notTrusted.succuss": "Development certificate for localhost is generated.",
"driver.prerequisite.summary.devCert.skipped": "Skip trusting development certificate for localhost.",
Expand Down Expand Up @@ -958,6 +960,7 @@
"driver.teamsApp.summary.validate": "Teams Toolkit has checked against all validation rules:\n\nSummary:\n%s.\n%s\n%s\n\nA complete log of validations can be found in %s",
"driver.teamsApp.summary.validate.succeed": "%s passed",
"driver.teamsApp.summary.validate.failed": "%s failed",
"driver.teamsApp.summary.validate.warning": "%s warning",
"driver.teamsApp.validate.skip": "%s action is currently skipped, will be updated in the future version.",
"driver.teamsApp.invalidParameter": "Following parameter is missing or invalid for %s action: %s.",
"driver.teamsApp.validate.invalidParameter": "Parameter %s should be provided for action %s",
Expand All @@ -971,8 +974,8 @@
"driver.botFramework.summary.update": "The bot registration has been updated successfully (%s).",
"driver.botFramework.progressBar.createOrUpdateBot": "Creating or updating bot registration.",
"driver.generateAppsettings.description": "Add or update environment variables to appsettings file.",
"error.yaml.InvalidYamlSchemaError": "Unable to parse yaml file: %s",
"error.yaml.InvalidYamlSchemaErrorWithReason": "Unable to parse yaml file: %s. Reason: %s",
"error.yaml.InvalidYamlSchemaError": "Unable to parse yaml file: %s. Please open the yaml file and check the PROBLEMS tab for more details.",
"error.yaml.InvalidYamlSchemaErrorWithReason": "Unable to parse yaml file: %s. Reason: %s. Please open the yaml file and check the PROBLEMS tab for more details",
"error.yaml.YamlFieldTypeError": "Field '%s' should have %s type, yaml file: %s",
"error.yaml.YamlFieldMissingError": "Field '%s' is missing, yaml file: %s",
"error.yaml.InvalidYmlActionNameError": "Action '%s' not found, yaml file: %s",
Expand Down
20 changes: 10 additions & 10 deletions packages/fx-core/resource/yaml.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
{ "$ref": "#/definitions/botframeworkCreate" },
{ "$ref": "#/definitions/fileCreateOrUpdateEnvironmentFile" },
{ "$ref": "#/definitions/fileCreateOrUpdateJsonFile" },
{ "$ref": "#/definitions/prerequisiteInstall" },
{ "$ref": "#/definitions/m365TitleAcquire" },
{ "$ref": "#/definitions/devToolInstall" },
{ "$ref": "#/definitions/teamsAppExtendToM365" },
{ "$ref": "#/definitions/spfxDeploy" },
{ "$ref": "#/definitions/teamsAppCopyAppPackageToSPFx" },
{ "$ref": "#/definitions/script" }
Expand Down Expand Up @@ -1133,10 +1133,10 @@
}
}
},
"prerequisiteInstall": {
"devToolInstall": {
"type": "object",
"additionalProperties": false,
"description": "Install prerequisite(s). Refer to https://aka.ms/teamsfx-actions/prerequisite-install for more details.",
"description": "Install development tool(s). Refer to https://aka.ms/teamsfx-actions/devtool-install for more details.",
"required": ["uses", "with"],
"properties": {
"name": {
Expand All @@ -1152,8 +1152,8 @@
},
"uses": {
"type": "string",
"description": "Install prerequisite(s). Refer to https://aka.ms/teamsfx-actions/prerequisite-install for more details.",
"const": "prerequisite/install"
"description": "Install development tool(s). Refer to https://aka.ms/teamsfx-actions/devtool-install for more details.",
"const": "devTool/install"
},
"with": {
"type": "object",
Expand Down Expand Up @@ -1207,10 +1207,10 @@
}
}
},
"m365TitleAcquire": {
"teamsAppExtendToM365": {
"type": "object",
"additionalProperties": false,
"description": "Upload app as M365 title. Refer to https://aka.ms/teamsfx-actions/m365-title-acquire for more details.",
"description": "Extend Teams app across Microsoft 365. Refer to https://aka.ms/teamsfx-actions/teamsapp-extendToM365 for more details.",
"required": ["uses", "with"],
"properties": {
"name": {
Expand All @@ -1226,8 +1226,8 @@
},
"uses": {
"type": "string",
"description": "Upload app as M365 title. Refer to https://aka.ms/teamsfx-actions/m365-title-acquire for more details.",
"const": "m365Title/acquire"
"description": "Extend Teams app across Microsoft 365. Refer to https://aka.ms/teamsfx-actions/teamsapp-extendToM365 for more details.",
"const": "teamsApp/extendToM365"
},
"with": {
"type": "object",
Expand Down
10 changes: 5 additions & 5 deletions packages/fx-core/src/common/m365/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { UserError } from "@microsoft/teamsfx-api";

import { getDefaultString, getLocalizedString } from "../localizeUtils";

export class M365TitleNotAcquiredError extends UserError {
export class NotExtendedToM365Error extends UserError {
constructor(source: string) {
super({
source: source,
name: "M365TitleNotAcquiredError",
message: getDefaultString("error.m365.M365TitleNotAcquiredError"),
displayMessage: getLocalizedString("error.m365.M365TitleNotAcquiredError"),
helpLink: "https://aka.ms/teamsfx-actions/m365-title-acquire",
name: "NotExtendedToM365Error",
message: getDefaultString("error.m365.NotExtendedToM365Error"),
displayMessage: getLocalizedString("error.m365.NotExtendedToM365Error"),
helpLink: "https://aka.ms/teamsfx-actions/teamsapp-extendToM365",
});
}
}
6 changes: 3 additions & 3 deletions packages/fx-core/src/common/m365/launchHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { CoreSource } from "../../core/error";
import { AppStudioScopes } from "../tools";
import { Hub } from "./constants";
import { M365TitleNotAcquiredError } from "./errors";
import { NotExtendedToM365Error } from "./errors";
import { PackageService } from "./packageService";
import { serviceEndpoint, serviceScope } from "./serviceConstant";

Expand Down Expand Up @@ -91,12 +91,12 @@ export class LaunchHelper {
try {
const m365AppId = await packageService.retrieveAppId(sideloadingToken, teamsAppId);
if (!m365AppId) {
return err(new M365TitleNotAcquiredError(CoreSource));
return err(new NotExtendedToM365Error(CoreSource));
}
return ok(m365AppId);
} catch (error) {
if ((error as FxError).innerError?.response.status === 404) {
return err(new M365TitleNotAcquiredError(CoreSource));
return err(new NotExtendedToM365Error(CoreSource));
}
return err(assembleError(error));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/fx-core/src/component/coordinator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const M365Actions = [
"aadApp/create",
"aadApp/update",
"botFramework/create",
"m365Title/acquire",
"teamsApp/extendToM365",
];
const AzureActions = ["arm/deploy"];
const AzureDeployActions = [
Expand Down
Loading

0 comments on commit ed8fcb5

Please sign in to comment.