Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b3482db
deps: remove flow related deps.
AlbertHambardzumyan May 3, 2018
cb1d9b5
scripts: remove flow related scripts.
AlbertHambardzumyan May 3, 2018
a2203ec
env: remove babelrc file.
AlbertHambardzumyan May 3, 2018
3a66692
env: remove .flowconfig file.
AlbertHambardzumyan May 3, 2018
637cca5
flow: remove flow-typed package.
AlbertHambardzumyan May 3, 2018
a31d03f
doc: remove flow-types documentation.
AlbertHambardzumyan May 3, 2018
c4b7ab4
env: remove dist package.
AlbertHambardzumyan May 3, 2018
5834ee5
env: remove flow annotation from files.
AlbertHambardzumyan May 3, 2018
a28d3bd
lint: update lint rules.
AlbertHambardzumyan May 3, 2018
349bcd0
lint: apply linting.
AlbertHambardzumyan May 3, 2018
48f855d
test: rename __tests__ package to test.
AlbertHambardzumyan May 3, 2018
638dbf1
scripts: update scripts
AlbertHambardzumyan May 3, 2018
ed46cdb
env: update main key in package.json file.
AlbertHambardzumyan May 3, 2018
cf7e51e
env: setup pre commit hook.
AlbertHambardzumyan May 3, 2018
aaab590
deps: update outdated deps.
AlbertHambardzumyan May 3, 2018
ec894a7
travis: update travis setting
AlbertHambardzumyan May 3, 2018
2198c3e
env: fix engines versions in package.json file.
AlbertHambardzumyan May 3, 2018
8bad396
env: add github template issue.
AlbertHambardzumyan May 3, 2018
fcd8731
doc: remove all badges from README.md file - prepare for making private.
AlbertHambardzumyan May 3, 2018
d8ce872
doc: separate documentation into different files.
AlbertHambardzumyan May 3, 2018
21db9a3
lint: apply lint on __mocks__ dir as well.
AlbertHambardzumyan May 3, 2018
9229b79
env: set keywords to be lowercase.
AlbertHambardzumyan May 3, 2018
ae3103c
:sparkles: release 2.1.0
AlbertHambardzumyan May 3, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .babelrc

This file was deleted.

93 changes: 29 additions & 64 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{
"extends": [
"standard",
"plugin:flowtype/recommended"
"standard"
],
"globals": {
"expect": false,
"test": false,
"describe": false,
"jest": false,
"afterAll": false
"afterAll": false,
"beforeAll": false
},
"plugins": [
"flowtype"
],
"rules": {
"curly": 0,
"comma-dangle": [
2,
"never"
Expand All @@ -26,80 +22,49 @@
"after": true
}
],
"no-sequences": 0,
"consistent-return": 0,
"camelcase": 0,
"no-proto": 0,
"no-throw-literal": 0,
"no-useless-escape": 0,
"curly": 2,
"eqeqeq": [
2,
"allow-null"
],
"key-spacing": 0,
"no-underscore-dangle": 0,
"no-unused-expressions": 0,
"space-before-function-paren": 2,
"global-require": 2,
"handle-callback-err": 2,
"indent": [
2,
2
],
"key-spacing": 2,
"new-cap": 2,
"no-cond-assign": 2,
"no-extend-native": 2,
"no-mixed-requires": 2,
"no-new-require": 2,
"no-proto": 2,
"no-sequences": 2,
"no-shadow": 0,
"no-shadow-restricted-names": 0,
"no-shadow-restricted-names": 2,
"no-throw-literal": 2,
"no-underscore-dangle": 0,
"no-unused-expressions": 2,
"no-use-before-define": [
"error",
{
"functions": true,
"classes": true
}
],
"no-extend-native": 0,
"no-var": 2,
"new-cap": 0,
"quotes": 2,
"semi-spacing": 0,
"space-unary-ops": 0,
"space-infix-ops": 0,
"consistent-return": 0,
"object-curly-spacing": [
"error",
"always"
],
"strict": 0,
"flowtype/boolean-style": [
2,
"boolean"
],
"flowtype/define-flow-type": 1,
"flowtype/delimiter-dangle": [
2,
"never"
],
"flowtype/generic-spacing": [
2,
"never"
],
"flowtype/no-primitive-constructor-types": 2,
"flowtype/no-types-missing-file-annotation": 2,
"flowtype/no-weak-types": 0,
"flowtype/object-type-delimiter": [
2,
"comma"
],
"flowtype/require-parameter-type": 0,
"flowtype/require-valid-file-annotation": 2,
"flowtype/space-after-type-colon": [
2,
"always"
],
"flowtype/space-before-generic-bracket": [
2,
"never"
],
"flowtype/space-before-type-colon": [
2,
"never"
],
"flowtype/union-intersection-spacing": [
2,
"always"
],
"flowtype/use-flow-type": 1,
"flowtype/valid-syntax": 1
"quotes": 2,
"semi-spacing": 2,
"space-before-function-paren": 2,
"space-infix-ops": 2,
"space-unary-ops": 2,
"strict": 2
}
}
16 changes: 0 additions & 16 deletions .flowconfig

This file was deleted.

17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
Thank you for reporting an issue.

Please fill in as much of the template below as you're able.


If possible, please provide additional details that demonstrate the problem, keeping it as
simple and free of external dependencies as you are able.
-->

* **Expected Behavior**:
* **Actual Behavior**:
* **Steps to reproduce the behavior**:

<!-- Enter your issue details below this comment. -->

* **Issue additional details**:
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
language: node_js
sudo: false
node_js:
- "6.9.1"
- "8.8.1"
- "6.13.1"
- "8.9.3"
cache:
directories:
- node_modules
install:
- npm install
script:
- npm run lint-no-fix
- npm test
72 changes: 6 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,11 @@
# notification-hooks
Notification Hooks 🚨
Notification Hooks.

[![Build Status](https://travis-ci.org/renderforest/notification-hooks.svg?branch=master)](https://travis-ci.org/renderforest/notification-hooks)
[![GitHub issues](https://img.shields.io/github/issues/renderforest/notification-hooks.svg)](https://github.com/renderforest/notification-hooks/issues)
[![GitHub release](https://img.shields.io/github/release/renderforest/notification-hooks.svg)](https://github.com/renderforest/notification-hooks/releases)
[![GitHub stars](https://img.shields.io/github/stars/renderforest/notification-hooks.svg)](https://github.com/renderforest/notification-hooks/stargazers)

[![Dep](https://img.shields.io/david/renderforest/notification-hooks.svg)](https://david-dm.org/renderforest/notification-hooks)
[![DevDep](https://img.shields.io/david/dev/renderforest/notification-hooks.svg)](https://david-dm.org/renderforest/notification-hooks?type=dev)


# API ✍

Environment variables(s):

* SLACK_WEB_HOOK_URL


## Slack API

#### notifyError(...)
``` javascript
const SlackHooks = require('notification-hooks').Slack

const options = {
channel: '#media-upload',
codeSnippet: false, // default value is `true`
iconEmoji: ':lion_face:', // default value is ':fire:'
text: 'Hello world!', // supports string, Object, Error
username: '@albert @ryan'
}

SlackHooks.notifyError(options).then().catch()
```

#### notifyWarn(...)
``` javascript
const SlackHooks = require('notification-hooks').Slack

const options = {
channel: '#backend',
codeSnippet: false, // default value is `true`
iconEmoji: ':bus:', // default value is ':warning:'
text: 'Hi there!', // supports both string & Object
username: '@cris @ryan'
}

SlackHooks.notifyWarn(options).then().catch()
```

#### notifyInfo(...)
``` javascript
const SlackHooks = require('notification-hooks').Slack

const options = {
channel: '#front',
codeSnippet: true, // default value is `true`
iconEmoji: ':airplane:', // default value is ':information_source:'
text: 'Hello!', // supports both string & Object
username: '@john'
}

SlackHooks.notifyError(options).then().catch()
```

# Development ⚠
In case you add new third party dependencies, use flow-typed npm package to add annotations for that packages.
* npm i -g flow-typed
* flow-typed install --ignoreDeps dev

Table of Contents

* [API](https://github.com/renderforest/notification-hooks/blob/master/doc/API.md)
* [Contributing](https://github.com/renderforest/notification-hooks/blob/master/CONTRIBUTING.md)
* [Test](https://github.com/renderforest/notification-hooks/blob/master/doc/TEST.md)
2 changes: 0 additions & 2 deletions __mocks__/request-promise.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
'use strict'

module.exports = (params) => Promise.resolve(params)
8 changes: 0 additions & 8 deletions dist/index.js

This file was deleted.

Loading