-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fa94c83
Showing
10 changed files
with
279 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
coverage | ||
docs | ||
lib | ||
.nyc_output | ||
.history | ||
.vscode | ||
*.log | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
coverage | ||
docs | ||
.nyc_output | ||
.history | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
language: node_js | ||
cache: | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
node_js: | ||
- '7' | ||
- '6' | ||
- '4' | ||
before_script: | ||
- npm prune | ||
after_success: | ||
- npm run semantic-release | ||
branches: | ||
except: | ||
- /^v\d+\.\d+\.\d+$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
The MIT License (MIT) | ||
===================== | ||
|
||
Copyright © 2017 Heng Patrick, Fabien Motte | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# quark-state | ||
|
||
A simple state manager. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install quark-state --save | ||
``` | ||
|
||
## Usage | ||
|
||
### Basic | ||
|
||
Basic example. | ||
|
||
```js | ||
import State from 'quark-state' | ||
``` | ||
|
||
## API | ||
|
||
See [https://fm-ph.github.io/quark-state/](https://fm-ph.github.io/quark-state/) | ||
|
||
## Build | ||
|
||
To build the sources with `babel` in `./lib` directory : | ||
|
||
```sh | ||
npm run build | ||
``` | ||
|
||
## Documentation | ||
|
||
To generate the `JSDoc` : | ||
|
||
```sh | ||
npm run docs | ||
``` | ||
|
||
To generate the documentation and deploy on `gh-pages` branch : | ||
|
||
```sh | ||
npm run docs:deploy | ||
``` | ||
|
||
## Testing | ||
|
||
To run the tests, first clone the repository and install its dependencies : | ||
|
||
```sh | ||
git clone https://github.com/fm_ph/quark-state.git | ||
cd quark-signal | ||
npm install | ||
``` | ||
|
||
Then, run the tests : | ||
|
||
```sh | ||
npm test | ||
``` | ||
|
||
To watch (test-driven development) : | ||
|
||
```sh | ||
npm run test:watch | ||
``` | ||
|
||
For coverage : | ||
|
||
```sh | ||
npm test:coverage | ||
``` | ||
|
||
## License | ||
|
||
MIT [License](LICENSE.md) © [Patrick Heng](http://hengpatrick.fr/) [Fabien Motte](http://fabienmotte.com/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"tags": { | ||
"allowUnknownTags": true, | ||
"dictionaries": [ | ||
"jsdoc" | ||
] | ||
}, | ||
"source": { | ||
"include": [ | ||
"README.md", | ||
"src" | ||
], | ||
"includePattern": ".js$", | ||
"excludePattern": "(node_modules/|docs)" | ||
}, | ||
"plugins": [ | ||
"plugins/markdown" | ||
], | ||
"templates": { | ||
"cleverLinks": false, | ||
"monospaceLinks": true, | ||
"useLongnameInNav": false | ||
}, | ||
"opts": { | ||
"destination": "./docs", | ||
"encoding": "utf8", | ||
"template": "node_modules/minami" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"name": "quark-state", | ||
"version": "0.0.0-development", | ||
"description": "Simple repository to start a new quark package", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"build": "BABEL_ENV=production babel src -d lib", | ||
"docs": "node_modules/.bin/jsdoc --configure jsdoc.json --verbose", | ||
"docs:deploy": "npm run docs && gh-pages -d docs/ -m 'docs: update'", | ||
"test": "ava", | ||
"test:watch": "ava --watch --verbose", | ||
"test:coverage": "nyc npm test", | ||
"prepublish": "npm test && npm run build", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"keywords": [ | ||
"quark" | ||
], | ||
"author": "fm_ph", | ||
"contributors": [ | ||
"Patrick Heng <hengpatrick.pro@gmail.com> (http://hengpatrick.fr/)", | ||
"Fabien Motte <contact@fabienmotte.com> (http://fabienmotte.com/)" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/fm-ph/quark-state.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/fm-ph/quark-state/issues" | ||
}, | ||
"homepage": "https://github.com/fm-ph/quark-state", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"ava": "^0.18.1", | ||
"babel-cli": "^6.22.2", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-transform-runtime": "^6.22.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"babelify": "^7.3.0", | ||
"gh-pages": "^0.12.0", | ||
"jsdoc": "^3.4.3", | ||
"minami": "nijikokun/minami", | ||
"nyc": "^10.1.2", | ||
"semantic-release": "^6.3.2" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"es2015" | ||
], | ||
"plugins": [ | ||
"add-module-exports" | ||
], | ||
"ignore": "test.js", | ||
"env": { | ||
"development": { | ||
"sourceMaps": "inline", | ||
"plugins": [ | ||
"transform-runtime" | ||
] | ||
} | ||
} | ||
}, | ||
"ava": { | ||
"files": [ | ||
"test/*.js" | ||
], | ||
"require": [ | ||
"babel-core/register" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Simple class | ||
* | ||
* @class | ||
* | ||
* @license {@link https://opensource.org/licenses/MIT|MIT} | ||
* | ||
* @author Patrick Heng <hengpatrick.pro@gmail.com> | ||
* @author Fabien Motte <contact@fabienmotte.com> | ||
* | ||
* @example | ||
* const simple = new Simple() | ||
* simple.test() | ||
*/ | ||
class Simple { | ||
/** | ||
* Creates an instance of Simple | ||
* | ||
* @constructor | ||
*/ | ||
constructor () { | ||
this.message = 'Hello world' | ||
} | ||
|
||
/** | ||
* Simple method | ||
* | ||
* @returns {string} | ||
*/ | ||
test () { | ||
return this.message | ||
} | ||
} | ||
|
||
export default Simple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import test from 'ava' | ||
|
||
import Simple from '../src/index' | ||
|
||
test.beforeEach(t => { | ||
t.context.simple = new Simple() | ||
}) | ||
|
||
test('simple test', t => { | ||
t.is(t.context.simple.test(), 'Hello world') | ||
}) |