@vttforge/testing 0.3.2 → 0.3.3

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vttforge/testing
2
2
 
3
+ ## 0.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 8a7ade5: Declare the Foundry globals with `var` so a consumer's own declarations can coexist. A package that adds `@vttforge/testing` to a typechecked project already declares `foundry`, `game`, `CONFIG`, `Hooks` and `ui` for its own source, and two `declare global` blocks only merge when both use `var`. With `const` on either side `tsc` stopped with `TS2451: Cannot redeclare block-scoped variable`, which is what a real consumer hit the first time it tried to typecheck its tests. The scaffolding templates are corrected the same way.
8
+
3
9
  ## 0.3.2
4
10
 
5
11
  ### Patch Changes
@@ -138,14 +138,25 @@ interface MockFoundryOptions {
138
138
  declare function withMockFoundry(options?: MockFoundryOptions): MockFoundry;
139
139
  //#endregion
140
140
  //#region src/vitest/index.d.ts
141
+ /**
142
+ * `var`, not `const`, and that is the whole point.
143
+ *
144
+ * A package that consumes this already declares these globals for its own
145
+ * source, because the SDK does not ship a Foundry runtime type. Two
146
+ * `declare global` blocks naming the same thing have to merge, and only
147
+ * `var` merges: `const` is block-scoped, so a second one is a redeclaration
148
+ * and `tsc` stops with TS2451. Consumers hit that the moment they add the
149
+ * test helpers to a typechecked project, which is the moment they most want
150
+ * them.
151
+ */
141
152
  declare global {
142
- const foundry: any;
143
- const game: any;
144
- const CONFIG: any;
145
- const Hooks: any;
146
- const ui: any;
147
- const CONST: any;
153
+ var foundry: any;
154
+ var game: any;
155
+ var CONFIG: any;
156
+ var Hooks: any;
157
+ var ui: any;
158
+ var CONST: any;
148
159
  }
149
160
  //#endregion
150
161
  export { RecordedSetting as a, MockDocument as c, createMockItem as d, RecordedHook as i, MockDocumentOptions as l, MockFoundryOptions as n, RecordedSheet as o, RecordedEnricher as r, withMockFoundry as s, MockFoundry as t, createMockActor as u };
151
- //# sourceMappingURL=index-ClqK8Qt0.d.mts.map
162
+ //# sourceMappingURL=index-DB9kK9Rn.d.mts.map
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { n as QuenchContext, r as registerBatch, t as BatchOptions } from "./index-G_T1z-KX.mjs";
2
- import { a as RecordedSetting, c as MockDocument, d as createMockItem, i as RecordedHook, l as MockDocumentOptions, n as MockFoundryOptions, o as RecordedSheet, r as RecordedEnricher, s as withMockFoundry, t as MockFoundry, u as createMockActor } from "./index-ClqK8Qt0.mjs";
2
+ import { a as RecordedSetting, c as MockDocument, d as createMockItem, i as RecordedHook, l as MockDocumentOptions, n as MockFoundryOptions, o as RecordedSheet, r as RecordedEnricher, s as withMockFoundry, t as MockFoundry, u as createMockActor } from "./index-DB9kK9Rn.mjs";
3
3
  export { type BatchOptions, type MockDocument, type MockDocumentOptions, type MockFoundry, type MockFoundryOptions, type QuenchContext, type RecordedEnricher, type RecordedHook, type RecordedSetting, type RecordedSheet, createMockActor, createMockItem, registerBatch, withMockFoundry };
@@ -1,2 +1,2 @@
1
- import { a as RecordedSetting, c as MockDocument, d as createMockItem, i as RecordedHook, l as MockDocumentOptions, n as MockFoundryOptions, o as RecordedSheet, r as RecordedEnricher, s as withMockFoundry, t as MockFoundry, u as createMockActor } from "../index-ClqK8Qt0.mjs";
1
+ import { a as RecordedSetting, c as MockDocument, d as createMockItem, i as RecordedHook, l as MockDocumentOptions, n as MockFoundryOptions, o as RecordedSheet, r as RecordedEnricher, s as withMockFoundry, t as MockFoundry, u as createMockActor } from "../index-DB9kK9Rn.mjs";
2
2
  export { type MockDocument, type MockDocumentOptions, type MockFoundry, type MockFoundryOptions, type RecordedEnricher, type RecordedHook, type RecordedSetting, type RecordedSheet, createMockActor, createMockItem, withMockFoundry };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vttforge/testing",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Foundry mocks for Vitest and Quench helpers, for testing VTTForge systems and modules.",
5
5
  "type": "module",
6
6
  "license": "MIT",