5etools-utils 0.13.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/lib/BrewCleaner.js +4 -1
  2. package/package.json +1 -1
  3. package/schema/brew/class/foundry.json +36 -0
  4. package/schema/brew/foundry-backgrounds.json +9 -0
  5. package/schema/brew/foundry-items.json +9 -0
  6. package/schema/brew/foundry-psionics.json +9 -0
  7. package/schema/brew/foundry-races.json +45 -0
  8. package/schema/brew/homebrew.json +4 -1
  9. package/schema/brew/rewards.json +4 -13
  10. package/schema/brew/util-additionalspells.json +4 -0
  11. package/schema/brew/util-foundry.json +70 -4
  12. package/schema/brew-fast/class/foundry.json +36 -0
  13. package/schema/brew-fast/foundry-backgrounds.json +9 -0
  14. package/schema/brew-fast/foundry-items.json +9 -0
  15. package/schema/brew-fast/foundry-psionics.json +9 -0
  16. package/schema/brew-fast/foundry-races.json +45 -0
  17. package/schema/brew-fast/homebrew.json +4 -1
  18. package/schema/brew-fast/rewards.json +4 -13
  19. package/schema/brew-fast/util-additionalspells.json +4 -0
  20. package/schema/brew-fast/util-foundry.json +70 -4
  21. package/schema/site/class/foundry.json +36 -0
  22. package/schema/site/foundry-backgrounds.json +9 -0
  23. package/schema/site/foundry-items.json +9 -0
  24. package/schema/site/foundry-psionics.json +9 -0
  25. package/schema/site/foundry-races.json +45 -0
  26. package/schema/site/homebrew.json +4 -1
  27. package/schema/site/rewards.json +4 -13
  28. package/schema/site/util-additionalspells.json +4 -0
  29. package/schema/site/util-foundry.json +70 -4
  30. package/schema/site-fast/class/foundry.json +36 -0
  31. package/schema/site-fast/foundry-backgrounds.json +9 -0
  32. package/schema/site-fast/foundry-items.json +9 -0
  33. package/schema/site-fast/foundry-psionics.json +9 -0
  34. package/schema/site-fast/foundry-races.json +45 -0
  35. package/schema/site-fast/homebrew.json +4 -1
  36. package/schema/site-fast/rewards.json +4 -13
  37. package/schema/site-fast/util-additionalspells.json +4 -0
  38. package/schema/site-fast/util-foundry.json +70 -4
  39. package/schema/ua/class/foundry.json +36 -0
  40. package/schema/ua/foundry-backgrounds.json +9 -0
  41. package/schema/ua/foundry-items.json +9 -0
  42. package/schema/ua/foundry-psionics.json +9 -0
  43. package/schema/ua/foundry-races.json +45 -0
  44. package/schema/ua/homebrew.json +4 -1
  45. package/schema/ua/rewards.json +4 -13
  46. package/schema/ua/util-additionalspells.json +4 -0
  47. package/schema/ua/util-foundry.json +70 -4
  48. package/schema/ua-fast/class/foundry.json +36 -0
  49. package/schema/ua-fast/foundry-backgrounds.json +9 -0
  50. package/schema/ua-fast/foundry-items.json +9 -0
  51. package/schema/ua-fast/foundry-psionics.json +9 -0
  52. package/schema/ua-fast/foundry-races.json +45 -0
  53. package/schema/ua-fast/homebrew.json +4 -1
  54. package/schema/ua-fast/rewards.json +4 -13
  55. package/schema/ua-fast/util-additionalspells.json +4 -0
  56. package/schema/ua-fast/util-foundry.json +70 -4
@@ -165,12 +165,15 @@ export class BrewCleaner {
165
165
  }
166
166
 
167
167
  static run () {
168
+ const tStart = Date.now();
169
+
168
170
  let totalFiles = 0;
171
+
169
172
  Uf.runOnDirs((dir) => {
170
173
  Um.info(`CLEANER`, `Cleaning dir "${dir}"...`);
171
174
  totalFiles += this._cleanFolder(dir);
172
175
  });
173
176
 
174
- Um.info(`CLEANER`, `Cleaning complete. Cleaned ${totalFiles} file${totalFiles === 1 ? "" : "s"}.`);
177
+ Um.info(`CLEANER`, `Cleaning complete. Cleaned ${totalFiles} file${totalFiles === 1 ? "" : "s"}. Ran in ${(Date.now() - tStart / 1000).toFixed(2)}s.`);
175
178
  }
176
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "5etools-utils",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "Shared utilities for the 5etools ecosystem.",
5
5
  "type": "module",
6
6
  "main": "lib/Api.js",
@@ -19,6 +19,12 @@
19
19
  "system": {
20
20
  "$ref": "../util-foundry.json#/$defs/foundrySystemObject"
21
21
  },
22
+ "activities": {
23
+ "type": "array",
24
+ "items": {
25
+ "$ref": "../util-foundry.json#/$defs/foundryActivityObject"
26
+ }
27
+ },
22
28
  "effects": {
23
29
  "type": "array",
24
30
  "items": {
@@ -44,6 +50,9 @@
44
50
  "chooseSystem": {
45
51
  "const": true
46
52
  },
53
+ "activities": {
54
+ "const": true
55
+ },
47
56
  "effects": {
48
57
  "const": true
49
58
  },
@@ -128,6 +137,12 @@
128
137
  "system": {
129
138
  "$ref": "../util-foundry.json#/$defs/foundrySystemObject"
130
139
  },
140
+ "activities": {
141
+ "type": "array",
142
+ "items": {
143
+ "$ref": "../util-foundry.json#/$defs/foundryActivityObject"
144
+ }
145
+ },
131
146
  "effects": {
132
147
  "type": "array",
133
148
  "items": {
@@ -153,6 +168,9 @@
153
168
  "chooseSystem": {
154
169
  "const": true
155
170
  },
171
+ "activities": {
172
+ "const": true
173
+ },
156
174
  "effects": {
157
175
  "const": true
158
176
  },
@@ -242,6 +260,12 @@
242
260
  "system": {
243
261
  "$ref": "../util-foundry.json#/$defs/foundrySystemObject"
244
262
  },
263
+ "activities": {
264
+ "type": "array",
265
+ "items": {
266
+ "$ref": "../util-foundry.json#/$defs/foundryActivityObject"
267
+ }
268
+ },
245
269
  "effects": {
246
270
  "type": "array",
247
271
  "items": {
@@ -267,6 +291,9 @@
267
291
  "chooseSystem": {
268
292
  "const": true
269
293
  },
294
+ "activities": {
295
+ "const": true
296
+ },
270
297
  "effects": {
271
298
  "const": true
272
299
  },
@@ -355,6 +382,12 @@
355
382
  "system": {
356
383
  "$ref": "../util-foundry.json#/$defs/foundrySystemObject"
357
384
  },
385
+ "activities": {
386
+ "type": "array",
387
+ "items": {
388
+ "$ref": "../util-foundry.json#/$defs/foundryActivityObject"
389
+ }
390
+ },
358
391
  "effects": {
359
392
  "type": "array",
360
393
  "items": {
@@ -380,6 +413,9 @@
380
413
  "chooseSystem": {
381
414
  "const": true
382
415
  },
416
+ "activities": {
417
+ "const": true
418
+ },
383
419
  "effects": {
384
420
  "const": true
385
421
  },
@@ -27,6 +27,12 @@
27
27
  "system": {
28
28
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
29
29
  },
30
+ "activities": {
31
+ "type": "array",
32
+ "items": {
33
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
34
+ }
35
+ },
30
36
  "effects": {
31
37
  "type": "array",
32
38
  "items": {
@@ -52,6 +58,9 @@
52
58
  "chooseSystem": {
53
59
  "const": true
54
60
  },
61
+ "activities": {
62
+ "const": true
63
+ },
55
64
  "effects": {
56
65
  "const": true
57
66
  },
@@ -24,6 +24,12 @@
24
24
  "system": {
25
25
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
26
26
  },
27
+ "activities": {
28
+ "type": "array",
29
+ "items": {
30
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
31
+ }
32
+ },
27
33
  "effects": {
28
34
  "type": "array",
29
35
  "items": {
@@ -49,6 +55,9 @@
49
55
  "chooseSystem": {
50
56
  "const": true
51
57
  },
58
+ "activities": {
59
+ "const": true
60
+ },
52
61
  "effects": {
53
62
  "const": true
54
63
  },
@@ -30,6 +30,12 @@
30
30
  "system": {
31
31
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
32
32
  },
33
+ "activities": {
34
+ "type": "array",
35
+ "items": {
36
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
37
+ }
38
+ },
33
39
  "effects": {
34
40
  "type": "array",
35
41
  "items": {
@@ -55,6 +61,9 @@
55
61
  "chooseSystem": {
56
62
  "const": true
57
63
  },
64
+ "activities": {
65
+ "const": true
66
+ },
58
67
  "effects": {
59
68
  "const": true
60
69
  },
@@ -17,6 +17,12 @@
17
17
  "system": {
18
18
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
19
19
  },
20
+ "activities": {
21
+ "type": "array",
22
+ "items": {
23
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
24
+ }
25
+ },
20
26
  "effects": {
21
27
  "type": "array",
22
28
  "items": {
@@ -42,6 +48,9 @@
42
48
  "chooseSystem": {
43
49
  "const": true
44
50
  },
51
+ "activities": {
52
+ "const": true
53
+ },
45
54
  "effects": {
46
55
  "const": true
47
56
  },
@@ -80,6 +89,12 @@
80
89
  "system": {
81
90
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
82
91
  },
92
+ "activities": {
93
+ "type": "array",
94
+ "items": {
95
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
96
+ }
97
+ },
83
98
  "effects": {
84
99
  "type": "array",
85
100
  "items": {
@@ -105,6 +120,9 @@
105
120
  "chooseSystem": {
106
121
  "const": true
107
122
  },
123
+ "activities": {
124
+ "const": true
125
+ },
108
126
  "effects": {
109
127
  "const": true
110
128
  },
@@ -144,6 +162,12 @@
144
162
  "system": {
145
163
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
146
164
  },
165
+ "activities": {
166
+ "type": "array",
167
+ "items": {
168
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
169
+ }
170
+ },
147
171
  "effects": {
148
172
  "type": "array",
149
173
  "items": {
@@ -169,6 +193,9 @@
169
193
  "chooseSystem": {
170
194
  "const": true
171
195
  },
196
+ "activities": {
197
+ "const": true
198
+ },
172
199
  "effects": {
173
200
  "const": true
174
201
  },
@@ -209,6 +236,12 @@
209
236
  "system": {
210
237
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
211
238
  },
239
+ "activities": {
240
+ "type": "array",
241
+ "items": {
242
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
243
+ }
244
+ },
212
245
  "effects": {
213
246
  "type": "array",
214
247
  "items": {
@@ -234,6 +267,9 @@
234
267
  "chooseSystem": {
235
268
  "const": true
236
269
  },
270
+ "activities": {
271
+ "const": true
272
+ },
237
273
  "effects": {
238
274
  "const": true
239
275
  },
@@ -274,6 +310,12 @@
274
310
  "system": {
275
311
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
276
312
  },
313
+ "activities": {
314
+ "type": "array",
315
+ "items": {
316
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
317
+ }
318
+ },
277
319
  "effects": {
278
320
  "type": "array",
279
321
  "items": {
@@ -299,6 +341,9 @@
299
341
  "chooseSystem": {
300
342
  "const": true
301
343
  },
344
+ "activities": {
345
+ "const": true
346
+ },
302
347
  "effects": {
303
348
  "const": true
304
349
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "1.10.30",
3
+ "version": "1.10.31",
4
4
  "type": "object",
5
5
  "description": "Homebrew for 5etools. Should include arrays titled similarly to the main site data, e.g. `spell` or `class`",
6
6
  "$defs": {
@@ -710,6 +710,9 @@
710
710
  "rewardFluff": {
711
711
  "$ref": "fluff-rewards.json#/properties/rewardFluff"
712
712
  },
713
+ "foundryReward": {
714
+ "$ref": "foundry-rewards.json#/properties/reward"
715
+ },
713
716
  "table": {
714
717
  "$ref": "tables.json#/properties/table"
715
718
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "rewards.json",
4
- "version": "1.1.4",
4
+ "version": "1.2.0",
5
5
  "type": "object",
6
6
  "$defs": {
7
7
  "reward": {
@@ -48,21 +48,12 @@
48
48
  ],
49
49
  "additionalProperties": false
50
50
  },
51
- "signaturespells": {
52
- "type": "object",
53
- "properties": {
54
- "entry": {
55
- "$ref": "entry.json"
56
- }
57
- },
58
- "required": [
59
- "entry"
60
- ],
61
- "additionalProperties": false
62
- },
63
51
  "rarity": {
64
52
  "$ref": "util.json#/$defs/rarity"
65
53
  },
54
+ "additionalSpells": {
55
+ "$ref": "util-additionalspells.json#/$defs/additionalSpellsArray"
56
+ },
66
57
  "entries": {
67
58
  "type": "array",
68
59
  "uniqueItems": true,
@@ -69,6 +69,10 @@
69
69
  "description": "Spells which cost a specific resource to use (such as Ki), but otherwise have no restrictions",
70
70
  "$ref": "#/$defs/_additionalSpellRechargeObject"
71
71
  },
72
+ "limited": {
73
+ "description": "Spells which do not recharge, and have a limited number of uses",
74
+ "$ref": "#/$defs/_additionalSpellRechargeObject"
75
+ },
72
76
  "_": {
73
77
  "description": "Spells which do not fall into the above categories (i.e. have no specific recharge, and are simply known)",
74
78
  "$ref": "#/$defs/_additionalSpellArrayOfStringOrFilterObject"
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "util-foundry.json",
4
4
  "title": "Util: Foundry",
5
- "version": "1.0.7",
5
+ "version": "1.0.8",
6
6
  "$defs": {
7
7
  "entryDataObject": {
8
8
  "description": "Additional \"5etools-type\" data to be stored on the entry.",
@@ -59,7 +59,14 @@
59
59
  "foundryId": {
60
60
  "type": "string",
61
61
  "minLength": 16,
62
- "maxLength": 16
62
+ "maxLength": 16,
63
+ "pattern": "^[A-Za-z0-9]+$"
64
+ },
65
+ "foundryIdShort": {
66
+ "type": "string",
67
+ "minLength": 1,
68
+ "maxLength": 16,
69
+ "pattern": "^[A-Za-z0-9]+$"
63
70
  },
64
71
  "foundryTokenScale": {
65
72
  "type": "number",
@@ -106,12 +113,44 @@
106
113
  },
107
114
  "minProperties": 1
108
115
  },
116
+ "_foundryActivityObject_utility": {
117
+ "type": "object",
118
+ "properties": {
119
+ "type": {
120
+ "const": "utility"
121
+ },
122
+ "effects": {
123
+ "type": "array",
124
+ "items": {
125
+ "type": "object",
126
+ "properties": {
127
+ "foundryId": {
128
+ "$ref": "#/$defs/foundryIdShort"
129
+ }
130
+ },
131
+ "required": [
132
+ "foundryId"
133
+ ]
134
+ }
135
+ }
136
+ },
137
+ "required": [
138
+ "type"
139
+ ]
140
+ },
141
+ "foundryActivityObject": {
142
+ "anyOf": [
143
+ {
144
+ "$ref": "#/$defs/_foundryActivityObject_utility"
145
+ }
146
+ ]
147
+ },
109
148
  "_foundryEffectObject": {
110
149
  "type": "object",
111
150
  "properties": {
112
151
  "foundryId": {
113
152
  "description": "Use only when required. For example, when linking an \"enchantmentRiderParent\".",
114
- "$ref": "#/$defs/foundryId"
153
+ "$ref": "#/$defs/foundryIdShort"
115
154
  },
116
155
  "name": {
117
156
  "type": "string"
@@ -202,7 +241,7 @@
202
241
  "maximum": 20
203
242
  },
204
243
  "enchantmentRiderParent": {
205
- "$ref": "#/$defs/foundryId"
244
+ "$ref": "#/$defs/foundryIdShort"
206
245
  },
207
246
  "type": {
208
247
  "type": "string",
@@ -263,6 +302,12 @@
263
302
  "system": {
264
303
  "$ref": "#/$defs/foundrySystemObject"
265
304
  },
305
+ "activities": {
306
+ "type": "array",
307
+ "items": {
308
+ "$ref": "#/$defs/foundryActivityObject"
309
+ }
310
+ },
266
311
  "effects": {
267
312
  "type": "array",
268
313
  "items": {
@@ -288,6 +333,9 @@
288
333
  "chooseSystem": {
289
334
  "const": true
290
335
  },
336
+ "activities": {
337
+ "const": true
338
+ },
291
339
  "effects": {
292
340
  "const": true
293
341
  },
@@ -326,6 +374,12 @@
326
374
  "system": {
327
375
  "$ref": "#/$defs/foundrySystemObject"
328
376
  },
377
+ "activities": {
378
+ "type": "array",
379
+ "items": {
380
+ "$ref": "#/$defs/foundryActivityObject"
381
+ }
382
+ },
329
383
  "effects": {
330
384
  "type": "array",
331
385
  "items": {
@@ -351,6 +405,9 @@
351
405
  "chooseSystem": {
352
406
  "const": true
353
407
  },
408
+ "activities": {
409
+ "const": true
410
+ },
354
411
  "effects": {
355
412
  "const": true
356
413
  },
@@ -410,6 +467,12 @@
410
467
  "system": {
411
468
  "$ref": "#/$defs/foundrySystemObject"
412
469
  },
470
+ "activities": {
471
+ "type": "array",
472
+ "items": {
473
+ "$ref": "#/$defs/foundryActivityObject"
474
+ }
475
+ },
413
476
  "effects": {
414
477
  "type": "array",
415
478
  "items": {
@@ -435,6 +498,9 @@
435
498
  "chooseSystem": {
436
499
  "const": true
437
500
  },
501
+ "activities": {
502
+ "const": true
503
+ },
438
504
  "effects": {
439
505
  "const": true
440
506
  },
@@ -19,6 +19,12 @@
19
19
  "system": {
20
20
  "$ref": "../util-foundry.json#/$defs/foundrySystemObject"
21
21
  },
22
+ "activities": {
23
+ "type": "array",
24
+ "items": {
25
+ "$ref": "../util-foundry.json#/$defs/foundryActivityObject"
26
+ }
27
+ },
22
28
  "effects": {
23
29
  "type": "array",
24
30
  "items": {
@@ -44,6 +50,9 @@
44
50
  "chooseSystem": {
45
51
  "const": true
46
52
  },
53
+ "activities": {
54
+ "const": true
55
+ },
47
56
  "effects": {
48
57
  "const": true
49
58
  },
@@ -128,6 +137,12 @@
128
137
  "system": {
129
138
  "$ref": "../util-foundry.json#/$defs/foundrySystemObject"
130
139
  },
140
+ "activities": {
141
+ "type": "array",
142
+ "items": {
143
+ "$ref": "../util-foundry.json#/$defs/foundryActivityObject"
144
+ }
145
+ },
131
146
  "effects": {
132
147
  "type": "array",
133
148
  "items": {
@@ -153,6 +168,9 @@
153
168
  "chooseSystem": {
154
169
  "const": true
155
170
  },
171
+ "activities": {
172
+ "const": true
173
+ },
156
174
  "effects": {
157
175
  "const": true
158
176
  },
@@ -242,6 +260,12 @@
242
260
  "system": {
243
261
  "$ref": "../util-foundry.json#/$defs/foundrySystemObject"
244
262
  },
263
+ "activities": {
264
+ "type": "array",
265
+ "items": {
266
+ "$ref": "../util-foundry.json#/$defs/foundryActivityObject"
267
+ }
268
+ },
245
269
  "effects": {
246
270
  "type": "array",
247
271
  "items": {
@@ -267,6 +291,9 @@
267
291
  "chooseSystem": {
268
292
  "const": true
269
293
  },
294
+ "activities": {
295
+ "const": true
296
+ },
270
297
  "effects": {
271
298
  "const": true
272
299
  },
@@ -355,6 +382,12 @@
355
382
  "system": {
356
383
  "$ref": "../util-foundry.json#/$defs/foundrySystemObject"
357
384
  },
385
+ "activities": {
386
+ "type": "array",
387
+ "items": {
388
+ "$ref": "../util-foundry.json#/$defs/foundryActivityObject"
389
+ }
390
+ },
358
391
  "effects": {
359
392
  "type": "array",
360
393
  "items": {
@@ -380,6 +413,9 @@
380
413
  "chooseSystem": {
381
414
  "const": true
382
415
  },
416
+ "activities": {
417
+ "const": true
418
+ },
383
419
  "effects": {
384
420
  "const": true
385
421
  },
@@ -27,6 +27,12 @@
27
27
  "system": {
28
28
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
29
29
  },
30
+ "activities": {
31
+ "type": "array",
32
+ "items": {
33
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
34
+ }
35
+ },
30
36
  "effects": {
31
37
  "type": "array",
32
38
  "items": {
@@ -52,6 +58,9 @@
52
58
  "chooseSystem": {
53
59
  "const": true
54
60
  },
61
+ "activities": {
62
+ "const": true
63
+ },
55
64
  "effects": {
56
65
  "const": true
57
66
  },
@@ -24,6 +24,12 @@
24
24
  "system": {
25
25
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
26
26
  },
27
+ "activities": {
28
+ "type": "array",
29
+ "items": {
30
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
31
+ }
32
+ },
27
33
  "effects": {
28
34
  "type": "array",
29
35
  "items": {
@@ -49,6 +55,9 @@
49
55
  "chooseSystem": {
50
56
  "const": true
51
57
  },
58
+ "activities": {
59
+ "const": true
60
+ },
52
61
  "effects": {
53
62
  "const": true
54
63
  },
@@ -30,6 +30,12 @@
30
30
  "system": {
31
31
  "$ref": "util-foundry.json#/$defs/foundrySystemObject"
32
32
  },
33
+ "activities": {
34
+ "type": "array",
35
+ "items": {
36
+ "$ref": "util-foundry.json#/$defs/foundryActivityObject"
37
+ }
38
+ },
33
39
  "effects": {
34
40
  "type": "array",
35
41
  "items": {
@@ -55,6 +61,9 @@
55
61
  "chooseSystem": {
56
62
  "const": true
57
63
  },
64
+ "activities": {
65
+ "const": true
66
+ },
58
67
  "effects": {
59
68
  "const": true
60
69
  },