Skip to content

Commit

Permalink
docs: add schema.json
Browse files Browse the repository at this point in the history
  • Loading branch information
cethien authored and JanDeDobbeleer committed Jan 1, 2025
1 parent 5251f7c commit 7dcc6c4
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
1 change: 1 addition & 0 deletions website/docs/setup/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The custom location can be a local file, or a URL pointing to a remote config.
## Example

```yaml
# yaml-language-server: $schema=https://aliae.dev/schema.json
alias:
- name: a
value: aliae
Expand Down
153 changes: 153 additions & 0 deletions website/static/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"if": {
"type": "string",
"description": "golang template (https://golang.org/pkg/text/template/) conditional statement, see if (https://aliae.dev/docs/setup/if)"
}
},
"type": "object",
"properties": {
"alias": {
"type": "array",
"description": "alias definitions (https://aliae.dev/docs/setup/alias)",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "the alias name"
},
"value": {
"type": "string",
"description": "the command(s) you want to execute, supports templating (https://aliae.dev/docs/setup/templates)"
},
"type": {
"type": "string",
"oneOf": [
{
"const": "command",
"description": "a regular alias, value is a one-liner (default)"
},
{
"const": "function",
"description": "a code block to be placed inside a function"
},
{
"const": "git",
"description": "a git alias definition"
}
]
},
"if": {
"$ref": "#/definitions/if"
}
},
"required": [
"name",
"value"
]
}
},
"env": {
"type": "array",
"description": "environment variable definitions (https://aliae.dev/docs/setup/env)",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "the variable name"
},
"value": {
"type": "string",
"description": "the variable value, supports templating (https://aliae.dev/docs/setup/templates)"
},
"delimiter": {
"type": "string",
"description": "if you want to join an array of string values (separated by newlines), supports templating (https://aliae.dev/docs/setup/templates)"
},
"if": {
"$ref": "#/definitions/if"
},
"persist": {
"type": "boolean",
"description": "if you want to persist the environment variable into the registry for the current user (Windows only)"
},
"type": {
"type": "string",
"description": "type to export to",
"enum": [
"string",
"array"
]
}
}
}
},
"path": {
"type": "array",
"description": "PATH entry definitions (https://aliae.dev/docs/setup/path)",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string",
"description": "the path entires you want to add, separated by a newline. Supports templating (https://aliae.dev/docs/setup/templates)"
},
"if": {
"$ref": "#/definitions/if"
},
"persist": {
"type": "boolean",
"description": "if you want to persist the environment variable into the registry for the current user (Windows only)"
},
"force": {
"type": "boolean",
"description": "if you want to always export the path even if it already exists in your current shell"
}
}
}
},
"script": {
"type": "array",
"description": "script definitions (https://aliae.dev/docs/setup/script)",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string",
"description": "the script you want to load. Supports templating (https://aliae.dev/docs/setup/templates)"
},
"if": {
"$ref": "#/definitions/if"
}
}
}
},
"link": {
"type": "array",
"description": "symbolic link definitions (https://aliae.dev/docs/setup/link)",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "the link file/folder to create, supports templating (https://aliae.dev/docs/setup/templates)"
},
"target": {
"type": "string",
"description": "the target file/folder, supports templating (https://aliae.dev/docs/setup/templates)"
},
"if": {
"$ref": "#/definitions/if"
},
"mkdir": {
"type": "boolean",
"description": "if you want to create name's parent directory if it doesn't exist"
}
}
}
}
}
}

0 comments on commit 7dcc6c4

Please sign in to comment.