|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "$id": "https://json.schemastore.org/typst.json", |
| 4 | + "title": "Typst Package Manifest", |
| 5 | + "description": "Schema for typst.toml package manifest files, used by the Typst package manager and universe.", |
| 6 | + "type": "object", |
| 7 | + "required": ["package"], |
| 8 | + "properties": { |
| 9 | + "package": { |
| 10 | + "type": "object", |
| 11 | + "description": "Contains metadata about the package.", |
| 12 | + "required": ["name", "version", "entrypoint"], |
| 13 | + "properties": { |
| 14 | + "name": { |
| 15 | + "type": "string", |
| 16 | + "description": "The package's identifier in its namespace. Should use kebab-case if it contains multiple words. Should not contain 'typst'. See https://github.com/typst/packages/tree/main?tab=readme-ov-file#submission-guidelines for detailed requirements.", |
| 17 | + "pattern": "^[a-z0-9][a-z0-9\\-]*$", |
| 18 | + "examples": ["my-package", "example", "uni-stuttgart-template"] |
| 19 | + }, |
| 20 | + "version": { |
| 21 | + "type": "string", |
| 22 | + "description": "The package's version as a full major-minor-patch triple (following SemVer, no pre-release or build tags). See https://semver.org/", |
| 23 | + "pattern": "^\\d+\\.\\d+\\.\\d+$", |
| 24 | + "examples": ["1.0.0", "0.2.1"] |
| 25 | + }, |
| 26 | + "entrypoint": { |
| 27 | + "type": "string", |
| 28 | + "description": "The path to the main Typst file (relative to the package root) that is evaluated when the package is imported.", |
| 29 | + "examples": ["lib.typ", "src/main.typ"] |
| 30 | + }, |
| 31 | + "authors": { |
| 32 | + "type": "array", |
| 33 | + "description": "A list of the package's authors. Each author can provide an email address (<[email protected]>), homepage (<https://example.com>), or GitHub handle (<@typst>) in angle brackets. Required for Typst Universe submission.", |
| 34 | + "items": { |
| 35 | + "type": "string" |
| 36 | + }, |
| 37 | + "minItems": 1, |
| 38 | + "examples": [ |
| 39 | + [ "Jane Doe <[email protected]>", "John Doe <@johndoe>"], |
| 40 | + ["Typst GmbH <https://typst.app>"] |
| 41 | + ] |
| 42 | + }, |
| 43 | + "license": { |
| 44 | + "type": "string", |
| 45 | + "description": "The package's license. Must contain a valid SPDX 2.3 expression describing one or multiple licenses that are either OSI-approved (https://opensource.org/licenses/) or CC-BY-4.0, CC-BY-SA-4.0, or CC0-1.0. See https://spdx.dev/learn/handling-license-info/. Required for Typst Universe submission.", |
| 46 | + "examples": [ |
| 47 | + "MIT", |
| 48 | + "Apache-2.0", |
| 49 | + "GPL-3.0-or-later", |
| 50 | + "MIT OR Apache-2.0", |
| 51 | + "CC-BY-SA-4.0" |
| 52 | + ] |
| 53 | + }, |
| 54 | + "description": { |
| 55 | + "type": "string", |
| 56 | + "description": "A short, clear description of the package (one sentence recommended). Required for Typst Universe submission." |
| 57 | + }, |
| 58 | + "homepage": { |
| 59 | + "type": "string", |
| 60 | + "description": "A URL to the package's web presence (e.g., documentation website).", |
| 61 | + "format": "uri", |
| 62 | + "examples": ["https://example.com/my-package-docs"] |
| 63 | + }, |
| 64 | + "repository": { |
| 65 | + "type": "string", |
| 66 | + "description": "A URL to the repository where this package is developed (e.g., GitHub, GitLab). Used if homepage is not set.", |
| 67 | + "format": "uri", |
| 68 | + "examples": ["https://github.com/user/my-package"] |
| 69 | + }, |
| 70 | + "keywords": { |
| 71 | + "type": "array", |
| 72 | + "description": "An array of search keywords for the package.", |
| 73 | + "items": { |
| 74 | + "type": "string" |
| 75 | + }, |
| 76 | + "uniqueItems": true, |
| 77 | + "examples": [ |
| 78 | + ["chart", "plot", "data visualization"], |
| 79 | + ["ieee", "template", "paper"] |
| 80 | + ] |
| 81 | + }, |
| 82 | + "categories": { |
| 83 | + "type": "array", |
| 84 | + "description": "An array with up to three categories from the official list to help users discover the package.", |
| 85 | + "items": { |
| 86 | + "type": "string", |
| 87 | + "enum": [ |
| 88 | + "components", |
| 89 | + "visualization", |
| 90 | + "model", |
| 91 | + "layout", |
| 92 | + "text", |
| 93 | + "languages", |
| 94 | + "scripting", |
| 95 | + "integration", |
| 96 | + "utility", |
| 97 | + "fun", |
| 98 | + "book", |
| 99 | + "report", |
| 100 | + "paper", |
| 101 | + "thesis", |
| 102 | + "poster", |
| 103 | + "flyer", |
| 104 | + "presentation", |
| 105 | + "cv", |
| 106 | + "office" |
| 107 | + ] |
| 108 | + }, |
| 109 | + "maxItems": 3, |
| 110 | + "uniqueItems": true, |
| 111 | + "examples": [ |
| 112 | + ["visualization", "components"], |
| 113 | + ["paper", "layout"] |
| 114 | + ] |
| 115 | + }, |
| 116 | + "disciplines": { |
| 117 | + "type": "array", |
| 118 | + "description": "An array of disciplines from the official list defining the target audience. Should be empty if generally applicable.", |
| 119 | + "items": { |
| 120 | + "type": "string", |
| 121 | + "enum": [ |
| 122 | + "agriculture", |
| 123 | + "anthropology", |
| 124 | + "archaeology", |
| 125 | + "architecture", |
| 126 | + "biology", |
| 127 | + "business", |
| 128 | + "chemistry", |
| 129 | + "communication", |
| 130 | + "computer-science", |
| 131 | + "design", |
| 132 | + "drawing", |
| 133 | + "economics", |
| 134 | + "education", |
| 135 | + "engineering", |
| 136 | + "fashion", |
| 137 | + "film", |
| 138 | + "geography", |
| 139 | + "geology", |
| 140 | + "history", |
| 141 | + "journalism", |
| 142 | + "law", |
| 143 | + "linguistics", |
| 144 | + "literature", |
| 145 | + "mathematics", |
| 146 | + "medicine", |
| 147 | + "music", |
| 148 | + "painting", |
| 149 | + "philosophy", |
| 150 | + "photography", |
| 151 | + "physics", |
| 152 | + "politics", |
| 153 | + "psychology", |
| 154 | + "sociology", |
| 155 | + "theater", |
| 156 | + "theology", |
| 157 | + "transportation" |
| 158 | + ] |
| 159 | + }, |
| 160 | + "uniqueItems": true, |
| 161 | + "examples": [["computer-science", "mathematics"], ["physics"]] |
| 162 | + }, |
| 163 | + "compiler": { |
| 164 | + "type": "string", |
| 165 | + "description": "The minimum Typst compiler version required for this package to work (SemVer format). Partial versions like '0' or '0.13' are supported. Pre-release tags are not supported.", |
| 166 | + "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){0,2}$", |
| 167 | + "examples": ["0", "0.13", "0.8.0", "1.0.0"] |
| 168 | + }, |
| 169 | + "exclude": { |
| 170 | + "type": "array", |
| 171 | + "description": "An array of globs specifying files (relative to package root) that should not be part of the published bundle. Do not exclude README or LICENSE.", |
| 172 | + "items": { |
| 173 | + "type": "string" |
| 174 | + }, |
| 175 | + "examples": [["docs/", "*.pdf", "images/draft*.png"]] |
| 176 | + } |
| 177 | + }, |
| 178 | + "additionalProperties": false |
| 179 | + }, |
| 180 | + "template": { |
| 181 | + "type": "object", |
| 182 | + "description": "If present, declares this package as a template.", |
| 183 | + "required": ["path", "entrypoint", "thumbnail"], |
| 184 | + "properties": { |
| 185 | + "path": { |
| 186 | + "type": "string", |
| 187 | + "description": "The directory within the package (relative to package root) containing files to be copied into the user's new project directory.", |
| 188 | + "examples": ["template", "skeleton"] |
| 189 | + }, |
| 190 | + "entrypoint": { |
| 191 | + "type": "string", |
| 192 | + "description": "Path relative to the template 'path' directory pointing to the main file to be compiled after initialization.", |
| 193 | + "examples": ["main.typ", "report.typ"] |
| 194 | + }, |
| 195 | + "thumbnail": { |
| 196 | + "type": "string", |
| 197 | + "description": "Path relative to the package root pointing to a PNG or lossless WebP thumbnail (min 1080px on longer edge, max 3MB) depicting the initialized template.", |
| 198 | + "pattern": "\\.(png|PNG|webp|WEBP)$", |
| 199 | + "examples": ["thumbnail.png", "preview.webp"] |
| 200 | + } |
| 201 | + }, |
| 202 | + "additionalProperties": false |
| 203 | + }, |
| 204 | + "tool": { |
| 205 | + "type": "object", |
| 206 | + "description": "Namespace for third-party tools to store their own configuration.", |
| 207 | + "additionalProperties": true |
| 208 | + } |
| 209 | + }, |
| 210 | + "additionalProperties": false, |
| 211 | + "allOf": [ |
| 212 | + { |
| 213 | + "if": { |
| 214 | + "required": ["template"] |
| 215 | + }, |
| 216 | + "then": { |
| 217 | + "properties": { |
| 218 | + "package": { |
| 219 | + "required": [ |
| 220 | + "name", |
| 221 | + "version", |
| 222 | + "entrypoint", |
| 223 | + "authors", |
| 224 | + "license", |
| 225 | + "description", |
| 226 | + "categories" |
| 227 | + ], |
| 228 | + "properties": { |
| 229 | + "categories": { |
| 230 | + "minItems": 1 |
| 231 | + } |
| 232 | + } |
| 233 | + } |
| 234 | + } |
| 235 | + } |
| 236 | + } |
| 237 | + ] |
| 238 | +} |
0 commit comments