@vttforge/cli 0.18.1 → 0.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vttforge/cli",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "Scaffold, dev loop, release build, lint and audit for Foundry VTT v14+ systems and modules.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@vttforge/cli": "^0.18.0",
21
- "@vttforge/types": "^0.5.0",
21
+ "@vttforge/types": "^0.7.0",
22
22
  "@vttforge/vite-plugin": "^0.6.0",
23
23
  "typescript": "^5.4.0",
24
24
  "vite": "^8.2.2"
@@ -4,51 +4,33 @@
4
4
  * An ambient declaration, so it lives in a `.d.ts` and `include` picks it up.
5
5
  * Nothing imports it.
6
6
  *
7
- * `var`, not `const`. Two `declare global` blocks naming the same global have
8
- * to merge, and only `var` merges. A `const` here collides with the identical
9
- * declaration `@vttforge/testing` ships, and `tsc` stops with TS2451.
7
+ * Two `declare global` blocks naming one global have to agree on two things,
8
+ * and both matter here because `@vttforge/testing` declares the same ones.
10
9
  *
11
- * `@vttforge/types` describes `game`, `ui`, `CONFIG`, `CONST`, the hook map
12
- * and the document classes. It does not yet describe the `foundry.*`
13
- * namespace, so `FoundryNamespace` below narrows the members this scaffold
14
- * reaches for. Add to it as you use more, rather than widening the whole
15
- * namespace to `any`: a typo in a namespaced path is the kind of mistake that
16
- * only shows up at runtime, in front of a player.
10
+ * `var`, not `const`. `const` is block-scoped, so a second one is a
11
+ * redeclaration and `tsc` stops with TS2451.
12
+ *
13
+ * The same type, from the same package. Two structurally identical interfaces
14
+ * are still two types, and `tsc` stops with TS2403 saying a variable "must be
15
+ * of type 'FoundryNamespace', but here has type 'FoundryNamespace'", which
16
+ * reads like a riddle. So `FoundryNamespace` is imported rather than written
17
+ * out here.
18
+ *
19
+ * Reaching a member it does not describe is a cast. Write the cast rather than
20
+ * widening the global to `any`: a typo in a namespaced path only shows up at
21
+ * runtime, in front of a player.
17
22
  */
18
23
  import type {
19
24
  ChatMessageConstructor,
20
25
  FoundryConfig,
21
26
  FoundryConstants,
27
+ FoundryNamespace,
22
28
  Game,
23
29
  HooksApi,
24
30
  RollConstructor,
25
31
  UiApi,
26
32
  } from '@vttforge/types';
27
33
 
28
- interface TextEditorImplementation {
29
- enrichHTML(content: string, options?: Record<string, unknown>): Promise<string>;
30
- }
31
-
32
- interface FoundryNamespace {
33
- readonly applications: {
34
- readonly api: {
35
- readonly DialogV2: {
36
- confirm(options: Record<string, unknown>): Promise<boolean>;
37
- };
38
- };
39
- readonly handlebars: {
40
- renderTemplate(path: string, context: unknown): Promise<string>;
41
- };
42
- readonly ux: {
43
- readonly TextEditor: { readonly implementation: TextEditorImplementation };
44
- };
45
- };
46
- readonly utils: {
47
- mergeObject<T>(original: T, other?: object, options?: object): T;
48
- randomID(length?: number): string;
49
- };
50
- }
51
-
52
34
  declare global {
53
35
  var game: Game;
54
36
  var CONFIG: FoundryConfig;
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "@vttforge/cli": "^0.18.0",
22
- "@vttforge/types": "^0.5.0",
22
+ "@vttforge/types": "^0.7.0",
23
23
  "@vttforge/vite-plugin": "^0.6.0",
24
24
  "typescript": "^5.4.0",
25
25
  "vite": "^8.2.2"
@@ -4,51 +4,33 @@
4
4
  * An ambient declaration, so it lives in a `.d.ts` and `include` picks it up.
5
5
  * Nothing imports it.
6
6
  *
7
- * `var`, not `const`. Two `declare global` blocks naming the same global have
8
- * to merge, and only `var` merges. A `const` here collides with the identical
9
- * declaration `@vttforge/testing` ships, and `tsc` stops with TS2451.
7
+ * Two `declare global` blocks naming one global have to agree on two things,
8
+ * and both matter here because `@vttforge/testing` declares the same ones.
10
9
  *
11
- * `@vttforge/types` describes `game`, `ui`, `CONFIG`, `CONST`, the hook map
12
- * and the document classes. It does not yet describe the `foundry.*`
13
- * namespace, so `FoundryNamespace` below narrows the members this scaffold
14
- * reaches for. Add to it as you use more, rather than widening the whole
15
- * namespace to `any`: a typo in a namespaced path is the kind of mistake that
16
- * only shows up at runtime, in front of a player.
10
+ * `var`, not `const`. `const` is block-scoped, so a second one is a
11
+ * redeclaration and `tsc` stops with TS2451.
12
+ *
13
+ * The same type, from the same package. Two structurally identical interfaces
14
+ * are still two types, and `tsc` stops with TS2403 saying a variable "must be
15
+ * of type 'FoundryNamespace', but here has type 'FoundryNamespace'", which
16
+ * reads like a riddle. So `FoundryNamespace` is imported rather than written
17
+ * out here.
18
+ *
19
+ * Reaching a member it does not describe is a cast. Write the cast rather than
20
+ * widening the global to `any`: a typo in a namespaced path only shows up at
21
+ * runtime, in front of a player.
17
22
  */
18
23
  import type {
19
24
  ChatMessageConstructor,
20
25
  FoundryConfig,
21
26
  FoundryConstants,
27
+ FoundryNamespace,
22
28
  Game,
23
29
  HooksApi,
24
30
  RollConstructor,
25
31
  UiApi,
26
32
  } from '@vttforge/types';
27
33
 
28
- interface TextEditorImplementation {
29
- enrichHTML(content: string, options?: Record<string, unknown>): Promise<string>;
30
- }
31
-
32
- interface FoundryNamespace {
33
- readonly applications: {
34
- readonly api: {
35
- readonly DialogV2: {
36
- confirm(options: Record<string, unknown>): Promise<boolean>;
37
- };
38
- };
39
- readonly handlebars: {
40
- renderTemplate(path: string, context: unknown): Promise<string>;
41
- };
42
- readonly ux: {
43
- readonly TextEditor: { readonly implementation: TextEditorImplementation };
44
- };
45
- };
46
- readonly utils: {
47
- mergeObject<T>(original: T, other?: object, options?: object): T;
48
- randomID(length?: number): string;
49
- };
50
- }
51
-
52
34
  declare global {
53
35
  var game: Game;
54
36
  var CONFIG: FoundryConfig;