GithubHelp home page GithubHelp logo

generate / generate Goto Github PK

View Code? Open in Web Editor NEW
298.0 298.0 22.0 3.73 MB

A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.

Home Page: http://generate.github.io/generate/

License: MIT License

JavaScript 76.13% HTML 3.29% CSS 20.59%
boilerplate cli create files generate generator gulp init initialize make project project-template rails scaffold slush task-runner template webpack yeoman yo

generate's Introduction

Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.

generate

NPM version NPM monthly downloads Build Status

You might also be interested in update.

Table of contents

(TOC generated by verb using markdown-toc)

Why use Generate?

Why use Generate?

There are other project scaffolders out there, why should you spend your time learning to use Generate?

Generate offers the robustness, power and configurability of Yeoman, with the expressiveness and simplicity of slush and gulp. See the following links if you're interested in a more detailed comparison:

Features

Features

  • advanced flow control: through the use of generators (not es2015 generators), sub-generators, and tasks
  • render templates: use templates to create new files, or replace existing files
  • any engine: use any template engine to render templates, including handlebars, lodash, swig and pug, and anything supported by consolidate. This is useful for generating templates from templates.
  • data: automatically gather data from the user's environment for rendering templates, to populate "hints" in user prompts or for rendering templates, etc.
  • prompts: It's easy to create custom prompts and use the answers for: context for rendering templates, settings options, determining file names, directory structure, and anything else that requires user feedback.
  • macros: create a completely custom generator from the command line using macros.
  • front-matter: use yaml front matter in templates to define settings or defaults on a file-by-file basis
  • smart plugins: Update is built on base, so any "smart" plugin from the Base ecosystem can be used
  • config store: persist configuration settings, global defaults, project-specific defaults, answers to prompts, and so on.
  • streams: full support for gulp and assemble plugins
  • vinyl: files and templates are vinyl files.
  • much more!
Developer toolkit

Developer toolkit

Generate is part of a suite of developer tools that share a common foundation. Any of these tools may be used standalone or together:

  • generate: (you are here) scaffold out new projects
  • assemble: build system for web projects
  • verb: documentation system for code projects
  • update: automate updates of any kind in code projects

All of these applications are built on top of base and templates, which provides a number of benefits, including:

  • similar API/CLI - Learn one, and you will know them all
  • common plugins - create a plugin for one, it will be usable by the others
  • cross-compatible - they can run one another (for example, assemble can run verb to generate markdown documentation, then use that to create an HTML website)

Command line usage

Generate may be installed locally or globally. However, if you wish to run any globally installed generators, Generate's CLI must be installed globally as well.

Install Generate

Install generate globally using npm:

$ npm install --global generate

This adds the gen command to your system path, allowing it to be run from anywhere.

Install a generator

If you'd like to see how generators work, install generate-example:

$ npm install --global generate-example

Then run the example generator with the following command:

$ gen example

Visit the generate-example project for additional steps and guidance.

Next steps

Command line arguments

The syntax for running generators is:

$ gen generator:task
  • generator one or more space-separated generator names
  • task - (optional) one or more comma-separated task names

Examples

# run generate-project's "default" task
$ gen project
# run generate-project's "license" task
$ gen project:license
# run generate-project's "package" task
$ gen project:package

generator.js

If a generator.js is in the current working directory, Generate's CLI will attempt to load it and execute any tasks you've specified at the command line.

Examples

Generators

generators are plugins that can be run by command line or using Generate's API.

Discovering generators

  • Find generators to install by searching npm for packages with the keyword generategenerator
  • Visit Generate's GitHub org to see the generators maintained by the core team

Discovering plugins

Plugins from any applications built on base should work with Generate (and can be used in your generator):

  • base: find base plugins on npm using the baseplugin keyword
  • assemble: find assemble plugins on npm using the assembleplugin keyword
  • generate: find generate plugins on npm using the generateplugin keyword
  • templates: find templates plugins on npm using the templatesplugin keyword
  • update: find update plugins on npm using the updateplugin keyword
  • verb: find verb plugins on npm using the verbplugin keyword

Authoring generators

Visit the documentation for generators to learn how to use, author and publish generators.

More information

About

Related projects

  • assemble: Get the rocks out of your socks! Assemble makes you fast at creating web projects… more | homepage
  • base: Framework for rapidly creating high quality node.js applications, using plugins like building blocks | homepage
  • update: Be scalable! Update is a new, open source developer framework and CLI for automating updates… more | homepage
  • verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… more | homepage

Community

Are you using Generate in your project? Have you published a generator and want to share your project with the world?

Here are some suggestions!

  • If you get like Generate and want to tweet about it, please feel free to mention @generatejs or use the #generatejs hashtag
  • Show your love by starring Generate and generate
  • Get implementation help on StackOverflow (please use the generatejs tag in questions)
  • Gitter Discuss Generate with us on Gitter
  • If you publish an generator, thank you! To make your project as discoverable as possible, please add the keyword generategenerator to package.json.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on June 02, 2017.

generate's People

Contributors

dawsbot avatar doowb avatar jonschlinkert avatar stefanwalther 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

generate's Issues

prompts / data

I recently introduced a bug that caused the license statement intended for a readme to be used as the license in package.json.

The bad news: I just pushed up a temporary fix for that bug, but it's not unlikely that other bugs will crop up as a result.

The good news: Data handling in generate is highly modular and the code for it is organized in a way that makes it easy to completely change. I'm working on that now. If anyone experiences regressions, please list them here. Sincerest apologies for any inconvenience

customizations

We are planning on implementing some features to give implementors and end-users more control over the experience. This issue will be used for tracking.

  • ~/generate: by default, user customizations, overrides, config, templates, etc will be in a generate folder in user home.
  • make the folder path customizable
  • generators will be in sub-directories in the ~/generate folder
  • users can define a ~/generate/config.js file with any custom code to be used when running generate. This file will work like any other generator.js file, so when running generate, the CLI will do something like app.use(require('~/generate/config.js')); before loading any generators
  • users can define a ~/generate/config.json file, with any global options/preferences. the path to this file will be customizable
  • users can define a ~/generate/generate-foo/config.js file for every generator, which would be lazily loaded directly prior to running generate-foo
  • users can define a ~/generate/generate-foo/config.json file, with options/preferences to be used every time generate-foo is run
  • users can define custom templates for generate-foo in the ~/generate/generate-foo/templates directory

also discussed here: generate/generate-dest#1 (comment)

Unexpected token ...

Whatever I am doing, I always get the following error message (using node 4.4.5):

/Users/xxx/.nvm/versions/node/v4.4.5/lib/node_modules/generate/lib/utils.js:31
      .apply(console, [utils.log[color](msg), ...rest]);
                                              ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)

I installed generate globally, did the same for generate-node, then did a $ gen node:mit ...

Any ideas, am I missing something?

Regards
Stefan

dependency tree

to help users with debugging, let's create a visual dependency tree with "major" dependencies, with comments about what each one does. Not sure how to approach this yet, but i think it would help

Can't use global generator, which has been installed using `pnpm`

I saw some similar issues, but I think this is different.

I was using npm for a long while (and the package did work) and relatively recently I've watched about how cool pnpm is and switched to it. It can sometime give errors when npm won't, but these are rare cases AFAIK. And this is probably one of those rare cases.

To test the issue, install pnpm and run pnpm add -g generate generate-license. Then gen license:

[19:42:33] starting generate
[19:42:33] ✔ running tasks: [ 'license' ]
Error: Cannot find generator: "license" in "/tmp"
    at Generate.<anonymous> (/home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/base-generators/index.js:499:18)
    at iterate (/home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/async-each-series/index.js:8:5)
    at module.exports (/home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/async-each-series/index.js:20:3)
    at Generate.generate (/home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/base-generators/index.js:492:15)
    at /home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/base-generators/index.js:475:18
    at iterate (/home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/async-each-series/index.js:8:5)
    at module.exports (/home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/async-each-series/index.js:20:3)
    at Generate.generate (/home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/base-generators/index.js:474:24)
    at Generate.generate (/home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/base-generators/index.js:463:23)
    at /home/user/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/generate/bin/generate.js:117:11

And as I found in similar issues you can directly use generator.js of the package that you want to use (generate-license), therefore the next command works as expected:

gen ~/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/generate-license/generator.js

Versions:

pnpm 7.26.2
generate 0.14.0
generate-license 1.0.0

Why and when `app.base.cache.data.name` is overriden by generate ?

Why and when app.base.cache.data.name and app.base.data(name) are overriden by generate ?

I'm developing a generator that:

  • use app.ask() to ask for data but not for name
  • set manually app.base.data({name}) in function of other user answers once it get these answers
  • use <%= name > in some templates to be rendered

I don't understand why after some template rendering (performed in some dedicated tasks), app.base.cache.data.name is reset to the cwd, overriding the manual value it put onto.

The consequence is some templates are rendered with the good value, whereas some other are filled with the cwd.

But, if FIRST I ask for name, i.e.:

app.question('name', opts)
app.ask(['name'], ({name}) => app.base.data({name}))`

Then app.base.cache.data.name neither app.base.data(name) is not overridden

Do you see what I mean? and why and how it behaves like that ?

More generally, I have some difficulties to understand the what, why and how of:

  • app.data
  • app.base.data
  • app.data.cache
  • app.base.data.cache
  • app.cache
  • app.cache.data

And their interactions with app.ask() or app.question() and app.choices()...

Can you brief me about that please ?

roadmap

I'd like to see the following on a formal roadmap (feedback, suggestions, ideas, requests, are all very welcome!):

  • improve prompts: This is a top priority. Node.js needs a fast, pluggable prompt library that isn't bloated and dog slow. We might have some ideas here :)
  • persisted data this needs to be easier and more consistent. Generate broke new ground by supporting chained generators (which means you can run multiple generators in a row from the command line, resulting in an experience that feels like one generator). While awesome, it introduces challenges regarding how data and state are managed from one generator to the next during prompts. Each generator has its own instance of generate, along with its own options, data, and so on. Generate also exposes a special "base" instance, on the app.base property, which can be used for shared data. This has turned out to be a really nice solution (since, after all, generators are used for scaffolding out projects, and not serving up web pages or apps etc). But we still have some rough edges around how "hints" are displayed and answers are pre-populated from successive prompts from multiple generators.
  • docs: we know this is a problem with Verb, Assemble and Generate, but we're working on docs for all three and will be releasing them soon, along with new websites and resources for finding plugins, and more

TBC...

Using generate inside of modules?

I'm collaborating on this project called cordlr and I just thought of an interesting idea.

We are making this cordlr setup command so it prompts the user for data and then creates some files and possibly also would install dependencies.

I was thinking about how it would be cool if there was a minimal version of generate I could use as a dependency just to make those mechanisms easier, for prompting, creating of the files, install dependencies, and whatever else.

I would normally suggest people to just use generate instead, but this has audience for not just programmers and idk if everyone would want to jump around to different tools. So, it would be cool to use this as a library.

The command line will also do other things that I think generate could be useful for. We might also use base in other areas for our plugins too, so it would look normal.

Windows: generate is hanging out

generate is hanging out when there's no package.json file in the current directory.

C:\Users\Aurelien\Documents\GitHub                   
λ mkdir test                                         

C:\Users\Aurelien\Documents\GitHub                   
λ cd test                                            

C:\Users\Aurelien\Documents\GitHub\test              
λ dir                                                
 Volume in drive C is Windows8_OS                    
 Volume Serial Number is FC40-CE9D                   

 Directory of C:\Users\Aurelien\Documents\GitHub\test

07/17/2016  02:02 PM    <DIR>          .             
07/17/2016  02:02 PM    <DIR>          ..            
               0 File(s)              0 bytes        
               2 Dir(s)  81,036,419,072 bytes free   

C:\Users\Aurelien\Documents\GitHub\test              
λ gen help                                           
[14:03:04] starting generate                         
[14:03:04] √ running tasks: [ 'defaults:help' ]      

Can't run the generator that's installed globally

I can't run a globally installed generator:

npm install -g generate generate-gitignore
gen gitignore

Error reported suggests the generator can't be found:

C:\temp\> gen gitignore
[13:56:05] starting generate
[13:56:06] √ running tasks: [ 'gitignore' ]
Error: Cannot find generator: "gitignore" in "C:\temp"
. . .

Note that when generate:gitignore is installed locally it works, so I'm guessing the problem is on the "generate" side.

gen -V
generate v0.14.0

npm -v
5.6.0

node -v
v8.11.1

Finally, how can customize the templates?

I'm totally lost already. :D The docs on the support/templates/customization only says "if you wanna cutomize more that single file, use scaffolds" where "scaffolds" is link to support/templates/.

Anyway. What you use currently with latest updates? How should override templates used by generate-project for example? Should I set them in ~/generate/project/templates or ~/generate/templates, or to ~/templates how it is said on generate-projects docs folder (i believe? it was before few minutes but..)?

I wanna start update everything this night and wanna start using verb, generate and update completely. 'Cuz I need tons of updates for last months and it is complete hell already, because I dont have this time these months. I have much things to push, and start working on and am excited to do them; and i dont have the time and willing to deal with such stuff. And actually that's the reason why I didn't have contribs recently - from 4900 to 3200... Nevermind.

You know, i'm The Unlucky guy :D that always have some fails using your libs ahahha, jk (some sort).

Use XDG base directories for cache/data?

While cleaning up, I see the folder ~/.data-store being used to store what seems to be just some cache.

Is there a reason XDG_CACHE_HOME or XDG_USER_DATA or their defaults (~/.cache and ~/.local/share) are not being used here? I have a lot of folders in my home directory I wish weren't there.

I can try and pull request this (maybe on data-store if needed, and then here) if it is an idea that sounds good to add. Maybe also with some Windows equivalents.

feature: help

Instead of automatically displaying a help menu, we should display a prompt to ask the user what they want to do.

  • install a generator
  • run a generator
  • list generators
  • update generators
  • help

Path must be a string. Received null

Generate Version: v0.11.2
Node Version: v6.4.0

After running gen project license, I received this error:

[�[90m04:03:13�[39m] starting generate
[�[90m04:03:13�[39m] �[32m✔�[39m �[32mrunning tasks:�[39m [ 'project', 'license' ]
path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received null
    at assertPath (path.js:7:11)
    at Object.resolve (path.js:1148:7)
    at Function.resolve (/home/sean/.npm-global/lib/node_modules/generate-project/node_modules/parse-git-config/index.js:107:15)
    at Function.parseSync [as sync] (/home/sean/.npm-global/lib/node_modules/generate-project/node_modules/parse-git-config/index.js:78:24)
    at Schema.module.exports (/home/sean/.npm-global/lib/node_modules/generate-project/node_modules/expand-pkg/lib/expanders/git.js:13:36)
    at Schema.normalizeField (/home/sean/.npm-global/lib/node_modules/generate-project/node_modules/map-schema/index.js:557:16)
    at Schema.update (/home/sean/.npm-global/lib/node_modules/generate-project/node_modules/map-schema/index.js:246:8)
    at Schema.module.exports (/home/sean/.npm-global/lib/node_modules/generate-project/node_modules/expand-pkg/lib/expanders/owner.js:14:10)
    at Schema.normalizeField (/home/sean/.npm-global/lib/node_modules/generate-project/node_modules/map-schema/index.js:557:16)
    at Schema.normalize (/home/sean/.npm-global/lib/node_modules/generate-project/node_modules/map-schema/index.js:497:27)

Asciinema: http://asciinema.org/a/8291tcxfnt46fok40dx5mus4z

Broken links in github page

There are some broken links in github page

  • 'Visit the getting started guide to learn more.' there is a link to empty repository
  • 'See the Best Practices Guide for advice on naming tasks.' I end up with Github's 404 page

bug: the reverse of inverse flags should be set on options

When --nofoo is set, it adds nofoo: true to the options. foo: false should also be added to the options. I thought yargs-parser did this but I might need to set an option for it. I think the best solution is to ensure this is done regardless of the args parser used.

proposed refactor of data handling

This is related to the data bullet in #35.

For the first time in all of my node.js projects, globals are looking like the most appropriate solution. Given that generators are run via command line to scaffold out a new project, versus running a server for a live application or something. In a single session, generate can chain generators and, ideally (and optionally), prevent the same prompt from being presented multiple times by:

  1. caching answers/data throughout the session, and
  2. making this "answer cache" available to all generators, allowing implementors to choose whether or not they want to make use of it. This should be a choice. Implementors can listen (or not) to feedback from users to decide whether or not this makes sense for their generator.

We've tried a few solutions to make sure the data from prompts is always available to all generators, but it hasn't been easy - especially since the code is written to ensure that generators have their own instance (and do not share state). The need for a session answer-cache that is available to all generators consistently seems like as good of a use case for globals as we're likely ever going to have.

Assuming others don't find this completely distasteful, here is how I propose we do it:

  • store the data on a unique namespace on global, like SOME_LONG_ANSWER_CACHE_NAME
  • provide methods for getting and setting, like app.global.set(), app.global.get() etc. These would of course also support object paths, like app.global.get('foo.bar.baz'). We could also have a .merge() method or something, so that data from generators could be stored separately until it's needed, at which time it would be cloned and merged.

I'm open to any alternatives, opinions, suggestions or pushback...

Any thoughts @doowb @stefanwalther @tunnckoCore @dawsonbotsford or others?

What's the state of custom templates?

Hi there 👋

We were talking about that before, but didn't remember where it was and what issues there had. But didn't follow what's up for awhile, so directly asking: how can we customize the templates of the generators, can we? Where to place them, in what structure?

I have personal streaming scaffolder, which is enough in most cases, but probably i want to start using Generate and i can't until i can customize the templates, because don't want to stick to the default ones. With verb it's easy, because it's just an option "layout": "empty", so that's why integrated it and using it for last year (or probably more; we waiting v0.9 finally ;p).

I'm going through very big changes around my profile and packages, so whole month i'll update all of my ~350 packages and will move most of them to @tunnckoCore organization. I want to unify everything.

ideas

I was going to suggest adding some of these to verb, but I think they belong in generate (as generate plugins)

  • generate-browserify: adds npm run browserify to package.json with default (or custom) browserify command
  • generate-coveralls: adds npm run coveralls to package.json with default (or custom) coveralls command
  • generate-mocha: adds npm test to package.json with default (or custom) mocha command, creates test folder with test.js file. optionally pass additional arg to create a named test/{name}.js test file.

Just some ideas on standalone plugins that don't create entire projects, but just modify existing functionality to add these things faster.

generate-example not working as intended

Hi there!

I've been recommended by my friend Jamen Marzonie to help contribute to this project. I started tinkering with it and came across an issue right off the bat.

I'm tried running npm install --global generate-example followed by gen example and got the following in return:

[21:27:15] starting generate
[21:27:15] ✔ running tasks: [ 'example' ]
[21:27:15] starting example
[21:27:15] starting example:default task
[21:27:15] starting example:example task
[21:27:16] finished example:example task 182ms
[21:27:16] finished example:default task 184ms
[21:27:16] finished example ✔ 195ms

Although it says the building the example was successful, when I check example.txt, the contents foo aren't added. How can I go about fixing this?

built-in "generators" / commands not work (as expected?)

% ❯ gen --version                                                                                          July 09, 02:08:24
[02:08:26] starting generate
Update v0.8.2

(and notice the "Update" instead of "Generate", but nevermind haha - THIS IS THE BIGGEST BUG MAAAN, jk)

Before few days when i was reviewing the things again there were (if i remember correctly) separate files for the init, help, new and etc, and they were (in lib/commands/ folder) called "built-in generators" and they looked like any generator which make sense. (btw, just noticing that lib/ itself is generator [haha that's freakin' fun ;d] and you started porting commands there? )

The new "generator"/command, works but do not adds the generator.js file. Maybe that's because there's no templates dir in this repo (according to lib/generator.js#L36-L43) - if that's the reason, okey, but why it not errors may be the next question.

Nevermind, i'm not rushing you, just digging around as usual in the late night :) In anyway, the work is awesome!

Use generate as API?

So Iv'e got a generator.js file working fine locally using a global command when I'm in the same directory as the file.

However I'm wanting to also trigger it via another node script without having to call the commandline.

The docs said it can be used via both cli and api, but I see no info anywhere on how to trigger a generator.

cli: liftoff

Implement liftoff for cli once the API is mostly complete

idea: generate-blog (or -simple-blog)

Could be interesting. Just super simple working example with homepage, blogpost page and about. Not so much, not using assemble.

I'll do try to do it to play with the generate et al. Then will use assemble(-core) if needed.

edit: or if i remember, there was such example somewhere (maybe in templates repo?), hm... it was while ago

Error: no writecb in Transform class

image

Error: no writecb in Transform class                                                       
    at afterTransform (/home/sean/.yarn-config/global/node_modules/through2/node_modules/re
adable-stream/lib/_stream_transform.js:74:40)                                              
    at TransformState.afterTransform (/home/sean/.yarn-config/global/node_modules/through2/
node_modules/readable-stream/lib/_stream_transform.js:58:12)                               
    at handleError (/home/sean/.yarn-config/global/node_modules/assemble-render-file/index.
js:109:3)                                                                                  
    at /home/sean/.yarn-config/global/node_modules/assemble-render-file/index.js:84:15     
    at /home/sean/.yarn-config/global/node_modules/base-routes/index.js:161:11             
    at /home/sean/.yarn-config/global/node_modules/base-routes/index.js:90:25              
    at /home/sean/.yarn-config/global/node_modules/en-route/lib/index.js:576:15            
    at next (/home/sean/.yarn-config/global/node_modules/en-route/lib/index.js:161:14)     
    at next (/home/sean/.yarn-config/global/node_modules/en-route/lib/route.js:65:14)      
    at Layer.handleFile (/home/sean/.yarn-config/global/node_modules/en-route/lib/layer.js:
78:5)   

It happens after entering all of my information as seen in the asciinema above.

add `generate` questions to stackoverflow

We should start adding simple generate questions to stackoverflow that we can answer, to provide users with a way to find searchable help and feedback.

SO actively encourages simple, high quality code questions like this. It would be great if someone could just start asking basic questions for @doowb and I to answer. feel free to link them here if anyone wants to do this

bug: license field

I haven't had a chance to look into this yet, so I'm creating the issue here, but this is a recent bug that I'm pretty sure I caused and it's most likely a generate-defaults or generate-package issue.

the license variable in templates is being mutated somewhere. Please double check your rendered package.json files until I get this fixed. Again, I'm pretty sure I know where the issue is, but I might not have a chance to fix until tomorrow.

How to run a global generator from a generator repository ?

Saying we are in a repository generate-mygenerator.
Thus we have a generator.js file in the root directory.

What if I want to run gen gh-repo ?

Have I to rename generator.js to generator.js.wait then rename it back after the generator is done ?

cli feature idea: list generator tasks / help and list available generators

Would be good to be able to list generator tasks - not all, but maybe that are not silenced? only the main, without the aliases. Also generator help task if exist.

Something like that

# list generate-project tasks
$ gen project --tasks

# list generate-node tasks
$ gen node --tasks
$ gen node --list-tasks?
$ gen node --list?

# list 
$ gen foo bar --tasks
$ gen foo bar baz qux --tasks

Hm. So, maybe would make more sense if I rephrase it to per generator options.

And just popup one more thing in my mind - list available generators (globally/locally installed).

Maybe something like

# list globally installed generators
$ gen --list

# list locally installed
$ gen --list-local

# list sub-generators of `foo` generator
$ gen foo --list
$ gen foo --list-local

# list tasks of `foo` generator
$ gen foo --tasks

# list sub-sub-sub-generator
$ gen foo bar baz --list

edit: Or.. because this looks a bit complex. maybe better option can be to list them all through core generate command. Or maybe even in help command (of course only the top generators, not their sub-generators) like:

$ gen list
Globally installed generators 

Path: /home/user/path/to/global/location
List: foo, bar, project
dest
node
mocha
gitignore

$ gen list-local
Locally installed generators

Path: ~/path/to/cwd/location
List: meow, car, train

$ gen list-tasks [generator-name]
# or
$ gen tasks [generator-name]

what generators do we need?

Generate is so much easier to use and maintain than yeoman generators, and it's far more powerful than slush, it's just a matter of time before users start migrating.

  • What yeoman generators should we start porting over?
  • What slush generators should we start porting over (note that generate can actually run yeoman slush generators. @doowb created generate-slush but hasn't open sourced it for some reason ;)

edit: and we'd love for users to create your own generators. if you create a generator, please let us know! (and make sure you add the generategenerator keyword to package.json, so it's uniquely identified in npm keyword searches!)

question: Why is needed that templates renaming? And second...

Talking about docs/recipe/renaming-templates.md (and renaming-files.md) (the _dotfile, and $package.json thingy)? Can't they be just as is and generate to just copy them - renaming only if needed (through api/front-matter).

And second. Is it normal to want index.js/generator.js when overriding templates using ~/generate/generator-name/templates? I think it can be a lil bit more comfortable to just be able to have the ... templates dir and execute it as normal generator but use these templates. All that will means that index.js/generator.js won't be required to override templates.

consider changing `each` to reduce

we maybe should consider changing to reduce so we can return streams, currently the flow-control methods (each and eachSeries) don't.

change generator signature to match plugin signature?

with minor changes, I think we can make generators and plugins interchangeable. In effect, this means that generators are nothing more than plugins that are registered by name (and can be invoked by name).

We would probably want to updated base-plugins to pass the base instance as the second argument to plugins. example:

function plugin(app, base) {
  // do plugin stuff
}
this.run(plugin(app, base));

thoughts? cc @doowb

Windows!

Hello guys,

I can't use generate on windows 8, only version work, am I missing something ?

C:\Users\Aurelien\Documents\GitHub
λ generate cwd
[11:44:26] starting generate
[11:44:26] changing cwd to ~/Documents\GitHub\C.UsersAurelienDocumentsGitHub
[11:44:26] √ running tasks: [ 'cwd' ]
path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
C:\Users\Aurelien\Documents\GitHub
λ generate init
[11:56:43] starting generate
[11:56:44] changing cwd to ~/Documents\GitHub\C.UsersAurelienDocumentsGitHub
[11:56:44] √ running tasks: [ 'init' ]
Error: Cannot find generator: "init" in "C:\Users\Aurelien\Documents\GitHub"

Versions:

C:\Users\Aurelien\Documents\GitHub
λ generate version
[11:56:16] starting generate
[11:56:17] changing cwd to ~/Documents\GitHub\C.UsersAurelienDocumentsGitHub
generate v0.8.7

C:\Users\Aurelien\Documents\GitHub
λ node --version
v6.2.2

C:\Users\Aurelien\Documents\GitHub
λ npm --version
3.10.2

C:\Users\Aurelien\Documents\GitHub
λ ver
Microsoft Windows [Version 6.3.9600]

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.