From 04b2c713a73396ac487e82993a940f83bffeae2c Mon Sep 17 00:00:00 2001 From: John Lago <750845+Lagoja@users.noreply.github.com> Date: Thu, 14 Mar 2024 14:12:13 -0700 Subject: [PATCH] Update JSON schema for plugin v2 --- .schema/devbox-plugin.schema.json | 90 +++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/.schema/devbox-plugin.schema.json b/.schema/devbox-plugin.schema.json index 42cfb0bc8c2..417df7d2987 100644 --- a/.schema/devbox-plugin.schema.json +++ b/.schema/devbox-plugin.schema.json @@ -21,6 +21,74 @@ "description": "A short description of the plugin and how it works. This will automatically display when the user first installs the plugin, or runs `devbox info`", "type": "string" }, + "packages": { + "description": "Collection of packages to install", + "oneOf": [ + { + "type": "array", + "items": { + "description": "Name and version of each package in name@version format.", + "type": "string" + } + }, + { + "type": "object", + "description": "Name of each package in {\"name\": {\"version\": \"1.2.3\"}} format.", + "patternProperties": { + ".*": { + "oneOf": [ + { + "type": "object", + "description": "Version number of the specified package in {\"version\": \"1.2.3\"} format.", + "properties": { + "version": { + "type": "string", + "description": "Version of the package" + }, + "platforms": { + "type": "array", + "description": "Names of platforms to install the package on. This package will be skipped for any platforms not on this list", + "items": { + "enum": [ + "i686-linux", + "aarch64-linux", + "aarch64-darwin", + "x86_64-darwin", + "x86_64-linux", + "armv7l-linux" + ] + } + }, + "excluded_platforms": { + "type": "array", + "description": "Names of platforms to exclude the package on", + "items": { + "enum": [ + "i686-linux", + "aarch64-linux", + "aarch64-darwin", + "x86_64-darwin", + "x86_64-linux", + "armv7l-linux" + ] + } + }, + "glibc_patch": { + "type": "boolean", + "description": "Whether to patch glibc to the latest available version for this package" + } + } + }, + { + "type": "string", + "description": "Version of the package to install." + } + ] + } + } + } + ] + }, "env": { "type": "object", "description": "List of additional environment variables to be set in the Devbox environment. These can be overridden by environment variables set in the user's devbox.json", @@ -48,8 +116,30 @@ "init_hook": { "type": ["array", "string"], "description": "Shell command to run right before initializing the user's shell, running a script, or starting a service" + }, + "scripts": { + "description": "List of command/script definitions to run with `devbox run `.", + "type": "object", + "patternProperties": { + ".*": { + "description": "Alias name for the script.", + "type": ["array", "string"], + "items": { + "type": "string", + "description": "The script's shell commands." + } + } + } } } + }, + "include": { + "description": "List of additional plugins to activate within your devbox shell", + "type": "array", + "items": { + "description": "Name of the plugin to activate.", + "type": "string" + } } }, "required": ["name", "version", "readme"]