You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Title says it.
I put the file in `.schema/` directory so that in future if we change
the schema we can align it with version. Meaning, we can add new schema
files with version numbers and enforce the schema based on the version
of devbox a user has installed. Putting it in root of this repository
would make the root too crowded especially if we add more schema files.
I'm going to host our schema in this repository and subsequently send a
PR to https://github.com/SchemaStore/schemastore/ with a link to the
schema file in our repo to register our repo in https://schemastore.org
afterwards, I can update the vscode extension to reference the
schemastore.org link and enforce our defined schema on files that are
named `devbox.json`
## How was it tested?
validated schema and examples of devbox.json in
https://www.jsonschemavalidator.net/
"description": "Defines fields and acceptable values of devbox.json",
6
+
"type": "object",
7
+
"properties": {
8
+
"packages": {
9
+
"description": "Collection of packages to install",
10
+
"oneOf": [
11
+
{
12
+
"type": "array",
13
+
"items": {
14
+
"description": "Name and version of each package in name@version format.",
15
+
"type": "string"
16
+
}
17
+
},
18
+
{
19
+
"type": "object",
20
+
"description": "Name of each package in {\"name\": \"version\"} format.",
21
+
"patternProperties": {
22
+
".*": {
23
+
"type": "string",
24
+
"description": "Version of the package to install."
25
+
}
26
+
}
27
+
},
28
+
{
29
+
"type": "object",
30
+
"description": "Name of each package in {\"name\": {\"version\": \"1.2.3\"}} format.",
31
+
"patternProperties": {
32
+
".*": {
33
+
"type": "object",
34
+
"description": "Version number of the specified package in {\"version\": \"1.2.3\"} format.",
35
+
"properties": {
36
+
"version": {
37
+
"type": "string",
38
+
"description": "Version of the package"
39
+
},
40
+
"platform": {},
41
+
"excluded_platform": {},
42
+
"glibc_patch": {}
43
+
}
44
+
}
45
+
}
46
+
}
47
+
]
48
+
},
49
+
"env": {
50
+
"description": "List of additional environment variables to be set in the Devbox environment. Values containing $PATH or $PWD will be expanded. No other variable expansion or command substitution will occur.",
51
+
"type": "object"
52
+
},
53
+
"shell": {
54
+
"description": "Definitions of scripts and actions to take when in devbox shell.",
55
+
"type": "object",
56
+
"properties": {
57
+
"init_hook": {
58
+
"type": [
59
+
"array",
60
+
"string"
61
+
],
62
+
"items": {
63
+
"description": "List of shell commands/scripts to run right after devbox shell starts.",
64
+
"type": "string"
65
+
}
66
+
},
67
+
"scripts": {
68
+
"description": "List of command/script definitions to run with `devbox run <script_name>`.",
0 commit comments