-
Notifications
You must be signed in to change notification settings - Fork 4
/
meta.js
83 lines (77 loc) · 1.74 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
"use strict";
module.exports = function (values) {
return {
questions: [
{
type: "list",
name: "transporter",
message: "Select a transporter",
choices: [
{ name: "TCP", value: "TCP" },
{ name: "NATS", value: "NATS" },
{ name: "MQTT", value: "MQTT" },
{ name: "AMQP", value: "AMQP" },
{ name: "Redis", value: "Redis" },
{ name: "NATS Streaming", value: "STAN" },
{ name: "Kafka", value: "Kafka" }
],
default: "TCP"
},
{
type: "confirm",
name: "needCacher",
message: "Would you like 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: "docker",
message: "Add Docker files?",
default: true
},
{
type: "confirm",
name: "lint",
message: "Use TSLint to lint your code?",
default: true
},
{
type: "confirm",
name: "jest",
message: "Setup unit tests with Jest?",
default: true
}
],
metalsmith: {
before(metalsmith) {
const data = metalsmith.metadata();
data.needTransporter = !!data.transporter;
data.redis = data.cacher == "Redis" || data.transporter == "Redis";
data.hasDepends = (data.needCacher && data.cacher !== 'Memory') || (data.needTransporter && data.transporter != "TCP");
}
},
"filters": {
"tslint.json": "lint",
"test/**/*": "jest",
".dockerignore": "docker",
"docker-compose.*": "docker",
"Dockerfile": "docker"
},
completeMessage: `
To get started:
cd {{projectName}}
npm run dev
`
};
};