@vttforge/core 0.11.2 → 0.12.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.
- package/CHANGELOG.md +38 -0
- package/dist/errors-manifest.json +1 -1
- package/dist/index.d.mts +120 -176
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +87 -72
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @vttforge/core
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4f81bfd: Add `onI18nInit` and `onSetup` to `registerSystem` and `registerModule`.
|
|
8
|
+
|
|
9
|
+
Foundry starts a world in four stages and only two of them were reachable. The missing two are the ones that are hard to work around.
|
|
10
|
+
|
|
11
|
+
`i18nInit` is the first moment `game.i18n` works. A label localized during `init` comes back as the key you passed in, because the language files have not loaded, and that raw key is what players read on screen. Translate CONFIG labels in `onI18nInit` instead, once, rather than calling `localize` on every render.
|
|
12
|
+
|
|
13
|
+
`setup` runs after every package has finished its own `init`. A setting registered during `init` can be read from here on, and a module can see what the system around it registered instead of racing it.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
registerSystem({
|
|
17
|
+
id: 'my-system',
|
|
18
|
+
onI18nInit: () => {
|
|
19
|
+
for (const ability of Object.values(CONFIG.MY_SYSTEM.abilities)) {
|
|
20
|
+
ability.label = game.i18n.localize(ability.label);
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
onSetup: () => {
|
|
24
|
+
if (settings.get('showTutorial')) openTutorial();
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Both are optional and neither is GM-gated. Omit one and no hook is staged for it.
|
|
30
|
+
|
|
31
|
+
## 0.11.3
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- 9b8ca8c: Export the option and config interfaces that public functions already took: `MockDocumentOptions` and `MockFoundryOptions` from `@vttforge/testing`, `ActorConfig` and `ItemConfig` from `@vttforge/core`. They were reachable through the functions but could not be named.
|
|
36
|
+
- 9b8ca8c: Plain punctuation in error messages, prompts and doc comments: em dashes replaced with sentence breaks, colons or parentheses. The generated API reference reads these comments, so they are public text.
|
|
37
|
+
- e0941e2: `@vttforge/types` now holds the Foundry surface the base factories stand on: `ApplicationV2Members`, `DocumentSheetV2Members` and `VttforgeClass`. `@vttforge/core` depends on it and re-exports the same names, so nothing changes for a system that imports from core.
|
|
38
|
+
- Updated dependencies [e0941e2]
|
|
39
|
+
- @vttforge/types@0.2.0
|
|
40
|
+
|
|
3
41
|
## 0.11.2
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|