Giter Club home page Giter Club logo

generator-chromeapp's Introduction

Chrome App generator Build Status

Maintainer: Jimmy Moon

Chrome Apps boilerplate generator that creates everything you need to get started with development. To test, go to: chrome://extensions, enable Developer mode and load app as an unpacked extension.

Getting Started

  • First make a new directory, and cd into it: mkdir my-new-chromeapp && cd $_
  • Install the generator: npm install -g generator-chromeapp
  • Run: yo chromeapp

Generators

Available generators:

App

Sets up a new Chrome App, generating all the boilerplate you need to get started.

Example:

yo chromeapp

Permission

Create manifest.json or append permission into manifest.json. You can choose permission to put into manifest.json

Example:

yo chromeapp:permission

Samples

You can create a new Chrome App with the google-chrome-app samples on GitHub.

Example:

yo chromeapp:samples

Build

Creates a production build, production files to zip file. You can publish zip file to Chrome Web Store.

Examples:

grunt build

Debug

Support two preview mode. LiveReload/run/debug your Chrome App on Chrome browser and Chrome app container.

  • grunt debug - Default, run you Chrome App on Chrome app container

  • grunt debug:server - Run you Chrome App on Chrome browser like 'serve' task of webapp.

Options

  • --skip-install

    Skips the automatic execution of bower and npm after scaffolding has finished.

  • --test-framework=[framework]

    Defaults to mocha. Can be switched for another supported testing framework like jasmine.

  • --skip-pull

    Skips the pull command of git which checks the google-chrome-app samples on GitHub

  • --coffee

    Add support for CoffeeScript.

  • --compass

    Add support for Compass.

WARN, Compiled files that generated by coffee or compass will be remained if your Chrome App running on Chrome App container (with grunt debug). You should remove or ignore that files if you don't want to commit to repo.

Contribute

See the contributing docs

License

BSD license

generator-chromeapp's People

Contributors

addyosmani avatar arthurvr avatar bcjordan avatar blakeblackshear avatar ghchinoy avatar itamarro avatar kevva avatar marian-r avatar mklabs avatar olecve avatar passy avatar paulkinlan avatar ragingwind avatar sindresorhus avatar sleeper avatar thethp avatar zoramite 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

generator-chromeapp's Issues

Manifest.json being created in /test/app/manifest.json

I've done some digging, but don't really known my way around yeoman. This is on a clean install when running yo chromeapp. The manifest.json file is created in the test directory instead of the the main project/app directory.

The temporary fix is just to move the file into the correct place.

"yo chromeapp" skips the permissions step

When I run "yo chromeapp", it seems to skip the permissions step when I click enter after entering the chrome app description. Skipping the permissions step, is also the cause for manifest.json not being generated within the app folder.

It is required to run yo chromeapp:permissions to generate the manifest.json after running the initial creation.

What is also somewhat related, at the end of downloading dependencies, the command promt hangs and waits for input .. when I click enter, I get the permissions selection. Selecting any of the permissions (URL permissions), it outputs a message that it DID create the manifest.json, but it didn't.

New sub-generator for Chrome App samples

screen shot 2013-10-25 at 8 58 43 pm

This is a new experimental feature. sub generator for chromeapp samples. This sub-generator will do scaffolding new chromeapp copy from GoogleChrome/chrome-app-samples

Check this scenario:

  • Clone and cache the Chrome Apps samples via git command
  • Get list of samples from cached directory
  • Users could select a Chrome Apps sample on list
  • Copy sample to app directory and copy some files in templates of app
  • The sample can using yeoman features with grunt (like build, reload or something)

checkout this https://github.com/ragingwind/generator-chromeapp/tree/samples

To team, Im using rimraf package to try to delete app directory if the directory is already exist in target path. As I know Yeoman base generator using rimraf internally. Could you make a new interface to use rimraf like a shelljs?

cc @mangini

grunt-config-htmlmin@~0.3.0

Can you bump the version of grunt-config-htmlmin from ~0.2.0 to ~0.3.0 - polymer conditional attributes need a feature only supported in 0.3.0?

Thanks!

'bower install ... --save' doesn't save.

I notice that the usual

bower install jquery --save

doesn't add anything to the bower.json file, which it should, I think.

I notice that the line :

   "json": "bower.json"

is missing from .bowerrc. Unless I'm missing something (I'm not familiar with yeoman nor the specific grunt plugins used), I think that should be added.

Upgrade to Yeoman 1.0 beta

@PaulKinlan Would it be useful to get Renato involved in helping us maintain this? It's currently not usable with the latest version of Yeoman but I'd love for it to be supported. I can help onboard him with what is involved if that helps.

npm error: [email protected] requires a peer of generator-mocha@>=0.1.6 but none was installed

I don't know how to bypass this error :( I tried installing the last generator-mocha, even getting the 0.1.6 one myself, but I still have the same problem.

$ npm install -g generator-chromeapp
npm WARN deprecated [email protected]: the module is now available as 'css-select'
npm WARN deprecated [email protected]: the module is now available as 'css-what'
npm WARN deprecated [email protected]: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
/usr/local/lib
├── [email protected]
└── UNMET PEER DEPENDENCY generator-mocha@>=0.1.6

npm WARN EPEERINVALID [email protected] requires a peer of generator-mocha@>=0.1.6 but none was installed.

node 5.3.0

debug target doesn't update page on chromeos+crouton

I'm using crouton on chrome os and notice that the web page isn't automatically refreshed like it is on other platforms.
I generated a chromeapp project, did npm and bower installs, and ran grunt debug, then opened another tab on the localhost URL. In another shell, I edited the file; I notice a message in the shell running grunt '>> File "app/index.html" changed.' and a 'Completed ... Waiting...' line which makes me think all is ok, but when I go to the tab open on the localhost URL, it doesn't reflect the change. A reload fixes it.

A minor issue and a corner-case (chromeos=crouton), but worth being aware of it, IMO.

Index.html has no index.js

The basic hello world app annoys me no end, I always have to create a new index.js file, there is no reasonable structure to the files either.

Generator doesn't update manifest.json file

I just ran the generator and found that the MSG_appName and MSG_appDescription doesn't get updated in the manifest.json file.
The generator asked for them and I entered some text there however it didn't update in the file.

Grunt does not launch app in Chrome App container

running the command grunt debug launches the app the same as grunt debug:server I expect grunt debug to launch the app in the app container just like is shown in your animated gif. How do I get Grunt to launch the app in the app container?

NPM issue with installing the generator

`Majors-iMac:js innovator$ npm install -g generator-mocha
/usr/local/lib
└── [email protected]

Majors-iMac:js innovator$ npm install -g generator-chromeapp
npm WARN deprecated [email protected]: the module is now available as 'css-select'
npm WARN deprecated [email protected]: the module is now available as 'css-what'
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
/usr/local/lib
├── [email protected]
└── UNMET PEER DEPENDENCY generator-mocha@>=0.1.6

npm WARN EPEERINVALID [email protected] requires a peer of generator-mocha@>=0.1.6 but none was installed.
Majors-iMac:js innovator$ node -v
v5.0.0
Majors-iMac:js innovator$ npm -v
3.3.9`

`grunt debug` doesn't update output files

I've created a new project and I can successfully run it as a chrome app. Then I type grunt debug and it starts watching file changes. When I change a file it get's detected correctly (command line says something like file "..." changed... and after a very short time Completed). But the output files don't get updated.

I've tried to put a unique sample string into index.html and used a software to find that text in any file of the entire project. But unless the original file none does contain the text I've entered. That means that no files get updated.

I'm working on a Windows machine and node.js 4.
What can I do to at least identify the source of the problem? Thank you for any help

Applying Polymer, gulp and cca

Applying Polymer, gulp to Chrome Apps generator, I've played with them for a while. For getting reasonable build task, to make easily and handy, I made a prototype kit before write a this PR. I think that the prototype kit is suitable to start making new version of the Generator.

What is (big) changes:

  • Polymer, Polymer is great. Make Polymer as default in developing Chrome Apps. I embedded Polymer project of polymer generator.
  • Mobile Chrome Apps, For preview, We can use cca run instead of livereload to preview app running on Chrome. Additionally, It is allowed to make a Mobile Chrome Apps using same source.
  • Gulp, gulp is primary task system, I made node packages and plugins for gulp (Grunt task is not supported yet, but it's not hard for me. We can support both of them)
  • Build task, Users should run build task first to Chrome Apps runs properly while current generator does not require that build task. to use Polymer, avoiding CSP issue and less vulcanizing Polymer elements, I add build task that makes bundled polymer library, which pre-builded(vulcanized) is included in user elements. so, once build(vulcanize) no more vulcanize in development version.

The one of my concern is that it would be fine that enforce using cca and Polymer. I need your any comments or any suggestions. how thought? Feel free to advice me. As you know that my Korean writing is much better than in this proposal.

/cc @sindresorhus, @addyosmani @robdodson

chromeapp:samples "Client ID is below specific application key"

When trying to use chromeapp:samples I'm getting the following error:

What sample would you like to use? identity
   create app/assets/screenshot_1280_800.png
   create app/identity.js
   create app/index.html
   create app/main.js
   create app/manifest.json
   create app/README.md
   create app/sample_support_metadata.json
   create app/sample_support/google-code-prettify/lang-css.js
   create app/sample_support/google-code-prettify/run_prettify.js
   create app/sample_support/prettify_theme.css
   create app/sample_support/prettify.css
   create app/sample_support/prettify.js
   create app/sample_support/README.md
   create app/sample_support/sample_support.js
   create app/sample_support/show_snippets.html
   create app/sample_support/show_snippets.js
   create app/sample_support/snippets.css
   create app/sample_support/standard.css
undefined:14
    // client_id below is specifc to the application key. Follow the
    ^
SyntaxError: Unexpected token /
    at Object.parse (native)
    at module.exports.yeoman.generators.Base.extend.manifest (/usr/local/lib/node_modules/generator-chromeapp/samples/index.js:186:21)
    at /usr/local/lib/node_modules/generator-chromeapp/node_modules/yeoman-generator/lib/base.js:395:14
    at processImmediate [as _immediateCallback] (timers.js:358:17)

Cannot find module '../manifest'

/usr/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:580
throw e;
^
Error: Cannot find module '../manifest'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/lib/node_modules/generator-chromeapp/app/index.js:6:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

Ubuntu Gnome 14.10 fresh install
npm -v
1.4.28
node -v
v0.10.37

mocha :all PhantomJS timed out

I created a new project per yo and selecting the Chromeapp generator. All went really nice so far, but when I call grunt I get the following error:

Running "mocha:all" (mocha) task
Testing: http://localhost:9000/index.html

Warning: PhantomJS timed out, possibly due to a missing Mocha run() call. Use --force to continue.

Aborted due to warnings.

'getting started' instructions in README.md don't work (for me)

I ran :

npm install -g yo
npm install -g generator-chromeapp

and they all seemed to do lots of stuff with no errors.

However, this still failed :

yo chromeapp

which produced the error :

Error chromeapp 

You don't seem to have a generator with the name chromeapp installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 1 registered generators run yo with the `--help` option.

If I do as it suggests (ie not use the -g), then it works, but I would have expected the README to give me those instructions in the first place.

Perhaps it is something specific to my setup?

grunt test fails due to not downloaded bower components in test folder

The "grunt test" task will fail with a timeout error if the bower components is not downloaded within the test folder. It is required for developers to open the test folder and run "bower update", to ensure that both chai and mocha are downloaded. When this is done, the user can run "grunt test" from the root folder successfully.

Either the gruntfile should ensure these components are downloaded, or the readme.md should include detailed instructions for developers.

Port conflict problems with grunt connect

Hello,
I tried yo chromeapp with basic settings. After the app was created, I typed grunt, and received the following output:

❯ grunt
Running "newer:jshint" (newer) task

Running "newer:jshint:all" (newer) task

Running "jshint:all" (jshint) task

✔ No problems


Running "newer-postrun:jshint:all:-1:./node_modules/grunt-newer/.cache" (newer-postrun) task

Running "connect:test" (connect) task
Started connect web server on http://localhost:9000

Running "mocha:all" (mocha) task
Testing: http://localhost:9000/index.html

Warning: PhantomJS timed out, possibly due to a missing Mocha run() call. Use --force to continue.

Aborted due to warnings.


Execution Time (2014-11-16 21:50:01 UTC)
jshint:all  89ms  1%
mocha:all   6.2s 98%
Total 6.3s

😞

Here's the output of running grunt connect:

❯ grunt connect
Running "connect:server" (connect) task
Started connect web server on http://localhost:9000

Running "connect:chrome" (connect) task
Fatal error: Port 9000 is already in use by another process.


Execution Time (2014-11-16 21:54:04 UTC)
loading tasks    3ms 9%
connect:server  23ms 68%
connect:chrome   7ms 21%
Total 34ms

Running lsof -i tcp:9000 returned no processes.

Grunt (bowerInstall) fails to download bower components

When running the gruntfile with "grunt debug" and modifying the bower.json file, I get the following error on Windows 8.1:

Warning: Cannot read property 'main' of undefined Use --force to continue.
Aborted due to warnings.

This happens when I create a shiny new project, and all I did was add the angular dependecy: "angular": "1.2.16".

Change workflow for Polymer

follow https://github.com/Polymer/vulcanize/issues/51#issuecomment-52611599

We don't need to mandatory compile task(vulcanize) for loading a ChromeApps on Chrome until now. But for now, If we want to use Polymer? We should do vulcanize before load a ChromeApps.

It lead to change workflow of ChromeApps. It will be origin source is in a src path(not app), do compile to make build files, load the build files to Chrome and make a optimized version for deploying. Like a workflow of native apps development. But It's too burden for me, and one of problems is vulcanize isn't needed if user dosen't use Polymer.

I try to new version of chromeapp-generator which supports polymer and vulcanize for few a month but I couldn't get best result as a yeoman-generators. Best case is we use a polymer while developing without CSP issues... :)

How about changing workflow of generator-chromeapps for ChromeApps @addyosmani @ebidel

Error thrown when try to run the generator

I'm using Node v0.11.3


/usr/local/lib/node_modules/generator-chromeapp/node_modules/yeoman-generator/lib/util/common.js:5
'\n   `---------´  |    ' + 'Welcome to Yeoman,'.yellow.bold + '    |' +
                                                       ^
TypeError: Cannot read property 'bold' of undefined
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-chromeapp/node_modules/yeoman-generator/lib/util/common.js:5:56)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
    at Module.require (module.js:357:17)
    at require (module.js:373:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-chromeapp/node_modules/yeoman-generator/lib/base.js:91:26)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)

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.