zladuric / mongoose-crud-scaffolder

MIT License
18 stars 6 forks source link

Lots of bugs #1

Open jorr opened 9 years ago

jorr commented 9 years ago

Hi,

this is really cool and i wasn't able to find anything like it either. however, did you ever test it?

  1. it doesn't list its dependencies (express, mongoose, ejs, to name a few)
  2. req.accepts('json') is always true when accessed from the browser. this is a wrong check.
  3. the controllers pass wrong local variables (e.g. "users" instead of "list" on the index method)
  4. EJS doesn't accept if (flash) -- needs if (locals.flash) or if (typeof(flash) !== 'undefined')
  5. the for loop in the index view is wrong - it doesn't define the loop variable. either should change to users[i][property] or should declare user = users[i]

just off the top of my head - it's a cool project but could really use some testing :)

zladuric commented 9 years ago

Uh, I didn't think anybody would ever look at this repo :) Thanks for the comments, I'll see what I can do.

dinooz commented 9 years ago

I like the simplicity of the dependency nightmare...at first just use the pluralize....

However agree with jorr, perhaps is good idea to start the project with some npm init... this will be able to create the first npm file with the ability to manage dependencies easily.

Also will be good idea to have a simple web server for quick testing. currenlty just saw the controllers,models and views folder/files with the users.

I think one of the most important parts of this scaffold will be the ability to use an api to work with relationships between models. That will be awesome in the generation not just of the models, but also the the handle of their interaction.

Validations will be a nice thing to have within the generator.

So starting with the basic npm init, then running npm install and ready to go to start creating your app.

I have the idea to have a simple Text file that have the basic skeleton of what needs to be build then can be read and parse directly to the generator. this way people can just share a single text file and running the generator will read this file and create all the magic of the code, relationships, validations etc all together in one place.

zladuric commented 9 years ago

Awesome, if you have time to move this forward, I'll help out as much as I want. This project is a bit old for me.

At the time it was used in a Express/Mongoose skeleton app that I've used for my projects, so I had no need for npm init and I only wanted to get the boilerplate stuff out there fast. But I can see that this could grow into something more useful, so if there are specific ideas, let's open them one issue at a time and see if I can do some of them (and of course, I'll take contributions).

traynor commented 9 years ago

Yeah, it is really cool idea to automate this, since it sometimes comes down to a lot of copy/pasting, with only changing a few routes and model names :)

Also, great suggestions and ideas for further development

I played with it a little, tried fixing those bugs for starters... maybe even created a few :)