Skip to content

Commit

Permalink
feat(CLI): Add the Whook CLI tool
Browse files Browse the repository at this point in the history
Adds the CLI and tweaks a few things to make it work altogether.

concerns #12
  • Loading branch information
nfroidure committed Feb 9, 2019
1 parent 624d756 commit 5511747
Show file tree
Hide file tree
Showing 59 changed files with 8,933 additions and 326 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lerna": "lerna",
"lint": "lerna run lint",
"metapak": "metapak",
"postinstall": "lerna bootstrap --hoist && lerna link && npm run compile",
"postinstall": "lerna bootstrap --hoist && npm run compile && lerna link",
"postmetapak": "lerna run metapak",
"precz": "npm t && npm run lint && npm run metapak -- -s",
"prettier": "prettier --write 'src/**/*.js'",
Expand Down
20 changes: 20 additions & 0 deletions packages/create-whook/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright © 2017 Nicolas Froidure

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.
53 changes: 53 additions & 0 deletions packages/create-whook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# create-whook
> Create a basic Whook server
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/create-whook/blob/master/LICENSE)
[![NPM version](https://badge.fury.io/js/create-whook.svg)](https://npmjs.org/package/create-whook)
[![Dependency Status](https://david-dm.org/nfroidure/create-whook.svg)](https://david-dm.org/nfroidure/create-whook)
[![devDependency Status](https://david-dm.org/nfroidure/create-whook/dev-status.svg)](https://david-dm.org/nfroidure/create-whook#info=devDependencies)
[![Package Quality](http://npm.packagequality.com/shield/create-whook.svg)](http://packagequality.com/#?package=create-whook)


[//]: # (::contents:start)

[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# create-whook
> Create a basic Whook server
[![NPM version](https://badge.fury.io/js/create-whook.svg)](https://npmjs.org/package/create-whook)
[![Dependency Status](https://david-dm.org/nfroidure/create-whook.svg)](https://david-dm.org/nfroidure/create-whook)
[![devDependency Status](https://david-dm.org/nfroidure/create-whook/dev-status.svg)](https://david-dm.org/nfroidure/create-whook#info=devDependencies)
[![Dependency Status](https://dependencyci.com/github/nfroidure/create-whook/badge)](https://dependencyci.com/github/nfroidure/create-whook)
[![Package Quality](http://npm.packagequality.com/shield/create-whook.svg)](http://packagequality.com/#?package=create-whook)


[//]: # (::contents:start)


[//]: # (::contents:end)

# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)

# License
[MIT](https://github.com/nfroidure/create-whook/blob/master/LICENSE)


[//]: # (::contents:end)

# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)

# License
[MIT](https://github.com/nfroidure/create-whook/blob/master/LICENSE)
3 changes: 3 additions & 0 deletions packages/create-whook/bin/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { runServer } from '../src/index';

runServer();
3 changes: 3 additions & 0 deletions packages/create-whook/bin/start.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { runServer } = require('../dist/index');

runServer();
35 changes: 35 additions & 0 deletions packages/create-whook/config/common/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import packageConf from '../../package';

const DEBUG_NODE_ENVS = ['development', 'preproduction', 'test'];
const NODE_ENVS = [...DEBUG_NODE_ENVS, 'production'];

const CONFIG = {
BASE_ENV: {},
CONFIG: {
basePath: '/v1',
schemes: ['http'],
version: packageConf.version,
name: packageConf.name,
description: packageConf.description || '',
},
NODE_ENVS,
DEBUG_NODE_ENVS: process.env.DEBUG ? NODE_ENVS : DEBUG_NODE_ENVS,
CORS: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET,POST,PUT,DELETE,OPTIONS',
'Access-Control-Allow-Headers': [
'Accept',
'Accept-Encoding',
'Accept-Language',
'Referrer',
'Content-Type',
'Content-Encoding',
'Authorization',
'Keep-Alive',
'User-Agent',
].join(','),
Vary: 'Origin',
},
};

export default CONFIG;
7 changes: 7 additions & 0 deletions packages/create-whook/config/development/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import COMMON_CONFIG from '../common/config';

const CONFIG = {
...COMMON_CONFIG,
};

export default CONFIG;
7 changes: 7 additions & 0 deletions packages/create-whook/config/preproduction/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import COMMON_CONFIG from '../common/config';

const CONFIG = {
...COMMON_CONFIG,
};

export default CONFIG;
7 changes: 7 additions & 0 deletions packages/create-whook/config/production/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import COMMON_CONFIG from '../common/config';

const CONFIG = {
...COMMON_CONFIG,
};

export default CONFIG;
Loading

0 comments on commit 5511747

Please sign in to comment.