@vttforge/cli 0.11.0 → 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 +6 -0
- package/README.md +4 -1
- package/dist/bin.mjs +45 -2
- package/dist/bin.mjs.map +1 -1
- package/dist/index.d.mts +44 -1
- package/dist/index.mjs +2 -2
- package/dist/{src-CgS7GUiL.mjs → src-CzzrhCN-.mjs} +108 -3
- package/dist/src-CzzrhCN-.mjs.map +1 -0
- package/lint/vttforge-biome.json +85 -0
- package/package.json +4 -2
- package/templates/module-js/README.md +3 -1
- package/templates/module-js/package.json +4 -2
- package/templates/module-ts/README.md +3 -1
- package/templates/module-ts/package.json +3 -1
- package/templates/module-ts/scripts/enricher.ts +3 -1
- package/templates/module-ts/tsconfig.json +2 -7
- package/templates/system-js/README.md +3 -1
- package/templates/system-js/package.json +4 -2
- package/templates/system-js/scripts/data/character-data.mjs +28 -4
- package/templates/system-js/scripts/sheets/character-sheet.mjs +3 -1
- package/templates/system-js/scripts/sheets/gear-sheet.mjs +5 -4
- package/templates/system-ts/README.md +3 -1
- package/templates/system-ts/package.json +3 -1
- package/templates/system-ts/scripts/data/character-data.ts +28 -4
- package/templates/system-ts/scripts/sheets/character-sheet.ts +13 -3
- package/templates/system-ts/scripts/sheets/gear-sheet.ts +5 -4
- package/dist/src-CgS7GUiL.mjs.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.11/schema.json",
|
|
3
|
+
"files": {
|
|
4
|
+
"ignoreUnknown": true,
|
|
5
|
+
"includes": ["**", "!**/dist", "!**/node_modules", "!**/packs", "!**/*.zip"]
|
|
6
|
+
},
|
|
7
|
+
"formatter": {
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"indentStyle": "space",
|
|
10
|
+
"indentWidth": 2,
|
|
11
|
+
"lineWidth": 100,
|
|
12
|
+
"lineEnding": "lf"
|
|
13
|
+
},
|
|
14
|
+
"javascript": {
|
|
15
|
+
"formatter": {
|
|
16
|
+
"quoteStyle": "single",
|
|
17
|
+
"jsxQuoteStyle": "double",
|
|
18
|
+
"semicolons": "always",
|
|
19
|
+
"trailingCommas": "all",
|
|
20
|
+
"arrowParentheses": "always",
|
|
21
|
+
"bracketSpacing": true
|
|
22
|
+
},
|
|
23
|
+
"globals": [
|
|
24
|
+
"game",
|
|
25
|
+
"canvas",
|
|
26
|
+
"ui",
|
|
27
|
+
"foundry",
|
|
28
|
+
"CONFIG",
|
|
29
|
+
"CONST",
|
|
30
|
+
"Hooks",
|
|
31
|
+
"Handlebars",
|
|
32
|
+
"PIXI",
|
|
33
|
+
"ProseMirror",
|
|
34
|
+
"Actor",
|
|
35
|
+
"Item",
|
|
36
|
+
"ChatMessage",
|
|
37
|
+
"Combat",
|
|
38
|
+
"Combatant",
|
|
39
|
+
"Scene",
|
|
40
|
+
"Token",
|
|
41
|
+
"TokenDocument",
|
|
42
|
+
"Roll",
|
|
43
|
+
"Folder",
|
|
44
|
+
"Macro",
|
|
45
|
+
"Playlist",
|
|
46
|
+
"RollTable",
|
|
47
|
+
"JournalEntry",
|
|
48
|
+
"User",
|
|
49
|
+
"ActiveEffect",
|
|
50
|
+
"Cards",
|
|
51
|
+
"Card",
|
|
52
|
+
"Dialog",
|
|
53
|
+
"DialogV2",
|
|
54
|
+
"FormApplication",
|
|
55
|
+
"Application",
|
|
56
|
+
"fromUuid",
|
|
57
|
+
"fromUuidSync",
|
|
58
|
+
"_del",
|
|
59
|
+
"_replace"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"json": {
|
|
63
|
+
"formatter": {
|
|
64
|
+
"trailingCommas": "none"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"linter": {
|
|
68
|
+
"enabled": true,
|
|
69
|
+
"rules": {
|
|
70
|
+
"preset": "recommended",
|
|
71
|
+
"style": {
|
|
72
|
+
"useImportType": "error",
|
|
73
|
+
"useNodejsImportProtocol": "error"
|
|
74
|
+
},
|
|
75
|
+
"suspicious": {
|
|
76
|
+
"noConsole": {
|
|
77
|
+
"level": "warn",
|
|
78
|
+
"options": {
|
|
79
|
+
"allow": ["error", "warn"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vttforge/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Scaffold, dev loop, release build and audit for Foundry VTT v14+ systems and modules.",
|
|
3
|
+
"version": "0.12.0",
|
|
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",
|
|
7
7
|
"homepage": "https://github.com/vttforge/vttforge#readme",
|
|
@@ -31,12 +31,14 @@
|
|
|
31
31
|
"types": "./dist/index.d.mts",
|
|
32
32
|
"files": [
|
|
33
33
|
"dist",
|
|
34
|
+
"lint",
|
|
34
35
|
"templates",
|
|
35
36
|
"README.md",
|
|
36
37
|
"CHANGELOG.md"
|
|
37
38
|
],
|
|
38
39
|
"sideEffects": false,
|
|
39
40
|
"dependencies": {
|
|
41
|
+
"@biomejs/biome": "^2.5.11",
|
|
40
42
|
"@clack/prompts": "^1.7.0",
|
|
41
43
|
"archiver": "^8.0.0",
|
|
42
44
|
"citty": "^0.2.2"
|
|
@@ -60,7 +60,9 @@ api.noteType; // "{{ID}}.note"
|
|
|
60
60
|
## Checks
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
|
|
63
|
+
pnpm lint # Biome (shipped with the CLI) over the project, then the v14 audit
|
|
64
|
+
pnpm format # the same, writing the safe fixes and formatting
|
|
65
|
+
npx vttforge audit # the audit alone: manifest + source against the v14 list of quiet breakages
|
|
64
66
|
```
|
|
65
67
|
|
|
66
68
|
## Releasing
|
|
@@ -8,13 +8,15 @@
|
|
|
8
8
|
"author": "{{AUTHOR}}",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "vttforge build",
|
|
11
|
-
"dev": "vttforge dev"
|
|
11
|
+
"dev": "vttforge dev",
|
|
12
|
+
"lint": "vttforge lint",
|
|
13
|
+
"format": "vttforge lint --fix"
|
|
12
14
|
},
|
|
13
15
|
"dependencies": {
|
|
14
16
|
"@vttforge/core": "^0.15.0"
|
|
15
17
|
},
|
|
16
18
|
"devDependencies": {
|
|
17
|
-
"@vttforge/cli": "^0.
|
|
19
|
+
"@vttforge/cli": "^0.12.0",
|
|
18
20
|
"@vttforge/vite-plugin": "^0.5.0",
|
|
19
21
|
"vite": "^8.2.2"
|
|
20
22
|
},
|
|
@@ -65,7 +65,9 @@ api.noteType; // "{{ID}}.note"
|
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
67
|
pnpm typecheck # tsc against the real @vttforge/core types
|
|
68
|
-
|
|
68
|
+
pnpm lint # Biome (shipped with the CLI) over the project, then the v14 audit
|
|
69
|
+
pnpm format # the same, writing the safe fixes and formatting
|
|
70
|
+
npx vttforge audit # the audit alone: manifest + source against the v14 list of quiet breakages
|
|
69
71
|
```
|
|
70
72
|
|
|
71
73
|
## Releasing
|
|
@@ -9,13 +9,15 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "vttforge build",
|
|
11
11
|
"dev": "vttforge dev",
|
|
12
|
+
"lint": "vttforge lint",
|
|
13
|
+
"format": "vttforge lint --fix",
|
|
12
14
|
"typecheck": "tsc --noEmit"
|
|
13
15
|
},
|
|
14
16
|
"dependencies": {
|
|
15
17
|
"@vttforge/core": "^0.15.0"
|
|
16
18
|
},
|
|
17
19
|
"devDependencies": {
|
|
18
|
-
"@vttforge/cli": "^0.
|
|
20
|
+
"@vttforge/cli": "^0.12.0",
|
|
19
21
|
"@vttforge/vite-plugin": "^0.5.0",
|
|
20
22
|
"typescript": "^5.4.0",
|
|
21
23
|
"vite": "^8.2.2"
|
|
@@ -35,7 +35,9 @@ export const noteEnricher: EnricherRegistration = {
|
|
|
35
35
|
link.className = '{{ID}}-note-link';
|
|
36
36
|
link.dataset.noteId = id;
|
|
37
37
|
link.draggable = false;
|
|
38
|
-
link.append(
|
|
38
|
+
link.append(
|
|
39
|
+
Object.assign(document.createElement('i'), { className: 'fa-solid fa-note-sticky' }),
|
|
40
|
+
);
|
|
39
41
|
link.append(note.name);
|
|
40
42
|
return link;
|
|
41
43
|
},
|
|
@@ -53,7 +53,9 @@ loses the sheet choice on every document already using it.
|
|
|
53
53
|
## Checks
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
|
|
56
|
+
pnpm lint # Biome (shipped with the CLI) over the project, then the v14 audit
|
|
57
|
+
pnpm format # the same, writing the safe fixes and formatting
|
|
58
|
+
npx vttforge audit # the audit alone: manifest + source against the v14 list of quiet breakages
|
|
57
59
|
```
|
|
58
60
|
|
|
59
61
|
## Releasing
|
|
@@ -8,14 +8,16 @@
|
|
|
8
8
|
"author": "{{AUTHOR}}",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "vttforge build",
|
|
11
|
-
"dev": "vttforge dev"
|
|
11
|
+
"dev": "vttforge dev",
|
|
12
|
+
"lint": "vttforge lint",
|
|
13
|
+
"format": "vttforge lint --fix"
|
|
12
14
|
},
|
|
13
15
|
"dependencies": {
|
|
14
16
|
"@vttforge/core": "^0.15.0",
|
|
15
17
|
"@vttforge/styles": "^0.4.0"
|
|
16
18
|
},
|
|
17
19
|
"devDependencies": {
|
|
18
|
-
"@vttforge/cli": "^0.
|
|
20
|
+
"@vttforge/cli": "^0.12.0",
|
|
19
21
|
"@vttforge/vite-plugin": "^0.5.0",
|
|
20
22
|
"vite": "^8.2.2"
|
|
21
23
|
},
|
|
@@ -60,12 +60,36 @@ const defineCharacterSchema = () => {
|
|
|
60
60
|
cha: score(),
|
|
61
61
|
}),
|
|
62
62
|
health: new f.SchemaField({
|
|
63
|
-
value: new f.NumberField({
|
|
64
|
-
|
|
63
|
+
value: new f.NumberField({
|
|
64
|
+
required: true,
|
|
65
|
+
nullable: false,
|
|
66
|
+
integer: true,
|
|
67
|
+
min: 0,
|
|
68
|
+
initial: 10,
|
|
69
|
+
}),
|
|
70
|
+
max: new f.NumberField({
|
|
71
|
+
required: true,
|
|
72
|
+
nullable: false,
|
|
73
|
+
integer: true,
|
|
74
|
+
min: 0,
|
|
75
|
+
initial: 10,
|
|
76
|
+
}),
|
|
65
77
|
}),
|
|
66
78
|
power: new f.SchemaField({
|
|
67
|
-
value: new f.NumberField({
|
|
68
|
-
|
|
79
|
+
value: new f.NumberField({
|
|
80
|
+
required: true,
|
|
81
|
+
nullable: false,
|
|
82
|
+
integer: true,
|
|
83
|
+
min: 0,
|
|
84
|
+
initial: 5,
|
|
85
|
+
}),
|
|
86
|
+
max: new f.NumberField({
|
|
87
|
+
required: true,
|
|
88
|
+
nullable: false,
|
|
89
|
+
integer: true,
|
|
90
|
+
min: 0,
|
|
91
|
+
initial: 5,
|
|
92
|
+
}),
|
|
69
93
|
}),
|
|
70
94
|
biography: new f.HTMLField(),
|
|
71
95
|
};
|
|
@@ -123,7 +123,9 @@ export class CharacterSheet extends BaseActorSheet() {
|
|
|
123
123
|
async onDropItem(item, _event) {
|
|
124
124
|
if (item?.type !== 'gear') {
|
|
125
125
|
ui.notifications?.warn(
|
|
126
|
-
game.i18n.format('{{LOCALE_PREFIX}}.Sheet.Drop.rejected', {
|
|
126
|
+
game.i18n.format('{{LOCALE_PREFIX}}.Sheet.Drop.rejected', {
|
|
127
|
+
type: item?.type ?? 'unknown',
|
|
128
|
+
}),
|
|
127
129
|
);
|
|
128
130
|
return false;
|
|
129
131
|
}
|
|
@@ -58,10 +58,11 @@ export class GearSheet extends BaseItemSheet() {
|
|
|
58
58
|
context.item = item;
|
|
59
59
|
context.system = item.system;
|
|
60
60
|
context.isEditable = this.isEditable;
|
|
61
|
-
context.enrichedDescription =
|
|
62
|
-
item.system.description,
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
context.enrichedDescription =
|
|
62
|
+
await foundry.applications.ux.TextEditor.implementation.enrichHTML(item.system.description, {
|
|
63
|
+
relativeTo: item,
|
|
64
|
+
secrets: item.isOwner,
|
|
65
|
+
});
|
|
65
66
|
return context;
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -53,7 +53,9 @@ for is yours to know. Each sheet here narrows it once in a getter (`actor`,
|
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
55
|
pnpm typecheck # tsc against the real @vttforge/core types
|
|
56
|
-
|
|
56
|
+
pnpm lint # Biome (shipped with the CLI) over the project, then the v14 audit
|
|
57
|
+
pnpm format # the same, writing the safe fixes and formatting
|
|
58
|
+
npx vttforge audit # the audit alone: manifest + source against the v14 list of quiet breakages
|
|
57
59
|
```
|
|
58
60
|
|
|
59
61
|
## Releasing
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "vttforge build",
|
|
11
11
|
"dev": "vttforge dev",
|
|
12
|
+
"lint": "vttforge lint",
|
|
13
|
+
"format": "vttforge lint --fix",
|
|
12
14
|
"typecheck": "tsc --noEmit"
|
|
13
15
|
},
|
|
14
16
|
"dependencies": {
|
|
@@ -16,7 +18,7 @@
|
|
|
16
18
|
"@vttforge/styles": "^0.4.0"
|
|
17
19
|
},
|
|
18
20
|
"devDependencies": {
|
|
19
|
-
"@vttforge/cli": "^0.
|
|
21
|
+
"@vttforge/cli": "^0.12.0",
|
|
20
22
|
"@vttforge/vite-plugin": "^0.5.0",
|
|
21
23
|
"typescript": "^5.4.0",
|
|
22
24
|
"vite": "^8.2.2"
|
|
@@ -62,12 +62,36 @@ const defineCharacterSchema = () => {
|
|
|
62
62
|
cha: score(),
|
|
63
63
|
}),
|
|
64
64
|
health: new f.SchemaField({
|
|
65
|
-
value: new f.NumberField({
|
|
66
|
-
|
|
65
|
+
value: new f.NumberField({
|
|
66
|
+
required: true,
|
|
67
|
+
nullable: false,
|
|
68
|
+
integer: true,
|
|
69
|
+
min: 0,
|
|
70
|
+
initial: 10,
|
|
71
|
+
}),
|
|
72
|
+
max: new f.NumberField({
|
|
73
|
+
required: true,
|
|
74
|
+
nullable: false,
|
|
75
|
+
integer: true,
|
|
76
|
+
min: 0,
|
|
77
|
+
initial: 10,
|
|
78
|
+
}),
|
|
67
79
|
}),
|
|
68
80
|
power: new f.SchemaField({
|
|
69
|
-
value: new f.NumberField({
|
|
70
|
-
|
|
81
|
+
value: new f.NumberField({
|
|
82
|
+
required: true,
|
|
83
|
+
nullable: false,
|
|
84
|
+
integer: true,
|
|
85
|
+
min: 0,
|
|
86
|
+
initial: 5,
|
|
87
|
+
}),
|
|
88
|
+
max: new f.NumberField({
|
|
89
|
+
required: true,
|
|
90
|
+
nullable: false,
|
|
91
|
+
integer: true,
|
|
92
|
+
min: 0,
|
|
93
|
+
initial: 5,
|
|
94
|
+
}),
|
|
71
95
|
}),
|
|
72
96
|
biography: new f.HTMLField(),
|
|
73
97
|
};
|
|
@@ -112,7 +112,9 @@ export class CharacterSheet extends BaseActorSheet() {
|
|
|
112
112
|
},
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
static override DRAG_DROP = [
|
|
115
|
+
static override DRAG_DROP = [
|
|
116
|
+
{ dragSelector: '.sh-item[draggable=true]', dropSelector: '.sh-body' },
|
|
117
|
+
];
|
|
116
118
|
|
|
117
119
|
/**
|
|
118
120
|
* The actor this sheet is for.
|
|
@@ -173,7 +175,11 @@ export class CharacterSheet extends BaseActorSheet() {
|
|
|
173
175
|
// ApplicationV2 declares action handlers static and calls them with `this`
|
|
174
176
|
// bound to the sheet instance. `this: CharacterSheet` says so to TypeScript.
|
|
175
177
|
|
|
176
|
-
static async _onRollAbility(
|
|
178
|
+
static async _onRollAbility(
|
|
179
|
+
this: CharacterSheet,
|
|
180
|
+
_event: Event,
|
|
181
|
+
target: HTMLElement,
|
|
182
|
+
): Promise<void> {
|
|
177
183
|
const key = target.dataset.ability;
|
|
178
184
|
if (!key) return;
|
|
179
185
|
const { actor } = this;
|
|
@@ -195,7 +201,11 @@ export class CharacterSheet extends BaseActorSheet() {
|
|
|
195
201
|
);
|
|
196
202
|
}
|
|
197
203
|
|
|
198
|
-
static async _onDeleteItem(
|
|
204
|
+
static async _onDeleteItem(
|
|
205
|
+
this: CharacterSheet,
|
|
206
|
+
_event: Event,
|
|
207
|
+
target: HTMLElement,
|
|
208
|
+
): Promise<void> {
|
|
199
209
|
const id = target.closest<HTMLElement>('[data-item-id]')?.dataset.itemId;
|
|
200
210
|
if (!id) return;
|
|
201
211
|
await this.actor.items.get(id)?.delete();
|
|
@@ -65,10 +65,11 @@ export class GearSheet extends BaseItemSheet() {
|
|
|
65
65
|
context.item = item;
|
|
66
66
|
context.system = item.system;
|
|
67
67
|
context.isEditable = this.isEditable;
|
|
68
|
-
context.enrichedDescription =
|
|
69
|
-
item.system.description,
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
context.enrichedDescription =
|
|
69
|
+
await foundry.applications.ux.TextEditor.implementation.enrichHTML(item.system.description, {
|
|
70
|
+
relativeTo: item,
|
|
71
|
+
secrets: item.isOwner,
|
|
72
|
+
});
|
|
72
73
|
return context;
|
|
73
74
|
}
|
|
74
75
|
}
|