Skip to content

Commit

Permalink
Merge branch 'release-0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed Mar 5, 2015
2 parents f48bad9 + 10ed4d5 commit 59b1227
Show file tree
Hide file tree
Showing 163 changed files with 1,210 additions and 609 deletions.
26 changes: 10 additions & 16 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# Authors and contributors
## Core developers

Here we add short biography of each contributor to this project.
| Eugene Obrezkov |
|:-------------------------------------------------------------------------------------:|
| ![Eugene Obrezkov](http://gravatar.com/avatar/be299f224394ab488001c9cab12eae2c?s=100) |
| Lead developer of this project |
| Get in touch with me via [@ghaiklor](https://twitter.com/ghaiklor) |

### Eugene Obrezkov (aka ghaiklor)
## Contributors

![Eugene Obrezkov](http://gravatar.com/avatar/be299f224394ab488001c9cab12eae2c?s=100)
We don't have contributors yet...

Lead developer of this project.
## Special Thanks

JavaScript developer with experience about 4+ years.

You can contact me via links below:

+ [VK](http://vk.com/ghaiklor_xakep)
+ [Facebook](https://www.facebook.com/ghaiklor)
+ [Twitter](https://twitter.com/ghaiklor)
+ [GMail](mailto:[email protected])
+ [Habrahabr](http://habrahabr.ru/users/ghaiklor/)
+ [Stack Overflow](http://stackoverflow.com/users/2357633/eugene-obrezkov)
+ [GitHub](https://github.com/ghaiklor)
+ [@rizr](https://github.com/rizr) - for participating in testing and proposals to make it better;
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

## Edge version

## Version 0.6.0

- Improvement: Implemented parsing CommonJS modules from AST (Abstract Syntax Tree), so now generator is knows which modules you are really using;
- Improvement: Frozen structure of generator and project. Any serious changes in project structure;
- Improvement: Add Yahoo authorization;
- Improvement: Split generator arguments declaration to separate folder;
- Improvement: Split generator options declaration to separate folder;
- Improvement: Split generator questions declaration to separate folder;
- Improvement: Answers to questions is dynamically assign to existing `this.answers` object in `RunContext`;
- Improvement: Split each generator step to separate folder and modules;
- Improvement: Implement util `assign()` method which is using in `prompting` step for extend answers object;
- Improvement: Redesign of generator structure;
- Improvement: Add options to `check-updates.js` tool;
- Improvement: Add tools to npm scripts, so you can call `npm run-script <tool-name>` now;
- Improvement: Add `verbose` flag, so you can see everything what going on in `RunContext`;
- Improvement: Add logging all `serverError` responses to log by default (you don't need call `sails.log.error()`);
- Improvement: Implement logging all responses in `silly` mode;
- Improvement: Add `ping` route to `AuthController` which just respond with OK;
- Fix: Bug when JWT issued to user `false`;
- Fix: Bug with passport-jwt upgrade;
- Fix: Bug with `bodyParser` is not parsing POST body;
- Fix: Bug with no colorful print in `fix-deps.js`;
- Fix: Bug with no colorful print in installing step in generator;
- Fix: Bug when returns total count of records even with `where` criteria;
- Fix: Change log level info to `info` in production mode;

## Version 0.5.1

- Hotfix: Bug when with `skip-all` generator is freeze up;
Expand Down Expand Up @@ -45,7 +71,7 @@

- Improvement: Frozen stability of the whole project, so work is going only in `services`, `test` and `doc` folder;
- Improvement: Add blank tests for each `controllers`, `models`, `policies`, `responses`, `services`;
- Improvement: Each test case named **TODO: write this test** as reminder and include `assert(true)`;
- Improvement: Each test case named **write this test** as reminder and include `assert(true)`;
- Improvement: Add JSON Web Token as part of `CipherService`;
- Improvement: Support for `skip-install` flag. You can skip `npm install` executing;
- Improvement: Add `customMiddleware` support in `config/http.js`;
Expand Down
181 changes: 181 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Contributing

At this page we explain how you can contribute to our project.

## Creating issue

If you have any proposal or want to report about bug, feel free to create issue.
We don't moderate issues and will answer you as soon as possible.

## Get the project

### Clone repository

Clone repository to your computer.

```bash
git clone https://github.com/ghaiklor/generator-sails-rest-api.git # via HTTPS
git clone [email protected]:ghaiklor/generator-sails-rest-api.git # via SSH
```

### Install dependencies

We are using `npm` for manage dependencies.
So all development dependencies is declared into `package.json` and you can install it simply call `npm install`.

```bash
cd generator-sails-rest-api
npm install
```

### Run generator-sails-rest-api locally

When you clone the repository, you can link this repository as global npm module in your system.
Then check if this linked up by executing `npm -g list --depth=0`.
If everything is correct, you will see path to your cloned repository.
After linking, you can call `yo sails-rest-api` and run generator locally.

```bash
git clone https://github.com/ghaiklor/generator-sails-rest-api.git
cd generator-sails-rest-api
sudo npm link
yo sails-rest-api
```

## Branch explanation

Our repository has two main branches:

1. [master](https://github.com/ghaiklor/generator-sails-rest-api/tree/master "Master Branch")
2. [dev](https://github.com/ghaiklor/generator-sails-rest-api/tree/dev "Development Branch")

All stable releases will merge into `master` branch.
So if you want get and use last stable release ready for production - use `master` branch.

But, of course, you can use edge version and check out our latest features.
They are may be unstable and not tested, so they are not ready for production.
All those changes and features will merge into `dev` branch.

Other branches it's only helper branches which can close at any time.
In general we have 3 types of branches:

+ Feature branches;
+ Release branches;
+ Hotfix branches;

Advanced description you will read below in "Git workflow" section.

## Git workflow

We are using git workflow, which are nice described [here in Russian](http://habrahabr.ru/post/106912/ "Thanks to Андрей Хитрин aka zloddey") and [here in English](http://nvie.com/posts/a-successful-git-branching-model/ "Thanks to Vincent Driessen").

In general, we are using `master` branch for stable releases (and ONLY stable releases) and `dev` branch for development purposes.

### Feature/bug branches

Let's say you want realize new feature or fix something.
You **MUST** checkout to new branch from `dev` branch.
Created branch **MUST** have name that begins with **feature-...** or **bug-...**.
This name conventions simplify work with many branches and we can got what exactly each branch doing.
When you finish with branch, manually merge feature-branch into `dev`.

```bash
git checkout dev # Checkout to dev branch
git pull # Update dev branch changes

git checkout -b feature-awesome # Create new feature branch
git commit -am "Commit 1" # Commit changes
git commit -am "Commit 2" # Last commit

git checkout dev # Switch back to dev branch
git pull # Update last changes in dev

git merge feature-awesome # Merge your changes into dev branch

git branch -d feature-awesome # And you can delete old branch
git push -u origin dev # Push changes to origin server
```

**_Note_**: If you don't have rights for push\merge into `dev`, create pull request and we accept it ourselves.

### Release branches

When we decide that `dev` branch is ready for release, we are create new branch with **release-...** prefix.
In this branch we update metadata and fix **ONLY** bugs.
When release branch will proceed all last checks and tests, we merge release branch into `master` and `dev`.
And add tag in `master` branch with appropriate release version.

```bash
git checkout dev # Switch to development branch
git pull # Get last changes

git checkout -b release-1.2.0 # Create new release branch

git commit -am "Release version v1.2.0" # Commit changes into release branch
git commit -am "Allows make small changes" # Maybe small changes

git checkout master # Switch to master branch
git merge release-1.2.0 # Merge release branch into master
git tag -a "v1.2.0" master # Add a tag to release commit in master branch

git checkout dev # Switch to dev branch
git merge release-1.2.0 # Merge release changes to dev branch

git branch -d release-1.2.0 # Remove unused release branch

git push -u origin --all # And push all to origin server
git push -u origin --tags # With tags too
```

### Hotfix branches

When some seriously error or bug occurs into stable release (`master`) we make hotfix branch.
Hotfix branch **MUST** begins with **hotfix-...** prefix.
After fixes we merge hotfix branch into `master` and `dev`.
Also increment patch version and publish this hotfix as new version.

```bash
git checkout master # Switch to master branch
git checkout -b hotfix-1.2.1 # Create new hotfix branch

git commit -am "Fix for something" # Critical bugs fixes
git commit -am "Bumped version and build" # Last commit

git checkout master # Switch back to master branch
git merge hotfix-1.2.1 # Merge hotfix branch
git tag -a "v1.2.1" master # Add tag to this commit

git checkout dev # Switch to dev branch
git merge hotfix-1.2.1 # Apply fixes to dev branch too

git branch -d hotfix-1.2.1 # Remove hotfix branch
git push -u origin --all # Push all changes to origin server
git push -u origin --tags # And push tags to origin server
```

## Tests

We are using Mocha for testing.
All test cases located into `test` folder and split like source files split.
For every file in `api/` folder we create appropriate in `test/` folder.

When you create new feature or fix some bug, you **MUST** write test case for it in `test` folder.
For example, you add new feature to `api/services/cipher/BCryptCipher.js`.
After that you need modify `test/services/cipher/BCryptCipher.js` for corresponds to new feature.

For run tests just call `npm test`.

## Versions

We are using "Semantic Versioning".
You can find rules how to use it [here](http://semver.org/).

In general, 4 types of version exists:

1. Pre-release -> `v1.2.3-4`. Pre-release changes only builds number after `-`. I.e `v1.2.3-4` -> `v1.2.3-5`.

2. Patch -> `v1.2.3`. Patch version changes only patch version at the end and remove builds number. I.e. `v1.2.3-5` -> `v1.2.3` -> `v1.2.4`.

3. Minor -> `v1.3.0`. Minor version changes second number in version and reset patch version and prerelease version. I.e. `v1.2.4` -> `v1.3.0`.

4. Major -> `v2.0.0`. Major version changes first number in version and reset all other versions. I.e. `v1.3.0` -> `v2.0.0`.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generator-sails-rest-api

[![npm version](https://badge.fury.io/js/generator-sails-rest-api.svg)](http://badge.fury.io/js/generator-sails-rest-api) [![Build Status](https://secure.travis-ci.org/ghaiklor/generator-sails-rest-api.png?branch=master)](https://travis-ci.org/ghaiklor/generator-sails-rest-api) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ghaiklor/generator-sails-rest-api?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [Documentation](https://github.com/ghaiklor/generator-sails-rest-api/wiki)
[![npm version](https://badge.fury.io/js/generator-sails-rest-api.svg)](http://badge.fury.io/js/generator-sails-rest-api) ![Dependencies is up to date](https://david-dm.org/ghaiklor/generator-sails-rest-api.svg) [![Build Status](https://travis-ci.org/ghaiklor/generator-sails-rest-api.svg?branch=master)](https://travis-ci.org/ghaiklor/generator-sails-rest-api) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ghaiklor/generator-sails-rest-api?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [Documentation](https://github.com/ghaiklor/generator-sails-rest-api/wiki)

> Stability: 2 - Unstable
Expand All @@ -24,7 +24,39 @@ Yeoman generator that provides already configured and optimized Sails REST API w
- Integrated Swagger doc specification in `doc` folder;
- Integrated Mocha tests for all `blueprints`, `controllers`, `models`, `policies`, `responses` and `services`. After generating you can execute `npm test`;

## ready-2-use services
## Getting Started

Start using generator is very simple.

First of all, you need install **yeoman** and **generator-sails-rest-api**:

```bash
npm install -g yo generator-sails-rest-api
```

Then create project directory and initiate the generator under the project directory:

```bash
mkdir my-project
cd my-project
yo sails-rest-api
```

You will be prompted for questions. Answer to those questions that generator is asks and you will get configured Sails project.

After scaffolding the project you can use this project as before. Just run the `app.js` file and all.

```bash
node app.js
```

Congratulations, you just have setup your first Sails REST API :+1:

## How to use project code?

_TODO:_ Fill with information. But you can read more at our [wiki page](https://github.com/ghaiklor/generator-sails-rest-api/wiki/How-to-use)

## Bundled Sails services

| Service Name | Implemented providers |
|:--------------:|:------------------------------------------------:|
Expand Down
28 changes: 21 additions & 7 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@

## Faraway

- [ ] Add **apn** and **gcm** push notifications;
- [ ] Add social service **Twitter**;
- [ ] Add support for **Amazon** mailer, **sendmail** mailer;
- [ ] Sub generators for each service;
- [ ] Add `md5`, `crc` Ciphers;
- [ ] Add `sendmail`, `Amazon` Mailer;
- [ ] Add `braintreepayments`, `PayPal` Payment;
- [ ] Add `Windows Phone` Pusher;
- [ ] Add `Twitter`, `VK`, `Google +` Social;
- [ ] Add `Local` Storage;
- [ ] Test coverage for all `api` files;
- [ ] Add questions list where you can choose which service need to include and copy only needed;
- [ ] Make swagger documentation as part of Sails generator;
- [ ] Implement search on top of `find` blueprint;
- [ ] Implement pluralized form only for REST models;
- [ ] Think about questions "Which hook you want to leave enable?" and disable\enable hooks based on those answers;
- [ ] Think about generating not only backend REST API, so user can still have clean Sails application (maybe call spawn `sails new <app-name>`;

## Next version
## Next minor version

- [ ] Implement converting camelCase attributes to snake_case in HTTP response;
- [ ] Make global error codes for API with description and how fix it;
- [ ] Add aliases to common operation (for instance, `v1/user/recently_registered`;

## Version 0.6.0 (released)

- [x] Improve stability (too much new features is appears in previous version);
- [x] Freeze architecture (only bug-fixes and adding new features);
- [x] Add questions list where you can choose which service need to include;

## Version 0.5.0 (released)

Expand Down
Loading

0 comments on commit 59b1227

Please sign in to comment.