angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

Create new route, and create new controller generators produce no files #313

Closed sethlesky closed 10 years ago

sethlesky commented 10 years ago

In the root of the project directory I'm running:

yo angular-fullstack:controller nameOfController yo angular-fullstack:route nameOfRoute

Neither command produces any files for me, although angular-fullstack:endpoint works fine.

edit: On a fresh install those generators do work. I'm not sure what changed in my project structure to break that functionality.

edit2: Furthermore it also no location suggests a location for the file like (client/app/) for those generators

JaKXz commented 10 years ago

@sethlesky could you clarify what you mean in edit2?

sethlesky commented 10 years ago

@JaKXz it doesn't suggest a location for the file like (client/app) when the generator is run.

Puigcerber commented 10 years ago

Hi @sethlesky!

You need the .yo-rc.json file so you can copy it to the root of your project directory from the fresh installation.

Cheers.

spencercarnage commented 10 years ago

I'm having the same problem with creating routes in that it doesn't generate any files. I'm not really sure what

You need the .yo-rc.json file so you can copy it to the root of your project directory from the fresh installation"

means but I do have the .yo-rc.json in my project directory and still no files are generated. And yes, the first prompt does not suggest a route for you, such as client/app/test, like you would expect.

Other than that, I'm loving what I'm seeing. Great job!

DaftMonk commented 10 years ago

Could you paste your .yo-rc file here?

spencercarnage commented 10 years ago
{
  "generator-angular-fullstack": {
    "insertRoutes": true,
    "registerRoutesFile": "server/routes.js",
    "routesNeedle": "// Insert routes below",
    "insertSockets": true,
    "registerSocketsFile": "server/config/socketio.js",
    "socketsNeedle": "// Insert sockets below",
    "filters": {
      "js": true,
      "jade": true,
      "sass": true,
      "uirouter": true,
      "socketio": true,
      "mongoose": true,
      "auth": true,
      "googleAuth": true,
      "facebookAuth": true,
      "twitterAuth": true
    }
  }
}
DaftMonk commented 10 years ago

Ok you're missing the ng-component configuration, which should be something like this:

{
  ...

  "generator-ng-component": {
    "routeDirectory": "client/app/",
    "directiveDirectory": "client/app/",
    "filterDirectory": "client/app/",
    "serviceDirectory": "client/app/",
    "basePath": "client",
    "filters": [
      "uirouter"
    ],
    "extensions": [
      "coffee",
      "jade",
      "less"
    ]
  }
}

What version of yo are you using? npm list -g yo

spencercarnage commented 10 years ago

@DaftMonk That fixed the problem. Thanks.

I just did a fresh install an hour ago. Is the lack of the generator-ng-component from my .yo-rc.json due to some input I gave to the Yeoman prompts when building an app? Shouldn't the generator-ng-component always be in the generated .yo-rc.json?

spencercarnage commented 10 years ago

What version of yo are you using? npm list -g yo

/usr/local/lib
├─┬ generator-angular-fullstack@2.0.3
│ └── yo@1.1.2 
└── yo@1.2.0 
DaftMonk commented 10 years ago

Yes that should always be generated. The only reason I can think that it wouldn't have been was that yo was on the wrong version when the project was originally scaffolded. But you do have the correct version right now....

So if you generate a new project does it have the generator-ng-component configuration?

sethlesky commented 10 years ago

@DaftMonk This was exactly the issue I was having. The original project was scaffolded with an older version of yo, and was missing 'generator-ng-component' in .yo-rc.json. After coping over the new .yo-rc-json generators are working. Thanks.

spencercarnage commented 10 years ago

Generated a new project and generator-ng-component was in the configuration. I too was having an issue with yeoman generator that required me to upgrade to the newest version.