Skip to content

Commit 72c1f1d

Browse files
committed
Update to new plugin infrastructure (#614)
* Update to new plugin infrastructure * Update Travis, remove Yarn lock, formatting * Formatting * Update feathers-commons to latest
1 parent 5ffaa0f commit 72c1f1d

23 files changed

Lines changed: 80 additions & 7095 deletions

.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.gitignore

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
.DS_Store
2+
13
# Logs
24
logs
35
*.log
4-
npm-debug.log*
56

67
# Runtime data
78
pids
@@ -17,19 +18,13 @@ coverage
1718
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
1819
.grunt
1920

20-
# node-waf configuration
21-
.lock-wscript
22-
2321
# Compiled binary addons (http://nodejs.org/api/addons.html)
2422
build/Release
2523

2624
# Dependency directory
27-
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
25+
# Commenting this out is preferred by some people, see
26+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
2827
node_modules
2928

30-
tmp*
31-
.idea/
32-
33-
34-
# The compiled/babelified modules
35-
lib/
29+
# Users Environment Variables
30+
.lock-wscript

.istanbul.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
verbose: false
22
instrumentation:
3-
root: ./src/
4-
excludes:
5-
- lib/
3+
root: ./lib/
64
include-all-sources: true
75
reporting:
86
print: summary
@@ -14,4 +12,4 @@ reporting:
1412
statements: [50, 80]
1513
lines: [50, 80]
1614
functions: [50, 80]
17-
branches: [50, 80]
15+
branches: [50, 80]

.npmignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
.github
21
.editorconfig
2+
.jshintrc
33
.travis.yml
44
.istanbul.yml
55
.babelrc
66
.idea/
7-
src/
7+
.vscode/
88
test/
9-
!lib/
10-
coverage
11-
.github/
9+
coverage/
10+
.github/

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ language: node_js
33
node_js:
44
- node
55
- '6'
6-
- '4'
76
addons:
87
code_climate:
98
repo_token: 498707228e4260677935eadfa95a35c24a9c2e9877bf05200d9c3aafb520abf6
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import makeDebug from 'debug';
2-
import { stripSlashes } from 'feathers-commons';
3-
import Uberproto from 'uberproto';
1+
const debug = require('debug')('feathers:application');
2+
const { stripSlashes } = require('feathers-commons');
43

5-
import events from './events';
6-
import hooks from './hooks';
4+
const Uberproto = require('uberproto');
5+
const events = require('./events');
6+
const hooks = require('./hooks');
77

8-
const debug = makeDebug('feathers:application');
98
const Proto = Uberproto.extend({
109
create: null
1110
});
@@ -129,4 +128,4 @@ const application = {
129128
}
130129
};
131130

132-
export default application;
131+
module.exports = application;

src/events.js renamed to lib/events.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { EventEmitter } from 'events';
2-
import Proto from 'uberproto';
1+
const { EventEmitter } = require('events');
2+
const Proto = require('uberproto');
33

4-
export function eventHook () {
4+
const eventHook = exports.eventHook = function eventHook () {
55
return function (hook) {
66
const { app, service } = hook;
77
const eventName = app.eventMappings[hook.method];
@@ -12,9 +12,9 @@ export function eventHook () {
1212
service.emit(eventName, hook.result, hook);
1313
}
1414
};
15-
}
15+
};
1616

17-
export function eventMixin (service) {
17+
const eventMixin = exports.eventMixin = function eventMixin (service) {
1818
if (service._serviceEvents) {
1919
return;
2020
}
@@ -54,9 +54,9 @@ export function eventMixin (service) {
5454
service._hookEvents.push(event);
5555
}
5656
});
57-
}
57+
};
5858

59-
export default function () {
59+
module.exports = function () {
6060
return function () {
6161
const app = this;
6262

@@ -79,4 +79,4 @@ export default function () {
7979

8080
app.mixins.push(eventMixin);
8181
};
82-
}
82+
};

src/hooks.js renamed to lib/hooks.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import {
2-
hooks as commons, validateArguments, isPromise
3-
} from 'feathers-commons';
1+
const {
2+
hooks,
3+
validateArguments,
4+
isPromise
5+
} = require('feathers-commons');
46

57
const {
68
createHookObject, getHooks, processHooks, enableHooks, makeArguments
7-
} = commons;
9+
} = hooks;
810

9-
export function hookMixin (service) {
11+
const hookMixin = exports.hookMixin = function hookMixin (service) {
1012
if (typeof service.hooks === 'function') {
1113
return;
1214
}
@@ -102,9 +104,9 @@ export function hookMixin (service) {
102104
});
103105

104106
service.mixin(mixin);
105-
}
107+
};
106108

107-
export default function () {
109+
module.exports = function () {
108110
return function () {
109111
const app = this;
110112

@@ -119,4 +121,4 @@ export default function () {
119121

120122
app.mixins.push(hookMixin);
121123
};
122-
}
124+
};

lib/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const Proto = require('uberproto');
2+
const Application = require('./application');
3+
const version = require('./version');
4+
5+
function createApplication () {
6+
const app = {};
7+
8+
// Mix in the base application
9+
Proto.mixin(Application, app);
10+
11+
app.init();
12+
13+
return app;
14+
}
15+
16+
createApplication.version = version;
17+
18+
module.exports = createApplication;

lib/version.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = '3.0.0-pre.0';

0 commit comments

Comments
 (0)