@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/CHANGELOG.md +25 -0
- package/README.md +5 -5
- package/dist/bin.mjs +428 -103
- package/dist/bin.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-5a2deycw.mjs → src-D3qRQqRr.mjs} +98 -6
- package/dist/src-D3qRQqRr.mjs.map +1 -0
- package/package.json +2 -2
- package/templates/module-js/README.md +10 -10
- package/templates/module-js/package.json +1 -1
- package/templates/module-ts/README.md +12 -13
- package/templates/module-ts/package.json +1 -1
- package/templates/system-js/README.md +12 -12
- package/templates/system-js/package.json +1 -1
- package/templates/system-ts/README.md +11 -12
- package/templates/system-ts/package.json +1 -1
- package/dist/src-5a2deycw.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vttforge/cli",
|
|
3
|
-
"version": "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.
|
|
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
|
-
|
|
23
|
-
CSS
|
|
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
|
-
##
|
|
41
|
+
## Before you edit
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
and `NOTE_TYPE` in `constants.
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
|
@@ -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
|
-
|
|
23
|
-
CSS
|
|
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
|
|
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
|
-
##
|
|
41
|
+
## Before you edit
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
53
|
-
|
|
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
|
|
|
@@ -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
|
-
|
|
23
|
-
CSS
|
|
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
|
|
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
|
-
##
|
|
40
|
+
## Before you edit
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
`declare
|
|
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
|
|
@@ -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
|
-
|
|
23
|
-
CSS
|
|
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
|
|
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
|
-
##
|
|
40
|
+
## Before you edit
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
49
|
-
|
|
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
|
|