build
build copied to clipboard
chore: add JSON schema for `netlify.toml`
Summary
This PR adds a new JSON schema file for netlify.toml. A direct link to this file will be added to https://github.com/SchemaStore/schemastore. Most IDEs (vscode with extension, intellij) try to read schemas from this store.
In the future, the schema could even be used to validate the netlify.toml
file in @netlify/config
, as I saw right now we have some hardcoded validation in the code.
The new package is private for now, so even if we want to rename it later into maybe config-validation
we can simply do this.
I added docs as reviewer, because I added a lot of links pointing to the docs and also copied most of the text from the docs.
Ref: https://github.com/netlify/pod-compute/issues/138
![Screenshot 2023-03-03 at 17 01 46](https://user-images.githubusercontent.com/231804/222768025-e1f6e0bf-4c5d-4330-bb5f-a635fefbc538.png)
![Screenshot 2023-03-03 at 17 07 39](https://user-images.githubusercontent.com/231804/222769438-47b6e4fc-9b59-4a2d-8dd0-f4516854f9d4.png)
A picture of a cute animal (not mandatory, but encouraged)
@danez any updates on this one? Would love having autocompletion for the toml 😂
~This pull request adds or modifies JavaScript (.js
, .cjs
, .mjs
) files. Consider converting them to TypeScript.~
Thank you for converting JavaScript files to TypeScript 🎉"
and the
functions
field on the build settings
The docs though say it should be this:
[functions]
directory = "my_functions"
maybe [build] -> functions
is the old way of doing it?
and the
functions
field on the build settingsThe docs though say it should be this:
[functions] directory = "my_functions"
maybe
[build] -> functions
is the old way of doing it?
mhm maybe @eduardoboucas can put some light on that?
and the
functions
field on the build settingsThe docs though say it should be this:
[functions] directory = "my_functions"
maybe
[build] -> functions
is the old way of doing it?
Looks like it was an older version of the config: https://github.com/netlify/build/blob/f1d8ebc03b95d1e614ce64ad4083c3f7eb420c7b/packages/config/src/functions_config.js#L12
I added it as deprecated.
I solved all the review comments. I had to rebase because of conflicts, but all new changes are in separate new commits. starting with chore: add test for cache
The config for edge functions is currently incorrect in the schema:
-
excludePattern
,excludePath
andpattern
are missing from the schema -
path
is currently only allowed to be a string, but it can also be an array of strings