-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneuw.schema.json
146 lines (146 loc) · 4.32 KB
/
neuw.schema.json
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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A descriptive name of the template."
},
"description": {
"type": "string",
"description": "A concise description of the template, further detailing what type of project it can be used to bootstrap."
},
"variables": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the variable, this should be a readable and concise name."
},
"description": {
"type": "string",
"description": "The concise description of how the variable is used within the template."
},
"identifier": {
"type": "string",
"minLength": 1,
"pattern": "^[A-Za-z]+$",
"description": "The identifier that this variable will be referenced by in evaluated content."
},
"default": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
}
],
"description": "The default value of this variable."
},
"required": {
"type": "boolean",
"description": "Whether the variable is required to be set."
},
"type": {
"oneOf": [
{
"type": "string",
"enum": ["string", "boolean", "double", "int", "any"]
},
{
"type": "object",
"additionalProperties": true,
"properties": {
"base": {
"type": "string",
"enum": ["string", "boolean", "double", "int"]
}
},
"description": "A refined base type that can add additional rules."
}
],
"description": "The type of the variable, can be a base type or a refined base type."
}
},
"required": ["name", "identifier", "type"]
},
"description": "The variables that this template defines to customize bootstrapping."
},
"commands": {
"type": "array",
"items": {
"type": "object",
"properties": {
"stage": {
"type": "string",
"enum": ["post-write", "pre-write"],
"description": "The stage at which this command will run.",
"enumDesc": "A command can run before the structure of the template is written, or after. Commands will always run after variables have been evaluated."
},
"condition": {
"type": "string",
"description": "The condition that determines whether this command will execute. This property is optional, but if defined, it should evaluate to a boolean value, any other value will mean the command will automatically be ignored."
},
"command": {
"type": "string",
"description": "The actual command that will be run."
}
},
"required": ["stage", "command"]
},
"description": "The commands executed in different stages of the building of this template."
},
"structure": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the structure item."
},
"content": {
"oneOf": [
{
"type": "string",
"description": "The content of this file structure item."
},
{
"type": "array",
"items": {
"$ref": "#/properties/structure/items",
"type": "string"
},
"description": "The children of this directory structure item."
}
],
"description": "Either string content (indicating that this item is a file), or an array of children items (indicating that this item is a directory)."
},
"condition": {
"type": "string",
"description": "The condition that determines whether this structure item will be written. This property is optional, but if defined, it should evaluate to a boolean value, any other value will mean the structure item will automatically be ignored."
}
},
"dependencies": {
"content": {
"not": {
"required": ["children"]
}
}
},
"required": ["name"]
},
"description": "The files and folders that make up this template."
}
},
"required": ["name", "structure"],
"title": "Neuw Template",
"description": "Details a template that can be used to bootstrap a project via Neuw."
}