«
Previous
|
Next
»
Revision 48a440fd
Added by koszko over 1 year ago
- ID 48a440fd1e13814f2adaa8a115baaf47e4c38c3c
- Parent f0e1d607
| index.json | ||
|---|---|---|
| 62 | 62 |
// will also belong here once they get implemented. |
| 63 | 63 |
"definitions": [ |
| 64 | 64 |
{
|
| 65 |
// Value of "type" can currently be one of: "resource" and |
|
| 66 |
// "mapping". The one we have here, "resource", defines a list |
|
| 67 |
// of injectable scripts that can be used as a payload or as a |
|
| 68 |
// dependency of another "resource". In the future CSS style sheets |
|
| 69 |
// and WASM modules will also be composite parts of a "resource" as |
|
| 70 |
// scripts are now. |
|
| 71 |
"type": "resource", |
|
| 65 |
// Value of "type" can currently be one of: "resource", "mapping" |
|
| 66 |
// and "mapping_and_resource" for a combined definition. The one we |
|
| 67 |
// have here, "mapping", associates resources with pages on which |
|
| 68 |
// they are to be used. |
|
| 69 |
"type": "mapping", |
|
| 72 | 70 |
|
| 73 |
// Used when referring to this resource in "dependencies" list of |
|
| 74 |
// another resource or in "payload" field of a mapping. Should |
|
| 75 |
// be consize and can only use a restricted set of characters. It |
|
| 76 |
// has to match: [-0-9a-z]+ |
|
| 71 |
// Used when referring to this mapping in "required_mappings" list |
|
| 72 |
// of another item. Should be consize and can only use a restricted |
|
| 73 |
// set of characters. It has to match: [-0-9a-z]+ |
|
| 77 | 74 |
"identifier": "helloapple", |
| 78 | 75 |
|
| 79 | 76 |
// "long_name" should be used to specify a user-friendly alternative |
| ... | ... | |
| 96 | 93 |
// Different versions (e.g. 1.0 and 1.3) of the same resource can be |
| 97 | 94 |
// defined in separate index.json files. This makes it easy to |
| 98 | 95 |
// accidently cause an identifier clash. To help detect it, we allow |
| 99 |
// each resource to have a UUID associated with it. Attempt to
|
|
| 100 |
// define multiple resources with the same identifier and different
|
|
| 101 |
// UUIDs will result in an error being reported. Defining multiple
|
|
| 102 |
// resources with different identifiers and the same UUID is
|
|
| 96 |
// each item to have a UUID associated with it. Attempt to define
|
|
| 97 |
// multiple mapping with the same identifier and different UUIDs
|
|
| 98 |
// will result in an error being reported. Defining multiple |
|
| 99 |
// mappings with different identifiers and the same UUID is
|
|
| 103 | 100 |
// disallowed for now (it may be later permitted if we consider it |
| 104 | 101 |
// good for some use-case). |
| 105 |
// As of package source schema version 1.0, UUIDs are optional and
|
|
| 102 |
// As of package source schema version 2.0, UUIDs are optional and
|
|
| 106 | 103 |
// can be omitted. |
| 104 |
"uuid": "54d23bba-472e-42f5-9194-eaa24c0e3ee7", |
|
| 105 |
|
|
| 106 |
// Thanks to the "version" field (and "revision" field in case of |
|
| 107 |
// "resource" or "mapping_and_resource", clients will know they have |
|
| 108 |
// to update certain item after a new version has appeared in the |
|
| 109 |
// repository. If multiple definitions of the same version of given |
|
| 110 |
// item are provided to Hydrilla server, an error is generated. |
|
| 111 |
// "version" differs from its counterpart in resource in that it has |
|
| 112 |
// no accompanying revision number. For combined definitions with |
|
| 113 |
// "mapping_and_resource" as type, the value of "revision" is |
|
| 114 |
// appended as the last component of the resulting mapping's |
|
| 115 |
// version. If type is simply "mapping", revision number is ignored. |
|
| 116 |
"version": [2021, 11, 10], |
|
| 117 |
|
|
| 118 |
// A short, meaningful description of what the mapping does. |
|
| 119 |
"description": "causes apple to get greeted on Hydrillabugs issue tracker", |
|
| 120 |
|
|
| 121 |
// If needed, a "comment" field can be added to provide some |
|
| 122 |
// additional information. |
|
| 123 |
// "comment": "this resource something something", |
|
| 124 |
|
|
| 125 |
// The "payloads" object specifies which payloads are to be applied |
|
| 126 |
// to which URLs. |
|
| 127 |
"payloads": {
|
|
| 128 |
// Each key should be a valid Haketilo URL pattern. |
|
| 129 |
"https://hydrillabugs.koszko.org/***": {
|
|
| 130 |
// Should be the name of an existing resource. The resource |
|
| 131 |
// may, but doesn't have to, be defined in the same |
|
| 132 |
// index.json file. |
|
| 133 |
"identifier": "helloapple" |
|
| 134 |
}, |
|
| 135 |
// More associations may follow. |
|
| 136 |
"https://hachettebugs.koszko.org/***": {
|
|
| 137 |
"identifier": "helloapple" |
|
| 138 |
} |
|
| 139 |
} |
|
| 140 |
}, {
|
|
| 141 |
// A "resource" item defines a list of injectable scripts that can |
|
| 142 |
// be used as a payload or as a dependency of another "resource". In |
|
| 143 |
// the future CSS style sheets and WASM modules will also be |
|
| 144 |
// composite parts of a "resource" as scripts are now. |
|
| 145 |
"type": "resource", |
|
| 146 |
|
|
| 147 |
// Has similar function to mapping's identifier. Used when |
|
| 148 |
// referring to this resource in "dependencies" list of another |
|
| 149 |
// resource or in "payload" field of a mapping. Should be consize |
|
| 150 |
// and can only use a restricted set of characters. It has to match: |
|
| 151 |
// [-0-9a-z]+ |
|
| 152 |
// It can be the same as some mapping identifier (those are |
|
| 153 |
// different entities and are treated separately). |
|
| 154 |
"identifier": "helloapple", |
|
| 155 |
|
|
| 156 |
// "long name" and "uuid" have the same meaning as in the case of |
|
| 157 |
// resources and "uuid" is also optional. UUIDs of a resource and a |
|
| 158 |
// mapping can technically be the same but it is recommended to |
|
| 159 |
// avoid even this kind of repetition. |
|
| 160 |
"long_name": "Hello Apple", |
|
| 107 | 161 |
"uuid": "a6754dcb-58d8-4b7a-a245-24fd7ad4cd68", |
| 108 | 162 |
|
| 109 | 163 |
// Version should match the upstream version of the resource (e.g. a |
| 110 | 164 |
// version of JavaScript library). Revision number starts as 1 for |
| 111 | 165 |
// each new resource version and gets incremented by 1 each time a |
| 112 |
// modification to the packaging of this version is done. Hydrilla |
|
| 113 |
// will allow multiple definitions of the same resource to load, as |
|
| 114 |
// long as their versions differ. Thanks to the "version" and |
|
| 115 |
// "revision" fields, clients will know they have to update certain |
|
| 116 |
// resource after it has been updated. If multiple definitions of |
|
| 117 |
// the same version of given resource are provided, an error is |
|
| 118 |
// generated (even if those definitions differ by revision number). |
|
| 166 |
// modification to the packaging of this version is done. |
|
| 167 |
// If multiple definitions of the same version of given resource are |
|
| 168 |
// provided to Hydrilla server, an error is generated (even if those |
|
| 169 |
// definitions differ by revision number). |
|
| 119 | 170 |
"version": [2021, 11, 10], |
| 120 | 171 |
"revision": 1, |
| 121 | 172 |
|
| ... | ... | |
| 123 | 174 |
// what it does. |
| 124 | 175 |
"description": "greets an apple", |
| 125 | 176 |
|
| 126 |
// If needed, a "comment" field can be added to provide some |
|
| 127 |
// additional information. |
|
| 128 |
// "comment": "this resource something something", |
|
| 177 |
// A comment, if necessary. |
|
| 178 |
// "comment": "blah blah because bleh" |
|
| 129 | 179 |
|
| 130 | 180 |
// Resource's "dependencies" array shall contain names of other |
| 131 | 181 |
// resources that (in case of scripts at least) should get evaluated |
| ... | ... | |
| 148 | 198 |
// If "dependencies" is empty, it can also be omitted. |
| 149 | 199 |
// "dependencies": [], |
| 150 | 200 |
"scripts": [{"file": "message.js"}]
|
| 151 |
}, {
|
|
| 152 |
"type": "mapping", |
|
| 153 |
|
|
| 154 |
// Has similar function to resource's identifier. Should be consize |
|
| 155 |
// and can only use a restricted set of characters. It has to match: |
|
| 156 |
// [-0-9a-z]+ |
|
| 157 |
// It can be the same as some resource identifier (those are |
|
| 158 |
// different entities and are treated separately). |
|
| 159 |
"identifier": "helloapple", |
|
| 160 |
|
|
| 161 |
// "long name" and "uuid" have the same meaning as in the case of |
|
| 162 |
// resources and "uuid" is also optional. UUIDs of a resource and a |
|
| 163 |
// mapping can technically be the same but it is recommended to |
|
| 164 |
// avoid even this kind of repetition. |
|
| 165 |
"long_name": "Hello Apple", |
|
| 166 |
"uuid": "54d23bba-472e-42f5-9194-eaa24c0e3ee7", |
|
| 167 |
|
|
| 168 |
// "version" differs from its counterpart in resource in that it has |
|
| 169 |
// no accompanying revision number. |
|
| 170 |
"version": [2021, 11, 10], |
|
| 171 |
|
|
| 172 |
// A short, meaningful description of what the mapping does. |
|
| 173 |
"description": "causes apple to get greeted on Hydrillabugs issue tracker", |
|
| 174 |
|
|
| 175 |
// A comment, if necessary. |
|
| 176 |
// "comment": "blah blah because bleh" |
|
| 177 |
|
|
| 178 |
// The "payloads" object specifies which payloads are to be applied |
|
| 179 |
// to which URLs. |
|
| 180 |
"payloads": {
|
|
| 181 |
// Each key should be a valid Haketilo URL pattern. |
|
| 182 |
"https://hydrillabugs.koszko.org/***": {
|
|
| 183 |
// Should be the name of an existing resource. The resource |
|
| 184 |
// may, but doesn't have to, be defined in the same |
|
| 185 |
// index.json file. |
|
| 186 |
"identifier": "helloapple" |
|
| 187 |
}, |
|
| 188 |
// More associations may follow. |
|
| 189 |
"https://hachettebugs.koszko.org/***": {
|
|
| 190 |
"identifier": "helloapple" |
|
| 191 |
} |
|
| 192 |
} |
|
| 193 | 201 |
} |
| 194 | 202 |
], |
| 195 | 203 |
// We can also list additional files to include in the produced source |
Also available in: Unified diff
reorder item definitions (put mapping first)