@vttforge/cli 0.15.0 → 0.15.2

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,19 @@
1
1
  # @vttforge/cli
2
2
 
3
+ ## 0.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 12aae87: The scaffold templates pin `@vttforge/core` at the version this release publishes.
8
+ - 1b42a83: The scaffold templates pin `@vttforge/core` and `@vttforge/styles` at the versions this release publishes.
9
+ - 12aae87: The scaffold templates pin `@vttforge/core` at the version this release publishes.
10
+
11
+ ## 0.15.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 27812a5: Audit rule 004 accepts an `HTMLField` or `FilePathField` that `template.json` declares at the document level for a type it lists: while the file exists the server copies that block onto every listed type, so the path is declared. A system generated with a `template.json` no longer gets one finding per rich field.
16
+
3
17
  ## 0.15.0
4
18
 
5
19
  ### Minor Changes
package/dist/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { _ as definesName, a as runDev, g as bareUsePattern, h as LEGACY_GLOBALS, i as runInit, m as maskComments, n as runLintCommand, p as REMOVED_UTILS, r as ScaffoldError, s as runBuild, t as VTTFORGE_CLI_VERSION, u as runAuditCommand, x as runReleaseRules, y as _internal } from "./src-BK9BmFiZ.mjs";
2
+ import { _ as definesName, a as runDev, g as bareUsePattern, h as LEGACY_GLOBALS, i as runInit, m as maskComments, n as runLintCommand, p as REMOVED_UTILS, r as ScaffoldError, s as runBuild, t as VTTFORGE_CLI_VERSION, u as runAuditCommand, x as runReleaseRules, y as _internal } from "./src-3yl_b4Xd.mjs";
3
3
  import { existsSync } from "node:fs";
4
4
  import { dirname, join, relative, resolve } from "node:path";
5
5
  import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { S as runManifestRules, a as runDev, b as runSourceRules, c as emitZip, d as formatReport, f as runAudit, i as runInit, l as readManifest, n as runLintCommand, o as emitReleaseZip, r as ScaffoldError, s as runBuild, t as VTTFORGE_CLI_VERSION, u as runAuditCommand, v as SEVERITY_RANK } from "./src-BK9BmFiZ.mjs";
1
+ import { S as runManifestRules, a as runDev, b as runSourceRules, c as emitZip, d as formatReport, f as runAudit, i as runInit, l as readManifest, n as runLintCommand, o as emitReleaseZip, r as ScaffoldError, s as runBuild, t as VTTFORGE_CLI_VERSION, u as runAuditCommand, v as SEVERITY_RANK } from "./src-3yl_b4Xd.mjs";
2
2
  export { SEVERITY_RANK, ScaffoldError, VTTFORGE_CLI_VERSION, emitReleaseZip, emitZip, formatReport, readManifest, runAudit, runAuditCommand, runBuild, runDev, runInit, runLintCommand, runManifestRules, runSourceRules };
@@ -11,7 +11,7 @@ import { createServer } from "node:http";
11
11
  import { homedir } from "node:os";
12
12
  import { promisify } from "node:util";
13
13
  //#region package.json
14
- var version = "0.15.0";
14
+ var version = "0.15.2";
15
15
  //#endregion
16
16
  //#region src/audit/manifest-rules.ts
17
17
  /**
@@ -1193,6 +1193,39 @@ async function collectDeclaredRichFields(cwd) {
1193
1193
  }
1194
1194
  }
1195
1195
  }
1196
+ const templatePath = join(cwd, "template.json");
1197
+ if (existsSync(templatePath)) {
1198
+ let template;
1199
+ try {
1200
+ template = JSON.parse(await readFile(templatePath, "utf8"));
1201
+ } catch {
1202
+ template = null;
1203
+ }
1204
+ if (template && typeof template === "object" && !Array.isArray(template)) for (const [docName, doc] of Object.entries(template)) {
1205
+ if (!doc || typeof doc !== "object" || Array.isArray(doc)) continue;
1206
+ const { types, htmlFields, filePathFields } = doc;
1207
+ if (!Array.isArray(types)) continue;
1208
+ const html = Array.isArray(htmlFields) ? htmlFields.filter((e) => typeof e === "string").map(normalizeDeclaredPath) : [];
1209
+ const filePath = declaredFilePathKeys(filePathFields).map(normalizeDeclaredPath);
1210
+ for (const type of types) {
1211
+ if (typeof type !== "string") continue;
1212
+ const key = `${docName}.${type}`;
1213
+ const entry = perSubtype.get(key) ?? {
1214
+ html: /* @__PURE__ */ new Set(),
1215
+ filePath: /* @__PURE__ */ new Set()
1216
+ };
1217
+ for (const path of html) {
1218
+ entry.html.add(path);
1219
+ globalHtml.add(path);
1220
+ }
1221
+ for (const path of filePath) {
1222
+ entry.filePath.add(path);
1223
+ globalFilePath.add(path);
1224
+ }
1225
+ perSubtype.set(key, entry);
1226
+ }
1227
+ }
1228
+ }
1196
1229
  return {
1197
1230
  declared: {
1198
1231
  perSubtype,
@@ -3679,4 +3712,4 @@ const VTTFORGE_CLI_VERSION = version;
3679
3712
  //#endregion
3680
3713
  export { runManifestRules as S, definesName as _, runDev as a, runSourceRules as b, emitZip as c, formatReport as d, runAudit as f, bareUsePattern as g, LEGACY_GLOBALS as h, runInit as i, readManifest as l, maskComments as m, runLintCommand as n, emitReleaseZip as o, REMOVED_UTILS as p, ScaffoldError as r, runBuild as s, VTTFORGE_CLI_VERSION as t, runAuditCommand as u, SEVERITY_RANK as v, runReleaseRules as x, _internal as y };
3681
3714
 
3682
- //# sourceMappingURL=src-BK9BmFiZ.mjs.map
3715
+ //# sourceMappingURL=src-3yl_b4Xd.mjs.map