Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
refactor(all): big refactor
Browse files Browse the repository at this point in the history
extend from koa-router; plugin system; swagger-ui
  • Loading branch information
amazing-gao committed Jan 23, 2018
1 parent 7b8bf03 commit 65a11f3
Show file tree
Hide file tree
Showing 78 changed files with 2,706 additions and 1,929 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"transform-decorators-legacy",
"transform-es2015-modules-commonjs",
"transform-es2015-arrow-functions",
"transform-object-rest-spread",
"transform-es2015-classes",
"transform-es2015-parameters",
"transform-es2015-destructuring",
Expand Down
4 changes: 1 addition & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.nyc_output
lib
coverage
dist
node_modules
lib/swagger-ui
24 changes: 18 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
{
"extends": "airbnb-base",
"rules": {
"arrow-body-style": ["error", "always"],
"arrow-body-style": [
"error",
"always"
],
"class-methods-use-this": 0,
"guard-for-in": 0,
"import/no-dynamic-require": 1,
"import/no-mutable-exports": 1,
"import/prefer-default-export": 0,
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/test/**"]}],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/test/**"
]
}
],
"no-console": 0,
"no-param-reassign": [
2,
Expand All @@ -16,8 +27,9 @@
],
"no-restricted-syntax": 1,
"no-unused-vars": 1,
"no-empty": "warn",
"object-curly-spacing": 0,
"key-spacing":"warn",
"max-len":"warn"
}
}
"key-spacing": "warn",
"max-len": "warn"
}
}
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
.DS_Store
.nyc_output
.vscode
coverage
dist
dist-test
node_modules

*.log
*.map
*.lcov

coverage
dist
dist-test
node_modules
5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
test
dist-test

example
src
test
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ node_js:
- "5"
- "6"
- "7"
script: "npm run test-travis"
- "8"
script: "npm run ci"
after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
branches:
only:
- master
- master
- "2.0.0"
24 changes: 0 additions & 24 deletions example/app.js

This file was deleted.

24 changes: 0 additions & 24 deletions example/controller/store.js

This file was deleted.

17 changes: 0 additions & 17 deletions example/package.json

This file was deleted.

20 changes: 20 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
bail: false,
verbose: true,
collectCoverage: true,
testEnvironment: 'node',
collectCoverageFrom: [
'src/**/*.js',
'!**/node_modules/**',
'!**/vendor/**',
'!**/test/**',
],
coverageThreshold: {
global: {
branches: 90,
functions: 90,
lines: 90,
statements: 90,
},
},
};
20 changes: 20 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

var _router = require('./router');

var _router2 = _interopRequireDefault(_router);

var _plugin = require('./plugin');

var _plugin2 = _interopRequireDefault(_plugin);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = _router2.default;

_router2.default.Plugin = _plugin2.default;

// Plugin.correction = require('koa-oai-router-correction');
// Plugin.responses = require('koa-oai-router-responses');
// Plugin.parameters = require('koa-oai-router-parameters');
// Plugin.middleware = require('koa-oai-router-middleware');
34 changes: 0 additions & 34 deletions lib/oai-explorer.js

This file was deleted.

Loading

0 comments on commit 65a11f3

Please sign in to comment.