-
Notifications
You must be signed in to change notification settings - Fork 21
/
meta.js
122 lines (112 loc) · 2.84 KB
/
meta.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
"use strict";
module.exports = function(values) {
return {
questions: [
{
type: "confirm",
name: "apiGW",
message: "Add API Gateway (moleculer-web) service?",
default: true
},
{
type: "confirm",
name: "needTransporter",
message: "Would you like to communicate with other nodes?",
default: true
},
{
type: "list",
name: "transporter",
message: "Select a transporter",
choices: [
{ name: "NATS (recommended)", value: "NATS" },
{ name: "Redis", value: "Redis" },
{ name: "MQTT", value: "MQTT" },
{ name: "AMQP", value: "AMQP" },
{ name: "TCP", value: "TCP" },
{ name: "NATS Streaming", value: "STAN" },
{ name: "Kafka", value: "Kafka" },
{ name: "AMQP 1.0 (experimental)", value: "AMQP10" }
],
when(answers) { return answers.needTransporter; },
default: "NATS"
},
{
type: "confirm",
name: "needCacher",
message: "Would you like to use cache?",
default: false
},
{
type: "list",
name: "cacher",
message: "Select a cacher solution",
choices: [
{ name: "Memory", value: "Memory" },
{ name: "Redis", value: "Redis" }
],
when(answers) { return answers.needCacher; },
default: "Memory"
},
{
type: "confirm",
name: "dbService",
message: "Add DB sample service?",
default: true
},
{
type: "confirm",
name: "metrics",
message: "Would you like to enable metrics?",
default: true
},
{
type: "confirm",
name: "tracing",
message: "Would you like to enable tracing?",
default: true
},
{
type: "confirm",
name: "docker",
message: "Add Docker & Kubernetes sample files?",
default: true
},
{
type: "confirm",
name: "lint",
message: "Use ESLint to lint your code?",
default: true
}
],
metalsmith: {
before(metalsmith) {
const data = metalsmith.metadata();
data.redis = data.cacher == "Redis" || data.transporter == "Redis";
data.hasDepends = (data.needCacher && data.cacher !== 'Memory') || (data.needTransporter && data.transporter != "TCP");
}
},
skipInterpolation: [
//"public/index.html"
],
filters: {
"services/api.service.js": "apiGW",
"public/**/*": "apiGW",
"services/products.service.js": "dbService",
"mixins/db.mixin.js": "dbService",
"test/unit/mixins/db.mixin.spec.js": "dbService",
"test/integration/products.service.spec.js": "dbService",
"test/unit/services/products.spec.js": "dbService",
".eslintrc.js": "lint",
".dockerignore": "docker",
"docker-compose.*": "docker",
"Dockerfile": "docker",
"k8s.yaml": "docker"
},
completeMessage: `
To get started:
cd {{projectName}}
npm run dev
`
};
};