Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikermcneil committed Jan 12, 2014
0 parents commit 658e80e
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
@@ -0,0 +1,15 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results

npm-debug.log
node_modules
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,25 @@
# Contributing to `sails-generate-backend`


## Opening Issues

Please observe the same conventions as you would opening issues in the main Sails repo.

See [Opening Issues](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md#opening-issues) for more information.



## Submitting Pull Requests

Please observe the same conventions as you would submitting pull requests to the Sails core.

See [Submitting Pull Requests](https://github.com/balderdashy/sails/blob/master/CONTRIBUTING.md#submitting-pull-requests).



## Need more help?

Please see the [contribution guide](https://github.com/balderdashy/sails/blob/v0.10/CONTRIBUTING.md#contributing-to-a-generator) in the Sails repo for more general guidelines.


[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/8acf2fc2ca0aca8a3018e355ad776ed7 "githalytics.com")](http://githalytics.com/balderdashy/sails-generate-backend/CONTRIBUTING.md)
81 changes: 81 additions & 0 deletions FAQ.md
@@ -0,0 +1,81 @@
# FAQ (Frequently Asked Questions)


### Which version should I use?

The latest stable version in npm is always a safe bet.

```sh
$ npm install sails-generate-backend
```

[![NPM](https://nodei.co/npm/.png?downloads=true&stars=true)](https://nodei.co/npm/sails-generate-backend/)



### Where is the documentation?
+ Documentation for this module is in the README.md file.
+ [Docs for the latest stable npm release of Sails are on the website](http://sailsjs.org/#!documentation)



### What is a generator?

A generator is one of the three main types of Sails plugins. It allows you to extend or override a generator in the Sails command-line interface (i.e. when a user runs `sails new` and/or `sails generate`.

Out of all the types of plugins, generators involve the fewest lines of code, and are probably the best way to get your hands dirty without getting buried.


### What kind of things can I do in a generator?

Generators are mainly about creating files. There are built-in helpers for:

+ creating folders
+ copying files
+ EJS template
+ running other generators



### How do I get involved?

+ [Contributing to this module](./CONTRIBUTING.md)
+ If you find a bug with this module, please submit an issue to the tracker in this repository. Better yet, send a pull request :)


### Where do I get help?

+ [Ask a question on StackOverflow](http://stackoverflow.com/questions/tagged/sailsjs?sort=newest&days=30)
+ Get help from the [Google Group](https://groups.google.com/forum/#!forum/sailsjs)
+ Get help on IRC ([#sailsjs on freenode](http://irc.netsplit.de/channels/details.php?room=%23sailsjs&net=freenode))
+ [Tweet @sailsjs](http://twitter.com/sailsjs)


### Why haven't I gotten a response to my feature request?

When people see something working in practice, they're usually a lot more down to get on board with it! That's even more true in the open-source community, since most of us are not getting paid to do this (myself included). The best feature request is a pull request-- even if you can't do the whole thing yourself, if you blueprint your thoughts, it'll help everyone understand what's going on.

### I want to make a sweeping change / add a major feature
It's always a good idea to contact the maintainer(s) of a module before doing a bunch of work. This is even more true when it affects how things work / breaks backwards compatibility.

### The maintainer of this module won't merge my pull request.

Most of the time, when PRs don't get merged, a scarcity of time is to blame. I can almost guarantee you it's nothing personal :) And I can only speak for myself here, but in most cases, when someone follows up on a PR that's been sitting for a little while on Twitter, I don't mind the reminder at all.

The best thing about maintaining lots of small modules is that it's trivial to override any one of them on their own. If you need some changes merged, please feel empowered to fork this model and release your own version.

If you feel that yours is the better approach, and should be the default, share it with the community via IRC, Twitter, Google Groups, etc. Also, feel free to let the core Sails/Waterline team know and we'll take it into consideration.



### More questions?

> If you have an unanswered question that isn't covered here, and that you feel would add value for the community, please feel free to send a PR adding it to this section.






[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/8acf2fc2ca0aca8a3018e355ad776ed7 "githalytics.com")](http://githalytics.com/balderdashy/sails-generate-backend/FAQ.md)
20 changes: 20 additions & 0 deletions LICENSE.md
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2014 a Node.js/Sails.js Contributor & contributors

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.
35 changes: 35 additions & 0 deletions README.md
@@ -0,0 +1,35 @@
# sails-generate-backend

A generator for Sails.js.


## Usage

#### On the command line

```sh
sails generate sails-generate-backend
```

#### In a node script

```javascript
var generate = require('sails-generate');
var scope = {};
generate(require('sails-generate-backend'), scope, function (err) {
if (err) throw err;

// Log output available in `scope` for your enjoyment:
console.log(scope);
});
```


## Contributing to this generator

See `CONTRIBUTING.md`.

## License

See `LICENSE.md`.

41 changes: 41 additions & 0 deletions index.js
@@ -0,0 +1,41 @@
/**
* sails-generate-backend
*
* Usage:
* `sails-generate-backend`
*
* @type {Object}
*/
module.exports = {
targets: {
'./:arg0': { exec: function (scope, cb) {
scope.output.push('Running generator (sails-generate-backend) @ `'+scope.rootPath+'`...');
cb();
} }
}
};


// Generator syntax:
//
// You can use params in your target paths:
// {
// './:someScopeVariable/somethingStatic/:somethingDynamicAgain': '...'
// }

// Other directives:
//
//
// Generate a folder: (`folder`)
// './:arg0/controllers': { folder: {} }
//
// Copy a file : (`copy`)
// './:arg0/someTemplate.foo': { copy: path.resolve(__dirname, './someTemplate.foo') },
//
// Render an EJS template: (`ejs`)
// (note: the template doesn't have to end in *.ejs)
// './:arg0/someTemplate.ejs': { ejs: path.resolve(__dirname, './someTemplate.ejs') },
//
// Run another generator:
// './:arg0/controllers/:controllerName.js': 'controller'
//
19 changes: 19 additions & 0 deletions package.json
@@ -0,0 +1,19 @@
{
"name": "sails-generate-backend",
"version": "0.0.0",
"description": "Generate a backend for Sails.",
"main": "index.js",
"scripts": {
"test": "mocha"
},
"keywords": [
"backend",
"generator",
"sails",
"generate",
"plugin"
],
"author": "a Node.js/Sails.js Contributor",
"license": "MIT",
"dependencies": {}
}

0 comments on commit 658e80e

Please sign in to comment.