Coder Social home page Coder Social logo

officedev / generator-office Goto Github PK

View Code? Open in Web Editor NEW
795.0 75.0 205.0 23.29 MB

Yeoman generator for building Microsoft Office related projects.

Home Page: https://www.npmjs.com/package/generator-office

License: MIT License

TypeScript 100.00%
office yeoman-generator add-ins yo-office

generator-office's People

Contributors

akrantz avatar alexjerabek avatar andrewconnell avatar beth-panx avatar casieber avatar davidchesnut avatar dependabot[bot] avatar devarvindsa avatar igor-ribeiiro avatar jasonjoh avatar jozefizso avatar jthake-msft avatar keyur32 avatar kwame-ansong avatar lindalu-msft avatar loumm avatar lucanerlich avatar martellaj avatar michaelmainer avatar millerds avatar nokafor avatar o365devx avatar pcostesi avatar rick-kirkham avatar roldengarm avatar stesee avatar tcourtneyowen avatar thorstenhans avatar waldekmastykarz avatar wrathofzombies avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-office's Issues

Add support for add-in commands to mail add-in

We should show off the new add-in commands in the add-in that's generated.

http://blogs.msdn.com/b/exchangedev/archive/2015/08/31/introducing-add-in-commands.aspx
http://blogs.msdn.com/b/exchangedev/archive/2015/09/01/building-add-ins-with-commands.aspx

I have a demo add-in that shows the three command button types that's a straight HTML/CSS/JS project. It also uses Fabric: https://github.com/jasonjoh/command-demo

I'd propose using this in place of the demo add-in that's there now. We could prompt the user to include the command button types they are interested in and only include those types. I'm working on a prototype in my fork of this repo, I'll update once I have something to look at.

Automate "bower install" after "npm install"

I think you should add the following snippet into the package.json file to automatically run bower install after running npm install. I know this is done when you first use the generator, but if I do a fresh clone of a project that has used the generator and run npm install, I'll be left without any of my bower components. It's a pretty simple addition and I can submit a PR if you think this would be beneficial.

"scripts": {
    "postinstall": "node_modules/.bin/bower install"
  }

When generating an add-in in a directory relative to current some files get placed in the current directory rather than the specified project root directory

When generating an add-in in a directory relative to current the following structure is generated (based on a Task Pane Add-in built using HTML):

.
|- bower.json
|- gulpfile.js
|- jsconfig.json
|- manifest.xml
|- node_modules
|- package.json
|- tsd.json
|- [project root directory]
|  |- app
|  |- bower_components
|  |- content
|  |- images
|  |- scripts

Shouldn't all files be placed in the project root directory which is what you get when you choose the current directory to be the project root directory, ie:

[project root directory]
|- bower.json
|- gulpfile.js
|- jsconfig.json
|- manifest.xml
|- node_modules
|- package.json
|- tsd.json
|- app
|- bower_components
|- content
|- images
|- scripts

Make localhost "safe"

I'm unfamiliar with SSL certificates and the like, but is there anyway to make the server started by Gulp "safe"? Unless you go to the index.html page in a browser and accept that it's unsafe, the Add-in fails to render. There might be no way around this, but it would be nice to not have to explicitly have to give instructions to go and accept the SSL certificate in our READMEs for samples and stuff.

Angular app lists the directory contents instead of the actual app

When browsing to the root of the app, I see the contents of the root folder.
image

However, I think what you're trying to show is something like the following image
image

If this is right, you just need to add ng-app and ng-controller directives to index.html

<html ng-app="officeAddin">
...
<body id="container" ng-controller="homeController">

and set directoryListing: false in gulpfile.js

Change names of the generated Gulp tasks to follow the naming convention

It seems like Gulp tasks follow the naming convention where a main task is a single word and a sub task consists of multiple words separated by a - or a :. In our case case the generated gulpfile.js files contain tasks such as serve-static and validate-xml. Shouldn't we have main tasks called serve and validate to call the existing sub tasks? We could either rename the existing tasks or add new tasks which would allow us for more flexibility in the future (like additional validation or serving files differently(?))?

The gulp validate-xml task throws an exception

When running the $ gulp validate-xml task you get the TypeError: undefined is not a function error. This has to do with the fact that the xml is passed to the icon validation function as a string buffer rather than a string. Let me get that fixed.

Error: Unable to parse C:\Users\Jeremy\src\.bowerrc: Unexpected token M

Got this error on a fresh windows 10 environment with node, git installed after running

npm install -g yo generator-office bower

I used yo office and for folder location "\My First" and it threw an error. Iwanted it to create a sub folder and add there but it broke. Doing it with "/MyFirst" with no space and the bower bit works fine. Looks like its something on how the bower command is run.

It appears it doesn't adhere to the folder structure as not everything gets put in the subfolder "MyFirst".

Got this error

C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:56
throw error;
^

Error: Unable to parse C:\Users\Jeremy\src.bowerrc: Unexpected token M
at parse (C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:49:21)
at C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:76:20
at Array.forEach (native)
at json (C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:74:14)
at rc (C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\util\rc.js:31:9)
at Config.load (C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\Config.js:14:20)
at Function.Config.read (C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\node_modules\bower-config\lib\Config.js:49:19)
at readCachedConfig (C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\lib\config.js:21:51)
at defaultConfig (C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\lib\config.js:11:24)
at Object. (C:\Users\Jeremy\AppData\Roaming\npm\node_modules\bower\lib\index.js:40:32)

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: bower install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'bower install'.
npm ERR! This is most likely a problem with the my-first package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get their info via:
npm ERR! npm owner ls my-first
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Jeremy\src\npm-debug.log

C:\Users\Jeremy\src>

Update docs for developers, testing & contributors

Update the /docs folder with new content:

  • update readme.md
  • move & refactor the CONTRIBUTING.md doc to docs (rename to contributing.md)
  • add details on CLA
  • add developer-guide.md
  • add developer-testing.md
  • revamp example docs
  • revamp docs/readme.md
  • add instructions on forking, resyncing & committing

HighResolutionIconUrl invalid on creation

Getting an error in uploading the manifest.xml when using yo office.

"This app can't be installed. The HighResolutionIconUrl value '[Icon URL]' isn't a corectly formatted URL."

Although it's great we use these values. I think its better to actually include a icon placeholder in the project and reference that with https://localhost:8443/ url as we are hard coding that anyway. Less steps to getting it running that way.

Add Mail Add-in Options for Mail & Calendar Read & Compose

Currently the generator builds mail read & compose forms. When picking a mail add-in, the generator should instead then prompt the user for four options, of which they can pick one or more:

  • Mail Compose Form
  • Mail Read Form
  • Calendar Compose Form
  • Calendar Read Form

The generator overwrites existing tsd.json

When the generator is run on an existing project, the existing tsd.json file is overwritten. We should support updating existing tsd.json the same way we do it for the bower.json file.

Invalid reference to scripts/jquery.fabric.min.js in generated appread files

For a Mail Add-in the appread/index.html file contains an invalid reference to the jquery.fabric.min.js file. The generated reference is scripts/jquery.fabric.min.js while it should be ../scripts/jquery.fabric.min.js to point to the correct location of the JavaScript file. The same invalid path is also used in references to content/fabric.min.css and content/fabric.components.min.css.

Log exception when one of the tests fails

When one of the tests in $ gulp test breaks at the end you get the following error:

/Users/usr/github/generator-office/gulpfile.js:129
  $.log(err.toString());
    ^
TypeError: undefined is not a function
    at Stream.handleError (/Users/usr/github/generator-office/gulpfile.js:129:5)
    at Stream.emit (events.js:129:20)

Shouldn't https://github.com/OfficeDev/generator-office/blob/master/gulpfile.js#L129 be referring to the function defined in https://github.com/OfficeDev/generator-office/blob/master/gulpfile.js#L113 (so calling log rather than $.log)?

Simplify bootstrapping add-ins

I believe we could simplify bootstrapping the add-in by removing jQuery from app.module.js and slightly changing the HTML structure in index.html.

Creation of TaskPane Addin failed.

Hi, i tried to create a TaskPane Addin and got the following error. Is is a bug or is there something I can do about?

This generator can also be run with: yo office
screen shot 2015-10-01 at 21 39 37

All script tags referring to application/javascript

In the index.html file all JavaScript references specify the script type as application/javascript. Shouldn't it be text/javascript instead which is the default script type in HTML5? If the script type will be changed consider removing it altogether as mentioned in issue #40.

Intellisense for manifest.xml

I noticed that if you put the XSD with the OfficeApp schema in the same directory as manifest.xml, Visual Studio Code gives you intellisense for the manifest's XML. I can imagine this being very useful for editing it. I'm not sure if this behavior is specific for VSCode but if there are more editors supporting it, we could include the XSD with the generated project to simplify working with the manifest.xml.

Add product options for task pane & contact add-in options

When creating a Office Task Pane Add-in or Content Add-in, prompt the user for the Office client products that the add-in is for:

  • Word
  • Excel
  • PowerPoint
  • OneNote
  • ...

This should be an extra question and allow 1 or more selections, but this should only show when the user picks one of these two add-in types.

Including additional Gulp tasks to support releases & deployment

@andrewconnell, @jthake: What do you guys think about including additional Gulps tasks in the generated gulpfile.js to support releases, such as copy the add-in files to be deployed to a separate folder (eg. dist), minifying scripts and CSS and bumping the version number in the manifest.xml and package.json? How about taking a look at the ability to upload the manifest.xml to the App Catalog? The main goal of these tasks would be to support developers in the deployment and release of projects built with the generator.

Generator creates invalid manifest.xml file

The generator creates an invalid add-in manifest file. If you try to upload the manifest.xml directly after generating the add-in, the Apps for Office catalog in SharePoint Online will consider the manifest as invalid. In order to fix the issue you need to remove the empty <SupportUrl/> element from manifest.xml. After that you will be able to upload the manifest.xml file as expected.

Manifest file name based on project name

Rather than call every manifest "manifest.xml" actually create file name as "-manifest.xml". Makes it useful when having a shared network folder for a Trusted add-in catalog on a local machine when testing in Office Windows client.

When released - add Office Fabric UI

When it's publicly released, include the Office Fabric UI as a dependency to all add-ins as using both bower & (if provided) the public CDN's.

Include both references in the index.html file but comment out the local bower references (default to CDN).

gulp run-yo does not work on Windows due to pathing issues

The problem seems to be right here in gulpfile.js:

  spawn('node',
    [
      '--debug',
      path.join(which.sync('yo'), '../../', 'lib/node_modules/yo/lib/cli.js'),
      'office',
      ' --skip-install'
    ], {
      stdio: 'inherit'
    });

This ends up looking for cli.js in the wrong place:

C:\Users\alexpark\OneDrive\fun\generator-office>gulp run-yo
[21:34:11] Using gulpfile ~\OneDrive\fun\generator-office\gulpfile.js
[21:34:11] Starting 'run-yo'...
[21:34:11] BE AWARE!!! - Running this with default options will scaffold the project in the generator's source folder.
[21:34:11] Finished 'run-yo' after 15 ms
Debugger listening on port 5858
module.js:338
    throw err;
          ^
Error: Cannot find module 'C:\Users\alexpark\AppData\Roaming\lib\node_modules\yo\lib\cli.js'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Changing path.join(which.sync('yo'), '../../', 'lib/node_modules/yo/lib/cli.js'), to path.join(which.sync('yo'), '../../', 'npm/node_modules/yo/lib/cli.js'), works, but a proper fix would switch based on the OS or maybe programmatically find the npm path?

Generator seems to hang waiting for user to hit Enter to finish

Using generator on Windows 10 in the following manner:

yo office
? Project name (display name): yotest2
? Root folder of project? Default to current directory
 (C:\Users\jasonjoh\Source\Repos\mail-addins\yotest2), or specify relative path
  from current (src / public):
? Office project type: Mail Add-in (read & compose forms)
? Technology to use: HTML, CSS & JavaScript

After the generator does its work, and the final line is output:

microsoft.office.js#2b215a298b bower_components\microsoft.office.js

The generator seems to hang, with the cursor just flashing. If you press Enter, it will exit.

Ideally the need to hit Enter can be removed, but if it can't, the tool should tell the user they need to hit Enter to exit.

Add reference to /typings/tsd.d.ts in .js files

Generated projects have the tsd.json file setup with references to Angular and Office typings. It would be helpful to include the reference to the /typings/tsd.d.ts file in all .js files so that developers can benefit of intellisense even if they're coding in plain JavaScript.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.