@vttforge/cli 0.13.0 → 0.15.1

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.13.0",
3
+ "version": "0.15.1",
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",
@@ -49,7 +49,7 @@
49
49
  "@babel/types": "^8.0.4",
50
50
  "@types/archiver": "^8.0.0",
51
51
  "@types/node": "^26.4.0",
52
- "@vttforge/dev-module": "0.2.4",
52
+ "@vttforge/dev-module": "0.2.5",
53
53
  "publint": "^0.3.24",
54
54
  "tsdown": "^0.23.0",
55
55
  "typescript": "^7.0.2",
@@ -19,8 +19,8 @@ the answer in `.vttforge/config.json`. Override with `--foundry-data <path>`
19
19
  or `FOUNDRY_DATA_DIR`. If Foundry runs in a container it cannot follow the
20
20
  symlink, and the command prints the compose mount to use instead.
21
21
 
22
- Save a template and the open sheet redraws in place; save a stylesheet and the
23
- CSS swaps. Enable **VTTForge Dev** in the world once; `pnpm dev` links it in.
22
+ A saved template redraws the open sheet in place, and a saved stylesheet swaps
23
+ the CSS. Enable **VTTForge Dev** in the world once; `pnpm dev` links it in.
24
24
 
25
25
  Then enable **{{TITLE}}** in a world and create a Note from the Items sidebar.
26
26
 
@@ -38,16 +38,16 @@ Then enable **{{TITLE}}** in a world and create a Note from the Items sidebar.
38
38
  | `styles/main.css` | Scoped under `.{{ID}}`, colours from Foundry's variables |
39
39
  | `lang/en.json` | Strings, under the `{{LOCALE_PREFIX}}` prefix, plus the `TYPES.Item` label |
40
40
 
41
- ## Two things worth knowing before you edit
41
+ ## Before you edit
42
42
 
43
- **A module's sub-types are namespaced.** You register `note`; Foundry files it
44
- as `{{ID}}.note`, and so must the manifest. `registerModule` adds the prefix,
45
- and `NOTE_TYPE` in `constants.ts` is the one place it is spelled out.
43
+ A module's sub-types are namespaced: you register `note`, Foundry files it as
44
+ `{{ID}}.note`, and the manifest must match. `registerModule` adds the prefix,
45
+ and `NOTE_TYPE` in `constants.mjs` is the one place it is spelled out.
46
46
 
47
- **Sheets are registered by id, not by class name.** `registerModule({ sheets })`
48
- pins each sheet under `{{ID}}.<id>`. Foundry saves that key on every item
49
- whose owner picked the sheet, and derives it from the class name unless told
50
- otherwise, and a bundler renames classes between builds. Keep the ids.
47
+ `registerModule({ sheets })` pins each sheet under `{{ID}}.<id>`, and Foundry
48
+ saves that key on every item whose owner picked the sheet. Without an
49
+ explicit id it derives the key from the class name, and a bundler renames
50
+ classes between builds. Keep the ids.
51
51
 
52
52
  ## Public API
53
53
 
@@ -16,7 +16,7 @@
16
16
  "@vttforge/core": "^0.15.0"
17
17
  },
18
18
  "devDependencies": {
19
- "@vttforge/cli": "^0.13.0",
19
+ "@vttforge/cli": "^0.15.0",
20
20
  "@vttforge/vite-plugin": "^0.5.0",
21
21
  "vite": "^8.2.2"
22
22
  },
@@ -19,8 +19,8 @@ the answer in `.vttforge/config.json`. Override with `--foundry-data <path>`
19
19
  or `FOUNDRY_DATA_DIR`. If Foundry runs in a container it cannot follow the
20
20
  symlink, and the command prints the compose mount to use instead.
21
21
 
22
- Save a template and the open sheet redraws in place; save a stylesheet and the
23
- CSS swaps. Enable **VTTForge Dev** in the world once; `pnpm dev` links it in.
22
+ A saved template redraws the open sheet in place, and a saved stylesheet swaps
23
+ the CSS. Enable **VTTForge Dev** in the world once; `pnpm dev` links it in.
24
24
 
25
25
  Then enable **{{TITLE}}** in a world and create a Note from the Items sidebar.
26
26
 
@@ -31,27 +31,26 @@ Then enable **{{TITLE}}** in a world and create a Note from the Items sidebar.
31
31
  | `module.json` | Manifest. Declares the `note` sub-type under `documentTypes` and the hot-reload paths |
32
32
  | `scripts/main.ts` | One `registerModule` call: data model, sheet, enricher, settings, API |
33
33
  | `scripts/constants.ts` | `MODULE_ID` and `NOTE_TYPE`, the prefixed key Foundry files the sub-type under |
34
- | `scripts/data/note-data.ts` | The data model. The schema is a function handed to `BaseTypeDataModel`, which is what makes `this.body` a `string` |
34
+ | `scripts/data/note-data.ts` | The data model. The schema is a function handed to `BaseTypeDataModel`, which makes `this.body` a `string` |
35
35
  | `scripts/sheets/note-sheet.ts` | The sheet, on `BaseItemSheet` |
36
36
  | `scripts/enricher.ts` | `@Note[id]` → a link that opens the note |
37
37
  | `templates/` | Handlebars, using Foundry's own elements (`<prose-mirror>`, `data-action`) |
38
38
  | `styles/main.css` | Scoped under `.{{ID}}`, colours from Foundry's variables |
39
39
  | `lang/en.json` | Strings, under the `{{LOCALE_PREFIX}}` prefix, plus the `TYPES.Item` label |
40
40
 
41
- ## Three things worth knowing before you edit
41
+ ## Before you edit
42
42
 
43
- **A module's sub-types are namespaced.** You register `note`; Foundry files it
44
- as `{{ID}}.note`, and so must the manifest. `registerModule` adds the prefix,
43
+ A module's sub-types are namespaced: you register `note`, Foundry files it as
44
+ `{{ID}}.note`, and the manifest must match. `registerModule` adds the prefix,
45
45
  and `NOTE_TYPE` in `constants.ts` is the one place it is spelled out.
46
46
 
47
- **Sheets are registered by id, not by class name.** `registerModule({ sheets })`
48
- pins each sheet under `{{ID}}.<id>`. Foundry saves that key on every item
49
- whose owner picked the sheet, and derives it from the class name unless told
50
- otherwise, and a bundler renames classes between builds. Keep the ids.
47
+ `registerModule({ sheets })` pins each sheet under `{{ID}}.<id>`, and Foundry
48
+ saves that key on every item whose owner picked the sheet. Without an
49
+ explicit id it derives the key from the class name, and a bundler renames
50
+ classes between builds. Keep the ids.
51
51
 
52
- **`this.document` is `unknown` on the sheet bases.** Which document a sheet is
53
- for is yours to know. The sheet narrows it once in a getter (`item`) and
54
- everything below reads typed.
52
+ `this.document` is `unknown` on the sheet bases. The sheet narrows it once
53
+ in a getter (`item`), and everything below reads typed.
55
54
 
56
55
  ## Public API
57
56
 
@@ -17,7 +17,7 @@
17
17
  "@vttforge/core": "^0.15.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@vttforge/cli": "^0.13.0",
20
+ "@vttforge/cli": "^0.15.0",
21
21
  "@vttforge/vite-plugin": "^0.5.0",
22
22
  "typescript": "^5.4.0",
23
23
  "vite": "^8.2.2"
@@ -19,8 +19,8 @@ the answer in `.vttforge/config.json`. Override with `--foundry-data <path>`
19
19
  or `FOUNDRY_DATA_DIR`. If Foundry runs in a container it cannot follow the
20
20
  symlink, and the command prints the compose mount to use instead.
21
21
 
22
- Save a template and the open sheet redraws in place; save a stylesheet and the
23
- CSS swaps. Enable **VTTForge Dev** in the world once; `pnpm dev` links it in.
22
+ A saved template redraws the open sheet in place, and a saved stylesheet swaps
23
+ the CSS. Enable **VTTForge Dev** in the world once; `pnpm dev` links it in.
24
24
 
25
25
  Then create a world on **{{TITLE}}** and open a character.
26
26
 
@@ -30,24 +30,24 @@ Then create a world on **{{TITLE}}** and open a character.
30
30
  |---|---|
31
31
  | `system.json` | Manifest: types, `htmlFields`, hot-reload paths, migration flags |
32
32
  | `scripts/main.mjs` | One `registerSystem` call: models, sheets, initiative, settings, migrations |
33
- | `scripts/data/*.mjs` | Data models. The schema is a function handed to `BaseTypeDataModel`, which is what keeps the schema in one place |
33
+ | `scripts/data/*.mjs` | Data models. The schema is a function handed to `BaseTypeDataModel`, which keeps the schema in one place |
34
34
  | `scripts/sheets/*.mjs` | Sheets on `BaseActorSheet` / `BaseItemSheet`: `static TABS`, `static DRAG_DROP`, `onDropItem` |
35
35
  | `scripts/migrations.mjs` | `createMigrationRunner`: versioned, idempotent, GM-gated |
36
36
  | `templates/` | Handlebars, using Foundry's own elements (`<prose-mirror>`, `data-action`) |
37
37
  | `styles/main.css` | Imports `@vttforge/styles` and scopes your rules under `.{{ID}}` |
38
38
  | `lang/en.json` | Strings, under the `{{LOCALE_PREFIX}}` prefix |
39
39
 
40
- ## Two things worth knowing before you edit
40
+ ## Before you edit
41
41
 
42
- **Sheets are registered by id, not by class name.** `registerSystem({ sheets })`
43
- pins each sheet under `{{ID}}.<id>`. Foundry saves that key on every actor
44
- whose owner picked the sheet, and derives it from the class name unless told
45
- otherwise, and a bundler renames classes between builds. Keep the ids; renaming one
46
- loses the sheet choice on every document already using it.
42
+ `registerSystem({ sheets })` pins each sheet under `{{ID}}.<id>`, and Foundry
43
+ saves that key on every actor whose owner picked the sheet. Without an
44
+ explicit id it derives the key from the class name, and a bundler renames
45
+ classes between builds. Renaming an id loses the sheet choice on every
46
+ document already using it.
47
47
 
48
- **Derived values live in the schema.** `mod` on each ability is computed in
49
- `prepareDerivedData`, but it is declared as a field. JavaScript has no
50
- `declare`: a plain class field would emit and reset the property to
48
+ Derived values live in the schema. `prepareDerivedData` computes `mod` on each
49
+ ability, and the schema still declares it as a field. JavaScript has no
50
+ `declare`, so a plain class field would emit and reset the property to
51
51
  `undefined` after every data preparation.
52
52
 
53
53
  ## Checks
@@ -17,7 +17,7 @@
17
17
  "@vttforge/styles": "^0.4.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@vttforge/cli": "^0.13.0",
20
+ "@vttforge/cli": "^0.15.0",
21
21
  "@vttforge/vite-plugin": "^0.5.0",
22
22
  "vite": "^8.2.2"
23
23
  },
@@ -19,8 +19,8 @@ the answer in `.vttforge/config.json`. Override with `--foundry-data <path>`
19
19
  or `FOUNDRY_DATA_DIR`. If Foundry runs in a container it cannot follow the
20
20
  symlink, and the command prints the compose mount to use instead.
21
21
 
22
- Save a template and the open sheet redraws in place; save a stylesheet and the
23
- CSS swaps. Enable **VTTForge Dev** in the world once; `pnpm dev` links it in.
22
+ A saved template redraws the open sheet in place, and a saved stylesheet swaps
23
+ the CSS. Enable **VTTForge Dev** in the world once; `pnpm dev` links it in.
24
24
 
25
25
  Then create a world on **{{TITLE}}** and open a character.
26
26
 
@@ -30,24 +30,23 @@ Then create a world on **{{TITLE}}** and open a character.
30
30
  |---|---|
31
31
  | `system.json` | Manifest: types, `htmlFields`, hot-reload paths, migration flags |
32
32
  | `scripts/main.ts` | One `registerSystem` call: models, sheets, initiative, settings, migrations |
33
- | `scripts/data/*.ts` | Data models. The schema is a function handed to `BaseTypeDataModel`, which is what makes `this.level` a `number` |
33
+ | `scripts/data/*.ts` | Data models. The schema is a function handed to `BaseTypeDataModel`, which makes `this.level` a `number` |
34
34
  | `scripts/sheets/*.ts` | Sheets on `BaseActorSheet` / `BaseItemSheet`: `static TABS`, `static DRAG_DROP`, typed `onDropItem` |
35
35
  | `scripts/migrations.ts` | `createMigrationRunner`: versioned, idempotent, GM-gated |
36
36
  | `templates/` | Handlebars, using Foundry's own elements (`<prose-mirror>`, `data-action`) |
37
37
  | `styles/main.css` | Imports `@vttforge/styles` and scopes your rules under `.{{ID}}` |
38
38
  | `lang/en.json` | Strings, under the `{{LOCALE_PREFIX}}` prefix |
39
39
 
40
- ## Two things worth knowing before you edit
40
+ ## Before you edit
41
41
 
42
- **Sheets are registered by id, not by class name.** `registerSystem({ sheets })`
43
- pins each sheet under `{{ID}}.<id>`. Foundry saves that key on every actor
44
- whose owner picked the sheet, and derives it from the class name unless told
45
- otherwise, and a bundler renames classes between builds. Keep the ids; renaming one
46
- loses the sheet choice on every document already using it.
42
+ `registerSystem({ sheets })` pins each sheet under `{{ID}}.<id>`, and Foundry
43
+ saves that key on every actor whose owner picked the sheet. Without an
44
+ explicit id it derives the key from the class name, and a bundler renames
45
+ classes between builds. Renaming an id loses the sheet choice on every
46
+ document already using it.
47
47
 
48
- **`this.document` is `unknown` on the sheet bases.** Which document a sheet is
49
- for is yours to know. Each sheet here narrows it once in a getter (`actor`,
50
- `item`) and everything below reads typed.
48
+ `this.document` is `unknown` on the sheet bases. Each sheet here narrows it
49
+ once in a getter (`actor`, `item`), and everything below reads typed.
51
50
 
52
51
  ## Checks
53
52
 
@@ -18,7 +18,7 @@
18
18
  "@vttforge/styles": "^0.4.0"
19
19
  },
20
20
  "devDependencies": {
21
- "@vttforge/cli": "^0.13.0",
21
+ "@vttforge/cli": "^0.15.0",
22
22
  "@vttforge/vite-plugin": "^0.5.0",
23
23
  "typescript": "^5.4.0",
24
24
  "vite": "^8.2.2"