In the last few weeks, a number of improvements have been added to the Yeoman Office Generator. Version – v0.4 – has recently been released to npm. (Editor’s note: v0.5 released 28 October 2015.)
$ yo office |
The Yeoman Office Generator helps you create Office Add-ins on any platform. It’s particularly useful if you’re not developing using Visual Studio and don’t have access to the Office project templates.
After answering a few questions, the Yeoman Office Generator will generate for you a working Office project of your choice allowing you to focus on building your project rather than its scaffolding. The Yeoman Office Generator currently supports a number of Office Add-ins types and technologies that should be sufficient for the most common scenarios.
Over the last few weeks, I had the pleasure of contributing a few additions to the Yeoman Office Generator. Here is a short overview of what I have worked on.
Configuring Office add-ins generated by the Yeoman Office Generator for using ADAL JS – manual
When working on Office projects, there is a chance you might want to communicate with Office 365. In order to do this, however, there are a number of steps that you have to complete in order to have your solution correctly connected to Office 365.
Recently we provided a step-by-step description of all these steps that you can use when building Office Add-ins connected to Office 365. This manual is not only useful when working with the Yeoman Office Generator, but you can also use it with Office Add-ins created in a different manner.
Added manifest.xml validation
When building Office Add-ins, one of the important pieces is the add-in manifest (manifest.xml), which provides information about the add-in and its capabilities. This manifest is also required for publishing the add-in to the Office Store or to a specific tenant.
Manifest.xml is an XML file that has to adhere to a specific schema. Any error in its contents will prevent you from deploying the add-in. Initially, the only way to find out whether the manifest.xml was valid or not was by uploading it to the App Catalog in your tenant. Any errors in the manifest.xml file would then be reported in the UI.
With a recent update to the Yeoman Office Generator, we have added a Gulp task that allows you to validate the manifest.xml. All you need to do now is to go to the command line and type:
$ gulp validate-xml
and the newly added Gulp task will validate the contents of the manifest.xml file of your add-in and tell you if there are any errors or not.
v0.4.0 of the generator, unfortunately, has a bug in the manifest validation task. This bug has already been fixed and should be included in the public release soon. Until that happens, if you want to use the task, please refer to the bugfix to see how to manually modify the task to have it working correctly.
Added Angular ADAL as technology
Initially we included the step-by-step guide describing the process of wiring up an Office Add-in generated by the Yeoman Office Generator for communicating with Office 365. Given the number of steps to complete, we decided that it would be good to have the generator do the necessary modifications for you.
With the latest release of the Yeoman Office Generator, we added Angular ADAL to the list of supported technologies for scaffolding add-ins. When you choose this technology, all the steps described in the manual will be automatically executed for you, allowing you to directly start building your add-in connected to Office 365.
Aside from adding new capabilities, a couple of us have also worked on fixing some issues in the generator. For the full list, see the releases page on GitHub.
As Office 365 and the web technologies evolve, so will the Yeoman Office Generator. There are still some issues and ideas left for the generator that could use your help. If you’re wondering where to start, how about creating your first project using the Yeoman Office Generator? Yo Office!
This blog is posted with permission from Waldek Mastykarz. You can find his original post here: http://blog.mastykarz.nl/yo-office-v0-4-released/