Skip to content

Added the possiblity to scaffold manifest version 1.14 & 1.15 #344

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

Merged
merged 1 commit into from
Dec 20, 2022
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
4 changes: 2 additions & 2 deletions packages/generator-teams/package-lock.json

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

25 changes: 22 additions & 3 deletions packages/generator-teams/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-teams",
"version": "4.0.1",
"version": "4.1.0",
"description": "Yeoman generator for Microsoft Teams Apps, including support for extending Teams apps to other parts of the Microsoft 365 ecosystem.",
"main": "generators/app/index.js",
"scripts": {
Expand Down Expand Up @@ -44,6 +44,26 @@
"name": "Wictor Wilén",
"email": "[email protected]",
"url": "http://www.wictorwilen.se"
},
{
"name": "Rick Van Rousselt",
"email": "[email protected]",
"url": "http://www.rickvanrousselt.com"
},
{
"name": "Thomas Gölles",
"email": "[email protected]",
"url": "https://thomy.tech"
},
{
"name": "Albert-Jan Schot",
"email": "[email protected]",
"url": "https://www.cloudappie.nl/"
},
{
"name": "Stephan Bisser",
"email": "[email protected]",
"url": "https://bisser.io"
}
],
"contributors": [
Expand All @@ -55,8 +75,7 @@
"Bauer, Stefan <https://github.com/StfBauer>",
"Connell, Andrew <https://github.com/andrewconnell>",
"Brennscheidt, Ralf <https://github.com/RalfBrennscheidt>",
"Bliss, Bill <https://github.com/billbliss>",
"Bisser, Stephan <https://github.com/stephanbisser>"
"Bliss, Bill <https://github.com/billbliss>"
],
"license": "MIT",
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { ManifestGenerator as ManifestGenerator110 } from "./manifestGenerators/
import { ManifestGenerator as ManifestGenerator111 } from "./manifestGenerators/generator111/ManifestGenerator";
import { ManifestGenerator as ManifestGenerator112 } from "./manifestGenerators/generator112/ManifestGenerator";
import { ManifestGenerator as ManifestGenerator113 } from "./manifestGenerators/generator113/ManifestGenerator";
import { ManifestGenerator as ManifestGenerator114 } from "./manifestGenerators/generator114/ManifestGenerator";
import { ManifestGenerator as ManifestGenerator115 } from "./manifestGenerators/generator115/ManifestGenerator";
import { ManifestGenerator as ManifestGeneratorDevPreview } from "./manifestGenerators/generatorDevPreview/ManifestGenerator";
import { ManifestGenerator as ManifestGeneratorM365DevPreview } from "./manifestGenerators/generatorM365DevPreview/ManifestGenerator";
import { BaseManifestGenerator } from "./BaseManifestGenerator";
Expand Down Expand Up @@ -60,6 +62,22 @@ export class ManifestGeneratorFactory {
hide: false,
comment: "With support for extending Teams apps to other parts of the Microsoft 365 ecosystem"
},
{
manifestVersion: ManifestVersions.v114,
schemaUrl: "https://developer.microsoft.com/en-us/json-schemas/teams/v1.14/MicrosoftTeams.schema.json",
manifestValue: "1.14",
default: true,
hide: false,
comment: "With support for extending Teams apps to other parts of the Microsoft 365 ecosystem"
},
{
manifestVersion: ManifestVersions.v115,
schemaUrl: "https://developer.microsoft.com/en-us/json-schemas/teams/v1.15/MicrosoftTeams.schema.json",
manifestValue: "1.15",
default: true,
hide: false,
comment: "With support for extending Teams apps to other parts of the Microsoft 365 ecosystem"
},
{
manifestVersion: ManifestVersions.devPreview,
schemaUrl: "https://raw.githubusercontent.com/OfficeDev/microsoft-teams-app-schema/preview/DevPreview/MicrosoftTeams.schema.json",
Expand Down Expand Up @@ -107,6 +125,10 @@ export class ManifestGeneratorFactory {
return new ManifestGenerator112();
} else if (manifestVersion == ManifestVersions.v113) {
return new ManifestGenerator113();
} else if (manifestVersion == ManifestVersions.v114) {
return new ManifestGenerator114();
} else if (manifestVersion == ManifestVersions.v115) {
return new ManifestGenerator115();
} else if (manifestVersion == ManifestVersions.devPreview) {
return new ManifestGeneratorDevPreview();
} else if (manifestVersion == ManifestVersions.m365DevPreview) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export enum ManifestVersions {
v111 = "v1.11",
v112 = "v1.12",
v113 = "v1.13",
v114 = "v1.14",
v115 = "v1.15",
devPreview = "devPreview",
m365DevPreview = "m365DevPreview"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) Wictor Wilén. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { BaseManifestGenerator } from "../../BaseManifestGenerator";
import { TabManifestUpdater } from "../generator19/TabManifestUpdater";
import { BotManifestUpdater } from "../generator18/BotManifestUpdater";
import { ConnectorManifestUpdater } from "../generator18/ConnectorManifestUpdater";
import { MessageExtensionManifestUpdater } from "../generator18/MessageExtensionManifestUpdater";
import { GeneratorTeamsAppOptions } from "../../../GeneratorTeamsAppOptions";
import { LocalizationManifestUpdater } from "../generator18/LocalizationManifestUpdater";
import * as chalk from 'chalk';


export class ManifestGenerator extends BaseManifestGenerator {
constructor() {
super();
this.tabUpdater = new TabManifestUpdater();
this.botUpdater = new BotManifestUpdater();
this.connectorUpdater = new ConnectorManifestUpdater();
this.messageExtensionUpdater = new MessageExtensionManifestUpdater();
this.localizationUpdater = new LocalizationManifestUpdater();
}

public generateManifest(options: GeneratorTeamsAppOptions): any {
const manifest = super.generateManifest(options);
manifest["$schema"] = "https://developer.microsoft.com/en-us/json-schemas/teams/v1.14/MicrosoftTeams.schema.json";
manifest.manifestVersion = "1.14";

return manifest;
}

public supportsUpdateManifest(from: string): boolean {
return from === "1.8" || from === "1.9" || from === "1.10" || from === "1.11" || from === "1.12" || from === "1.13";
}

public updateManifest(manifest: any, log?: (message?: string, context?: any) => void): any {
switch (manifest.manifestVersion) {
case "1.8":
case "1.9":
case "1.10":
case "1.11":
case "1.12":
case "1.13":
manifest["$schema"] = "https://developer.microsoft.com/en-us/json-schemas/teams/v1.14/MicrosoftTeams.schema.json";
manifest.manifestVersion = "1.14";
return manifest;
default:
throw "Unable to update manifest";

}
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright (c) Wictor Wilén. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { BaseManifestGenerator } from "../../BaseManifestGenerator";
import { TabManifestUpdater } from "../generator19/TabManifestUpdater";
import { BotManifestUpdater } from "../generator18/BotManifestUpdater";
import { ConnectorManifestUpdater } from "../generator18/ConnectorManifestUpdater";
import { MessageExtensionManifestUpdater } from "../generator18/MessageExtensionManifestUpdater";
import { GeneratorTeamsAppOptions } from "../../../GeneratorTeamsAppOptions";
import { LocalizationManifestUpdater } from "../generator18/LocalizationManifestUpdater";
import * as chalk from 'chalk';


export class ManifestGenerator extends BaseManifestGenerator {
constructor() {
super();
this.tabUpdater = new TabManifestUpdater();
this.botUpdater = new BotManifestUpdater();
this.connectorUpdater = new ConnectorManifestUpdater();
this.messageExtensionUpdater = new MessageExtensionManifestUpdater();
this.localizationUpdater = new LocalizationManifestUpdater();
}

public generateManifest(options: GeneratorTeamsAppOptions): any {
const manifest = super.generateManifest(options);
manifest["$schema"] = "https://developer.microsoft.com/en-us/json-schemas/teams/v1.15/MicrosoftTeams.schema.json";
manifest.manifestVersion = "1.15";

return manifest;
}

public supportsUpdateManifest(from: string): boolean {
return from === "1.8" || from === "1.9" || from === "1.10" || from === "1.11" || from === "1.12" || from === "1.13" || from === "1.14";
}

public updateManifest(manifest: any, log?: (message?: string, context?: any) => void): any {
switch (manifest.manifestVersion) {
case "1.8":
case "1.9":
case "1.10":
case "1.11":
case "1.12":
case "1.13":
case "1.14":
manifest["$schema"] = "https://developer.microsoft.com/en-us/json-schemas/teams/v1.15/MicrosoftTeams.schema.json";
manifest.manifestVersion = "1.15";
return manifest;
default:
throw "Unable to update manifest";

}
};
}
4 changes: 4 additions & 0 deletions packages/generator-teams/tests/helpers/TestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ export const SCHEMA_110 = 'https://developer.microsoft.com/en-us/json-schemas/te
export const SCHEMA_111 = 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json';
export const SCHEMA_112 = 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.12/MicrosoftTeams.schema.json';
export const SCHEMA_113 = 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.13/MicrosoftTeams.schema.json';
export const SCHEMA_114 = 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.14/MicrosoftTeams.schema.json';
export const SCHEMA_115 = 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.15/MicrosoftTeams.schema.json';
export const SCHEMA_DEVPREVIEW = 'https://raw.githubusercontent.com/OfficeDev/microsoft-teams-app-schema/preview/DevPreview/MicrosoftTeams.schema.json';
export const SCHEMA_M365DEVPREVIEW = 'https://raw.githubusercontent.com/OfficeDev/microsoft-teams-app-schema/preview/DevPreview/MicrosoftTeams.schema.json';

Expand All @@ -135,6 +137,8 @@ export const SCHEMAS: { [key: string]: string } = {
"v1.11": SCHEMA_111,
"v1.12": SCHEMA_112,
"v1.13": SCHEMA_113,
"v1.14": SCHEMA_114,
"v1.15": SCHEMA_115,
"devPreview": SCHEMA_DEVPREVIEW,
"m365DevPreview": SCHEMA_M365DEVPREVIEW
}
Expand Down
Loading