Code Monkey home page Code Monkey logo

generator-generator's Introduction

Welcome, Friend!

Yeoman is a robust and opinionated set of tools, libraries, and a workflow that can help developers quickly build beautiful, compelling web apps.

image

Code of Conduct

Everyone in this community (from core members to random committers and volunteers) are asked to please act in accordance with the Yeoman Community Contributor Code of Conduct. We encourage you to follow these social rules which help guide our interactions with each other, and ensure we provide a safe environment for everyone. We aim to make Yeoman a positive, welcoming, open and inclusive project and community.

Code of Conduct

Issue Submission

Make sure you've read the issue submission guidelines before you open a new issue.

Yeoman is composed of a number of different sub-projects, most of which have their own dedicated repository. If you are looking for a repo for a particular piece, you'll find it on the organization page.

Feature requests

Feature requests should be submitted to the repo it concerns. Submit to yeoman/yeoman if you're unsure, otherwise the repositories for our officially maintained generators can be found here.

Contribute

See the contributing docs

Support

Need help or have a question?

Please don't use the issue trackers for support/questions.

Links

Team

Yeoman is beautifully crafted by these people and a bunch of awesome contributors

Addy Osmani Sindre Sorhus Pascal Hartig Stephen Sawchuk Simon Boudrias
Addy Osmani Sindre Sorhus Pascal Hartig Stephen Sawchuk Simon Boudrias
Brian Ford Eddie Monge Paul Irish Hemanth.HM Revath S Kumar
Brian Ford Eddie Monge Paul Irish Hemanth.HM Revath S Kumar
Jimmy Moon Frederick Ros Mickael Daniel Eric Bidelman Matija Marohnić
Jimmy Moon Frederick Ros Mickael Daniel Eric Bidelman Matija Marohnić
Kevin Mårtensson Arthur Verschaeve Michael Kühnel Mehdy Dara Ulises Gascon
Kevin Mårtensson Arthur Verschaeve Michael Kühnel Mehdy Dara Ulises Gascon

Backers

Love Yeoman work and community? Help us keep it alive by donating funds to cover project expenses!
[Become a backer]

License

BSD license Copyright (c) Google

generator-generator's People

Contributors

addyosmani avatar alefteris avatar binduwavell avatar briansipple avatar coaxial avatar corburn avatar danielruf avatar eddiemonge avatar greenkeeper[bot] avatar hemanth avatar karlotimmerman avatar kevva avatar kirillseva avatar mfdeveloper avatar mgcrea avatar mgol avatar mischah avatar passy avatar peterblazejewicz avatar rgksugan avatar robdodson avatar ruyadorno avatar sboudrias avatar silvenon avatar sindresorhus avatar stephenplusplus avatar techmsi avatar thomasbertet avatar udnisap avatar ulisesgascon 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

generator-generator's Issues

yo fails to generate anything when GitHub API limit exceeded

See the output:

$ npm info generator-generator version
0.4.3
$ yo generator

(...)

Create your own magical generator with superpowers!
[?] Would you mind telling me your username on GitHub? username
[?] What's the base name of your generator? generator-name

/usr/local/Cellar/nvm/0.2.0/v0.10.26/lib/node_modules/generator-generator/app/index.js:42
      throw err;
            ^
Error: {"message":"API rate limit exceeded for 178.42.87.179. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"http://developer.github.com/v3/#rate-limiting"}

No files are created.

Homebrew has the same problem, they advocate to register the API token for it and set the HOMEBREW_GITHUB_API_TOKEN environmental variable to it. Yeoman should allow to do sth similar, otherwise I just can't use it in such circumstances (which become more common, at least for me).

generated index.js not running installDependencies

Was just creating a new generator and realised bower install wasn't being run when using my generator.

After inspecting the index.js generated by the new version of generator-generator I noticed that the 'on end function' was only calling this.npmInstall();.

Changed to this.installDependencies(); or..

this.npmInstall();
this.bowerInstall();

and works fine again.

Is there a reason it's only set to npmInstall(); or an oversight?

Thanks in advance

Testing

Hi!

Thanks to yeoman/generator-generator I have written my generator.
In my project appeared a folder test. I have some troubles with it.
Can you give, please, a bit more detailed description about how to write a testing system to check the work of generators written on yo? How to run this testing system? It would be great, if you give a primitive example.

Multiple Modules with Dependencies on colors.js results in 'Unable to register generator-cordova/app/index.js (Error: underline already exists on String.prototype, cannot override.)'

[Posted here as well: https://github.com/Marak/colors.js/issues/53]

When trying to develop a Yeoman generatorfor Cordova, I run into this problem of:

Unable to register generator-cordova/app/index.js (Error: underline already exists on String.prototype, cannot override.)

I believe this is due to generator-generator relying on cli-table which has a dependency on colors (https://github.com/yeoman/generator/blob/master/package.json + https://github.com/LearnBoost/cli-table/blob/master/package.json) AND cordova-cli relies directly on colors (https://github.com/apache/cordova-cli/blob/master/package.json)

So when I run the generator, I get the follow error message:

Unable to register generator-cordova/app/index.js (Error: underline already exists on String.prototype, cannot override.)

This could be due to cli-table using an old version of colors, but I've tried updating this to 0.6.0 but didn't seem to get any further.

Creating a generator with folder name and base name different still says name is taken on NPM

In the terminal:

learning-yeoman-ch6 $ yo generator

The output is the questions, after specifying a different name, it still says name is taken on NPM.

    |       |    .--------------------------.
    |--(o)--|    |  Create your own Yeoman  |
   `---------´   |      generator with      |
    ( _´U`_ )    |       superpowers!       |
    /___A___\    '--------------------------'
     |  ~  |     
   __'.___.'__   
 ´   `  |° ´ Y ` 

[?] Would you mind telling me your username on GitHub? jonnie
[?] What's the base name of your generator? mygen
[?] The name above already exists on npm, choose another? No

Yeoman gets the wrong generator name when creating a generator and linking with 'npm link'

It creates the generator scaffolding just fine, and 'npm link' successfully adds the link to the global npm modules, but 'yo --help' lists the wrong name. Here's what I did:

> mkdir /home/jason/misc/yomario && cd $_

> yo generator
    ... went with the default "yomario" name

> npm link

> mkdir /home/jason/misc/yomario-test && cd $_

> yo yomario
   Error yomario

    You don't seem to have....

> yo --help
    ...
    Please choose a generator below.

    Generator
        generator:app
        generator:subgenerator

    Home
        home:jason:misc:mariogen:app

Now, if I clone https://github.com/yeoman/generator-backbone into a local dir and run 'npm link', I can successfully issue 'yo backbone' commands in other dirs, and the output of 'yo --help' becomes

Please choose a generator below.


Backbone
  backbone:all
  backbone:app
  backbone:collection
  backbone:model
  backbone:router
  backbone:view

Generator
  generator:app
  generator:subgenerator

Home
  home:jason:misc:mariogen:app

<% %> conflict

Well, I'm building a new generator name ect a Javascript template engine.

The syntax for ect is <% ... %>

When I try to build it,

it will conflict with the generator syntax <%= %> let the whole file doesn't compile

How do I fix it?

Thanks

Test case is passed in local but fail in travis

Thanks for the generator.

I create a project in github: https://github.com/ilife5/generator-avalon-oniui. And I want to build the test case and CI in travic:https://travis-ci.org/ilife5/generator-avalon-oniui/builds/45439815。
But I meet a problem.

my test code is:

'use strict';

var path = require('path');
var assert = require('yeoman-generator').assert;
var helpers = require('yeoman-generator').test;
var os = require('os');

describe('avalon-oniui:app bower', function () {
  this.timeout(20000);
  before(function (done) {
    helpers.run(path.join(__dirname, '../app'))
      .withPrompt({
        packageManagement: "bower",
        appName: "avalon_oniui_yo"
      }).on('end', done);
  });

  it('creates files', function () {
    assert.file([
      'bower.json',
      'package.json'
    ]);
  });
});

in travis:

npm WARN package.json [email protected] No repository field.
  1) "before all" hook
  0 passing (20s)
  1 failing
  1) avalon-oniui:app bower "before all" hook:
     Error: timeout of 20000ms exceeded
      at null.<anonymous> (/home/travis/build/ilife5/generator-avalon-oniui/node_modules/mocha/lib/runnable.js:159:19)
      at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

[Documentation] Add note about permission issues - permission denied when running yo generator as sudo

I get this error when I try to run yo generator

>sudo yo generator

/usr/local/lib/node_modules/yo/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/polyfills.js:8
    cwd = origCwd.call(process)
                  ^
Error: EACCES, permission denied
    at process.cwd (/usr/local/lib/node_modules/yo/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/polyfills.js:8:19)
    at process.cwd (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/node_modules/graceful-fs/polyfills.js:8:19)
    at process.cwd (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/glob/node_modules/graceful-fs/polyfills.js:8:19)
    at new Environment (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index.js:45:42)
    at createEnv (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/index.js:38:10)
    at init (/usr/local/lib/node_modules/yo/cli.js:71:40)
    at pre (/usr/local/lib/node_modules/yo/cli.js:131:3)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/cli.js:161:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

MacOSX 10.9.4

Variable names for files and directories templates

Hi,
is there a way to have variable names for files and directories with the current yeoman release or is it planned to be?

currently we are using yeoman to scaffold our components and we have developed a custom generator using yeoman 0.9 and we already have a quick implementation of this functionality, so far we've found useful to see the component name at the filename/directory specially when testing or debugging.

Generator not found

Hi, i follow the instrunctions on yeoman site to create a new generator, but after i run npm link , and create a a new folder , and run yo genName , its not found, i have to do
yo Users:myUsername:Documents:dev:genName:app , to start the generator

Did this happen to anyone else?

$ npm test

> [email protected] test /Users/hemanth/labs/generator-generator
> mocha



     _-----_
    |       |
    |--(o)--|   .--------------------------.
   `---------´  |    Welcome to Yeoman,    |
    ( _´U`_ )   |   ladies and gentlemen!  |
    /___A___\   '__________________________'
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

Create your own magical generator with superpowers!
   create package.json
   create .editorconfig
․   create .jshintrc
   create .travis.yml
   create README.md
   create .gitattributes
   create .gitignore
   create app/index.js
․

  0 passing (2s)
  2 failing

  1) Generator generator creates expected files:
     Error: timeout of 2000ms exceeded
      at null.<anonymous> (/Users/hemanth/labs/generator-generator/node_modules/mocha/lib/runnable.js:175:14)
      at Timer.listOnTimeout (timers.js:124:15)

  2) Subgenerator subgenerator "before each" hook:
     Uncaught Error: EACCES, permission denied '/app'
      at Object.fs.mkdirSync (fs.js:634:18)
      at Function.sync (/Users/hemanth/labs/generator-generator/node_modules/yeoman-generator/node_modules/mkdirp/index.js:55:12)
      at null.<anonymous> (/Users/hemanth/labs/generator-generator/node_modules/yeoman-generator/lib/actions/actions.js:216:14)
      at processImmediate [as _immediateCallback] (timers.js:385:17)



npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

Trying to repro it. /cc @SBoudrias @passy

Strange Error

$ yo generator

 _-----_
|       |    .--------------------------.
|--(o)--|    |  Create your own Yeoman  |

---------´ | generator with | ( _´U_ ) | superpowers! |
/_A\ '--------------------------'
| ~ |
**'.
**.'__
´ |° ´ Y

? Would you mind telling me your username on GitHub? hfreni
? What's the base name of your generator? Stackathon-Stackers

/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:580
throw e;
^
TypeError: Cannot read property 'removeListener' of null
at PromptUI.UI.close (/usr/local/lib/node_modules/yo/node_modules/inquirer/lib/ui/baseUI.js:56:10)
at PromptUI.onCompletion (/usr/local/lib/node_modules/yo/node_modules/inquirer/lib/ui/prompt.js:66:8)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.completed (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:1955:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:1892:14)
at AnonymousObserver.tryCatcher (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:568:29)
at AutoDetachObserverPrototype.completed (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:4885:56)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:1892:14)
at InnerObserver.onCompleted (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:3194:65)
at InnerObserver.tryCatcher (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:568:29)
at AutoDetachObserverPrototype.completed (/usr/local/lib/node_modules/yo/node_modules/inquirer/node_modules/rx/dist/rx.js:4885:56)

Boilerplate structure does not work with template variables

I had some problems using template variables using the boilerplate code generated.

When I started coding my generator using the generated this.src.copy method (app/index.js:L40):

this.src.copy('_package.json', 'package.json');

Led me to errors, because when trying to access someOption variable inside my templates I would always get nothing. In the generated code, the someOption variable is assigned here (app/index.js:L28):

this.prompt(prompts, function (props) {
  this.someOption = props.someOption;
  done();
}.bind(this));

Once I switched to using this.copy method (the way I was used to in my previous generators) everything worked fine.

CoffeeScript support

I think the yeoman supports generators written in CoffeeScript.
Does this generator supports it??

Fresh Installation Error

Running zshell on latest Mac OSX

On first yo generator after installation today:

/usr/local/lib/node_modules/generator-generator/node_modules/yeoman-generator/lib/base.js:445
  this.env.sharedFs.on('change', writeFiles);
                    ^
TypeError: Object #<Object> has no method 'on'
    at run (/usr/local/lib/node_modules/generator-generator/node_modules/yeoman-generator/lib/base.js:445:21)
    at Environment.run (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:330:20)
    at /usr/local/lib/node_modules/yo/lib/cli.js:91:9
    at Environment.resolver.lookup (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/resolver.js:50:12)
    at init (/usr/local/lib/node_modules/yo/lib/cli.js:66:7)
    at pre (/usr/local/lib/node_modules/yo/lib/cli.js:53:3)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:155:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Improve generated readme

I've noticed people not getting it when they a generator repo.

As we know very well, users are lazy, and they probably don't bother clicking any links to read more. We should make the default generated readme a little bit more comprehensive and explain what yeoman is, what a generator is, why they should care and how it can make their life easier. Should be short, but very understandable and shouldn't assume prior knowledge in the stack.

https://github.com/yeoman/generator-generator/blob/master/app/templates/README.md

Thoughts?

@stephenplusplus you've done a great job making yeoman more approachable. Interested?

// @passy @addyosmani

Generating .travis.yml

Generating a .travis.yml with the newly generated generators will be helpful.

sample : .travis.yml

language: node_js
node_js:
  - 0.8

Test files do not pass jshint.

The wrong global is declared on the following test files:

  • app/templates/test-app.js.
  • subgenerator/templates/test-subgenerator.js.
  • test/test-app.js.
  • test/test-subgenerator.js.

Instead of beforeEach it should be before as it is the one used on the code. This causes the test files to fail JShint on a newly generated generator.

Tests on generated generator fails with yeoman-generator 0.15/0.16

Worked fine with 0.14.

  1) s generator "before each" hook:
     Uncaught Error: You don't seem to have a generator with the name s:app 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.
      at Environment.create (/Users/sindresorhus/Downloads/s/node_modules/yeoman-generator/lib/env/index.js:285:7)
      at Object.helpers.createGenerator (/Users/sindresorhus/Downloads/s/node_modules/yeoman-generator/lib/test/helpers.js:233:23)
      at Context.<anonymous> (/Users/sindresorhus/Downloads/s/test/test-creation.js:13:26)
      at /Users/sindresorhus/Downloads/s/node_modules/yeoman-generator/lib/test/helpers.js:183:5
      at CB (/Users/sindresorhus/Downloads/s/node_modules/yeoman-generator/node_modules/rimraf/rimraf.js:42:5)
      at Object.oncomplete (fs.js:107:15)

@SBoudrias did anything change regarding testing?

support http proxies

There are other issues for http proxy which are closed. I am reopening one, as it seems there is a regression on that area.

Issues I have found:

  • npm-name does not support proxies (sindresorhus/npm-name#1)
  • node-github looks like changed its api, as the config.proxy is now an url, and no more {host:, port:} mapping.

This is unfortunate, as there are a number of big companies using proxies, and having yeoman fail is a big message that this technology is not mature.

Error: {"message":"Not Found","documentation_url":"http://developer.github.com/v3"}

I am getting this error when running yo generator.

Create your own magical generator with superpowers!
[?] Would you mind telling me your username on GitHub? [email protected]
[?] What's the base name of your generator? mobileboilerplate

/usr/local/lib/node_modules/generator-generator/app/index.js:42
      throw err;
            ^
Error: {"message":"Not Found","documentation_url":"http://developer.github.com/v3"}

I have try updating yo, installing and reinstalling it and updating/reinstalling the generator-generator.
I know there is a similar issue at #28 but their stack trace is different.

This is the versions I am using.

$ node -v
v0.10.21
$ npm -v
1.3.11
$ yo -v
1.1.2
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.9.1
BuildVersion:   13B42

This is what i get when running '$ yo --version && echo $PATH $NODE_PATH && node -e 'console.log(process.platform, process.versions)' && cat Gruntfile.js
1.1.2'
as mentioned in the contribution file.

$ yo --version && echo $PATH $NODE_PATH && node -e 'console.log(process.platform, process.versions)' && cat Gruntfile.js
1.1.2
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
darwin { http_parser: '1.0',
  node: '0.10.21',
  v8: '3.14.5.9',
  ares: '1.9.0-DEV',
  uv: '0.10.18',
  zlib: '1.2.3',
  modules: '11',
  openssl: '1.0.1e' }
cat: Gruntfile.js: No such file or directory

Thanks in advance for the help...

Ability to change template delimiters?

I think it would be really useful to be able to change the delimiters used by lodash within the this.template() method in a generator. A generator I'm currently working on has client side underscore templates in the output files, as well as a Gruntfile that is trying to use underscore templates for config variables - both are causing collisions. I've tried a solution like this to change the delimiters to <: :>, within the generator construction function:

    this._.templateSettings.interpolate = /<\:(.+?)\:>/g;
    this._.templateSettings.escape = /<\:-(.*?)\:>/g;
    this._.templateSettings.evaluate = /<\:=(.*?)\:>/g;

mentioned in this issue: yeoman/yeoman#1235, but that doesn't appear to work, none of the updated delimiter/tags are getting parsed.

I realize I can use my own instance of lodash, or some other templating engine, but it would be really great to be able to use the this.template() method, since it's so much more convenient/useful for generating files from templates...

Perhaps I'm missing something?

creating a generator

Trying to set up a generator from the new docs looked fairly straighforward but i can even generator created from the base webapp code base

seems like the structure has changed around a little from beta 4 yeoman now is at beta 5

therefore I need to install 'yo install generator-webapp'
for 'yo webapp' to work

the only warnings Im seeing are

npm WARN package.json [email protected] 'devDependences' should probably be 'devDependencies'
/Users/ms/.nvm/v0.8.23/lib/node_modules/tt55 -> /Applications/XAMPP/xamppfiles/htdocs/tt55

any ideas what might be going on

M

Github username

if you insert an email, on the username of the github it gives an error

Success callback for this.installDependencies()

If you could call

var cb = this.async();
this.installDependencies({...}, cb());

You would be able to trigger things after the install. Like a message to run grunt commands.

If theres a better way to do this I haven't been able to find any documentation.

Thanks!

generator:subgenerator always creates a NamedBase generator

yo generator:subgenerator always creates a NamedBase generator.

This had me to believe that you couldn't create just a normal Base generator. But I tried and it worked. I would propose something like

yo generator:namedsubgenerator "name" - would create a NamedBase generator.
yo generator:subgenerator "name" --named - would create a NamedBase generator.
yo generator:subgenerator "named" - would create a NamedBase generator.
yo generator:subgenerator - has no name so make it a Base generator.

or something like that so you can generate both types.

Thanks!

Superb may contain single quotes

This exits the string and causes a bug. Is there a way to easily escape them or should I escape them on the superb repo itself?

--help

I run this command:

yo my-generator --help

I recieve:

Usage:
  yo my-generator [options] 

Options:
  -h,   --help  # Print generator's options and usage  Default: false

For example, I want to add an option --version.
How can I add more options into this log?

P.S. Sorry, I am sure that it is really silly question)

github.user.getFrom fails behind corporate proxy

Here's the error I get when trying to run the generator:

/Users/username/opt/lib/node_modules/generator-generator/app/index.js:28
      throw err;
            ^
connect ETIMEDOUT
    at Object.proto.sendError (/Users/username/opt/lib/node_modules/generator-generator/node_modules/github/api/v3.0.0/index.js:30:19)
    at getFrom (/Users/username/opt/lib/node_modules/generator-generator/node_modules/github/api/v3.0.0/user.js:35:29)
    at ClientRequest.httpSend (/Users/username/opt/lib/node_modules/generator-generator/node_modules/github/index.js:700:17)
    at ClientRequest.EventEmitter.emit (events.js:96:17)
    at CleartextStream.socketErrorListener (http.js:1455:9)
    at CleartextStream.EventEmitter.emit (events.js:96:17)
    at Socket.onerror (tls.js:1336:17)
    at Socket.EventEmitter.emit (events.js:126:20)
    at Socket._destroy.self.errorEmitted (net.js:329:14)
    at process.startup.processNextTick.process._tickCallback (node.js:245:9)

Looking at node-github, you can pass in proxy settings as a config variable so I assume that's why it's failing.

Scripts added with appendScript don't used for 'usemin' when I do 'grunt build'

Scripts added with appendScript don't used for usemin-task when I do grunt build.

AppGenerator.prototype.writeIndex = function writeIndex() {

  this.indexFile = this.readFileAsString(path.join(this.sourceRoot(), 'index.html'));
  this.indexFile = this.engine(this.indexFile, this);

  if (this.frameworkSelected == 'foundation') {
    this.indexFile = this.appendScripts(this.indexFile, 'js/foundation.js', [
      "bower_components/foundation/js/foundation/foundation.js",
      "bower_components/foundation/js/foundation/foundation.abide.js",
      "bower_components/foundation/js/foundation/foundation.alerts.js",
      "bower_components/foundation/js/foundation/foundation.clearing.js",
      "bower_components/foundation/js/foundation/foundation.cookie.js",
      "bower_components/foundation/js/foundation/foundation.dropdown.js",
      "bower_components/foundation/js/foundation/foundation.forms.js",
      "bower_components/foundation/js/foundation/foundation.interchange.js",
      "bower_components/foundation/js/foundation/foundation.joyride.js",
      "bower_components/foundation/js/foundation/foundation.magellan.js",
      "bower_components/foundation/js/foundation/foundation.orbit.js",
      "bower_components/foundation/js/foundation/foundation.placeholder.js",
      "bower_components/foundation/js/foundation/foundation.reveal.js",
      "bower_components/foundation/js/foundation/foundation.section.js",
      "bower_components/foundation/js/foundation/foundation.tooltips.js",
      "bower_components/foundation/js/foundation/foundation.topbar.js"
      ]);
  }
};

When I scaffold project with Foundation, I have app/index.html with these scripts:

<!-- build:js js/foundation.js -->
        <script src="bower_components/foundation/js/foundation/foundation.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.abide.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.alerts.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.clearing.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.cookie.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.dropdown.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.forms.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.interchange.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.joyride.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.magellan.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.orbit.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.placeholder.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.reveal.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.section.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.tooltips.js"></script>
        <script src="bower_components/foundation/js/foundation/foundation.topbar.js"></script>
        <!-- endbuild -->

But when I do grunt build without changing index.html after scaffolding I have dist/index.html with the same scripts in the end of file.
If I change the file (add/delete some line) I have normal compress these scripts and concatinate to js/{someChars}.foundation.js

How I can resolve this problem?

GitHub API vs git.config

In my (limited) experience, it seems more intuitive to try to get the system's git config info, and pull the GitHub username from that. Try something like this in Node.

// index.js
var util = require('util'),
    exec = require('child_process').exec,
    child;

child = exec('git config github.user',
  function (error, stdout, stderr) {
    console.log('stdout: ' + stdout);
    console.log('stderr: ' + stderr);
    if (error !== null) {
      console.log('exec error: ' + error);
    }
});

On my system, it returns a large response object, and then:
> stdout: kevinSuttle

Or even:

...
// index.js
var util = require('util'),
    exec = require('child_process').exec,
    child;

...

var lookForUserGitConfig = function(){
  child = exec('git config github.user',
    function (error, stdout, stderr) {
      console.log( stdout);
  });
}

JekyllGenerator.prototype.askFor = function askFor() {
  var cb = this.async();

   ...

  var prompts = [{
    type: '',
    name: 'githubUser',
    message: 'Would you mind telling me your username on GitHub?',
    default: lookForUserGitConfig()
  }];
...

On my system, this returns (newline intentional)

kevinSuttle

It's late, so I may not be thinking clearly, but wanted to clarify either way. 😄

Erro: New Create generator

Hi! I am starting the yeoman, when trying to create a generator, but is giving this error, anyone know what can be?

[?] Would you mind telling me your username on Github? geraldotomaz
[?] What's the base name of your generator? test

/usr/local/share/npm/lib/node_modules/generator-generator/app/index.js:28
throw err;
^
getaddrinfo ENOTFOUND
at Object.proto.sendError (/usr/local/share/npm/lib/node_modules/generator-generator/node_modules/github/api/v3.0.0/index.js:30:19)
at /usr/local/share/npm/lib/node_modules/generator-generator/node_modules/github/api/v3.0.0/user.js:35:29
at ClientRequest. (/usr/local/share/npm/lib/node_modules/generator-generator/node_modules/github/index.js:700:17)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1492:9)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at Socket.onerror (tls.js:1337:17)
at Socket.EventEmitter.emit (events.js:117:20)
at net.js:792:16
at process._tickCallback (node.js:415:13)

thank you!

Generator fails with timeout

D:\sandbox>yo generator

Create your own magical generator with superpowers!
[?] Would you mind telling me your username on GitHub? someuser
[?] What's the base name of your generator? sandbox

C:\Users\Shrike\AppData\Roaming\npm\node_modules\generator-generator\app\index.js:42
      throw err;
            ^
connect ETIMEDOUT
    at Object.proto.sendError (C:\Users\Shrike\AppData\Roaming\npm\node_modules\generator-generator\node_modules\github\api\v3.0.0\index.js:30:19)
    at C:\Users\Shrike\AppData\Roaming\npm\node_modules\generator-generator\node_modules\github\api\v3.0.0\user.js:36:29
    at ClientRequest.<anonymous> (C:\Users\Shrike\AppData\Roaming\npm\node_modules\generator-generator\node_modules\github\index.js:766:17)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1547:9)
    at CleartextStream.EventEmitter.emit (events.js:95:17)
    at Socket.onerror (tls.js:1445:17)
    at Socket.EventEmitter.emit (events.js:117:20)
    at net.js:440:14
    at process._tickCallback (node.js:415:13)

generator-generator v0.4.3

generator package.json file

npm link creates a symlink from the local node_modules folder to the global node_modules folder

should the generator package-name be taken from package.json ?? , and not from directory name this is not currently the case when you create the package name.

it would appear that the folder name is placed in the package.json file instead overriding what the user puts in the second command line option

trying to figure out what is going on here :)

M

`yo generator` fails (SSL23_GET_SERVER_HELLO:unknown protocol)

While I run yo generator behind a corporate proxy, it fails (after having asked 2 questions: username and generator name) with the following error:

C:\My Program Files\Npm\node_modules\generator-generator\app\index.js:38
      throw err;
            ^
712:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:766:

    at Object.proto.sendError (C:\My Program Files\Npm\node_modules\generator-generator\node_modules\github\api\v3.0.0\index.js:30:19)
    at C:\My Program Files\Npm\node_modules\generator-generator\node_modules\github\api\v3.0.0\user.js:36:29
    at ClientRequest.<anonymous> (C:\My Program Files\Npm\node_modules\generator-generator\node_modules\github\index.js:719:17)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1547:9)
    at CleartextStream.EventEmitter.emit (events.js:95:17)
    at SecurePair.<anonymous> (tls.js:1386:15)
    at SecurePair.EventEmitter.emit (events.js:95:17)
    at SecurePair.error (tls.js:1006:27)
    at CleartextStream.read [as _read] (tls.js:457:17)

Please note that:

  • I'm behind an anonymous proxy (squid)
  • I'm using Windows 7, node v0.10.21, npm 1.3.11
  • I've set proxy and https-proxy npm configs
  • I've set HTTP_PROXY environment variable
  • Other generators (webapp, angular) are working fine
  • I've tried npm cache clean and re-run

Any ideas about what could have possibly caused this?

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.