Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

office-addin-project

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

office-addin-project - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

temp/TaskPane.manifest.json

3

lib/commands.js

@@ -24,4 +24,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

yield (0, convert_1.convertProject)(manifestPath, backupPath);
throw new Error("Upgrade function is not ready yet.");
// usageDataObject.reportSuccess("convert");
defaults_1.usageDataObject.reportSuccess("convert");
}

@@ -28,0 +27,0 @@ catch (err) {

@@ -21,2 +21,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

const child_process_1 = require("child_process");
const office_addin_manifest_converter_1 = require("office-addin-manifest-converter");
const office_addin_usage_data_1 = require("office-addin-usage-data");

@@ -27,2 +28,3 @@ /* global console */

return __awaiter(this, void 0, void 0, function* () {
const outputPath = path.dirname(manifestPath);
if (manifestPath.endsWith(".json")) {

@@ -41,2 +43,3 @@ throw new office_addin_usage_data_1.ExpectedError(`The convert command only works on xml manifest based projects`);

yield updateManifestXmlReferences();
yield (0, office_addin_manifest_converter_1.convert)(manifestPath, outputPath, false, false);
});

@@ -48,3 +51,3 @@ }

const question = {
message: `This command will convert your XML manifest to a JSON manifest and upgrade your project dependencies to make it compatible with the new project.\nWould you like to continue?`,
message: `This command will convert your current xml manifest to a json manifest and then proceed to upgrade your project dependencies to ensure compatibility with the new project structure.\nHowever, in order for this newly updated project to function correctly you must be on a private environment that has not yet been released publicly.\nWould you like to continue?`,
name: "didUserConfirm",

@@ -107,3 +110,3 @@ type: "confirm",

console.log(messageToBePrinted.slice(0, -1));
(0, child_process_1.exec)(command);
(0, child_process_1.execSync)(command);
}

@@ -110,0 +113,0 @@ function updateManifestXmlReferences() {

{
"name": "office-addin-project",
"version": "0.2.0",
"version": "0.3.0",
"description": "Provides project wide commands to an Office Addin Project",

@@ -22,3 +22,5 @@ "main": "./lib/main.js",

"inquirer": "^7.3.3",
"office-addin-usage-data": "^1.6.0",
"office-addin-manifest": "^1.10.1",
"office-addin-manifest-converter": "^0.1.4",
"office-addin-usage-data": "^1.6.1",
"path": "^0.12.7"

@@ -30,3 +32,3 @@ },

"@types/inquirer": "^6.5.0",
"@types/mocha": "^9.1.0",
"@types/mocha": "^9.1.1",
"@types/node": "^14.17.2",

@@ -36,4 +38,4 @@ "@types/semver": "^7.3.9",

"concurrently": "^7.0.0",
"mocha": "^9.2.0",
"office-addin-lint": "^2.2.0",
"mocha": "^10.0.0",
"office-addin-lint": "^2.2.1",
"rimraf": "^3.0.2",

@@ -55,3 +57,3 @@ "semver": "^7.3.5",

"license": "MIT",
"gitHead": "a4308f6c2b476ccd02ef17cbe151fedfc258a629"
"gitHead": "08fde5a3f8e7a0cbbcdf3329481a7bbb69ba6b29"
}

@@ -9,2 +9,3 @@ # Office-Addin-Project

## Command-Line Interface
* [convert](#info)

@@ -11,0 +12,0 @@

@@ -15,4 +15,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

await convertProject(manifestPath, backupPath);
throw new Error("Upgrade function is not ready yet.");
// usageDataObject.reportSuccess("convert");
usageDataObject.reportSuccess("convert");
} catch (err: any) {

@@ -19,0 +18,0 @@ usageDataObject.reportException("convert", err);

@@ -10,3 +10,4 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import * as util from "util";
import { exec } from "child_process";
import { execSync } from "child_process";
import { convert } from "office-addin-manifest-converter";
import { ExpectedError } from "office-addin-usage-data";

@@ -16,3 +17,3 @@

const skipBackup: string[] = [ "node_modules" ]
const skipBackup: string[] = ["node_modules"];

@@ -23,2 +24,3 @@ export async function convertProject(

) {
const outputPath: string = path.dirname(manifestPath);
if (manifestPath.endsWith(".json")) {

@@ -43,2 +45,3 @@ throw new ExpectedError(

await updateManifestXmlReferences();
await convert(manifestPath, outputPath, false, false);
}

@@ -48,3 +51,3 @@

const question = {
message: `This command will convert your XML manifest to a JSON manifest and upgrade your project dependencies to make it compatible with the new project.\nWould you like to continue?`,
message: `This command will convert your current xml manifest to a json manifest and then proceed to upgrade your project dependencies to ensure compatibility with the new project structure.\nHowever, in order for this newly updated project to function correctly you must be on a private environment that has not yet been released publicly.\nWould you like to continue?`,
name: "didUserConfirm",

@@ -60,7 +63,7 @@ type: "confirm",

const outputPath: string = path.resolve(backupPath);
const rootDir: string = path.resolve();
const rootDir: string = path.resolve();
const files: string[] = fs.readdirSync(rootDir);
files.forEach((entry) => {
const fullPath = path.resolve(entry)
const fullPath = path.resolve(entry);
const entryStats = fs.lstatSync(fullPath);

@@ -109,3 +112,3 @@

console.log(messageToBePrinted.slice(0, -1));
exec(command);
execSync(command);
}

@@ -112,0 +115,0 @@

@@ -5,5 +5,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

import * as assert from "assert";
import * as fs from "fs";
import * as mocha from "mocha";
import * as path from "path";
import { convertProject } from "../src/convert";
import { ExpectedError } from "office-addin-usage-data";
import { convert } from "office-addin-manifest-converter";

@@ -26,3 +28,26 @@ describe("office-addin-project tests", function() {

});
describe("convertManifest", function() {
it("Converts test manifest", async function() {
this.timeout(6000);
const manifestPath = "./test/test-manifest.xml";
const outputPath = "./temp/";
await convert(manifestPath, outputPath);
assert.strictEqual(fs.existsSync(path.join(outputPath, "test-manifest.json")), true);
});
it("Converts TaskPane manifest", async function() {
this.timeout(6000);
const manifestPath = "./test/TaskPane.manifest.xml";
const outputPath = "./temp/";
await convert(manifestPath, outputPath);
assert.strictEqual(fs.existsSync(path.join(outputPath, "TaskPane.manifest.json")), true);
});
it("Can't convert malformed manifest", async function() {
this.timeout(6000);
const manifestPath = "./test/invalid.manifest.xml";
const outputPath = "./out";
convert(manifestPath, outputPath);
assert.strictEqual(fs.existsSync(path.join(outputPath, "manifest.json")), false);
});
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc