Skip to content

Instantly share code, notes, and snippets.

@Mark-Marks
Last active January 4, 2025 20:40
Show Gist options
  • Select an option

  • Save Mark-Marks/1a1e094456c4f4d5b6dd1aa8978ff9eb to your computer and use it in GitHub Desktop.

Select an option

Save Mark-Marks/1a1e094456c4f4d5b6dd1aa8978ff9eb to your computer and use it in GitHub Desktop.
pesde toml schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"required": ["name", "version", "target"],
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"pattern": "[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+",
"title": "The name of the package.",
"description": "The name of the package. This is used to identify the package in the registry.\nThe name consists of a scope and a package name, separated by a slash (`/`). It may only contain lowercase letters, numbers, and underscores.\nThe first one to publish to a given scope gets to own it. If you want multiple people to be able to publish to the same scope, you can send a pull request to the pesde-pkg/index GitHub repository and add the GitHub user ID of the other person to the owners field of the scope.toml file of the given scope. For more information, see policies in the documentation."
},
"version": {
"type": "string",
"pattern": "^(\\^|=|>|<|<=|>=|~)?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "The version of the package.",
"description": "The version of the package. This must be a valid SemVer version, such as `1.2.3`",
"default": "0.1.0"
},
"description": {
"type": "string",
"title": "A short description of the package.",
"description": "A short description of the package. This is displayed on the package page in the registry."
},
"license": {
"type": "string",
"title": "The license of the package.",
"description": "The license of the package. It is recommended to use a SPDX license identifier, such as `MIT` or `Apache-2.0`.",
"default": "UNLICENSED"
},
"authors": {
"type": "array",
"title": "A list of authors of the package.",
"description": "Each author is a string containing the name of the author, optionally followed by an email address in angle brackets, and a website URL in parentheses. For example: `[\"John Doe <john.doe@acme.local> (https://acme.local)\"]`",
"items": {
"type": "string"
},
"default": []
},
"repository": {
"type": "string",
"pattern": "https?:\/\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)",
"title": "The URL of the repository where the package is hosted.",
"description": "The URL of the repository where the package is hosted. This is displayed on the package page in the registry."
},
"private": {
"type": "boolean",
"title": "A boolean indicating whether the package is private.",
"description": "A boolean indicating whether the package is private. If set to `true`, the package cannot be published to the registry.",
"default": false
},
"includes": {
"type": "array",
"title": "List of globs to include in the package when publishing.",
"description": "List of globs to include in the package when publishing. Files and directories not listed here will not be published.",
"items": {
"type": "string"
},
"default": []
},
"pesde_version": {
"type": "string",
"pattern": "^(\\^|=|>|<|<=|>=|~)?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "The version of pesde to use within this project.",
"description": "The version of pesde to use within this project. The `pesde` CLI will look at this field and run the correct version of pesde for this project."
},
"workspace_members": {
"type": "array",
"title": "A list of globs containing the members of this workspace.",
"items": {
"type": "string"
}
},
"target": {
"title": "Contains information about the target platform for the package.",
"description": "The `[target]` section contains information about the target platform for the package.\n[**Learn more**](https://docs.pesde.dev/reference/manifest/#target)",
"oneOf": [
{
"type": "object",
"properties": {
"environment": {
"enum": ["luau", "lune"],
"title": "The target environment for the package.",
"description": "The target environment for the package. This can be one of the following:\n- `luau`: Standalone Luau code that can be run using the `luau` CLI.\n- `lune`: Luau code that requires the Lune runtime.\n- `roblox`: Luau code that must be run in Roblox.\n- `roblox_server`: Same as `roblox`, but only for server-side code.",
"default": "lune"
},
"lib": {
"type": "string",
"title": "The entry point of the library exported by the package.",
"description": "This file is what will be required when the package is loaded using `require`.",
"default": "src/init.luau"
},
"bin": {
"type": "string",
"title": "The entry point of the binary exported by the package.",
"description": "The entry point of the binary exported by the package. This file is what will be run when the package is executed as a binary.",
"default": "lib/bin.luau"
},
"scripts": {
"type": "array",
"title": "A list of scripts that will be linked to the project’s `.pesde` directory, and copied over to the scripts section when initialising a project with this package.",
"default": []
}
},
"required": ["environment"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"environment": {
"enum": ["roblox", "roblox_server"],
"title": "The target environment for the package.",
"description": "The target environment for the package. This can be one of the following:\n- `luau`: Standalone Luau code that can be run using the `luau` CLI.\n- `lune`: Luau code that requires the Lune runtime.\n- `roblox`: Luau code that must be run in Roblox.\n- `roblox_server`: Same as `roblox`, but only for server-side code.",
"default": "roblox"
},
"lib": {
"type": "string",
"title": "The entry point of the library exported by the package.",
"description": "This file is what will be required when the package is loaded using `require`.",
"default": "src/init.luau"
},
"build_files": {
"type": "array",
"title": "A list of files that should be synced to Roblox when the package is installed.",
"description": "A list of files that should be synced to Roblox when the package is installed.\nThese files are passed to `roblox_sync_config_generator` when the package is installed in order to generate the necessary configuration.",
"items": {
"type": "string"
},
"default": []
}
},
"required": ["environment"],
"additionalProperties": false
}
]
},
"scripts": {
"type": "object",
"title": "List of scripts which can be ran with `pesde run`.",
"description": "Contains scripts that can be ran using the `pesde run` command. These scripts are ran using Lune.\nThere are also a few special scripts that are ran in certain cases by pesde.\n[**Learn more**](https://docs.pesde.dev/reference/manifest/#scripts-1)",
"patternProperties": {
"^(?!(?:roblox_sync_config_generator|sourcemap_generator)$).*": {
"type": "string"
}
},
"properties": {
"roblox_sync_config_generator": {
"type": "string",
"title": "Responsible for generating adequate configuration files for Roblox sync tools.",
"description": "This is responsible for generating adequate configuration files for Roblox sync tools.\n`process.args` will contain the directory containing the package, and the list of files specified within the `target.build_files` of the package.\nYou can find template scripts inside the `pesde-pkg/scripts` repository for various sync tools.",
"default": ".pesde/roblox_sync_config_generator.luau"
},
"sourcemap_generator": {
"type": "string",
"title": "Responsible for generating sourcemaps for packages that are installed.",
"description": "This is responsible for generating sourcemaps for packages that are installed. This is required to get proper types support when using Wally dependencies.\nThe script will receive the path to the package directory as the first argument through `process.args`.",
"default": ".pesde/sourcemap_generator.luau"
}
},
"additionalProperties": false
},
"indices": {
"type": "object",
"title": "A list of pesde indices where packages can be installed from.",
"description": "The `[indices]` section contains a list of pesde indices where packages can be installed from.\nThese can then be referenced in the `dependencies` of the package. The `default` index is used if no index is specified.\n[**Learn more**](https://docs.pesde.dev/reference/manifest/#indices)",
"properties": {
"default": {
"type": "string",
"pattern": "https?:\/\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)",
"title": "Default indice for pesde packages.",
"default": "https://github.com/pesde-pkg/index"
}
},
"patternProperties": {
"^(?!(?:default)$).*": {
"type": "string",
"pattern": "https?:\/\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)"
}
}
},
"wally_indices": {
"type": "object",
"title": "A list of Wally indices where packages can be installed from.",
"description": "The `[wally_indices]` section contains a list of Wally indices where packages can be installed from. This is used for Wally dependencies.\nThese can then be referenced in the `dependencies` of the package. The `default` index is used if no index is specified.\n[**Learn more**](https://docs.pesde.dev/reference/manifest/#wally_indices)",
"properties": {
"default": {
"type": "string",
"pattern": "https?:\/\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)",
"title": "Default indice for Wally packages.",
"default": "https://github.com/UpliftGames/wally-index"
}
},
"patternProperties": {
"^(?!(?:default)$).*": {
"type": "string",
"pattern": "https?:\/\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)"
}
}
},
"overrides": {
"type": "object",
"title": "Contains a list of overrides for dependencies.",
"description": "The `[overrides]` section contains a list of overrides for dependencies. This allows you to replace certain dependencies with different versions or even different packages.\nEach key in the overrides table is a comma-separated list of package paths. The path is a list of package names separated by `>`. For example, `foo>bar>baz` refers to the `baz` dependency of the `bar` package, which is a dependency of the `foo` package.\n[**Learn more**](https://docs.pesde.dev/guides/overrides/)",
"patternProperties": {
"^([a-zA-Z0-9_-]+>)|([a-zA-Z0-9_-]+)$": {
"$ref": "#/definitions/dependency"
}
},
"additionalProperties": false
},
"patches": {
"type": "object",
"title": "Contains a list of patches for dependencies.",
"description": "The `[patches]` section contains a list of patches for dependencies. This allows you to modify the source code of dependencies.\nEach key in the patches table is the package name, and the value is a table where the keys are the version and target, and the value is the path to the patch.\nThe patches can be generated using the `pesde patch` command.\nNot meant to be edited directly.\n[**Learn more**](https://docs.pesde.dev/guides/overrides/#patching-dependencies)",
"patternProperties": {
"^([a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+)$": {
"type": "object",
"patternProperties": {
"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))? (luau|lune|roblox|roblox_server)$": {
"type": "string",
"title": "Path to the .patch."
}
}
}
},
"additionalProperties": false
},
"place": {
"type": "object",
"title": "Used in Roblox projects to specify where packages are located in the Roblox datamodel.",
"description": "Used in Roblox projects to specify where packages are located in the Roblox model.\n[**Learn more**](https://docs.pesde.dev/reference/manifest/#place)",
"properties": {
"shared": {
"type": "string",
"title": "Path to shared packages.",
"default": "game.ReplicatedStorage.Packages"
},
"server": {
"type": "string",
"title": "Path to server packages.",
"default": "game.ServerScriptService.Packages"
}
},
"additionalProperties": false
},
"dependencies": {
"type": "object",
"title": "Contains a list of dependencies for the package.",
"description": "The `[dependencies]` section contains a list of dependencies for the package.\nEach key in the dependencies table is the name of the dependency, and the value is a dependency specifier.\nThere are several types of dependency specifiers.\n[**Learn more**](https://docs.pesde.dev/guides/dependencies/#_top)",
"patternProperties": {
".*": {
"$ref": "#/definitions/dependency"
}
}
},
"peer_dependencies": {
"type": "object",
"title": "Contains a list of peer dependencies for the package.",
"description": "The `[peer_dependencies]` section contains a list of peer dependencies for the package. These are dependencies that are required by the package, but are not installed automatically. Instead, they must be installed by the user of the package.\n[**Learn more**](https://docs.pesde.dev/guides/dependencies/#peer-dependencies)",
"patternProperties": {
".*": {
"$ref": "#/definitions/dependency"
}
}
},
"dev_dependencies": {
"type": "object",
"title": "Contains a list of development dependencies for the package.",
"description": "The `[dev_dependencies]` section contains a list of development dependencies for the package. These are dependencies that are only required during development, such as testing libraries or build tools. They are not installed when the package is used by another package.\n[**Learn more**](https://docs.pesde.dev/guides/dependencies/#dev-dependencies)",
"patternProperties": {
".*": {
"$ref": "#/definitions/dependency"
}
}
}
},
"definitions": {
"pesde_dependency": {
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+",
"title": "The scope and name of the package."
},
"version": {
"type": "string",
"pattern": "^(\\^|=|>|<|<=|>=|~)?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "The version of the package."
},
"index": {
"type": "string",
"title": "The pesde index to install the package from.",
"description": "The pesde index to install the package from. If not specified, the `default` index is used.",
"default": "default"
},
"target": {
"type": "string",
"title": "The target platform for the package.",
"description": "The target platform for the package. If not specified, the target platform of the current package is used."
}
},
"additionalProperties": false,
"required": ["name", "version"]
},
"wally_dependency": {
"type": "object",
"properties": {
"wally": {
"type": "string",
"pattern": "[a-zA-Z0-9_-]+\\/[a-zA-Z0-9_-]+",
"title": "The name of the package."
},
"version": {
"type": "string",
"pattern": "^(\\^|=|>|<|<=|>=|~)?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "The version of the package."
},
"index": {
"type": "string",
"title": "The Wally index to install the package from.",
"description": "The Wally index to install the package from. If not specified, the `default` index is used.",
"default": "default"
}
},
"additionalProperties": false,
"required": ["wally", "version"]
},
"git_dependency": {
"type": "object",
"properties": {
"repo": {
"type": "string",
"pattern": "([a-zA-Z0-9_-]+\\/[a-zA-Z0-9_-]+)|(?:git|ssh|https?|git@[-\\w.]+):(\/\/)?(.*?)(\\.git)(\/?|\\#[-\\d\\w._]+?)",
"title": "The URL of the Git repository.",
"description": "The URL of the Git repository. This can either be `<owner>/<name>` for a GitHub repository, or a full URL."
},
"rev": {
"type": "string",
"title": "The Git revision to install.",
"description": "The Git revision to install. This can be a tag or commit hash."
},
"path": {
"type": "string",
"title": "The path within the repository to install.",
"description": "The path within the repository to install. If not specified, the root of the repository is used."
}
},
"additionalProperties": false,
"required": ["repo", "rev"]
},
"workspace_dependency": {
"type": "object",
"properties": {
"workspace": {
"type": "string",
"pattern": "[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+",
"title": "The name of the package in the workspace."
},
"version": {
"type": "string",
"pattern": "^(\\^|=|>|<|<=|>=|~)?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?|(\\*|~|\\^|=)$",
"title": "The version requirement for the package.",
"description": "The version requirement for the package. This can be `^`, `*`, `=`, `~`, or a specific version requirement such as `^1.2.3`."
}
},
"additionalProperties": false,
"required": ["workspace, version"]
},
"dependency": {
"oneOf": [
{ "$ref": "#/definitions/pesde_dependency" },
{ "$ref": "#/definitions/wally_dependency" },
{ "$ref": "#/definitions/git_dependency" },
{ "$ref": "#/definitions/workspace_dependency" }
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment