afj176 / generator-mongoose Goto Github PK
View Code? Open in Web Editor NEWA mongoose generator for Yeoman
Home Page: http://www.yomongoo.se/
License: MIT License
A mongoose generator for Yeoman
Home Page: http://www.yomongoo.se/
License: MIT License
@arvindr21, pasts test locally can you help test why the builds in travis are failing?
Getting this warning after running grunt. After that it does this:
(node) warning: Recursive process.nextTick detected. This will break in the next version of node
And then it dies.
I am unable to install version 0.0.5 on a windows system and a linux system with a clean node install. I get the following error :
npm ERR! peerinvalid Peer [email protected] wants yo@latest
I can however install version 0.0.4 with out issue. I've made sure that I have the latest version of yo installed (1.1.2)
I am going to do a pull request with the version of yo specified in the package.json instead of using "latest"
My recommended fix is
FROM
"latest"
to
">=1.1.1"
Hi,
When I run the generator, in the step "Will you be using heroku?" I have this error:
? Will you be using heroku? No
(!) #mkdir() is deprecated. Use mkdirp module instead. https://www.npmjs.com/package/mkdirp
(!) #mkdir() is deprecated. Use mkdirp module instead. https://www.npmjs.com/package/mkdirp
(!) #_ is deprecated. Require your own version of Lodash or underscore.string
events.js:72
throw er; // Unhandled 'error' event
^
TypeError: Cannot call method 'slugify' of undefined
at eval (eval at <anonymous> (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/node_modules/lodash/index.js:10693:16), <anonymous>:8:13)
at underscore (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/lib/util/engines.js:23:45)
at MongooseGenerator.actions.engine (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/lib/actions/actions.js:224:32)
at MongooseGenerator.template (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/lib/actions/actions.js:198:19)
at MongooseGenerator.app (/usr/local/lib/node_modules/generator-mongoose/app/index.js:76:8)
at /usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/lib/base.js:421:16
at processImmediate [as _immediateCallback] (timers.js:345:15)
I think that is related with this issue: yeoman/generator#766
When creating a new model. Any particular reason why you are creating nested object for the model values?
example this is how the information is sent
{
"store": {
"title": "The annals copied down are therefore incorrect from 1045 to 1052, which has two entries.",
"tagline": "He developed bronchial problems followed by double pneumonia.",
"description": "Whittle was separate actions aga... Line in 1917.",
"email": "Pincus presents James as neither naïve nor stupid nor egotistical.",
"created": "1999-12-22T07:17:24.032Z"
}
}
Why not have is flat like so:
{
"title": "The annals copied down are therefore incorrect from 1045 to 1052, which has two entries.",
"tagline": "He developed bronchial problems followed by double pneumonia.",
"description": "Whittle was separate actions aga... Line in 1917.",
"email": "Pincus presents James as neither naïve nor stupid nor egotistical.",
"created": "1999-12-22T07:17:24.032Z"
}
I ask because I planned to use it with backbone but, requires extra work to specify the model again (granted the service is specific enough) and then nest the body.
Just wondering if this is preference or another reason I my be missing.
mongoose generator creates expected files:
Uncaught TypeError: object is not a function
at MongooseGenerator. (/home/travis/build/afj176/generator-mongoose/node_modules/yeoman-generator/lib/base.js:383:5)
mongoose generator mongoose schema generator creates expected files:
Uncaught TypeError: object is not a function
at SchemaGenerator. (/home/travis/build/afj176/generator-mongoose/node_modules/yeoman-generator/lib/base.js:383:5)
Recently downloaded this generator and after installing and running npm install & bower install. Running grunt gives me this error. "Windows cannot find 'http://localhost:undefined'. Make sure you typed the name correctly and try again."
I have tried it on several machines with the same consequences.
I have attached a screenshot of this error.
Any help with this would be greatly appreciated.
After installation, the default root url '/' returns error in index.js.
Seems the routes map is missing. The app does connect to mongoDB fine, this is application issue.
Steps to reproduce:
The server should be up & running with the below error message.
C:\mongodb\yoMongooseApp2>grunt server
Running "server" task
Running "express:dev" (express) task
Starting background Express server
Tue, 12 Aug 2014 14:15:04 GMT body-parser deprecated bodyParser: use individual json/urlencoded midd
lewares at app.js:62:9
Express server listening on port 3000 in development mode
Tue, 12 Aug 2014 14:15:04 GMT body-parser deprecated undefined extended: provide extended option at
node_modules\body-parser\index.js:75:29
Running "open:server" (open) task
Successfully connected to: mongodb://localhost/myTestDB
Running "watch" task
Waiting...
GET / 500 5.582 ms - 1195
TypeError: Cannot read property 'get' of undefined
at route.index (C:\mongodb\yoMongooseApp2\routes\index.js:9:33)
at Layer.handle [as handle_request](C:PAwsmongodbyoMongooseApp2node_modulesexpresslibro
uterlayer.js:76:5)
at next (C:\PA\ws\mongodb\yoMongooseApp2\node_modules\express\lib\router\route.js:100:13)
at Route.dispatch (C:\PA\ws\mongodb\yoMongooseApp2\node_modules\express\lib\router\route.js:81:3
)
at Layer.handle [as handle_request](C:PAwsmongodbyoMongooseApp2node_modulesexpresslibro
uterlayer.js:76:5)
at C:\PA\ws\mongodb\yoMongooseApp2\node_modules\express\lib\router\index.js:227:24
at Function.proto.process_params (C:\PA\ws\mongodb\yoMongooseApp2\node_modules\express\lib\route
r\index.js:305:12)
at C:\PA\ws\mongodb\yoMongooseApp2\node_modules\express\lib\router\index.js:221:12
at Function.match_layer (C:\PA\ws\mongodb\yoMongooseApp2\node_modules\express\lib\router\index.j
s:288:3)
at next (C:\PA\ws\mongodb\yoMongooseApp2\node_modules\express\lib\router\index.js:182:10)
Hi there, I was recently looking around for a generator that could create the boilerplate for mongoose schema/models and here we are.
I wanted to be able to use this generator as a sub-generator for a different project and layout. However the structure of the schema
sub-gen is fairly different than the one I'm using. What I'm wondering is, would you be open to using the .yo-rc.json
config file to configure the schema sub-gen?
app/index.js
could save a default config in yo-rc for the schema gen to use when using this generator solely, but would allow others to define a config section in their own yo-rc and use your generator in any yeoman generated project.
I think it'd be really nice to see the yeoman communities 'outsourcing' to more specialized generators when possible, as it would make the ecosystem more modular and focused. If any of this seems out of scope for this project, no worries I completely understand.
However if you are interested let me know and I'd be glad to discuss in more detail.
Thanks,
Cody
Getting this error when running yo mongoose
TypeError: Cannot read property 'Base' of undefined
at Object.<anonymous> (/usr/local/lib/node_modules/generator-mongoose/app/index.js:20:51)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.get [as mongoose:app] (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/store.js:38:27)
at Store.get (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/store.js:61:39)
Could this be related to following SO thread: https://stackoverflow.com/questions/42846410/yeoman-generator-cannot-read-property-base-of-undefined-with-1-1-version
I'm getting the following error before the questions right after running yo mongoose
:
(!) this.readFileAsString() is deprecated. Use require("html-wiring").readFileAsString() instead.
I'm also getting errors after answering the initialization questions:
(!) #mkdir() is deprecated. Use mkdirp module instead. https://www.npmjs.com/package/mkdirp
(!) #mkdir() is deprecated. Use mkdirp module instead. https://www.npmjs.com/package/mkdirp
events.js:85
throw er; // Unhandled 'error' event
^
ReferenceError: /usr/local/lib/node_modules/generator-mongoose/app/templates/Gruntfile.js:45
43| open: {
44| server: {
>> 45| url: 'http://localhost:<%= express.options.port %>'
46| }
47| }
48| });
express is not defined
at eval (eval at <anonymous> (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:455:12), <anonymous>:11:28)
at /usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:482:14
at Object.exports.render (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/node_modules/mem-fs-editor/node_modules/ejs/lib/ejs.js:316:13)
at copy.process (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy-tpl.js:18:18)
at applyProcessingFunc (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy.js:12:16)
at EditionInterface.exports._copySingle (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy.js:55:24)
at EditionInterface.exports.copy (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy.js:22:17)
at EditionInterface.module.exports [as copyTpl] (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy-tpl.js:16:8)
at MongooseGenerator.template (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/lib/actions/actions.js:134:11)
at MongooseGenerator.copy (/usr/local/lib/node_modules/generator-mongoose/node_modules/yeoman-generator/lib/actions/actions.js:43:10)
I answered the questions as follows:
? Database Name: contacts-react
? Database Host: localhost
? Database User:
? Database Password:
? Database Port: 27017
? Will you be using heroku? No
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.