5etools-utils 0.16.42 → 0.17.0

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.
@@ -0,0 +1,242 @@
1
+ export const getEslintGlobals = names => names
2
+ .reduce((accum, name) => {
3
+ accum[name] = "readonly";
4
+ return accum;
5
+ }, {});
6
+
7
+ export const ESLINT_GLOBALS_VETOOLS = getEslintGlobals([
8
+ "$",
9
+ "_SEO_PAGE",
10
+ "AbilityScoreFilter",
11
+ "ace",
12
+ "AnimationUtil",
13
+ "BaseComponent",
14
+ "BlocklistUi",
15
+ "BlocklistUtil",
16
+ "BookModeViewBase",
17
+ "BookUtil",
18
+ "BrewUtil2",
19
+ "BrewUtilShared",
20
+ "BrowserUtil",
21
+ "CleanUtil",
22
+ "CollectionUtil",
23
+ "Color",
24
+ "ComponentUiUtil",
25
+ "ConfigUi",
26
+ "ConverterSpell",
27
+ "ContextUtil",
28
+ "CryptUtil",
29
+ "CurrencyUtil",
30
+ "DataLoader",
31
+ "DataUtil",
32
+ "DatetimeUtil",
33
+ "domtoimage",
34
+ "DragReorderUiUtil",
35
+ "ElementUtil",
36
+ "EditorUtil",
37
+ "elasticlunr",
38
+ "EventUtil",
39
+ "ExcludeUtil",
40
+ "ExtensionUtil",
41
+ "Filter",
42
+ "FilterBox",
43
+ "FILTER_BOX_EVNT_VALCHANGE",
44
+ "FILTER_BOX_TITLE_BTN_RESET",
45
+ "FilterCommon",
46
+ "FilterItem",
47
+ "FontManager",
48
+ "GenUtil",
49
+ "Handlebars",
50
+ "HASH_BLANK",
51
+ "HASH_LIST_SEP",
52
+ "HASH_PART_SEP",
53
+ "HASH_SUB_KV_SEP",
54
+ "HASH_SUB_LIST_SEP",
55
+ "HASH_SUB_NONE",
56
+ "Hist",
57
+ "IMGUR_CLIENT_ID",
58
+ "icon_names",
59
+ "InputUiUtil",
60
+ "IndexableFileQuickReference",
61
+ "IS_DEPLOYED",
62
+ "jQuery",
63
+ "JqueryUtil",
64
+ "List",
65
+ "ListItem",
66
+ "ListPage",
67
+ "ListPageBookView",
68
+ "ListPageMultiSource",
69
+ "ListPageSettingsManager",
70
+ "ListPageStateManager",
71
+ "ListPageTokenDisplay",
72
+ "ListSelectClickHandler",
73
+ "ListSelectClickHandlerBase",
74
+ "ListSyntaxBestiary",
75
+ "ListSyntaxDecks",
76
+ "ListSyntaxDeities",
77
+ "ListSyntaxItems",
78
+ "ListSyntaxObjects",
79
+ "ListSyntaxPsionics",
80
+ "ListSyntaxRecipes",
81
+ "ListSyntaxSpells",
82
+ "ListSyntaxTables",
83
+ "ListSyntaxTrapsHazards",
84
+ "ListSyntaxVehicles",
85
+ "ListUiPreviewButtonHandlerBase",
86
+ "ListUiPreviewButtonHandlerStatsFluff",
87
+ "ListUiUtil",
88
+ "ListUtil",
89
+ "ListUtilEntity",
90
+ "localforage",
91
+ "MarkdownConverter",
92
+ "MiscUtil",
93
+ "MixinBaseComponent",
94
+ "MixinComponentGlobalState",
95
+ "MixinProxyBase",
96
+ "ModalFilterBackgrounds",
97
+ "ModalFilterBase",
98
+ "ModalFilterBestiary",
99
+ "ModalFilterFeats",
100
+ "ModalFilterItems",
101
+ "ModalFilterOptionalFeatures",
102
+ "ModalFilterRaces",
103
+ "ModalFilterSpells",
104
+ "MultiFilter",
105
+ "MultiSourceUtil",
106
+ "NavBar",
107
+ "NumberUtil",
108
+ "Omnidexer",
109
+ "OptionsFilter",
110
+ "PageFilterActions",
111
+ "PageFilterBackgrounds",
112
+ "PageFilterBase",
113
+ "PageFilterBastions",
114
+ "PageFilterBestiary",
115
+ "PageFilterCharCreationOptions",
116
+ "PageFilterClasses",
117
+ "PageFilterClassesBase",
118
+ "PageFilterConditionsDiseases",
119
+ "PageFilterCultsBoons",
120
+ "PageFilterDecks",
121
+ "PageFilterDeities",
122
+ "PageFilterFeats",
123
+ "PageFilterHomeCrafts",
124
+ "PageFilterItems",
125
+ "PageFilterLanguages",
126
+ "PageFilterObjects",
127
+ "PageFilterOptionalFeatures",
128
+ "PageFilterPsionics",
129
+ "PageFilterRaces",
130
+ "PageFilterRecipes",
131
+ "PageFilterRewards",
132
+ "PageFilterSpells",
133
+ "PageFilterTables",
134
+ "PageFilterTrapsHazards",
135
+ "PageFilterVariantRules",
136
+ "PageFilterVehicles",
137
+ "Parser",
138
+ "Peer",
139
+ "PeerUtilV0",
140
+ "PeerVeClient",
141
+ "PeerVeServer",
142
+ "polylabel",
143
+ "PrereleaseUtil",
144
+ "ProxyBase",
145
+ "RangeFilter",
146
+ "RenderableCollectionBase",
147
+ "RenderableCollectionAsyncGenericRows",
148
+ "RenderableCollectionGenericRows",
149
+ "RenderableCollectionSelectClickHandler",
150
+ "RenderCard",
151
+ "RendererCard",
152
+ "RenderCharCreationOptions",
153
+ "RenderCultsBoons",
154
+ "RenderDecks",
155
+ "RenderDeities",
156
+ "RenderEncounters",
157
+ "RenderLanguages",
158
+ "RenderNames",
159
+ "RenderObjects",
160
+ "RenderPsionics",
161
+ "RenderTables",
162
+ "RenderTrapsHazards",
163
+ "RenderVariantRules",
164
+ "RenderVehicles",
165
+ "Renderer",
166
+ "RendererMarkdown",
167
+ "RollerUtil",
168
+ "SaveManager",
169
+ "ScaleClassSummonedCreature",
170
+ "ScaleCreature",
171
+ "ScaleSpellSummonedCreature",
172
+ "SearchableFilter",
173
+ "SearchUiUtil",
174
+ "SearchUtil",
175
+ "SearchWidget",
176
+ "SessionStorageUtil",
177
+ "SettingsUtil",
178
+ "SortUtil",
179
+ "SourceFilter",
180
+ "SourceFilterItem",
181
+ "SourceUtil",
182
+ "StorageUtil",
183
+ "StorageUtilMemory",
184
+ "StrUtil",
185
+ "SublistCell",
186
+ "SublistCellTemplate",
187
+ "SublistManager",
188
+ "SublistPersistor",
189
+ "SublistPlugin",
190
+ "TabUiUtil",
191
+ "TabUiUtilSide",
192
+ "Trie",
193
+ "UiUtil",
194
+ "UidUtil",
195
+ "UrlUtil",
196
+ "UtilsTableview",
197
+ "UtilsChangelog",
198
+ "VeCt",
199
+ "VetoolsConfig",
200
+ "veE",
201
+ "veEm",
202
+ "veEs",
203
+ "VeLock",
204
+ "veT",
205
+ "VERSION_NUMBER",
206
+ "styleSwitcher",
207
+ ]);
208
+
209
+ export const ESLINT_GLOBALS_FOUNDRY = getEslintGlobals([
210
+ "ActiveEffect",
211
+ "Actor",
212
+ "Application",
213
+ "AudioHelper",
214
+ "canvas",
215
+ "Card",
216
+ "Cards",
217
+ "ChatMessage",
218
+ "CombatTracker",
219
+ "CONFIG",
220
+ "CONST",
221
+ "Dialog",
222
+ "FilePicker",
223
+ "Folder",
224
+ "foundry",
225
+ "fromUuid",
226
+ "fromUuidSync",
227
+ "game",
228
+ "Hooks",
229
+ "Item",
230
+ "JournalEntry",
231
+ "JournalEntryPage",
232
+ "Macro",
233
+ "Module",
234
+ "Ray",
235
+ "Roll",
236
+ "RollTable",
237
+ "Scene",
238
+ "TableResult",
239
+ "Token",
240
+ "TokenDocument",
241
+ "ui",
242
+ ]);
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "5etools-utils",
3
- "version": "0.16.42",
3
+ "version": "0.17.0",
4
4
  "description": "Shared utilities for the 5etools ecosystem.",
5
5
  "type": "module",
6
6
  "main": "lib/Api.js",
7
7
  "exports": {
8
8
  ".": "./lib/Api.js",
9
- "./eslint": "./lib/eslint/eslint-plugin-jquery.js",
10
9
  "./eslint/*": "./lib/eslint/*",
11
10
  "./lib/*": "./lib/*",
12
11
  "./schema/*": "./schema/*",
@@ -34,6 +33,7 @@
34
33
  "test-img-file-sizes": "bin/test-img-file-sizes.js",
35
34
  "test-img-source-names-brew": "bin/test-img-source-names-brew.js",
36
35
  "test-img-source-names-ua": "bin/test-img-source-names-ua.js",
36
+ "vet-eslint": "bin/lint-js.js",
37
37
  "lint-js-changed": "bin/lint-js-changed.js"
38
38
  },
39
39
  "scripts": {
@@ -42,7 +42,7 @@
42
42
  "test": "npm run lint:js && npm run test:js",
43
43
  "test:js": "node --disable-warning=ExperimentalWarning --localstorage-file test/localstorage.tmp --experimental-vm-modules node_modules/jest/bin/jest.js",
44
44
  "lint": "npm run lint:js",
45
- "lint:js": "eslint lib node test --fix",
45
+ "lint:js": "node bin/lint-js.js lib node test --fix",
46
46
  "lint:js:fast": "node bin/lint-js-changed.js",
47
47
  "preversion": "npm t"
48
48
  },
@@ -57,10 +57,12 @@
57
57
  },
58
58
  "homepage": "https://github.com/TheGiddyLimit/5etools-utils#readme",
59
59
  "dependencies": {
60
+ "@eslint/js": "^10.0.1",
60
61
  "ajv": "^8.18.0",
61
62
  "ajv-formats": "^3.0.1",
62
63
  "commander": "^14.0.3",
63
- "eslint": "^10.0.1",
64
+ "eslint": "^10.10.0",
65
+ "globals": "^17.4.0",
64
66
  "hasha": "^7.0.0",
65
67
  "he": "^1.2.0",
66
68
  "json-source-map": "^0.6.1",
@@ -69,7 +71,6 @@
69
71
  "simple-git": "^3.36.0"
70
72
  },
71
73
  "devDependencies": {
72
- "@eslint/js": "^10.0.1",
73
74
  "jest": "^30.2.0"
74
75
  }
75
76
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "corpus-shared.json",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "$defs": {
6
6
  "corpusCover": {
7
7
  "description": "A link to an image. Preferred sizes are 300 x 300px or 600 x 600px.",
@@ -44,16 +44,35 @@
44
44
  "statblock": {
45
45
  "const": true
46
46
  },
47
+ "tag": {
48
+ "type": "string"
49
+ },
50
+ "uid": {
51
+ "type": "string"
52
+ },
47
53
  "index": {
48
54
  "description": "The relative index of this header in the current chapter, i.e. if \"Treasure\" appears twice and you wish the contents entry to link to the second instance, set the \"index\" to 1.",
49
55
  "type": "integer",
50
56
  "markdownDescription": "The relative index of this header in the current chapter, i.e. if "Treasure" appears twice and you wish the contents entry to link to the second instance, set the "index" to 1."
51
57
  }
52
58
  },
53
- "additionalProperties": false,
54
59
  "required": [
55
60
  "header"
56
- ]
61
+ ],
62
+ "dependentRequired": {
63
+ "source": [
64
+ "statblock"
65
+ ],
66
+ "tag": [
67
+ "statblock",
68
+ "uid"
69
+ ],
70
+ "uid": [
71
+ "statblock",
72
+ "tag"
73
+ ]
74
+ },
75
+ "additionalProperties": false
57
76
  }
58
77
  ]
59
78
  }
@@ -3,7 +3,7 @@
3
3
  "$id": "entry.json",
4
4
  "title": "Entry",
5
5
  "description": "A recursively renderable object.",
6
- "version": "1.10.1",
6
+ "version": "1.10.2",
7
7
  "$defs": {
8
8
  "_arrayOfSpell": {
9
9
  "type": "array",
@@ -3285,6 +3285,67 @@
3285
3285
  ],
3286
3286
  "additionalProperties": false
3287
3287
  },
3288
+ {
3289
+ "type": "object",
3290
+ "properties": {
3291
+ "name": {
3292
+ "type": "string"
3293
+ },
3294
+ "type": {
3295
+ "type": "string",
3296
+ "const": "statblock"
3297
+ },
3298
+ "source": {
3299
+ "$ref": "util.json#/$defs/source"
3300
+ },
3301
+ "page": {
3302
+ "$ref": "util.json#/$defs/page"
3303
+ },
3304
+ "data": {
3305
+ "$ref": "#/$defs/_entryDataData"
3306
+ },
3307
+ "id": {
3308
+ "type": "string"
3309
+ },
3310
+ "displayName": {
3311
+ "type": "string"
3312
+ },
3313
+ "hash": {
3314
+ "type": "string"
3315
+ },
3316
+ "style": {
3317
+ "$ref": "#/$defs/_entryDataStyle"
3318
+ },
3319
+ "slotSize": {
3320
+ "$ref": "#/$defs/_entryStatblockSlotSize"
3321
+ },
3322
+ "collapsed": {
3323
+ "const": true
3324
+ },
3325
+ "tag": {
3326
+ "const": "subclass"
3327
+ },
3328
+ "shortName": {
3329
+ "type": "string"
3330
+ },
3331
+ "className": {
3332
+ "type": "string"
3333
+ },
3334
+ "classSource": {
3335
+ "$ref": "util.json#/$defs/source"
3336
+ }
3337
+ },
3338
+ "required": [
3339
+ "type",
3340
+ "tag",
3341
+ "name",
3342
+ "shortName",
3343
+ "source",
3344
+ "className",
3345
+ "classSource"
3346
+ ],
3347
+ "additionalProperties": false
3348
+ },
3288
3349
  {
3289
3350
  "type": "object",
3290
3351
  "properties": {
@@ -135,12 +135,16 @@
135
135
  "LFL",
136
136
  "EFA",
137
137
  "FFotR",
138
+ "RHW",
139
+ "AU",
140
+ "AUD",
138
141
  "TD",
139
142
  "Screen",
140
143
  "ScreenWildernessKit",
141
144
  "ScreenDungeonKit",
142
145
  "ScreenSpelljammer",
143
146
  "XScreen",
147
+ "XScreenRHW",
144
148
  "HF",
145
149
  "HFFotM",
146
150
  "HFStCM",
@@ -184,7 +188,9 @@
184
188
  "MCV3MC",
185
189
  "MCV4EC",
186
190
  "MisMV1",
187
- "AATM"
191
+ "AATM",
192
+ "CaBoMP",
193
+ "BQDD"
188
194
  ]
189
195
  },
190
196
  "sourcesLegacy": {
@@ -378,12 +384,18 @@
378
384
  "LFL",
379
385
  "EFA",
380
386
  "FFotR",
387
+ "RHW",
388
+ "AU",
389
+ "AUD",
381
390
  "XScreen",
391
+ "XScreenRHW",
382
392
  "HFDoMM",
383
393
  "UtHftLH",
384
394
  "ScoEE",
385
395
  "HBTD",
386
- "BQGT"
396
+ "BQGT",
397
+ "CaBoMP",
398
+ "BQDD"
387
399
  ]
388
400
  }
389
401
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "corpus-shared.json",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "$defs": {
6
6
  "corpusCover": {
7
7
  "description": "A link to an image. Preferred sizes are 300 x 300px or 600 x 600px.",
@@ -44,16 +44,35 @@
44
44
  "statblock": {
45
45
  "const": true
46
46
  },
47
+ "tag": {
48
+ "type": "string"
49
+ },
50
+ "uid": {
51
+ "type": "string"
52
+ },
47
53
  "index": {
48
54
  "description": "The relative index of this header in the current chapter, i.e. if \"Treasure\" appears twice and you wish the contents entry to link to the second instance, set the \"index\" to 1.",
49
55
  "type": "integer",
50
56
  "markdownDescription": "The relative index of this header in the current chapter, i.e. if "Treasure" appears twice and you wish the contents entry to link to the second instance, set the "index" to 1."
51
57
  }
52
58
  },
53
- "additionalProperties": false,
54
59
  "required": [
55
60
  "header"
56
- ]
61
+ ],
62
+ "dependentRequired": {
63
+ "source": [
64
+ "statblock"
65
+ ],
66
+ "tag": [
67
+ "statblock",
68
+ "uid"
69
+ ],
70
+ "uid": [
71
+ "statblock",
72
+ "tag"
73
+ ]
74
+ },
75
+ "additionalProperties": false
57
76
  }
58
77
  ]
59
78
  }
@@ -3,7 +3,7 @@
3
3
  "$id": "entry.json",
4
4
  "title": "Entry",
5
5
  "description": "A recursively renderable object.",
6
- "version": "1.10.1",
6
+ "version": "1.10.2",
7
7
  "$defs": {
8
8
  "_arrayOfSpell": {
9
9
  "type": "array",
@@ -3285,6 +3285,67 @@
3285
3285
  ],
3286
3286
  "additionalProperties": false
3287
3287
  },
3288
+ {
3289
+ "type": "object",
3290
+ "properties": {
3291
+ "name": {
3292
+ "type": "string"
3293
+ },
3294
+ "type": {
3295
+ "type": "string",
3296
+ "const": "statblock"
3297
+ },
3298
+ "source": {
3299
+ "$ref": "util.json#/$defs/source"
3300
+ },
3301
+ "page": {
3302
+ "$ref": "util.json#/$defs/page"
3303
+ },
3304
+ "data": {
3305
+ "$ref": "#/$defs/_entryDataData"
3306
+ },
3307
+ "id": {
3308
+ "type": "string"
3309
+ },
3310
+ "displayName": {
3311
+ "type": "string"
3312
+ },
3313
+ "hash": {
3314
+ "type": "string"
3315
+ },
3316
+ "style": {
3317
+ "$ref": "#/$defs/_entryDataStyle"
3318
+ },
3319
+ "slotSize": {
3320
+ "$ref": "#/$defs/_entryStatblockSlotSize"
3321
+ },
3322
+ "collapsed": {
3323
+ "const": true
3324
+ },
3325
+ "tag": {
3326
+ "const": "subclass"
3327
+ },
3328
+ "shortName": {
3329
+ "type": "string"
3330
+ },
3331
+ "className": {
3332
+ "type": "string"
3333
+ },
3334
+ "classSource": {
3335
+ "$ref": "util.json#/$defs/source"
3336
+ }
3337
+ },
3338
+ "required": [
3339
+ "type",
3340
+ "tag",
3341
+ "name",
3342
+ "shortName",
3343
+ "source",
3344
+ "className",
3345
+ "classSource"
3346
+ ],
3347
+ "additionalProperties": false
3348
+ },
3288
3349
  {
3289
3350
  "type": "object",
3290
3351
  "properties": {
@@ -135,12 +135,16 @@
135
135
  "LFL",
136
136
  "EFA",
137
137
  "FFotR",
138
+ "RHW",
139
+ "AU",
140
+ "AUD",
138
141
  "TD",
139
142
  "Screen",
140
143
  "ScreenWildernessKit",
141
144
  "ScreenDungeonKit",
142
145
  "ScreenSpelljammer",
143
146
  "XScreen",
147
+ "XScreenRHW",
144
148
  "HF",
145
149
  "HFFotM",
146
150
  "HFStCM",
@@ -184,7 +188,9 @@
184
188
  "MCV3MC",
185
189
  "MCV4EC",
186
190
  "MisMV1",
187
- "AATM"
191
+ "AATM",
192
+ "CaBoMP",
193
+ "BQDD"
188
194
  ]
189
195
  },
190
196
  "sourcesLegacy": {
@@ -378,12 +384,18 @@
378
384
  "LFL",
379
385
  "EFA",
380
386
  "FFotR",
387
+ "RHW",
388
+ "AU",
389
+ "AUD",
381
390
  "XScreen",
391
+ "XScreenRHW",
382
392
  "HFDoMM",
383
393
  "UtHftLH",
384
394
  "ScoEE",
385
395
  "HBTD",
386
- "BQGT"
396
+ "BQGT",
397
+ "CaBoMP",
398
+ "BQDD"
387
399
  ]
388
400
  }
389
401
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "corpus-shared.json",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "$defs": {
6
6
  "corpusCover": {
7
7
  "description": "A link to an image. Preferred sizes are 300 x 300px or 600 x 600px.",
@@ -44,16 +44,35 @@
44
44
  "statblock": {
45
45
  "const": true
46
46
  },
47
+ "tag": {
48
+ "type": "string"
49
+ },
50
+ "uid": {
51
+ "type": "string"
52
+ },
47
53
  "index": {
48
54
  "description": "The relative index of this header in the current chapter, i.e. if \"Treasure\" appears twice and you wish the contents entry to link to the second instance, set the \"index\" to 1.",
49
55
  "type": "integer",
50
56
  "markdownDescription": "The relative index of this header in the current chapter, i.e. if "Treasure" appears twice and you wish the contents entry to link to the second instance, set the "index" to 1."
51
57
  }
52
58
  },
53
- "additionalProperties": false,
54
59
  "required": [
55
60
  "header"
56
- ]
61
+ ],
62
+ "dependentRequired": {
63
+ "source": [
64
+ "statblock"
65
+ ],
66
+ "tag": [
67
+ "statblock",
68
+ "uid"
69
+ ],
70
+ "uid": [
71
+ "statblock",
72
+ "tag"
73
+ ]
74
+ },
75
+ "additionalProperties": false
57
76
  }
58
77
  ]
59
78
  }