Skip to content

Commit

Permalink
feat: initiate new project
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jun 25, 2019
1 parent 58e34af commit e067c2f
Show file tree
Hide file tree
Showing 25 changed files with 216 additions and 1,509 deletions.
40 changes: 40 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: 2
jobs:
build_10.15.3:
docker:
- image: 'circleci/node:10.15.3'
working_directory: ~/app
steps:
- checkout
- restore_cache:
keys:
- 'v1-dependencies-{{ checksum "package.json" }}'
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: 'v1-dependencies-{{ checksum "package.json" }}'
- run: npm test
build_latest:
docker:
- image: 'circleci/node:latest'
working_directory: ~/app
steps:
- checkout
- restore_cache:
keys:
- 'v1-dependencies-{{ checksum "package.json" }}'
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: 'v1-dependencies-{{ checksum "package.json" }}'
- run: npm test
workflows:
version: 2
workflow:
jobs:
- build_10.15.3
- build_latest
70 changes: 70 additions & 0 deletions .github/COMMIT_CONVENTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
## Git Commit Message Convention

> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular).
Using conventional commit messages, we can automate the process of generating the CHANGELOG file. All commits messages will automatically be validated against the following regex.

``` js
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|ci|chore|types|build)((.+))?: .{1,50}/
```

## Commit Message Format
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:

> The **scope** is optional
```
feat(router): add support for prefix
Prefix makes it easier to append a path to a group of routes
```

1. `feat` is type.
2. `router` is scope and is optional
3. `add support for prefix` is the subject
4. The **body** is followed by a blank line.
5. The optional **footer** can be added after the body, followed by a blank line.

## Types
Only one type can be used at a time and only following types are allowed.

- feat
- fix
- docs
- style
- refactor
- perf
- test
- workflow
- ci
- chore
- types
- build

If a type is `feat`, `fix` or `perf`, then the commit will appear in the CHANGELOG.md file. However if there is any BREAKING CHANGE, the commit will always appear in the changelog.

### Revert
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>`., where the hash is the SHA of the commit being reverted.

## Scope
The scope could be anything specifying place of the commit change. For example: `router`, `view`, `querybuilder`, `database`, `model` and so on.

## Subject
The subject contains succinct description of the change:

- use the imperative, present tense: "change" not "changed" nor "changes".
- don't capitalize first letter
- no dot (.) at the end

## Body

Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

## Footer

The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.

2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ _Put an `x` in the boxes that apply_

_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._

- [ ] I have read the [CONTRIBUTING](https://github.com/adonisjs/adonis-redis/CONTRIBUTING.md) doc
- [ ] I have read the [CONTRIBUTING](https://github.com/adonisjs/adonis-redis/blob/master/CONTRIBUTING.md) doc
- [ ] Lint and unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added necessary documentation (if appropriate)
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
message="chore(release): %s"
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

100 changes: 0 additions & 100 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License

Copyright 2018 thetutlage, contributors
Copyright 2019 thetutlage, 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:

Expand Down
96 changes: 25 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,39 @@
# AdonisJs Redis 🚀
> Provider to run redis commands from your Adonis app
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of contents

[![NPM Version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Appveyor][appveyor-image]][appveyor-url]
[![Coveralls][coveralls-image]][coveralls-url]
- [@adonisjs/redis](#adonisjsredis)
- [Change log](#change-log)
- [Contributing](#contributing)
- [Authors & License](#authors--license)

Adonis redis is a wrapper on top of [IoRedis](https://github.com/luin/ioredis) to run redis commands from your Adonisjs app.
<!-- END doctoc generated TOC please keep comment here to allow auto update -->

<img src="http://res.cloudinary.com/adonisjs/image/upload/q_100/v1497112678/adonis-purple_pzkmzt.svg" width="200px" align="right" hspace="30px" vspace="100px">
# @adonisjs/redis

## Features
[![circleci-image]][circleci-url]
[![npm-image]][npm-url]
![](https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript)

1. Support for cluser.
2. Run redis commands using `async/await` syntax.
3. Intutive pub/sub API.
## Change log

The change log can be found in the [CHANGELOG.md](CHANGELOG.md) file.

## Node/OS Target
## Contributing

This repo/branch is supposed to run fine on all major OS platforms and targets `Node.js >=7.0`
Everyone is welcome to contribute. Please go through the following guides, before getting started.

## Development
1. [Contributing](https://adonisjs.com/contributing)
2. [Code of conduct](https://adonisjs.com/code-of-conduct)

Great! If you are planning to contribute to the framework, make sure to adhere to following conventions, since a consistent code-base is always joy to work with.

Run the following command to see list of available npm scripts.
## Authors & License
[thetutlage](https://github.com/thetutlage) and [contributors](https://github.com/adonisjs/adonis-redis/graphs/contributors).

```
npm run
```
MIT License, see the included [MIT](LICENSE.md) file.

### Tests & Linting
[circleci-image]: https://img.shields.io/circleci/project/github/adonisjs/adonis-redis/master.svg?style=for-the-badge&logo=circleci
[circleci-url]: https://circleci.com/gh/adonisjs/adonis-redis "circleci"

1. Lint your code using standardJs. Run `npm run lint` command to check if there are any linting errors.
2. Make sure you write tests for all the changes/bug fixes.
3. Also you can write **regression tests**, which shows that something is failing but doesn't breaks the build. Which is actually a nice way to show that something fails. Regression tests are written using `test.failing()` method.
4. Make sure all the tests are passing on `travis` and `appveyor`.

### General Practices

Since Es6 is in, you should strive to use latest features. For example:

1. Use `Spread` over `arguments` keyword.
2. Never use `bind` or `call`. After calling these methods, we cannot guarantee the scope of any methods and in AdonisJs codebase we do not override the methods scope.
3. Make sure to write proper docblock.

## Issues & PR

It is always helpful if we try to follow certain practices when creating issues or PR's, since it will save everyone's time.

1. Always try creating regression tests when you find a bug (if possible).
2. Share some context on what you are trying to do, with enough code to reproduce the issue.
3. For general questions, please create a forum thread.
4. When creating a PR for a feature, make sure to create a parallel PR for docs too.


## Regression Tests

Regression tests are tests, which shows how a piece of code fails under certain circumstance, but the beauty is even after the failure, the test suite will never fail. Actually is a nice way to notify about bugs, but making sure everything is green.

The regression tests are created using

```
test.failing('2 + 2 is always 4, but add method returns 6', (assert) => {
assert.true(add(2, 2), 4)
})
```

Now since the `add` method has a bug, it will return `6` instead of `4`. But the build will pass.

[appveyor-image]: https://img.shields.io/appveyor/ci/thetutlage/adonis-redis/master.svg?style=flat-square

[appveyor-url]: https://ci.appveyor.com/project/thetutlage/adonis-redis

[npm-image]: https://img.shields.io/npm/v/@adonisjs/redis.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@adonisjs/redis

[travis-image]: https://img.shields.io/travis/adonisjs/adonis-redis/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/adonisjs/adonis-redis

[coveralls-image]: https://img.shields.io/coveralls/adonisjs/adonis-redis/develop.svg?style=flat-square

[coveralls-url]: https://coveralls.io/github/adonisjs/adonis-redis
[npm-image]: https://img.shields.io/npm/v/@adonisjs/redis.svg?style=for-the-badge&logo=npm
[npm-url]: https://npmjs.org/package/@adonisjs/redis "npm"
16 changes: 0 additions & 16 deletions appveyor.yml

This file was deleted.

9 changes: 3 additions & 6 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"core": true,
"ts": false,
"ts": true,
"license": "MIT",
"services": [
"travis",
"appveyor",
"coveralls"
"circleci"
],
"appveyorUsername": "thetutlage",
"minNodeVersion": "8.0.0"
"minNodeVersion": "10.15.3"
}
Loading

0 comments on commit e067c2f

Please sign in to comment.