Skip to content

Commit ca1d575

Browse files
committed
chore: add template
1 parent 8193fb4 commit ca1d575

File tree

7 files changed

+108
-1
lines changed

7 files changed

+108
-1
lines changed

packages/config-schema/src/schema/netlify-toml.schema.json

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
"title": "Environment Variables",
2828
"description": "Define build environment variables. Variables set here override those set with the Netlify UI, CLI, or API. Be mindful when using this option and avoid committing sensitive values to public source repositories.",
2929
"type": "object",
30-
"additionalProperties": true
30+
"additionalProperties": {
31+
"type": "string"
32+
}
3133
},
3234
"Processing": {
3335
"title": "Post processing",
@@ -650,6 +652,38 @@
650652
"key": "https://docs.netlify.com/configure-builds/file-based-configuration/#netlify-dev"
651653
}
652654
}
655+
},
656+
"template": {
657+
"title": "Template configuration",
658+
"description": "",
659+
"type": "object",
660+
"additionalProperties": false,
661+
"properties": {
662+
"incoming-hooks": {
663+
"title": "Incoming hooks",
664+
"description": "A list of incoming hooks for the users site. This is very useful if you want to allow a third party service to control when to deploy the site. This is what headless CMS services like Contentful and DatoCMS do.",
665+
"type": "array",
666+
"default": [""],
667+
"items": {
668+
"title": "Integrations",
669+
"description": "The name of an integration.",
670+
"type": "string"
671+
}
672+
},
673+
"environment": {
674+
"title": "Environment Variables",
675+
"description": "A list of required environment variables. This is the way to let users configure specific configuration options upon deployment. It also enables customization without having to change the code of the base template.",
676+
"type": "object",
677+
"additionalProperties": {
678+
"type": "string"
679+
}
680+
}
681+
},
682+
"x-taplo": {
683+
"links": {
684+
"key": "https://docs.netlify.com/site-deploys/create-deploys/#template-configuration"
685+
}
686+
}
653687
}
654688
},
655689
"x-taplo": {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"errors": [
3+
{
4+
"instancePath": "/template",
5+
"keyword": "additionalProperties",
6+
"message": "must NOT have additional properties",
7+
"params": {
8+
"additionalProperty": "other",
9+
},
10+
"schemaPath": "#/properties/template/additionalProperties",
11+
},
12+
{
13+
"instancePath": "/template/environment",
14+
"keyword": "type",
15+
"message": "must be object",
16+
"params": {
17+
"type": "object",
18+
},
19+
"schemaPath": "#/properties/template/properties/environment/type",
20+
},
21+
{
22+
"instancePath": "/template/incoming-hooks",
23+
"keyword": "type",
24+
"message": "must be array",
25+
"params": {
26+
"type": "array",
27+
},
28+
"schemaPath": "#/properties/template/properties/incoming-hooks/type",
29+
},
30+
],
31+
"valid": false,
32+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[template]
2+
incoming-hooks = 1
3+
other = 1
4+
environment = 1
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"errors": [
3+
{
4+
"instancePath": "/template/environment/ASDFG",
5+
"keyword": "type",
6+
"message": "must be string",
7+
"params": {
8+
"type": "string",
9+
},
10+
"schemaPath": "#/properties/template/properties/environment/additionalProperties/type",
11+
},
12+
{
13+
"instancePath": "/template/incoming-hooks/0",
14+
"keyword": "type",
15+
"message": "must be string",
16+
"params": {
17+
"type": "string",
18+
},
19+
"schemaPath": "#/properties/template/properties/incoming-hooks/items/type",
20+
},
21+
],
22+
"valid": false,
23+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[template]
2+
incoming-hooks = [1]
3+
4+
[template.environment]
5+
ASDFG = 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"errors": undefined,
3+
"valid": true,
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[template]
2+
incoming-hooks = ["Contentful"]
3+
4+
[template.environment]
5+
ASDFG = "STRING"

0 commit comments

Comments
 (0)