Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update response templates folder name #9960

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/api/.nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"include": ["src/**/*.ts", "src/**/*.js"],
"reporter": ["text", "html", "cobertura", "lcov"],
"check-coverage": true,
"exclude": [
"src/constants.ts"
],
"lines": 75
}
}
6 changes: 3 additions & 3 deletions packages/api/review/teamsfx-api.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import { IWebApplicationInfo } from '@microsoft/teams-manifest';
import { Result } from 'neverthrow';
import { TokenCredential } from '@azure/core-auth';

// @public (undocumented)
export const AdaptiveFolderName = "adaptiveCards";

// @public (undocumented)
export interface ApiOperation {
// (undocumented)
Expand Down Expand Up @@ -612,6 +609,9 @@ export const ProductName = "teamsfx";
// @public (undocumented)
export type Question = SingleSelectQuestion | MultiSelectQuestion | TextInputQuestion | SingleFileQuestion | MultiFileQuestion | FolderQuestion | SingleFileQuestion | SingleFileOrInputQuestion;

// @public (undocumented)
export const ResponseTemplatesFolderName = "responseTemplates";

// @public
export type SelectFileConfig = UIConfig<string> & {
filters?: {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export const ConfigFolderName = "fx";
export const AppPackageFolderName = "appPackage";
export const BuildFolderName = "build";
export const AdaptiveFolderName = "adaptiveCards";
export const ResponseTemplatesFolderName = "responseTemplates";
export const TemplateFolderName = "templates";
export const ProductName = "teamsfx";
export const AutoGeneratedReadme = "README-auto-generated.md";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
Platform,
Result,
UserError,
AdaptiveFolderName,
ResponseTemplatesFolderName,
AppPackageFolderName,
Warning,
} from "@microsoft/teamsfx-api";
Expand Down Expand Up @@ -202,7 +202,7 @@ export class CopilotPluginGenerator {
const adaptiveCardFolder = path.join(
destinationPath,
AppPackageFolderName,
AdaptiveFolderName
ResponseTemplatesFolderName
);
const generateResult = await specParser.generate(
manifestPath,
Expand Down
4 changes: 2 additions & 2 deletions packages/fx-core/src/core/FxCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { hooks } from "@feathersjs/hooks";
import {
AdaptiveFolderName,
ResponseTemplatesFolderName,
ApiOperation,
AppPackageFolderName,
BuildFolderName,
Expand Down Expand Up @@ -1120,7 +1120,7 @@ export class FxCore {
const adaptiveCardFolder = path.join(
inputs.projectPath!,
AppPackageFolderName,
AdaptiveFolderName
ResponseTemplatesFolderName
);

const context = createContextV3();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
ok,
OpenAIManifestAuthType,
Platform,
ResponseTemplatesFolderName,
SystemError,
TeamsAppManifest,
} from "@microsoft/teamsfx-api";
Expand Down Expand Up @@ -147,7 +148,7 @@ describe("copilotPluginGenerator", function () {
sandbox.stub(fs, "ensureDir").resolves();
sandbox.stub(manifestUtils, "_readAppManifest").resolves(ok({ ...teamsManifest }));
sandbox.stub(specParserUtils, "isYamlSpecFile").resolves(false);
sandbox.stub(SpecParser.prototype, "generate").resolves({
const generateParser = sandbox.stub(SpecParser.prototype, "generate").resolves({
allSuccess: true,
warnings: [
{ type: WarningType.GenerateCardFailed, content: "test", data: "getPets" },
Expand All @@ -168,6 +169,7 @@ describe("copilotPluginGenerator", function () {
assert.equal(result.value.warnings![2].type, WarningType.GenerateCardFailed);
assert.equal(result.value.warnings![3].type, WarningType.OperationOnlyContainsOptionalParam);
assert.equal(result.value.warnings![3].content, "");
assert.isTrue(generateParser.args[0][3].includes(ResponseTemplatesFolderName));
}
});

Expand Down
Loading