-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathtemplate-plugins.schema.json
More file actions
165 lines (165 loc) · 5.82 KB
/
template-plugins.schema.json
File metadata and controls
165 lines (165 loc) · 5.82 KB
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
157
158
159
160
161
162
163
164
165
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://databricks.github.io/appkit/schemas/template-plugins.schema.json",
"title": "AppKit Template Plugins Manifest",
"description": "Aggregated plugin manifest for AppKit templates. Read by Databricks CLI during init to discover available plugins and their resource requirements.",
"type": "object",
"required": ["version", "plugins"],
"properties": {
"$schema": {
"type": "string",
"description": "Reference to the JSON Schema for validation"
},
"version": {
"type": "string",
"enum": ["1.0", "1.1"],
"description": "Schema version for the template plugins manifest"
},
"scaffolding": {
"$ref": "#/$defs/scaffolding"
},
"plugins": {
"type": "object",
"description": "Map of plugin name to plugin manifest with package source",
"additionalProperties": {
"$ref": "#/$defs/templatePlugin"
}
}
},
"additionalProperties": false,
"$defs": {
"scaffolding": {
"type": "object",
"description": "Template-level metadata for constructing the scaffolding CLI command.",
"required": ["command", "flags", "rules"],
"properties": {
"command": {
"type": "string",
"description": "The base CLI command for scaffolding."
},
"flags": {
"type": "object",
"description": "Map of flag name to flag descriptor.",
"additionalProperties": {
"type": "object",
"required": ["required", "description"],
"properties": {
"required": { "type": "boolean" },
"description": { "type": "string" },
"pattern": { "type": "string" },
"default": { "type": "string" }
},
"additionalProperties": false
}
},
"rules": {
"type": "array",
"items": { "type": "string" },
"description": "Rules for constructing the scaffolding command."
}
},
"additionalProperties": false
},
"templatePlugin": {
"type": "object",
"required": [
"name",
"displayName",
"description",
"package",
"resources"
],
"description": "Plugin manifest with package source information",
"properties": {
"name": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$",
"description": "Plugin identifier. Must be lowercase, start with a letter, and contain only letters, numbers, and hyphens.",
"examples": ["analytics", "server", "my-custom-plugin"]
},
"displayName": {
"type": "string",
"minLength": 1,
"description": "Human-readable display name for UI and CLI",
"examples": ["Analytics Plugin", "Server Plugin"]
},
"description": {
"type": "string",
"minLength": 1,
"description": "Brief description of what the plugin does",
"examples": ["SQL query execution against Databricks SQL Warehouses"]
},
"package": {
"type": "string",
"minLength": 1,
"description": "NPM package name that provides this plugin",
"examples": ["@databricks/appkit", "@my-org/custom-plugin"]
},
"requiredByTemplate": {
"type": "boolean",
"default": false,
"description": "When true, this plugin is required by the template and cannot be deselected during CLI init. The user will only be prompted to configure its resources. When absent or false, the plugin is optional and the user can choose whether to include it."
},
"onSetupMessage": {
"type": "string",
"description": "Message displayed to the user after project initialization. Use this to inform about manual setup steps (e.g. environment variables, resource provisioning)."
},
"postScaffold": {
"type": "array",
"description": "Ordered steps to follow after scaffolding.",
"items": {
"$ref": "plugin-manifest.schema.json#/$defs/postScaffoldStep"
}
},
"resources": {
"type": "object",
"required": ["required", "optional"],
"description": "Databricks resource requirements for this plugin",
"properties": {
"required": {
"type": "array",
"description": "Resources that must be available for the plugin to function",
"items": {
"$ref": "#/$defs/resourceRequirement"
}
},
"optional": {
"type": "array",
"description": "Resources that enhance functionality but are not mandatory",
"items": {
"$ref": "#/$defs/resourceRequirement"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"resourceType": {
"$ref": "plugin-manifest.schema.json#/$defs/resourceType"
},
"resourceFieldEntry": {
"allOf": [
{ "$ref": "plugin-manifest.schema.json#/$defs/resourceFieldEntry" },
{
"properties": {
"resolution": {
"type": "string",
"enum": [
"user-provided",
"platform-injected",
"static",
"cli-resolved"
],
"description": "Computed during sync. Indicates how the field's value is provided: user-provided (needs --set), platform-injected (auto-set at deploy), static (has a default value), or cli-resolved (resolved by the CLI during init)."
}
}
}
]
},
"resourceRequirement": {
"$ref": "plugin-manifest.schema.json#/$defs/resourceRequirement"
}
}
}