aboutsummaryrefslogtreecommitdiff
path: root/lpm.json
blob: de3e7479afddb59b77c588418f8c01b2c9401624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
{
  "$schema": "https://json-schema.org/draft-07/schema",
  "$id": "https://github.com/lite-xl/lite-xl-plugin-manager/raw/master/lpm.json",
  "title": "Lite XL Plugin Manager Manifest",
  "description": "Description of Lite XL addons",
  "$comment": "TODO: Add our own uri format for <url>:<ref>.",
  "definitions": {
    "addon-id": {
      "type": "string",
      "pattern": "^[a-z0-9\\-_]+$"
    },
    "addon-version": {
      "type": "string",
      "$comment": "TODO: should we avoid limiting this to only 3 components? See lite-xl-lsp-servers -> lsp_json.",
      "pattern": "^[0-9]+(\\.[0-9]+){0,2}$"
    },
    "addon-version-specifier": {
      "type": "string",
      "pattern": "^[><]?=?[0-9]+(\\.[0-9]+){0,2}$"
    },
    "mod-version": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^[0-9\\.]+$"
        },
        {
          "type": "integer",
          "minimum": 0
        }
      ]
    },
    "arch": {
      "description": "Lite XL/Clang architecture tuple that the file is relevant for",
      "type": "string",
      "examples": [
        "x86_64-linux",
        "x86_64-windows",
        "x86_64-darwin",
        "aarch64-darwin"
      ]
    },
    "checksum": {
      "type": "string",
      "oneOf": [
        {
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        {
          "const": "SKIP"
        }
      ]
    },
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "checksum": {
            "$ref": "#/definitions/checksum"
          },
          "arch": {
            "description": "List of architectures this file is relevant for",
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/arch"
                }
              },
              {
                "$ref": "#/definitions/arch"
              }
            ]
          },
          "path": {
            "description": "The location to install this file inside the addon's directory",
            "type": "string"
          },
          "optional": {
            "description": "Whether the file is an optional addition. If omitted, the file is assumed to be required.",
            "type": "boolean"
          }
        },
        "required": [
          "url",
          "checksum"
        ]
      }
    }
  },
  "type": "object",
  "properties": {
    "remotes": {
      "description": "A simple array of string repository identifiers",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "addons": {
      "description": "A simple array of string repository identifiers",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "The semantic id of the addon",
            "$ref": "#/definitions/addon-id"
          },
          "version": {
            "description": "The semantic version of the addon",
            "$ref": "#/definitions/addon-version"
          },
          "mod_version": {
            "description": "The mod_version this addon is compatible with",
            "$ref": "#/definitions/mod-version"
          },
          "type": {
            "description": "Addon type",
            "type": "string",
            "default": "plugin",
            "enum": [
              "plugin",
              "library",
              "color",
              "font",
              "meta"
            ]
          },
          "name": {
            "description": "The name of the addon",
            "type": "string"
          },
          "description": {
            "description": "The description of the addon",
            "type": "string"
          },
          "provides": {
            "description": "Array of strings that are a shorthand of functionality this addon provides. Can be used as a dependency.",
            "type": "array",
            "items": {
              "$ref": "#/definitions/addon-id"
            }
          },
          "replaces": {
            "description": "Array of ids that this plugin explicitly replaces. Will always prefer this plugin in place of those plugins, so long as version requirements are met.",
            "type": "array",
            "items": {
              "$ref": "#/definitions/addon-id"
            }
          },
          "remote": {
            "description": "Public https git link where this addon is located",
            "type": "string"
          },
          "dependencies": {
            "description": "Table of dependencies",
            "type": "object",
            "propertyNames": {
              "$ref": "#/definitions/addon-id"
            },
            "patternProperties": {
              "": {
                "version": {
                  "description": "Dependency version specifier",
                  "$ref": "#/definitions/addon-version-specifier"
                },
                "optional": {
                  "description": "Determines whether the dependency is optional",
                  "type": "boolean"
                }
              }
            }
          },
          "conflicts": {
            "description": "Table of addons that conflict with the current one",
            "type": "object",
            "propertyNames": {
              "$ref": "#/definitions/addon-id"
            },
            "$comment": "TODO: The spec says in the same format as `dependencies`, but I don't think this supports `optional`.",
            "patternProperties": {
              "": {
                "version": {
                  "description": "Dependency version specifier",
                  "$ref": "#/definitions/addon-version-specifier"
                }
              }
            }
          },
          "tags": {
            "description": "Freeform tags that may describe attributes of the addon",
            "type": "array",
            "$comment": "TODO: Should we limit the tag format? For example to #/definitions/addon-id",
            "items": {
              "type": "string"
            }
          },
          "path": {
            "description": "The path to the addon in the repository. If omitted, will only pull the files in files. To pull the whole repository, use \".\".",
            "type": "string"
          },
          "arch": {
            "description": "List of architectures this plugin supports. If not present, and no `files` entry specifies arches, the plugin is valid for all architectures. Otherwise uses the arches specified in `files` entries.",
            "type": "array",
            "items": {
              "$ref": "#/definitions/arch"
            }
          },
          "post": {
            "description": "Commands to run after the addon is installed",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "propertyNames": {
                  "$ref": "#/definitions/arch"
                },
                "patternProperties": {
                  "": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "url": {
            "description": "URL which specifies a direct download link to a single lua file. Precludes the use of `remote`, `path`.",
            "type": "string",
            "format": "uri"
          },
          "checksum": {
            "description": "SHA256 digest of the file specified in `url`",
            "$ref": "#/definitions/checksum"
          },
          "extra": {
            "description": "Dictionary which holds any desired extra information",
            "type": "object",
            "examples": [
              {
                "author": "Ford Prefect",
                "license": "MIT"
              }
            ]
          },
          "files": {
            "description": "Files that are downloaded and placed inside the addon directory. If the file is an archive, it will be automatically extracted.",
            "$ref": "#/definitions/files"
          }
        },
        "required": [
          "id", "version"
        ]
      }
    },
    "lite-xls": {
      "description": "Represents the different versions of Lite XL that are registered in this repository",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "version": {},
          "mod_version": {
            "description": "The modversion the binary corresponds to",
            "$ref": "#/definitions/mod-version"
          },
          "files": {
            "description": "Files that are downloaded. If the file is an archive, it will be automatically extracted. Conventionally, there should be a single file per architecture that is a `.tar.gz` or `.zip` containing all necessary files for Lite XL to run.",
            "$ref": "#/definitions/files"
          }
        }
      }
    }
  }
}