Closed chanced closed 10 years ago
This works fine for me. Are you sure you typed the sub generator exactly as you wrote it (yo ng-component:directive something)?
Yea.
$ yo ng-component:directive something
You're using the fantastic NgComponent generator.
Initializing yo-rc.json configuration.
Type `yo ng-component --help` for a list of available generators.
I'll generate a new project in a few and try again when I get to a breaking point.
I'm experiencing the same issue. I am going to try soon on another dev machine with fresh installs.
I also feel there's a lack of documentation here. I've spent some 30 minutes trying to fish the right information out of the sources available, with little success.
I've looked in the generators folder in the angular-fullstack-generator, and the readme there said those are only deprecated generators. There seems to be little notes on the ng-component features, the readme says little, then when running ng-component --help only a few generators are listed, which don't work, just as explained in this ticket by chanced. I know it's open source, and I'd love to help, ( which is why i'm attempting to test ), but so far it's been tough.
The readme file for angular-generator-fullstack, in the 2.0.0 branch, is also outdated (listing the deprecated sub generators)
A bit tough so far, but i'll keep on digging through it.
so to confirm, here is my console output when trying to use ng-component :
$ yo ng-component --help
Usage:
yo ng-component [options]
Options:
-h, --help # Print generator's options and usage Default: false
Description:
Generators for AngularJS components
Available Generators:
yo ng-component:route [name]
yo ng-component:directive [name]
yo ng-component:service [name]
yo ng-component:factory [name]
yo ng-component:filter [name]
$ yo ng-component:route todo
You're using the fantastic NgComponent generator.
Initializing yo-rc.json configuration.
Type `yo ng-component --help` for a list of available generators.
First off it's confusing that when running --help, only a few options are listed. What about controllers ? views ? server related subgenerators like routes, models, controllers ?
Secondly ... I can't use the generators. any attempt gives me that friendly message which does nothing
Also confusing is that the message says yo-rc.json , when in fact the file is .yo-rc.json
Maybe it's relevant to mention that i'm not using a ng-component snapshot, instead i've installed it using :
npm install -g generator-ng-component
@kosz I understand your frustration with the lack of documentation, and I've been holding off release until I can get it written up, and clean out the outdated/incorrect information.
So the reason the generators folder in angular fullstack only contains deprecated generators is because I didn't want those commands to just fail with no explanation. For yeoman to register those deprecated generators, they need to be either in the root of the app, or in the generators folder. I decided to put all deprecated sub generators in the generators folder, and leave all working generators in the root of the app.
Have you tried running the ng-component sub-generators through angular-fullstack? That's how they're intended to be used, i.e, yo angular-fullstack:route blah
.
@DaftMonk i'm not really frustrated about the documentation, i can understand since you're working on a new release, but i just wanted to point out that it makes testing of 2.0 difficult, which is what i am trying to do.
In fact the lack of the documentation seems not to be a problem here at all, since based on what you just said above, the same sub generators commands should work. The problem is that for some of us they don't work right now.
Tried everything so far. Last pull was 10 minutes ago.
newerapp$ yo angular-fullstack:route blah
You're using the fantastic NgComponent generator.
Initializing yo-rc.json configuration.
Type `yo ng-component --help` for a list of available generators.
An update:
I was able to get past this problem by running npm link from a freshly cloned generator-ng-component project. Once I did that I ran into the same issue described here: https://github.com/DaftMonk/generator-ng-component/issues/1
Thanks for the feedback so far kosz! I will see if I can reproduce this myself.
Yep, started getting this issue when I tried using the npm version of ng-component rather than the linked version. I'm not sure why its happening yet, but now I can start debugging it. :)
Pushed a new version of the 2.0 branch that fixes this.
I'm not able to generate anything beyond the initialization.
For example, if I run
yo ng-component:directive something
then the following output occurs:It also changes my
.yo-rc.json
fromto
Info
yo version
:1.2.0
$NODE_PATH
:/Users/chance/bin:/usr/local/bin:/Users/chance/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
console.log(process.platform, process.versions)
:Gruntfile