Skip to content

Commit bc2137c

Browse files
committed
chore: review fixes
1 parent d746a1c commit bc2137c

File tree

6 files changed

+51
-25
lines changed

6 files changed

+51
-25
lines changed

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

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,11 @@
610610
"type": "number",
611611
"default": 8888
612612
},
613+
"staticServerPort": {
614+
"title": "Static server port",
615+
"description": "Port for the static file server. This value will only take effect if `framework` is set to `#static` or `#auto` without any framework being detected.",
616+
"type": "number"
617+
},
613618
"targetPort": {
614619
"title": "Target port",
615620
"description": "Port for your application server, framework, or site generator. If provided, the CLI will wait until the provided `targetPort` is reachable and then proxy requests to it. If you specify values for both `command` and `targetPort`, `framework` must be `#custom`.",
@@ -635,25 +640,27 @@
635640
"description": "Secret used to verify tokens for JWT-based redirects.",
636641
"type": "string"
637642
},
643+
"envFiles": {
644+
"title": "Dotenv files",
645+
"description": "List of dotenv files to consider loading. Defaults to `.env.development.local, .env.local, .env.development, .env` in this order.",
646+
"type": "array",
647+
"default": [".env.development.local", ".env.local", ".env.development", ".env"],
648+
"items": {
649+
"title": "Filename",
650+
"description": "The name of the dotenv file.",
651+
"type": "string"
652+
}
653+
},
638654
"autoLaunch": {
639-
"title": "Publish path",
655+
"title": "Automatically launch browser",
640656
"description": "Boolean value that determines whether Netlify Dev launches the local server address in your browser.",
641657
"type": "boolean"
642658
},
643659
"framework": {
644-
"title": "Publish path",
645-
"description": "Setting to use if a project is detected incorrectly, flagged by multiple detectors, or requires a `command` and `targetPort`.",
660+
"title": "Framework",
661+
"description": "Setting to use if a project is detected incorrectly, flagged by multiple detectors, or requires a `command` and `targetPort`. Possible values are `#auto`, `#static`, `#custom` or a framework name.",
646662
"type": "string",
647-
"enum": ["#auto", "#static", "#custom"],
648-
"x-taplo": {
649-
"docs": {
650-
"enumValues": [
651-
"Default, tests all available detectors.",
652-
"Use only a static file server.",
653-
"Use the `command` value to run an app server and the `targetPort` value to connect to it. Required if `command` and `targetPort` are both set."
654-
]
655-
}
656-
}
663+
"default": "#auto"
657664
},
658665
"https": {
659666
"title": "HTTPS",

packages/config-schema/tests/fixtures/dev-errors/snapshot.snap

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,22 @@
2828
"schemaPath": "#/properties/dev/properties/command/type",
2929
},
3030
{
31-
"instancePath": "/dev/framework",
31+
"instancePath": "/dev/envFiles",
3232
"keyword": "type",
33-
"message": "must be string",
33+
"message": "must be array",
3434
"params": {
35-
"type": "string",
35+
"type": "array",
3636
},
37-
"schemaPath": "#/properties/dev/properties/framework/type",
37+
"schemaPath": "#/properties/dev/properties/envFiles/type",
3838
},
3939
{
4040
"instancePath": "/dev/framework",
41-
"keyword": "enum",
42-
"message": "must be equal to one of the allowed values",
41+
"keyword": "type",
42+
"message": "must be string",
4343
"params": {
44-
"allowedValues": [
45-
"#auto",
46-
"#static",
47-
"#custom",
48-
],
44+
"type": "string",
4945
},
50-
"schemaPath": "#/properties/dev/properties/framework/enum",
46+
"schemaPath": "#/properties/dev/properties/framework/type",
5147
},
5248
{
5349
"instancePath": "/dev/functionsPort",
@@ -121,6 +117,15 @@
121117
},
122118
"schemaPath": "#/properties/dev/properties/publish/type",
123119
},
120+
{
121+
"instancePath": "/dev/staticServerPort",
122+
"keyword": "type",
123+
"message": "must be number",
124+
"params": {
125+
"type": "number",
126+
},
127+
"schemaPath": "#/properties/dev/properties/staticServerPort/type",
128+
},
124129
{
125130
"instancePath": "/dev/targetPort",
126131
"keyword": "type",

packages/config-schema/tests/fixtures/dev-errors/test.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ command = 1
33
port = "string"
44
targetPort = "8000"
55
functionsPort = "8000"
6+
staticServerPort = "5858"
67
publish = 1
78
jwtRolePath = 1
89
jwtSecret = 1
910
autoLaunch = 1
1011
framework = 1
1112
other = 1
13+
envFiles = 1
1214
[dev.https]
1315
certFile = 1
1416
keyFile = 1

packages/config-schema/tests/fixtures/dev-errors2/snapshot.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{
22
"errors": [
3+
{
4+
"instancePath": "/dev/envFiles/0",
5+
"keyword": "type",
6+
"message": "must be string",
7+
"params": {
8+
"type": "string",
9+
},
10+
"schemaPath": "#/properties/dev/properties/envFiles/items/type",
11+
},
312
{
413
"instancePath": "/dev/https",
514
"keyword": "required",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[dev]
2+
envFiles = [1]
23
[dev.https]
34
certFile = "cert.pem"

packages/config-schema/tests/fixtures/dev-pass/test.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ command = "yarn start"
33
port = 8888
44
targetPort = 3000
55
functionsPort = 3000
6+
staticServerPort = 5858
67
publish = "dist"
78
jwtRolePath = "app_metadata.authorization.roles"
89
jwtSecret = "MY_JWT_SECRET_VALUE"
910
autoLaunch = true
1011
framework = "#custom"
12+
envFiles = [".env", ".env.local"]
1113
[dev.https]
1214
certFile = "cert.pem"
1315
keyFile = "key.pem"

0 commit comments

Comments
 (0)