Giter Site home page Giter Site logo

generator-meanjs's Introduction

MEAN.JS Logo

Build Status Dependencies Status

MEAN.JS is a full-stack JavaScript open-source solution, which provides a solid starting point for MongoDB, Node.js, Express, and AngularJS based applications. The idea is to solve the common issues with connecting those frameworks, build a robust framework to support daily development needs, and help developers use better practices while working with popular JavaScript components.

Overview

One of the most frequently asked features from MEAN users is a way to scaffold their applications. As we looked for a way to help the community build and deploy production level MEAN applications, we decided to go with a Yeoman generator. Yeoman generators provides a powerful, easy to maintain, and open solution for scaffolding applications.

So, we set out to work on the features we thought every developer needs, and we are proud to present the official MEAN.JS Yeoman generator. It includes a set of simple tools you can use to make your MEAN application development easier and way more fun.

Getting Started

Before you begin make sure you have the yo scaffolding tool installed (As it is part of the Yeoman tool set you might have installed it before). To globally install yo you will need to use npm:

$ npm install -g yo

Note: Your user might not have the permissions to install package globally, so use a super user or sudo.

Once you have yo installed, you will need to install the MEAN.JS generator as well:

$ npm install -g generator-meanjs

You are now ready to get started with the MEAN.JS generator. The generator will help you create a MEAN.JS application.

Generators

Available generators:

Note: Sub-generators are to be run from the root directory of your app. The main generator will create your project folder for you.

Application Generator

The application generator will help you create a fresh copy of a MEAN.JS application in your working folder. To create your MEAN application, navigate to a new project folder, and then use yo to generate your application:

$ yo meanjs

The generator will ask you a few questions about your new application and will generate it for you. When the installation process is over, you will be able to use grunt to run your new MEAN application:

$ grunt

Currently there are no sub generators for the current version of the MEAN.js project, but they are under development and will be coming soon. Feel free to create one and submit a pull request!

License

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

generator-meanjs's People

Contributors

amoshaviv avatar andresgottlieb avatar apmats avatar bagnier avatar bricejlin avatar codydaig avatar colmprunty avatar donohutcheon avatar fereloper avatar ilanbiala avatar keshavos avatar luofan189 avatar matthewrankin avatar netusco avatar pun4drunk avatar revdave33 avatar rschwabco avatar saintwilbur avatar samof76 avatar therobinkim avatar tonymtz avatar undeadbanegithub avatar vepasto 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  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

generator-meanjs's Issues

Barebones setup generator

I can see how the crud-module generator works, and the meanjs setup generator works. However, I can see it being a little bit of a pain to want to start using the generator, use yo meanjs, then delete a lot of files and directories, then starting over with the crud-module generator and all the other sub-generators to make a new app.

I can see the value of being able to generate the full meanjs example for people to understand how this works, but by using the other generators do we need to make the full example only for people to later undo a lot of the work.

For example, I'm finding it very helpful to sort through the example while understanding the meanjs way of doing things, but on my second and third project using the generator, that might get a bit old. On those projects I just want to setup the barebones structure that can then have all the other generators interact with. I can be working on adding to rather than having to stop and undo what the generator does.

David

Error: yo meanjs

 _-----_
|       |
|--(o)--|   .--------------------------.

---------´ | Welcome to Yeoman, | ( _´U_ ) | ladies and gentlemen! |
/_A\ '__________________________'
| ~ |
**'.
**.'__
´ |° ´ Y

You're using the official MEAN.JS generator.
? What would you like to call your application? firstapp
? How would you describe your application? (Full-Stack JavaScript with MongoDB, ? How would you describe your application? Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js
? How would you describe your application in comma seperated key words? (MongoDB? How would you describe your application in comma seperated key words? MongoDB, Express, AngularJS, Node.js
? What is your company/author name? sapna
? Would you like to generate the article example CRUD module? No
? Which AngularJS modules would you like to include? ngCookies, ngAnimate, ngTouch, ngSanitize
create app/views/404.server.view.html
create app/views/500.server.view.html
create app/views/index.server.view.html
create app/views/layout.server.view.html
create app/views/templates/reset-password-confirm-email.server.view.html
create app/views/templates/reset-password-email.server.view.html
create app/controllers/core.server.controller.js
create app/controllers/users.server.controller.js
create app/controllers/errors.server.controller.js
create app/controllers/users/users.authentication.server.controller.js
create app/controllers/users/users.authorization.server.controller.js
create app/controllers/users/users.password.server.controller.js
create app/controllers/users/users.profile.server.controller.js
create app/models/user.server.model.js
create app/routes/core.server.routes.js
create app/routes/users.server.routes.js
create app/tests/user.server.model.test.js
create public/application.js
create public/humans.txt
create public/robots.txt
create public/modules/users/config/users.client.config.js
create public/modules/users/config/users.client.routes.js
create public/modules/users/controllers/authentication.client.controller.js
create public/modules/users/controllers/password.client.controller.js
create public/modules/users/controllers/settings.client.controller.js
create public/modules/users/css/users.css
create public/modules/users/img/buttons/facebook.png
create public/modules/users/img/buttons/github.png
create public/modules/users/img/buttons/google.png
create public/modules/users/img/buttons/linkedin.png
create public/modules/users/img/buttons/twitter.png
create public/modules/users/services/authentication.client.service.js
create public/modules/users/services/users.client.service.js
create public/modules/users/tests/authentication.client.controller.test.js
create public/modules/users/users.client.module.js
create public/modules/users/views/authentication/signin.client.view.html
create public/modules/users/views/authentication/signup.client.view.html
create public/modules/users/views/password/forgot-password.client.view.html
create public/modules/users/views/password/reset-password-invalid.client.view.html
create public/modules/users/views/password/reset-password-success.client.view.html
create public/modules/users/views/password/reset-password.client.view.html
create public/modules/users/views/settings/change-password.client.view.html
create public/modules/users/views/settings/edit-profile.client.view.html
create public/modules/users/views/settings/social-accounts.client.view.html
create public/modules/core/config/core.client.routes.js
create public/modules/core/controllers/header.client.controller.js
create public/modules/core/controllers/home.client.controller.js
create public/modules/core/css/core.css
create public/modules/core/img/brand/favicon.ico
create public/modules/core/img/brand/logo.png
create public/modules/core/img/loaders/loader.gif
create public/modules/core/services/menus.client.service.js
create public/modules/core/tests/header.client.controller.test.js
create public/modules/core/tests/home.client.controller.test.js
create public/modules/core/views/home.client.view.html
create public/modules/core/core.client.module.js
create config/strategies/facebook.js
create config/strategies/github.js
create config/strategies/google.js
create config/strategies/linkedin.js
create config/strategies/local.js
create config/strategies/twitter.js
create config/config.js
create config/init.js
create config/express.js
create config/passport.js
create karma.conf.js
create gruntfile.js
create server.js
create Procfile
create fig.yml
create Dockerfile
create generate-ssl-certs.sh
create README.md
create LICENSE.md
create .bowerrc
create .csslintrc
create .editorconfig
create .jshintrc
create .gitignore
create .slugignore
create .travis.yml
create config/env/all.js
create config/env/development.js
create config/env/production.js
create config/env/test.js
create config/env/secure.js
create public/config.js
create public/modules/core/views/header.client.view.html
create package.json
create bower.json
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No license field.
npm WARN peerDependencies The peer dependency grunt@~0.4.1 included from grunt-ng-annotate will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency grunt@~0.4.1 included from grunt-contrib-cssmin will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency grunt@~0.4.0 included from grunt-contrib-csslint will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency grunt@~0.4.2 included from grunt-node-inspector will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency grunt@~0.4.1 included from grunt-nodemon will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency grunt@~0.4.0 included from grunt-contrib-jshint will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency mocha@>=1.20.0 included from grunt-mocha-test will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency grunt@~0.4.0 included from grunt-contrib-uglify will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency [email protected] included from grunt-karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency grunt@~0.4.0 included from grunt-contrib-watch will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN excluding symbolic link build/defs-config.json -> ../defs-config.json
npm WARN optional dep failed, continuing [email protected]

[email protected] install /home/sapna/Project/firstMeanApp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
node install.js

Download already available at /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Extracting tar contents (via spawned process)
Removing /home/sapna/Project/firstMeanApp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1436604951351/phantomjs-1.9.8-linux-x86_64 -> /home/sapna/Project/firstMeanApp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /home/sapna/Project/firstMeanApp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})

[email protected] install /home/sapna/Project/firstMeanApp/node_modules/connect-mongo/node_modules/mongodb/node_modules/kerberos
(node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory /home/sapna/Project/firstMeanApp/node_modules/connect-mongo/node_modules/mongodb/node_modules/kerberos/build' CXX(target) Release/obj.target/kerberos/lib/kerberos.o make: Leaving directory/home/sapna/Project/firstMeanApp/node_modules/connect-mongo/node_modules/mongodb/node_modules/kerberos/build'
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x"} (current: {"node":"0.12.6","npm":"2.13.0"})

[email protected] install /home/sapna/Project/firstMeanApp/node_modules/connect-mongo/node_modules/mongodb/node_modules/bson
(node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory /home/sapna/Project/firstMeanApp/node_modules/connect-mongo/node_modules/mongodb/node_modules/bson/build' CXX(target) Release/obj.target/bson/ext/bson.o SOLINK_MODULE(target) Release/obj.target/bson.node COPY Release/bson.node make: Leaving directory/home/sapna/Project/firstMeanApp/node_modules/connect-mongo/node_modules/mongodb/node_modules/bson/build'

[email protected] install /home/sapna/Project/firstMeanApp/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
(node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory /home/sapna/Project/firstMeanApp/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build' CXX(target) Release/obj.target/kerberos/lib/kerberos.o make: Leaving directory/home/sapna/Project/firstMeanApp/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'

[email protected] install /home/sapna/Project/firstMeanApp/node_modules/mongoose/node_modules/mongodb/node_modules/bson
(node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory /home/sapna/Project/firstMeanApp/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build' CXX(target) Release/obj.target/bson/ext/bson.o SOLINK_MODULE(target) Release/obj.target/bson.node COPY Release/bson.node make: Leaving directory/home/sapna/Project/firstMeanApp/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'

[email protected] preinstall /home/sapna/Project/firstMeanApp/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler

[email protected] preinstall /home/sapna/Project/firstMeanApp/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug

[email protected] install /home/sapna/Project/firstMeanApp/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws
(node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory /home/sapna/Project/firstMeanApp/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws/build' CXX(target) Release/obj.target/bufferutil/src/bufferutil.o SOLINK_MODULE(target) Release/obj.target/bufferutil.node COPY Release/bufferutil.node CXX(target) Release/obj.target/validation/src/validation.o SOLINK_MODULE(target) Release/obj.target/validation.node COPY Release/validation.node make: Leaving directory/home/sapna/Project/firstMeanApp/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws/build'
npm WARN optional dep failed, continuing [email protected]

[email protected] install /home/sapna/Project/firstMeanApp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
(node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory /home/sapna/Project/firstMeanApp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build' CXX(target) Release/obj.target/bufferutil/src/bufferutil.o SOLINK_MODULE(target) Release/obj.target/bufferutil.node COPY Release/bufferutil.node CXX(target) Release/obj.target/validation/src/validation.o SOLINK_MODULE(target) Release/obj.target/validation.node COPY Release/validation.node make: Leaving directory/home/sapna/Project/firstMeanApp/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'

npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.6","npm":"2.13.0"})

[email protected] install /home/sapna/Project/firstMeanApp/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler
node-pre-gyp install --fallback-to-build

[v8-profiler] Success: "/home/sapna/Project/firstMeanApp/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.2.9/node-v14-linux-x64/profiler.node" is installed via remote

[email protected] install /home/sapna/Project/firstMeanApp/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug
node-pre-gyp install --fallback-to-build

[v8-debug] Success: "/home/sapna/Project/firstMeanApp/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v14-linux-x64/debug.node" is installed via remote

[email protected] postinstall /home/sapna/Project/firstMeanApp
bower install --config.interactive=false

bower EACCES EACCES, open '/home/sapna/.cache/bower/registry/bower.herokuapp.com/lookup/angular-mocks_f6200'

Stack trace:
Error: EACCES, open '/home/sapna/.cache/bower/registry/bower.herokuapp.com/lookup/angular-mocks_f6200'
at Error (native)

Console trace:
Trace
at StandardRenderer.error (/home/sapna/Project/firstMeanApp/node_modules/bower/lib/renderers/StandardRenderer.js:82:17)
at Logger. (/home/sapna/Project/firstMeanApp/node_modules/bower/bin/bower:110:22)
at Logger.emit (events.js:107:17)
at Logger.emit (/home/sapna/Project/firstMeanApp/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
at /home/sapna/Project/firstMeanApp/node_modules/bower/lib/commands/index.js:40:20
at _rejected (/home/sapna/Project/firstMeanApp/node_modules/bower/node_modules/q/q.js:797:24)
at /home/sapna/Project/firstMeanApp/node_modules/bower/node_modules/q/q.js:823:30
at Promise.when (/home/sapna/Project/firstMeanApp/node_modules/bower/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch (/home/sapna/Project/firstMeanApp/node_modules/bower/node_modules/q/q.js:741:41)
at /home/sapna/Project/firstMeanApp/node_modules/bower/node_modules/q/q.js:557:44

System info:
Bower version: 1.3.12
Node version: 0.12.6
OS: Linux 3.16.0-30-generic x64

npm ERR! Linux 3.16.0-30-generic
npm ERR! argv "node" "/usr/bin/npm" "install"
npm ERR! node v0.12.6
npm ERR! npm v2.13.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: bower install --config.interactive=false
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'bower install --config.interactive=false'.
npm ERR! This is most likely a problem with the firstapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install --config.interactive=false
npm ERR! You can get their info via:
npm ERR! npm owner ls firstapp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/sapna/Project/firstMeanApp/npm-debug.log

karma:unit is broken

$ grunt karma:unit
Running "karma:unit" (karma) task
ERROR [config]: Invalid config file!
  Error: Cannot find module './env/undefined'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/pk/testMean/config/config.js:14:2)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Using generator only for Client

Your generator is simply amazing. The most complete one with best practice approaches across the entire stack.

Do you think it would be possible to use your generator to create only a client application with angularJS?

Thank you again for the outstanding work.

[minor typo] Malformed url in v0.4 vertical module

I generated a new vertical module using yo meanjs:vertical-module shortcut.

After it ran, line 6 in /modules/shortcuts/client/views/list-shortcuts.client.view.html includes the following href:
data-ng-href="#!/shortcuts/{{shortcut._id}}

Which should be
data-ng-href="/#!/shortcuts/{{shortcut._id}}
otherwise the link won't work.

This is pretty minor, I can make a PR for it.

space and tabs both used for indent

We have mixed of tabs and spaces. I can fix it but would like to know what is the correct/expected style?
I see tabs, 2 spaces, 4 spaces in css, html, and js file. What do we want it to be?

Thanks

The generator does not escape apostrophes in the app description.

This causes a SyntaxError when the app is run because an apostrophe in the description breaks all.js.

meanjs:$ node server.js 

/meanjs/config/env/all.js:6
        description: 'this apostrophe's fault',
                                        ^
SyntaxError: Unexpected identifier
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/meanjs/config/config.js:13:2)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Minor initial setup bug

Hey,

when answering the intro questions, at the question "What is your company/author name?" I instinctively replied LLC "Company name" which corrupted the package.json file because the line "author" contained the string "LLC "Company name"" so npm install failed.

It's not a major thing, it just might throw off new users(such as myself) but the fix was easy enough, I deleted everything generated and started over only this time using single quotes :)

Design Principle: Updating Core files

I am thinking that one of the design principles for the generator, especially as the primary meanjs project continues to strengthen the flexibility of it modularity is that users of the generator should be able to update the core files with minimal impact on their own code. With the use of modules at more levels the developer should be wary about modifying any of the core files so that as bug fixes are pulled and enhancements are there that they can stay up to date on them.

Part of that is using yeoman's config storage mechanism to remember the answers to previous prompts. There also can be warnings of any upgrading issues that go beyond the core (e.g. moving from Express 3 to 4: a pointer to what might need to be updated)

enhancement: articules module should be optional

Hi, I think modules should be optional when generating the project.

When running yo meanjs you should be asked whether you want it or not. Later, as more modules get incorporated we could add a selection option to chose the ones you will use.

What do you think?

New module not working caused by module name

I have yo a new route

yo meanjs:express-model <module-name>

with a name like: "node", "node-info", "info" and found that is not loaded (tested with console.log).

Then I tried rename the default articles module as above and restart gulp, but still find err.

Is there any restriction for the naming of the module? Thanks.

Remarks:

  • (name "express" works)
  • OS: Windows 8 x64
  • mean.js version 0.4.0

Static files accessed incorrectly

In my MEAN app, I have two routes, /:room and /:room/manage. Both of these routes serve an HTML template that accesses static files. However, /:room/manage, returns a 404 when it tries to grab these files. For instance, with :room = 0, it tries to access /0/lib/bootstrap/... instead of /lib/bootstrap/....

This is because there is no leading slash in the generated layout.server.view.html. That is, the problem was fixed for me by changing

{% for cssFile in cssFiles %}<link rel="stylesheet" href="{{cssFile}}">{% endfor %}

to

{% for cssFile in cssFiles %}<link rel="stylesheet" href="/{{cssFile}}">{% endfor %}

Hope this helps.

Incorrect glob pattern on file config/assets/default.js

Hi,
There's a problem with the glob pattern on the file config/assets/default.js, on server.routes (line 45). Actually, it's:

routes: ['modules/*[!core]/server/routes/**/*.js', 'modules/core/server/routes/**/*.js'],

And it should be:

routes: ['modules/!(core)/server/routes/**/*.js', 'modules/core/server/routes/**/*.js'],

Otherwise it excludes all module names which end with c, o, r or e.

And thanks for this great generator :)

0.4.0

@lirantal - Has there been any work on the 0.4.0 version outside of what's in the 0.4-dev branch? If not, I'm gonna dive into the generator and see what I can come up with to make it work with 0.4.x.

How to download the 0.4-dev generator?

I am using the meanjs 0.4.0 branch, and currently my generator installed on my mac is 0.3 generator. How can I switch to use the 0.4-dev generator. I know its not stable yet, but I hear the crud-vertical-module generator seems to be working fine. So I just want to use it to generate my crud module. Thanks.

Option to generate tests when using any of the sub-generators

I'm wanting to instill within myself the habit of always writing tests. In playing with the sub-generators that I can issue a command to build a test base for controllers in angular and models in express. I can see where it might be helpful to maybe add a prompt when using the sub-generators to generate the test at the same time as the controller/model.

Also, I think it would be a very good thing to also offer the option for all the sub-generators.

I do have a couple other thoughts I will put into other issues.

I liked the meanjs setup and think I will like the generator even more.

David

yo meanjs:express-view

It's funny think but I made a mistake and tried to run the

yo meanjs:express-view 

instead of

yo meanjs:express-route.

Intrestingly yo couldn't recognise the diffrence and has run the

yo meanjs

0.4 Issue with social signin

So if I enter http://localhost:3000/api/auth/facebook it will do the usual sign in process (go to facebook, get auth, redirect etc)....but if I click a link in an anchor Sign in with facebook it does absolutely nothing. I am wondering if this is an issue anyone else is encountering. Seems a bit odd. I also tried with the absolute url and same thing, yet as stated if I actually go to the api route by entering it in the address bar, it works correctly.

Thank you.

Keep up to date with mean?

I'm presuming that one of the guiding principles of the generator is that by using the generator you can precisely duplicate the files in the primary mean project. (at least by using example generator).

The flip side is that if we introduce new content here (such as new tests for the test generators) that you would appreciate a pull request to enhance the primary mean project. In this case would you prefer the PR to hit the mean project first and then when it is propagated there that it then gets folded back here?

I'm enjoying playing around with what this generator can do. Can you tell?

".server.controller" missing in pathnames

When using "$ yo meanjs:crud-module " the files required at the top of

  • app/routes/.server.routes.js
  • app/controllers/.server.controller.js
    are not called with the right name (missing ".server.controller")

It seems that the problem occurs only on unix based servers (I tested on mac os, and debian) but not on a Windows server.

If you replace the files inclusion everything work perfectly.

CODE
.server.routes.js
module.exports = function(app) {
var users = require('../../app/controllers/users.server.controller'); // this line misses ".server.controller"
var products = require('../../app/controllers/.server.controller'); // this line misses ".server.controller"

.server.controller.js
var mongoose = require('mongoose'),
errorHandler = require('./errors.server.controller'), // this line misses ".server.controller"

Uncaught Error: Menu does not exists

When I generate a CRUD module and have it add it to the topbar menu. I get "Uncaught Error: Menu does not exists ".

I looked it up and the generator is adding the name of my CRUD module as the menu instead of topbar.

for instance:

This is the output for my sample CRUD:
Menus.addSubMenuItem('Apple Notes', 'apples', 'List Apples', 'apples');

The actual output should be:
Menus.addSubMenuItem('topbar', 'apples', 'List Apples', 'apples');

These three functions -
Menus.addMenuItem
Menus.addSubMenuItem (list)
Menus.addSubMenuItem (new item)

are effected in the public > modules > [my_CRUD_module].

Configuring the generators

I know this might go against the idea of an opinionated generator, but there are a couple things that I would like to be able to configure.

The biggest thing is the naming of the main directories: app and public.

I understand that the naming comes from the express side of things, but most of the tutorials and books I've been reading from the angular side names the angular part 'app' and the express/node part 'server'. I'm still having to think twice about what directory I'm needing to work in and have been on the verge of changing them in the original meanjs boilerplate, but that would be messed up with using the generators.

In setting up the app the first time, when asking for all the original setup information, I can see how it would be helpful to ask for the preferred way of setting up the directories. then somehow saving them in a config file that future generators can look at, then using lodash templates (courtesy of yo) to make everything go in the right place with the other files fitting right in.

I'm sure there are other items that can be helpful in that kind of configuration file. Those are just the first ones I have thought of.

Menu item for route doesn't appear in the topbar after creating module via yo meanjs:vertical-module

Hi,

Creating a new module using the vertical-module generator is not working for me.
After running:
yo meanjs:vertical-module sets
I got this:

          // Configuring the Articles module
         'use strict';

           // Configuring the Sets module
         angular.module('sets').run(['Menus',
        function(Menus) {

    // Add the Sets dropdown item
    Menus.addMenuItem('topbar', {
        title: 'Sets',
        state: 'sets',
        type: 'dropdown'
    });

    // Add the dropdown list item
    Menus.addSubMenuItem('topbar', 'sets', {
        title: 'List Sets',
        state: 'sets.list'
    });

    // Add the dropdown create item
    Menus.addSubMenuItem('topbar', 'sets', {
        title: 'Create Set',
        state: 'sets.create'
    });
}]);

But then in running the app, the menu item for the "sets" route doesn't appear in the topbar!

0.4.0 $ yo meanjs:crud-module <module-name> RUNS $ yo meanjs

I've got a new 0.4.0 MEAN.js app.

When I try to generate a new crud-module named "meets" by running:

yo meanjs:crud-module meets

I am greeted by:

CompName:AppName metasean$ yo meanjs:crud-module meets

     _-----_
    |       |
    |--(o)--|   .--------------------------.
   `---------´  |    Welcome to Yeoman,    |
    ( _´U`_ )   |   ladies and gentlemen!  |
    /___A___\   '__________________________'
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

You're using the official MEAN.JS 0.4 generator.
? What would you like to call your application? (MEAN) 

Moved from meanjs/mean#437

"bower install" is not automatically run

I was just trying the generator-meanjs. After downloading the code and run grunt
a blank page is shown, so i was wondering what's going on? when you take a look at the code you realize something is missing...

bower install

It could be great the generator do it for you as it does npm install

Why is test a separate grunt task?

I started with the yeoman generator. I see that testing is a separate grunt task - grunt test. What workflow do you guys follow? Run grunt test first and write your tests and when everything is green you run grunt default task to spin the server up? Wouldn't you want to have the unit tests run every time something changes (when the watches kick-in)? I know it is up to the developer but I was just wondering what the general pattern/recommendation was.

lots of errors on new generated stack

I ran yo meanjs and then ran grunt.

vagrant@vagrant-ubuntu-trusty-64:~/app/yo/meanjs$ grunt
Loading "uglify.js" tasks...ERROR

Error: Cannot find module 'pako/lib/zlib/messages'
Loading "cssmin.js" tasks...ERROR
Error: Cannot find module 'pako/lib/zlib/messages'
Loading "mocha-test.js" tasks...ERROR
Error: Cannot find module 'escape-string-regexp'
Loading "grunt-karma.js" tasks...ERROR
Error: Cannot find module 'socket.io'

Running "jshint:all" (jshint) task

55 files lint free.

Running "csslint:all" (csslint) task

2 files lint free.

Running "concurrent:default" (concurrent) task
Loading "uglify.js" tasks...ERROR

Error: Cannot find module 'pako/lib/zlib/messages'
Loading "uglify.js" tasks...ERROR
Error: Cannot find module 'pako/lib/zlib/messages'
Loading "cssmin.js" tasks...ERROR
Error: Cannot find module 'pako/lib/zlib/messages'
Loading "cssmin.js" tasks...ERROR
Error: Cannot find module 'pako/lib/zlib/messages'
Loading "mocha-test.js" tasks...ERROR
Error: Cannot find module 'escape-string-regexp'
Loading "mocha-test.js" tasks...ERROR
Error: Cannot find module 'escape-string-regexp'
Loading "grunt-karma.js" tasks...ERROR
Error: Cannot find module 'socket.io'

Running "watch" task
Waiting...
Loading "grunt-karma.js" tasks...ERROR

Error: Cannot find module 'socket.io'

Initial setup - unit test failing

I followed the instructions to install the app using yo. I made sure npm install and bower install was run. I then attempted to test my application using "gulp test".

I receive a unit test error:

image

calling server side code from client side in Mean JS

i have a code to send activation link in Server.js....and i want to call it from client side Javascript file ...here is the code

var express=require('express');
var nodemailer = require('nodemailer');
var app=express();
/*
Here we are configuring our SMTP Server details.
STMP is mail server which is responsible for sending and recieving email.
*/
var smtpTransport = nodemailer.createTransport('SMTP',{
service: 'Gmail',
auth: {
user: '',
pass: ''
}
});
var rand,mailOptions,host,link

app.get('/send',function(req,res){
console.log('Hola!!');
rand=Math.floor((Math.random() * 100) + 54);
host=req.get('host');
link='http://'+req.get('host')+'/verify?id='+rand;
mailOptions={
to : req.query.to,
subject : 'Please confirm your Email account',
html : 'Hello,
Please Click on the link to verify your email.
Click here to verify'
};
console.log(mailOptions);
smtpTransport.sendMail(mailOptions, function(error, response){
if(error){
console.log(error);
res.end('error');
}else{
console.log('Message sent: ' + response.message);
res.end('sent');
}
});
});

app.get('/verify',function(req,res){
console.log(req.protocol+':/'+req.get('host'));
if((req.protocol+'://'+req.get('host'))===('http://'+host))
{
console.log('Domain is matched. Information is from Authentic email');
if(req.query.id===rand)
{
console.log('email is verified');
res.end('

Email '+mailOptions.email+' is been Successfully verified');
}
else
{
console.log('email is not verified');
res.end('

Bad Request

');
}
}
else
{
res.end('

Request is from unknown source');
}
});

how to route from client side javascript to this server side javascript file

Gulp default fails

I ran the generator and tried to start the server with gulp and got the following error:

[gulp] [nodemon] starting `grunt server.js`
Warning: Task "server.js" not found. Used --force, continuing.

In package.json the start script is specified as grunt. I can fix this by changing it to node, but I'm not sure if this would affect the deployment process. If this is the correct fix, I can make a PR.

[crud-module] Unable to set a "custom" url.

Dear,

I generated a crud-module named room. Everything works UNTIL I change the roomId meaning. I want to obtain an URL with the room's name instead of the ObjectID.

http://127.0.0.1:3000/#!/rooms/1E10

So I changed :

  • The client's view from room._id to room.ID
  • The client service for the meaning of roomId from { roomId: '@_id' } to { roomId: '@ID' }
  • The server's controller's function roomByID from Room.findById(id) to Room.findOne({ ID : id })

Now, I have an unexpected error, when I try to create an object with the ID "testID" for example, the route is no more post /rooms but post /rooms/testID. However, there is no route for this. So I added a route from post /rooms/:roomId to rooms.create.

app.route('/rooms/:roomId')
    .post(users.requiresLogin, rooms.create)
    .get(rooms.read)
    .put(users.requiresLogin, rooms.hasAuthorization, rooms.update)
    .delete(users.requiresLogin, rooms.hasAuthorization, rooms.delete);

app.param('roomId', rooms.roomByID);

Obviously, the server controlleur will return an error because of the app.param function! We are trying to read a room that's NOT created. So I just commented the throw of the error and it works...

Before, it was working because @_id was not defined therefore the route was /rooms/ .

exports.roomByID = function(req, res, next, id) {
    Room.findOne({ ID : id }).populate('user', 'displayName').exec(function(err, room) {
        if (err) return next(err);
        if (! room) return next();  //next(new Error('Failed to load Room ' + id));
        req.room = room ;
        next();
    });
};

Please, this way is awful! Is there a proper solution or is it an issue? Actually, the error is no more forwarded...

SOLUTION : Add a condition in the roomByID function :

exports.roomByID = function(req, res, next, id) {
    if(req.method === 'POST') return next();
    Room.findOne({ ID : id }).populate('user', 'displayName').exec(function(err, room) {
        if (err) return next(err);
        if (! room) return next(new Error('Failed to load Room ' + id));
        req.room = room ;
        return next();
    });
};

(really) Minor spelling

seperated -> separated

In the part where one is asked:

"How would you describe your application in comma seperated key words? MongoDB, Express, AngularJS, Node.js"

Two users can associate the same providerProfile to their accounts

Two users can associate the same providerProfile to their accounts and a user might do it unexpectedly.

Step to repeat:

  1. Create a user with a local provider, associate a facebook account.
  2. Create a user with a google provider, associate the same facebook account to it.

The facebook account is not removed from the first user and is added to the second. Which user should signin when the he signin from a Facebook provider ?

Error: Cannot find module 'strip-ansi'

screen shot 2014-10-11 at 2 48 52 pm

Please tell me how can I solve this :
I tried the sudo npm cache clean, sudo npm install -g yo, sudo npm install -g generator-meanjs, sudo chown -Rwhoami~/.npm and sudo chown -Rwhoami/usr/local/lib/node_modules , but none of these solved the problem.

npm version : 1.3.26
node version : 0.10.30
yo version : 1.3.2

Option in include/exclude passport authentication

A lot of apps live behind firewalls on corporate Intranets. On these sites authentication is handled via system login. It would be great to have Passport and any authentication features as an option in the generator.

Cheers.

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.