Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add JSON schema for netlify.toml #4585

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

chore: add JSON schema for netlify.toml #4585

wants to merge 1 commit into from

Conversation

danez
Copy link
Contributor

@danez danez commented Oct 7, 2022

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

Kapture 2022-07-06 at 19 03 48

Screenshot 2022-07-06 at 19 16 12

Screenshot 2023-03-03 at 17 01 46

Screenshot 2023-03-03 at 17 07 39

A picture of a cute animal (not mandatory, but encouraged)

photo-1542736637-74169a802172

@lukasholzer
Copy link
Contributor

@danez any updates on this one? Would love having autocompletion for the toml 😂

@github-actions github-actions bot removed the stale label Feb 2, 2023
@danez danez changed the title chore: add JSON schema for netlify-toml WIP chore: add JSON schema for netlify.toml Mar 3, 2023
@danez danez self-assigned this Mar 3, 2023
@danez danez force-pushed the json-schema branch 2 times, most recently from 18e199e to 6847f55 Compare March 3, 2023 15:50
@danez danez requested a review from a team March 3, 2023 15:52
@danez danez marked this pull request as ready for review March 3, 2023 15:52
@danez danez requested a review from a team March 3, 2023 15:59
@danez danez force-pushed the json-schema branch 2 times, most recently from 98eb976 to 4a88be6 Compare March 3, 2023 16:12
@rstavchansky rstavchansky requested a review from codebyuma March 3, 2023 18:48
Copy link

@codebyuma codebyuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @danez, sorry for the delay in reviewing this.

I know you copied all of these from the docs but I left a number of suggested edits to make some items more concise, clearer, or to just follow a more consistent format. Hopefully they should be quick and easy to apply but let me know if you have questions.

Since there are a bunch of edits, I'll go ahead and request changes here. But I'll keep an eye out to re-review this once you're ready.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 30, 2023

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files. Consider converting them to TypeScript.
Thank you for converting JavaScript files to TypeScript 🎉"

codebyuma
codebyuma previously approved these changes Mar 30, 2023
Copy link

@codebyuma codebyuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @danez thanks for making these changes!

In this review, I spotted one typo that I missed last time and I tagged @klavavej to review the caching updates as I know the docs for EF caching are still a WIP. I just want to make sure we use the same language. I did leave some suggestions in the meantime.

I also checked all your links this time and can confirm they work as expected 👍

I don't see any blockers, so I'll approve. But it might be worth waiting for Kristen's approval too.

"definitions": {
"BasePath": {
"title": "Base path",
"description": "Directory to change to before starting a build. This is where we will look dependency management files such as `package.json` or `.nvmrc`. If not set, defaults to the root directory.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I must have made a typo in my suggestion, sorry. We're missing a word here

Suggested change
"description": "Directory to change to before starting a build. This is where we will look dependency management files such as `package.json` or `.nvmrc`. If not set, defaults to the root directory.",
"description": "Directory to change to before starting a build. This is where we will look for dependency management files such as `package.json` or `.nvmrc`. If not set, defaults to the root directory.",

klavavej
klavavej previously approved these changes Mar 30, 2023
Copy link
Contributor

@klavavej klavavej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the ping @codebyuma ! I left a few notes but nothing blocking from me either so I will approve

Copy link
Contributor

@lukasholzer lukasholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the template field is missing on the root and the functions field on the build settings.

[build]
  # This is where we will look for your lambda functions
  functions = "project/functions/"

and for example:

# Set enviroment variable prompts for templates
[template.environment]
  YOUR_ENV_KEYS_NEEDED = "Enter in the ENV key here"
  # ref https://bit.ly/2wQ1mVk
  incoming-hooks = ["Service-1"]

@danez
Copy link
Contributor Author

danez commented Apr 14, 2023

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?

@lukasholzer
Copy link
Contributor

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?

mhm maybe @eduardoboucas can put some light on that?

@danez danez dismissed stale reviews from klavavej and codebyuma via a973943 April 14, 2023 14:29
codebyuma
codebyuma previously approved these changes Jun 12, 2023
Copy link

@codebyuma codebyuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one small suggested edit but otherwise the latest updates look good to me 🤞

codebyuma
codebyuma previously approved these changes Jun 13, 2023
Copy link

@codebyuma codebyuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you still need another technical review but the copy looks good to me 🚢

@danez danez requested a review from a team as a code owner July 6, 2023 10:44
@danez
Copy link
Contributor Author

danez commented Jul 14, 2023

The config for edge functions is currently incorrect in the schema:

  • excludePattern, excludePath and pattern are missing from the schema
  • path is currently only allowed to be a string, but it can also be an array of strings

@danez danez removed their assignment Aug 15, 2023
@github-actions github-actions bot added the stale label Oct 14, 2023
@github-actions github-actions bot removed the stale label Jul 27, 2024
@github-actions github-actions bot added the stale label Sep 25, 2024
Copy link

@github-actions github-actions bot removed the stale label Sep 26, 2024
@github-actions github-actions bot added the stale label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants