cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.56k stars 259 forks source link

add devenv.schema.json for devenv.yaml #598

Closed bobvanderlinden closed 3 weeks ago

bobvanderlinden commented 1 year ago

Currently devenv.yaml doesn't have autocompletion or a schema. Whenever an editor supports the yaml language server it is possible to add schema information using # yaml-language-server: $schema=.

This adds a JSON schema for devenv.yaml. It should be hosted on https://devenv.sh/devenv.schema.json

The schema url is used in the simple example's devenv.yaml.

For devenv.yaml in the root of devenv I added the line, but referring to the devenv.schema.json in the same repo. This should already work regardless of whether the schema is published on devenv.sh already.

shyim commented 11 months ago

After merge we should adjust https://github.com/SchemaStore/schemastore/blob/master/src/api/json/catalog.json so it works in most editors out of the box :)

bobvanderlinden commented 11 months ago

After merge we should adjust https://github.com/SchemaStore/schemastore/blob/master/src/api/json/catalog.json so it works in most editors out of the box :)

I wasn't aware! Great idea :smile::+1:

domenkozar commented 2 months ago

For #1005 we have a way to generate this from the types, but it's blocked on https://github.com/moonrepo/schematic/issues/105

domenkozar commented 3 weeks ago

1169 generates it now :)