{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://json.schemastore.org/gleam.toml.schema.json", "title": "gleam.toml", "description": "A gleam project configuration", "type": "object", "x-taplo-info": { "authors": ["Lily Rose (https://github.com/LilyRose2798)"], "patterns": ["^(.*(/|\\\\)gleam\\.toml|gleam\\.toml)$"] }, "x-tombi-toml-version": "v1.0.0", "x-tombi-table-keys-order": "schema", "properties": { "name": { "description": "The name of your project", "type": "string", "pattern": "[a-z][a-z0-9_]+", "examples": ["my_project"] }, "version": { "description": "The version of your project", "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z-.]+)?(\\+[0-9A-Za-z-.]+)?$", "examples": ["1.0.0"] }, "gleam_version": { "description": "The version of gleam to use for the project", "type": "string", "examples": [">= 0.30.0", "1.12.0"] }, "licences": { "description": "The licences which the project uses, in SPDX format", "type": "array", "items": { "description": "An SPDX licence name", "type": "string", "examples": ["Apache-2.0", "MIT"] }, "examples": [["Apache-2.0", "MIT"]] }, "description": { "description": "A short description of your project", "type": "string", "examples": ["Gleam bindings to..."] }, "documentation": { "description": "Documentation specific configuration", "type": "object", "properties": { "pages": { "description": "Additional markdown pages to be included in generated HTML docs", "type": "array", "items": { "description": "Additional markdown page to be included in generated HTML docs", "type": "object", "properties": { "title": { "description": "The title of the page", "type": "string", "examples": ["My Page"] }, "path": { "description": "The path for the generated html to be output to", "type": "string", "examples": ["my-page.html"] }, "source": { "description": "The path where the markdown document is located", "type": "string", "examples": ["./path/to/my-page.md"] } }, "additionalProperties": false, "examples": [ { "title": "My Page", "path": "my-page.html", "source": "./path/to/my-page.md" } ] }, "examples": [ [ { "title": "My Page", "path": "my-page.html", "source": "./path/to/my-page.md" } ] ] } }, "additionalProperties": false, "examples": [ { "pages": [ { "title": "My Page", "path": "my-page.html", "source": "./path/to/my-page.md" } ] } ] }, "dependencies": { "description": "The packages the project needs to compile and run", "type": "object", "patternProperties": { "[a-z][a-z0-9_]+": { "oneOf": [ { "description": "The Hex version requirements for the dependency", "type": "string", "examples": [ ">= 0.18.0 and < 2.0.0", ">= 0.2.0 and < 2.0.0", ">= 2.1.0 and < 3.0.0" ] }, { "description": "A local dependency", "type": "object", "properties": { "path": { "description": "The path of the local dependency", "type": "string", "examples": ["../my_other_project"] } }, "required": ["path"], "additionalProperties": false, "examples": [{ "path": "../my_other_project" }] }, { "description": "A git dependency", "type": "object", "properties": { "git": { "description": "The git repository of the dependency", "type": "string", "examples": [ "git@github.com:my-project/my-library.git", "git@github.com:gleam-lang/stdlib.git" ] }, "ref": { "description": "The git ref to use for the dependency", "type": "string", "examples": ["main", "a8b3c5d82"] } }, "required": ["git", "ref"], "additionalProperties": false, "examples": [ { "git": "git@github.com:my-project/my-library.git", "ref": "main" }, { "git": "git@github.com:gleam-lang/stdlib.git", "ref": "a8b3c5d82" } ] } ], "examples": [ ">= 0.18.0 and < 2.0.0", ">= 0.2.0 and < 2.0.0", ">= 2.1.0 and < 3.0.0", { "path": "../my_other_project" }, { "git": "git@github.com:my-project/my-library.git", "ref": "a8b3c5d82" }, { "git": "git@github.com:gleam-lang/stdlib.git", "ref": "main" } ] } }, "additionalProperties": false, "examples": [ { "gleam_stdlib": ">= 0.18.0 and < 2.0.0", "gleam_erlang": ">= 0.2.0 and < 2.0.0", "gleam_http": ">= 2.1.0 and < 3.0.0", "my_other_project": { "path": "../my_other_project" }, "my_git_library": { "git": "git@github.com:my-project/my-library.git", "ref": "a8b3c5d82" }, "latest_stdlib": { "git": "git@github.com:gleam-lang/stdlib.git", "ref": "main" } } ] }, "dev-dependencies": { "description": "The packages the project needs for the tests", "type": "object", "patternProperties": { "[a-z][a-z0-9_]+": { "oneOf": [ { "description": "The Hex version requirements for the dev dependency", "type": "string", "examples": [">= 1.0.0 and < 2.0.0"] }, { "description": "A local dev dependency", "type": "object", "properties": { "path": { "description": "The path of the local dev dependency", "type": "string", "examples": ["../my_other_project"] } }, "required": ["path"], "additionalProperties": false, "examples": [{ "path": "../my_other_project" }] }, { "description": "A git dev dependency", "type": "object", "properties": { "git": { "description": "The git repository of the dev dependency", "type": "string", "examples": ["git@github.com:my-project/my-testing-library.git"] }, "ref": { "description": "The git ref to use for the dev dependency", "type": "string", "examples": ["main", "a8b3c5d82"] } }, "required": ["git", "ref"], "additionalProperties": false, "examples": [{ "git": "git@github.com:my-project/my-testing-library.git", "ref": "main" }] } ], "examples": [ ">= 0.18.0 and < 2.0.0", ">= 0.2.0 and < 2.0.0", ">= 2.1.0 and < 3.0.0", { "path": "../my_other_project" }, { "git": "git@github.com:my-project/my-library.git", "ref": "a8b3c5d82" }, { "git": "git@github.com:gleam-lang/stdlib.git", "ref": "main" } ] } }, "additionalProperties": false, "examples": [ { "gleeunit": ">= 1.0.0 and < 2.0.0" } ] }, "repository": { "description": "The source code repository location", "oneOf": [ { "type": "object", "properties": { "type": { "description": "The type of repository", "type": "string", "enum": ["github", "gitlab", "sourcehut", "bitbucket", "codeberg"], "examples": ["github", "gitlab", "sourcehut", "bitbucket", "codeberg"] }, "user": { "description": "The user that the repository is under", "type": "string", "examples": ["example"] }, "repo": { "description": "The repository name", "type": "string", "examples": ["my_project"] }, "tag_prefix": { "description": "The tag prefix of the repository", "type": "string", "examples": ["v"] } }, "required": ["type", "user", "repo"], "additionalProperties": false, "examples": [ { "type": "github", "user": "example", "repo": "my_project" }, { "type": "gitlab", "user": "example", "repo": "my_project" }, { "type": "sourcehut", "user": "example", "repo": "my_project" }, { "type": "bitbucket", "user": "example", "repo": "my_project" }, { "type": "codeberg", "user": "example", "repo": "my_project" } ] }, { "type": "object", "properties": { "type": { "description": "The type of repository", "type": "string", "enum": ["forgejo", "gitea"], "examples": ["forgejo", "gitea"] }, "host": { "description": "The host name of the repository server", "type": "string", "examples": ["example.com"] }, "user": { "description": "The user that the repository is under", "type": "string", "examples": ["example"] }, "repo": { "description": "The repository name", "type": "string", "examples": ["my_project"] }, "tag_prefix": { "description": "The tag prefix of the repository", "type": "string", "examples": ["v"] } }, "required": ["type", "host", "user", "repo"], "additionalProperties": false, "examples": [ { "type": "forgejo", "host": "example.com", "user": "example", "repo": "my_project" }, { "type": "gitea", "host": "example.com", "user": "example", "repo": "my_project" } ] }, { "type": "object", "properties": { "type": { "description": "The type of repository", "type": "string", "enum": ["custom"], "examples": ["custom"] }, "url": { "description": "The url of the repository", "type": "string", "examples": ["https://example.com/my_project"] }, "tag_prefix": { "description": "The tag prefix of the repository", "type": "string", "examples": ["v"] } }, "required": ["type", "url"], "additionalProperties": false, "examples": [{ "type": "custom", "url": "https://example.com/my_project" }] } ], "examples": [{ "type": "github", "user": "example", "repo": "my_project" }] }, "links": { "description": "Links to any related website", "type": "array", "items": { "description": "A link to any related website", "type": "object", "properties": { "title": { "description": "The title of the link", "type": "string", "examples": ["Home page", "Other site"] }, "href": { "description": "The url of the link", "type": "string", "examples": ["https://example.com", "https://another.example.com"] } }, "additionalProperties": false, "examples": [ { "title": "Home page", "href": "https://example.com" }, { "title": "Other site", "href": "https://another.example.com" } ] }, "examples": [ [ { "title": "Home page", "href": "https://example.com" }, { "title": "Other site", "href": "https://another.example.com" } ] ] }, "erlang": { "description": "Erlang specific configuration", "type": "object", "properties": { "application_start_module": { "description": "The name of the OTP application module, if the project has one", "type": "string", "examples": ["my_app/application"] }, "extra_applications": { "description": "The names of any OTP applications that need to be started in addition to the ones from the project dependencies", "type": "array", "items": { "description": "The name of an OTP application", "type": "string", "examples": ["inets", "ssl"] }, "examples": [["inets", "ssl"]] } }, "additionalProperties": false, "examples": [ { "application_start_module": "my_app/application", "extra_applications": ["inets", "ssl"] } ] }, "javascript": { "description": "JavaScript specific configuration", "type": "object", "properties": { "typescript_declarations": { "description": "Generate TypeScript .d.ts files", "type": "boolean", "examples": [true, false] }, "runtime": { "description": "Which JavaScript runtime to use with `gleam run`, `gleam test` etc.", "type": "string", "enum": ["node", "deno", "bun"], "examples": ["node", "deno", "bun"] } }, "additionalProperties": false, "examples": [ { "typescript_declarations": true, "runtime": "node" } ] }, "javascript.deno": { "description": "Configuration specific to the Deno runtime", "type": "object", "properties": { "allow_all": { "description": "Whether to allow all permissions", "type": "boolean", "examples": [true, false] }, "allow_sys": { "description": "Whether to allow sys permission", "type": "boolean", "examples": [true, false] }, "allow_ffi": { "description": "Whether to allow ffi permission", "type": "boolean", "examples": [true, false] }, "allow_hrtime": { "description": "Whether to allow hrtime permission", "type": "boolean", "examples": [true, false] }, "allow_env": { "description": "The environment variables to allow", "oneOf": [ { "description": "Whether to allow all environment variables", "type": "boolean", "examples": [true, false] }, { "description": "A list of environment variables", "type": "array", "items": { "description": "An environment variable", "type": "string", "examples": ["DATABASE_URL"] } } ], "examples": [true, ["DATABASE_URL"]] }, "allow_net": { "description": "The IP addresses or hostnames to allow", "oneOf": [ { "description": "Whether to allow all IP addresses and hostnames", "type": "boolean", "examples": [true, false] }, { "description": "A list of IP addresses or hostnames", "type": "array", "items": { "description": "An IP address or hostname", "type": "string", "examples": ["example.com:443"] } } ], "examples": [true, ["example.com:443"]] }, "allow_run": { "description": "The paths allowed to be run", "oneOf": [ { "description": "Whether to allow all paths to be run", "type": "boolean", "examples": [true, false] }, { "description": "A list of paths to allow to be run", "type": "array", "items": { "description": "A path", "type": "string", "examples": ["./bin/migrate.sh"] } } ], "examples": [true, ["./bin/migrate.sh"]] }, "allow_read": { "description": "The paths allowed to be read from", "oneOf": [ { "description": "Whether to allow all paths to be read from", "type": "boolean", "examples": [true, false] }, { "description": "A list of paths to allow to be read from", "type": "array", "items": { "description": "A path", "type": "string", "examples": ["./database.sqlite"] } } ], "examples": [true, ["./database.sqlite"]] }, "allow_write": { "description": "The paths allowed to be written to", "oneOf": [ { "description": "Whether to allow all paths to be written to", "type": "boolean", "examples": [true, false] }, { "description": "A list of paths to allow to be written to", "type": "array", "items": { "description": "A path", "type": "string", "examples": ["./database.sqlite"] } } ], "examples": [true, ["./database.sqlite"]] }, "unstable": { "description": "Whether to use the unstable version of deno", "type": "boolean", "examples": [true, false] }, "location": { "description": "The location of the deno runtime executable", "type": "string", "examples": ["/usr/bin/deno"] } }, "additionalProperties": false, "examples": [ { "allow_all": false, "allow_sys": false, "allow_ffi": false, "allow_hrtime": false, "allow_env": ["DATABASE_URL"], "allow_net": ["example.com:443"], "allow_run": ["./bin/migrate.sh"], "allow_read": ["./database.sqlite"], "allow_write": ["./database.sqlite"] } ] }, "target": { "description": "The target to default to when compiling or running Gleam code", "type": "string", "enum": ["erlang", "javascript"], "examples": ["erlang", "javascript"] }, "internal_modules": { "description": "Modules that should be considered \"internal\" and will not be included in generated documentation", "type": "array", "items": { "description": "A module path", "type": "string", "examples": ["my_app/internal", "my_app/internal/*"] }, "examples": [["my_app/internal", "my_app/internal/*"]] } }, "required": ["name", "version"], "additionalProperties": false }