-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathmeta.js
156 lines (146 loc) · 4.21 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
"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: "list",
name: "reporter",
message: "Select a reporter solution",
choices: [
{ name: "Console", value: "Console" },
{ name: "CSV", value: "Redis" },
{ name: "Event", value: "CSV" },
{ name: "Prometheus", value: "Prometheus" },
{ name: "Datadog", value: "Datadog" },
{ name: "StatsD", value: "StatsD" }
],
when(answers) { return answers.metrics; },
default: "Prometheus"
},
{
type: "confirm",
name: "tracing",
message: "Would you like to enable tracing?",
default: true
},
{
type: "list",
name: "exporter",
message: "Select an exporter solution",
choices: [
{ name: "Console", value: "Console" },
{ name: "EventLegacy", value: "EventLegacy" },
{ name: "Event", value: "CSV" },
{ name: "Jaeger", value: "Jaeger" },
{ name: "Datadog", value: "Datadog" },
{ name: "Zipkin", value: "Zipkin" },
{ name: "NewRelic", value: "NewRelic" }
],
when(answers) { return answers.tracing; },
default: "Console"
},
{
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.ts": "apiGW",
"public/**/*": "apiGW",
"services/products.service.ts": "dbService",
"mixins/db.mixin.ts": "dbService",
"test/mixins/db.mixin.spec.ts": "dbService",
"test/integration/products.service.spec.ts": "dbService",
"test/unit/services/products.spec.ts": "dbService",
".eslintrc.js": "lint",
"tsconfig.eslint.json": "lint",
".prettierignore": "lint",
".prettierrc.json": "lint",
".dockerignore": "docker",
"docker-compose.*": "docker",
"Dockerfile": "docker",
"k8s.yaml": "docker"
},
completeMessage: `
To get started:
cd {{projectName}}
npm run dev
`
};
};