AdamBrodzinski / meteor-generate

Meteor Generate - A Rails Inspired File Generator for Meteor
MIT License
65 stars 2 forks source link

Installation issues #9

Closed gb96 closed 9 years ago

gb96 commented 9 years ago

Might want to better document how to intall... https://www.npmjs.com/package/meteor-generate says npm install meteor-generate however I doubt anyone would really ever want to install meteor-generate as a local package. I suspect more likely people should install it a system-global tool with something like sudo install meteor-generate --global

After I installed and tried to run mgen create myproject I got the following error:

module.js:338
    throw err;
          ^
Error: Cannot find module 'coffee-script/register'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/meteor-generate/bin/mgen:4:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)

Of course this was easily fixed by first running sudo npm install coffee-script --global and then repeating mgen create myproject. However I guess this means your package.json is missing a dependency declaration for coffee-script? Had a quick look and looks like coffee-script is there, under "devDependencies". Perhaps it needs to go under "dependencies" instead?

Anyhow, great tool, looking forward to creating some cool Meteor projects with it! :)

AdamBrodzinski commented 9 years ago

Hey thanks @gb96 ! I just pushed a new built to NPM, tested it by deleting my global coffeescript and updated the readme. :beers:

Let me know how you like it. You may want to checkout the models branch which adds models of course but also adds user-accounts with new project so that the model can check for security. The syntax for this currently is mgen model post and it will insert foo and bar fields that need to be updated. Eventually the syntax should be something like mgen model post name:string desc:string so that it generates the fields and checks for you.

Here's a template for the models which gets inserted in both/models/post.js. This helps keep database calls abstracted and out of your click handlers.

Model Template

Also i'm working on a draft for basic model tests to ensure they're working correctly. This would be generated and inserted into tests/jasmine/server/integration/models/postSpec.js (unfortunate path structure but works with fuzzy search pretty well).

Generated Model Specs Draft