-
-
Notifications
You must be signed in to change notification settings - Fork 743
/
index.js
68 lines (60 loc) · 1.55 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
module.exports = {
async prompt ({ config }) {
const { feathers } = config.helpers;
const hasSocketio = feathers.transports && feathers.transports.includes('websockets');
const dependencies = [
'@feathersjs/feathers',
'@feathersjs/errors',
'@feathersjs/schema',
'@feathersjs/configuration',
'@feathersjs/authentication',
'@feathersjs/transport-commons',
'winston'
];
const devDependencies = [
'nodemon',
'axios',
'mocha'
];
if (hasSocketio) {
dependencies.push('@feathersjs/socketio');
}
if (feathers.database !== 'custom') {
dependencies.push(`feathers-${feathers.database}`);
}
if (feathers.framework === 'koa') {
dependencies.push(
'@feathersjs/koa',
'koa-static'
);
}
if (feathers.framework === 'express') {
dependencies.push(
'@feathersjs/express',
'compression',
'helmet'
);
}
if (feathers.language === 'ts') {
devDependencies.push(
'@types/mocha',
feathers.framework === 'koa' ? '@types/koa-static' : '@types/compression',
'@types/node',
'nodemon',
'ts-node',
'typescript',
'shx'
);
}
return {
hasSocketio,
dependencies,
devDependencies
};
},
async rendered (result, config) {
const { args: { dependencies, devDependencies } } = result;
await config.helpers.install(config, dependencies);
await config.helpers.install(config, devDependencies, true);
}
}