Skip to content

Commit

Permalink
Merge pull request #779 from millerds/update-json-manifest-package
Browse files Browse the repository at this point in the history
[patch] Update json manifest package
  • Loading branch information
millerds committed Jun 2, 2023
2 parents f4763de + 40a567b commit d68be42
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions packages/office-addin-manifest/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/office-addin-manifest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"Office Add-in"
],
"dependencies": {
"@microsoft/teams-manifest": "^0.0.9",
"@microsoft/teams-manifest": "^0.1.0",
"adm-zip": "^0.5.9",
"chalk": "^2.4.2",
"commander": "^6.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/office-addin-manifest/src/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from "fs";
import * as fsExtra from "fs-extra";
import * as AdmZip from "adm-zip";
import * as path from "path";
import { ManifestUtil, TeamsAppManifest } from "@microsoft/teams-manifest";
import { ManifestUtil, devPreview } from "@microsoft/teams-manifest";

/* global console */

Expand All @@ -28,7 +28,7 @@ async function createZip(manifestPath: string): Promise<AdmZip> {
throw new Error(`The file '${manifestPath}' does not exist`);
}

const manifest: TeamsAppManifest = await ManifestUtil.loadFromPath(manifestPath);
const manifest: devPreview.DevPreviewSchema = await ManifestUtil.loadFromPath(manifestPath);
addIconFile(manifest.icons?.color, manifestDir, zip);
addIconFile(manifest.icons?.outline, manifestDir, zip);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { devPreview, ManifestUtil, TeamsAppManifest } from "@microsoft/teams-manifest";
import { devPreview, ManifestUtil } from "@microsoft/teams-manifest";
import { v4 as uuidv4 } from "uuid";
import { ManifestInfo } from "../manifestInfo";
import { ManifestHandler } from "./manifestHandler";

export class ManifestHandlerJson extends ManifestHandler {
/* eslint-disable @typescript-eslint/no-unused-vars */
async modifyManifest(guid?: string, displayName?: string): Promise<TeamsAppManifest> {
async modifyManifest(guid?: string, displayName?: string): Promise<devPreview.DevPreviewSchema> {
try {
const appManifest: TeamsAppManifest = await ManifestUtil.loadFromPath(this.manifestPath);
const appManifest: devPreview.DevPreviewSchema = await ManifestUtil.loadFromPath(this.manifestPath);

if (typeof guid !== "undefined") {
if (!guid || guid === "random") {
Expand Down Expand Up @@ -60,7 +60,7 @@ export class ManifestHandlerJson extends ManifestHandler {
return manifestInfo;
}

async writeManifestData(manifestData: TeamsAppManifest): Promise<void> {
async writeManifestData(manifestData: devPreview.DevPreviewSchema): Promise<void> {
await ManifestUtil.writeToPath(this.manifestPath, manifestData);
}
/* eslint-enable @typescript-eslint/no-unused-vars */
Expand Down
4 changes: 2 additions & 2 deletions packages/office-addin-manifest/src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import { createReadStream } from "fs";
import { ManifestUtil, TeamsAppManifest } from "@microsoft/teams-manifest";
import { ManifestUtil, devPreview } from "@microsoft/teams-manifest";
import fetch from "node-fetch";
import { OfficeAddinManifest } from "./manifestOperations";
import { usageDataObject } from "./defaults";
Expand Down Expand Up @@ -74,7 +74,7 @@ export async function validateManifest(
await OfficeAddinManifest.readManifestFile(manifestPath);

if (manifestPath.endsWith(".json")) {
const manifest: TeamsAppManifest = await ManifestUtil.loadFromPath(manifestPath);
const manifest: devPreview.DevPreviewSchema = await ManifestUtil.loadFromPath(manifestPath);
const validationResult: string[] = await ManifestUtil.validateManifest(manifest);
if (validationResult.length !== 0) {
// There are errors
Expand Down

0 comments on commit d68be42

Please sign in to comment.