Skip to content

Commit

Permalink
Merge pull request #236 from OfficeDev/include-validator
Browse files Browse the repository at this point in the history
Include manifest validator
  • Loading branch information
beth-panx committed Apr 5, 2017
2 parents 412bb3a + 3decb37 commit 52910bd
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 48 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "generator-office",
"version": "1.1.3",
"version": "1.1.4",
"description": "Yeoman generator for creating Microsoft Office projects using any text editor.",
"repository": {
"type": "git",
Expand Down
7 changes: 4 additions & 3 deletions readme.md
Expand Up @@ -61,12 +61,13 @@ Browse to the 'External' IP address listed in your console to test your web app

## Validate manifest.xml

As you modify your `manifest.xml` file, use the [Office Add-in Validator](https://github.com/OfficeDev/office-addin-validator) to ensure that your XML file is correct and complete. It will also give you information on against what platforms to test your add-ins before submitting to the store.
As you modify your `manifest.xml` file, use the included [Office Add-in Validator](https://github.com/OfficeDev/office-addin-validator) to ensure that your XML file is correct and complete. It will also give you information on against what platforms to test your add-ins before submitting to the store.

To run Office Add-in Validator, install the validator and type the following command in your console:
To run Office Add-in Validator, use the following command in your project directory:
```bash
$ validate-office-addin your_manifest.xml
$ npm run validate your_manifest.xml
```
![](src/docs/assets/validator.gif)

For more information on manifest validation, refer to our [add-in manifests documentation](https://dev.office.com/docs/add-ins/overview/add-in-manifests).

Expand Down
25 changes: 8 additions & 17 deletions src/app/index.ts
Expand Up @@ -297,28 +297,19 @@ module.exports = yo.extend({
if (this.project.isResourcePageOpened) {
opn(`resource.html`);
}
if (!this.options['skip-install'] && this.project.framework !== 'manifest-only') {
if (this.options['skip-install']) {
this.installDependencies({
npm: true,
npm: false,
bower: false,
callback: this._postInstallHints.bind(this)
});
}
else {
if (this.project.framework !== 'manifest-only') {
this.installDependencies({
npm: false,
bower: false,
callback: this._postInstallHints.bind(this)
});
}
else {
this.installDependencies({
npm: false,
bower: false,
callback: this._exitProcess.bind(this)
});
}
this.installDependencies({
npm: true,
bower: false,
callback: this._exitProcess.bind(this)
});
}
} catch (err) {
insight.trackException(new Error('Installation Error: ' + err));
Expand All @@ -334,7 +325,7 @@ module.exports = yo.extend({
this.log(` trust the Self-Signed Certificate for the site if you haven't done that)`);
this.log(` 2. Sideload the add-in into your Office application.\n`);
this.log(` Please refer to resource.html in your project for more information.`);
this.log(` Or visit our repo at: https://github.com/officeDev/generator-office`);
this.log(` Or visit our repo at: https://github.com/officeDev/generator-office \n`);
this.log('----------------------------------------------------------------------------------------------------------\n');
this._exitProcess();
},
Expand Down
6 changes: 4 additions & 2 deletions src/app/templates/js/angular/package.json
Expand Up @@ -4,13 +4,15 @@
"author": "",
"version": "0.1.0",
"scripts": {
"start": "browser-sync start --config bsconfig.json"
"start": "browser-sync start --config bsconfig.json",
"validate": "./node_modules/.bin/validate-office-addin"
},
"dependencies": {
"office-ui-fabric-js": "^1.3.0",
"jquery": "^3.1.1",
"angular": "^1.6.1",
"core-js": "^2.4.1"
"core-js": "^2.4.1",
"office-addin-validator": "^1.0.1"
},
"devDependencies": {
"browser-sync": "^2.18.5",
Expand Down
4 changes: 2 additions & 2 deletions src/app/templates/js/angular/resource.html
Expand Up @@ -107,8 +107,8 @@ <h1>Build</h1>
● Use the <a target="_blank" href="https://github.com/officedev/office-js-helpers" onclick="appInsights.trackEvent('linkClick_office-js-helpers');return true;">Office Helpers</a> to simplify Authentication, Storage management etc.

● Use the included <a target="_blank" href="https://github.com/officedev/office-addin-validator" onclick="appInsights.trackEvent('linkClick_office-addin-validator');return true;">Office Add-in Validator</a> to ensure your manifest.xml file is correct and complete. It will also give you information on against what platforms to test your add-in before submitting to the store.
<span class="comment"># Type the following command in your console to validate your manifest:</span>
$ validate-office-addin <%= projectInternalName %>-manifest.xml</pre>
<span class="comment"># To validate your manifest, use the following command in your project directory:</span>
$ npm run validate <%= projectInternalName %>-manifest.xml</pre>

<p> For more information and resources to help you develop your add-in project, follow through the next steps
or click on the additional resources to help you get started.</p>
Expand Down
6 changes: 4 additions & 2 deletions src/app/templates/js/jquery/package.json
Expand Up @@ -4,12 +4,14 @@
"author": "",
"version": "0.1.0",
"scripts": {
"start": "browser-sync start --config bsconfig.json"
"start": "browser-sync start --config bsconfig.json",
"validate": "./node_modules/.bin/validate-office-addin"
},
"dependencies": {
"core-js": "^2.4.1",
"office-ui-fabric-js": "^1.3.0",
"jquery": "^3.1.1"
"jquery": "^3.1.1",
"office-addin-validator": "^1.0.1"
},
"devDependencies": {
"browser-sync": "^2.18.5",
Expand Down
4 changes: 2 additions & 2 deletions src/app/templates/js/jquery/resource.html
Expand Up @@ -107,8 +107,8 @@ <h1>Build</h1>
● Use the <a target="_blank" href="https://github.com/officedev/office-js-helpers" onclick="appInsights.trackEvent('linkClick_office-js-helpers');return true;">Office Helpers</a> to simplify Authentication, Storage management etc.

● Use the included <a target="_blank" href="https://github.com/officedev/office-addin-validator" onclick="appInsights.trackEvent('linkClick_office-addin-validator');return true;">Office Add-in Validator</a> to ensure your manifest.xml file is correct and complete. It will also give you information on against what platforms to test your add-in before submitting to the store.
<span class="comment"># Type the following command in your console to validate your manifest:</span>
$ validate-office-addin <%= projectInternalName %>-manifest.xml</pre>
<span class="comment"># To validate your manifest, use the following command in your project directory:</span>
$ npm run validate <%= projectInternalName %>-manifest.xml</pre>

<p> For more information and resources to help you develop your add-in project, follow through the next steps
or click on the additional resources to help you get started.</p>
Expand Down
7 changes: 6 additions & 1 deletion src/app/templates/manifest-only/package.json
Expand Up @@ -3,6 +3,11 @@
"description": "",
"author": "",
"version": "0.1.0",
"dependencies": {},
"scripts": {
"validate": "./node_modules/.bin/validate-office-addin"
},
"dependencies": {
"office-addin-validator": "^1.0.1"
},
"devDependencies": {}
}
4 changes: 2 additions & 2 deletions src/app/templates/manifest-only/resource.html
Expand Up @@ -107,8 +107,8 @@ <h1>Build</h1>
● Use the <a target="_blank" href="https://github.com/officedev/office-js-helpers" onclick="appInsights.trackEvent('linkClick_office-js-helpers');return true;">Office Helpers</a> to simplify Authentication, Storage management etc.

● Use the included <a target="_blank" href="https://github.com/officedev/office-addin-validator" onclick="appInsights.trackEvent('linkClick_office-addin-validator');return true;">Office Add-in Validator</a> to ensure your manifest.xml file is correct and complete. It will also give you information on against what platforms to test your add-in before submitting to the store.
<span class="comment"># Type the following command in your console to validate your manifest:</span>
$ validate-office-addin <%= projectInternalName %>-manifest.xml</pre>
<span class="comment"># To validate your manifest, use the following command in your project directory:</span>
$ npm run validate <%= projectInternalName %>-manifest.xml</pre>

<p> For more information and resources to help you develop your add-in project, follow through the next steps
or click on the additional resources to help you get started.</p>
Expand Down
6 changes: 4 additions & 2 deletions src/app/templates/ts/angular/package.json
Expand Up @@ -7,13 +7,15 @@
"tsc": "tsc -p tsconfig.json -w",
"server": "browser-sync start --config bsconfig.json",
"copy": "cpx \"src/**/!(*.ts)\" dist --watch",
"start": "rimraf dist && concurrently \"npm run tsc\" \"npm run copy\" \"npm run server\""
"start": "rimraf dist && concurrently \"npm run tsc\" \"npm run copy\" \"npm run server\"",
"validate": "./node_modules/.bin/validate-office-addin"
},
"dependencies": {
"core-js": "^2.4.1",
"office-ui-fabric-js": "^1.3.0",
"jquery": "^3.1.1",
"angular": "^1.6.1"
"angular": "^1.6.1",
"office-addin-validator": "^1.0.1"
},
"devDependencies": {
"concurrently": "^3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/app/templates/ts/angular/resource.html
Expand Up @@ -107,8 +107,8 @@ <h1>Build</h1>
● Use the <a target="_blank" href="https://github.com/officedev/office-js-helpers" onclick="appInsights.trackEvent('linkClick_office-js-helpers');return true;">Office Helpers</a> to simplify Authentication, Storage management etc.

● Use the included <a target="_blank" href="https://github.com/officedev/office-addin-validator" onclick="appInsights.trackEvent('linkClick_office-addin-validator');return true;">Office Add-in Validator</a> to ensure your manifest.xml file is correct and complete. It will also give you information on against what platforms to test your add-in before submitting to the store.
<span class="comment"># Type the following command in your console to validate your manifest:</span>
$ validate-office-addin <%= projectInternalName %>-manifest.xml</pre>
<span class="comment"># To validate your manifest, use the following command in your project directory:</span>
$ npm run validate <%= projectInternalName %>-manifest.xml</pre>

<p> For more information and resources to help you develop your add-in project, follow through the next steps
or click on the additional resources to help you get started.</p>
Expand Down
6 changes: 4 additions & 2 deletions src/app/templates/ts/jquery/package.json
Expand Up @@ -7,12 +7,14 @@
"tsc": "tsc -p tsconfig.json -w",
"server": "browser-sync start --config bsconfig.json",
"copy": "cpx \"src/**/!(*.ts)\" dist --watch",
"start": "rimraf dist && concurrently \"npm run tsc\" \"npm run copy\" \"npm run server\""
"start": "rimraf dist && concurrently \"npm run tsc\" \"npm run copy\" \"npm run server\"",
"validate": "./node_modules/.bin/validate-office-addin"
},
"dependencies": {
"core-js": "^2.4.1",
"office-ui-fabric-js": "^1.3.0",
"jquery": "^3.1.1"
"jquery": "^3.1.1",
"office-addin-validator": "^1.0.1"
},
"devDependencies": {
"concurrently": "^3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/app/templates/ts/jquery/resource.html
Expand Up @@ -107,8 +107,8 @@ <h1>Build</h1>
● Use the <a target="_blank" href="https://github.com/officedev/office-js-helpers" onclick="appInsights.trackEvent('linkClick_office-js-helpers');return true;">Office Helpers</a> to simplify Authentication, Storage management etc.

● Use the included <a target="_blank" href="https://github.com/officedev/office-addin-validator" onclick="appInsights.trackEvent('linkClick_office-addin-validator');return true;">Office Add-in Validator</a> to ensure your manifest.xml file is correct and complete. It will also give you information on against what platforms to test your add-in before submitting to the store.
<span class="comment"># Type the following command in your console to validate your manifest:</span>
$ validate-office-addin <%= projectInternalName %>-manifest.xml</pre>
<span class="comment"># To validate your manifest, use the following command in your project directory:</span>
$ npm run validate <%= projectInternalName %>-manifest.xml</pre>

<p> For more information and resources to help you develop your add-in project, follow through the next steps
or click on the additional resources to help you get started.</p>
Expand Down
14 changes: 8 additions & 6 deletions src/app/templates/ts/react/package.json
Expand Up @@ -7,14 +7,16 @@
"clean": "rimraf dist && rimraf .awcache",
"lint": "tslint --project tsconfig.json",
"start": "webpack-dev-server --inline --hot --config config/webpack.dev.js --progress",
"build": "npm run clean && webpack --config config/webpack.prod.js --colors --progress --bail"
"build": "npm run clean && webpack --config config/webpack.prod.js --colors --progress --bail",
"validate": "./node_modules/.bin/validate-office-addin"
},
"dependencies": {
"core-js": "2.4.1",
"office-ui-fabric-react": "2.6.0",
"react": "15.4.2",
"react-dom": "15.4.2",
"typescript": "2.2.1"
"core-js": "^2.4.1",
"office-ui-fabric-react": "^2.6.0",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"typescript": "^2.2.1",
"office-addin-validator": "^1.0.1"
},
"devDependencies": {
"@types/office-js": "0.0.39",
Expand Down
4 changes: 2 additions & 2 deletions src/app/templates/ts/react/resource.html
Expand Up @@ -107,8 +107,8 @@ <h1>Build</h1>
● Use the <a target="_blank" href="https://github.com/officedev/office-js-helpers" onclick="appInsights.trackEvent('linkClick_office-js-helpers');return true;">Office Helpers</a> to simplify Authentication, Storage management etc.

● Use the included <a target="_blank" href="https://github.com/officedev/office-addin-validator" onclick="appInsights.trackEvent('linkClick_office-addin-validator');return true;">Office Add-in Validator</a> to ensure your manifest.xml file is correct and complete. It will also give you information on against what platforms to test your add-in before submitting to the store.
<span class="comment"># Type the following command in your console to validate your manifest:</span>
$ validate-office-addin <%= projectInternalName %>-manifest.xml</pre>
<span class="comment"># To validate your manifest, use the following command in your project directory:</span>
$ npm run validate <%= projectInternalName %>-manifest.xml</pre>

<p> For more information and resources to help you develop your add-in project, follow through the next steps
or click on the additional resources to help you get started.</p>
Expand Down
Binary file added src/docs/assets/validator.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 52910bd

Please sign in to comment.