pixelkiln 0.118.0 → 0.120.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/CONTRIBUTING.md CHANGED
@@ -48,6 +48,12 @@ PixelKiln can use, add an entry at the top of that list. The newest entry
48
48
  shows its figures and code sample; earlier ones collapse to a short row. Show
49
49
  only output from a real call, with the bill the docs record.
50
50
 
51
+ The `/tiles` terrain brush paints with the tile lookups in
52
+ `website/app/lib/brush-tilesets.ts`, generated from the locks under
53
+ `website/art/` by `npx tsx scripts/gen-brush-tilesets.ts`. Run it after a lock
54
+ or a set's wording changes, and add a set by adding it to the list at the top of
55
+ that script; do not edit the generated file.
56
+
51
57
  Website sprites are generated from `website/art/pixelkiln.manifest.json`.
52
58
  Treat those requests as paid work: run `plan` and `audit` first, use an explicit
53
59
  hard budget, and commit the manifest, lockfile, and reviewed outputs together.
package/dist/cli.js CHANGED
@@ -29078,6 +29078,13 @@ function mountStyle(lock, styleId, manifestDir, mount, cells, sources = {}, outp
29078
29078
  }
29079
29079
 
29080
29080
  // src/pipeline/connected-sets.ts
29081
+ function unmatchedRoleWarning(label, outputs, terrainTiles) {
29082
+ const roles = new Set(terrainTiles.flatMap((tile) => isRecord2(tile) && typeof tile.role === "string" ? [tile.role] : []));
29083
+ const missing = outputs.flatMap((output) => output.role && !roles.has(output.role) ? [output.role] : []);
29084
+ if (!missing.length) return null;
29085
+ const shown2 = missing.slice(0, 3).join(", ") + (missing.length > 3 ? `, and ${missing.length - 3} more` : "");
29086
+ return `${label}: ${missing.length} tile(s) have a role that is not in the lock's terrainTiles (${shown2}), so their corners were taken by position and may be wrong; regenerate the set if it paints the wrong tiles`;
29087
+ }
29081
29088
  var key2 = (spec) => `${spec.styleId}/${spec.assetId}`;
29082
29089
  var SIDES = ["lower", "upper"];
29083
29090
  function connectedGroup(start, specs) {
@@ -29188,6 +29195,7 @@ function mergeConnectedTerrain(members, manifestDir) {
29188
29195
  names[index] = name;
29189
29196
  }
29190
29197
  const tiles = [];
29198
+ const warnings = [];
29191
29199
  const providerRules = {};
29192
29200
  for (const { spec, entry } of members) {
29193
29201
  const metadata = entry.providerMetadata?.[entry.provider];
@@ -29202,6 +29210,8 @@ function mergeConnectedTerrain(members, manifestDir) {
29202
29210
  if (spec.source && sourceIsStem(spec.source, entry, manifestDir)) {
29203
29211
  outputs = outputs.map((output) => ({ ...output, absolutePath: sourceOutputPath(spec.source, entry, output.index, manifestDir) }));
29204
29212
  }
29213
+ const warning = unmatchedRoleWarning(key2(spec), outputs, terrainTiles);
29214
+ if (warning) warnings.push(warning);
29205
29215
  for (const output of outputs) {
29206
29216
  const tile = (output.role ? terrainTiles.find((item) => isRecord2(item) && item.role === output.role) : void 0) ?? terrainTiles[output.index];
29207
29217
  if (!isRecord2(tile) || !isRecord2(tile.corners)) continue;
@@ -29219,7 +29229,7 @@ function mergeConnectedTerrain(members, manifestDir) {
29219
29229
  }
29220
29230
  }
29221
29231
  if (!tiles.length) throw new Error(`connected sets ${ids.join(", ")} have no tiles with corner data`);
29222
- return { assets: ids, terrains: names, tiles, tileType: members[0].spec.tileType, providerRules };
29232
+ return { assets: ids, terrains: names, tiles, tileType: members[0].spec.tileType, providerRules, warnings };
29223
29233
  }
29224
29234
  function tileCorners(rules, tile) {
29225
29235
  if (tile.corners) return tile.corners;
@@ -29762,13 +29772,16 @@ function exportTileset(entry, spec, options) {
29762
29772
  terrainRules && !normalizeTileRules(rawRules) ? terrainTileIndexes(metadata, outputs) : void 0,
29763
29773
  spec.tileType === "isometric" ? isometricFootprint(packed.png, frames) : null
29764
29774
  );
29775
+ const roleWarning = terrainRules && !normalizeTileRules(rawRules) && isRecord3(metadata) && Array.isArray(metadata.terrainTiles) ? unmatchedRoleWarning(`${spec.styleId}/${spec.assetId}`, outputs, metadata.terrainTiles) : null;
29776
+ const warnings = roleWarning ? [roleWarning] : [];
29765
29777
  if (options.format === "generic") {
29766
29778
  return {
29767
29779
  png: packed.png,
29768
29780
  extension: ".json",
29769
29781
  document: JSON.stringify(generic, null, 2) + "\n",
29770
29782
  generic,
29771
- sources: packed.sources
29783
+ sources: packed.sources,
29784
+ warnings
29772
29785
  };
29773
29786
  }
29774
29787
  assertUniformTiles(generic);
@@ -29792,7 +29805,7 @@ function exportTileset(entry, spec, options) {
29792
29805
  "godot export does not yet map edge/side adjacency onto an oblique tile's diagonal peering bits safely; use --format generic or --format tiled"
29793
29806
  );
29794
29807
  }
29795
- return renderTileset(generic, packed, spec.tileType, options);
29808
+ return { ...renderTileset(generic, packed, spec.tileType, options), warnings };
29796
29809
  }
29797
29810
  function terrainTileIndexes(metadata, outputs) {
29798
29811
  const tiles = isRecord3(metadata) && Array.isArray(metadata.terrainTiles) ? metadata.terrainTiles : [];
@@ -29866,11 +29879,12 @@ function exportMergedTilesets(members, options) {
29866
29879
  extension: ".json",
29867
29880
  document: JSON.stringify(generic, null, 2) + "\n",
29868
29881
  generic,
29869
- sources: packed.sources
29882
+ sources: packed.sources,
29883
+ warnings: merged.warnings
29870
29884
  };
29871
29885
  }
29872
29886
  assertUniformTiles(generic);
29873
- return renderTileset(generic, packed, merged.tileType, options);
29887
+ return { ...renderTileset(generic, packed, merged.tileType, options), warnings: merged.warnings };
29874
29888
  }
29875
29889
  function isometricFootprint(png, frames) {
29876
29890
  const image = decodePng(png);
@@ -30474,6 +30488,7 @@ async function runExport(args) {
30474
30488
  log(
30475
30489
  ` ${path53.relative(process.cwd(), base)}.png + ${path53.basename(base)}${result.extension} + .pixelkiln.json`
30476
30490
  );
30491
+ for (const warning of result.warnings) log(` warning: ${warning}`);
30477
30492
  }
30478
30493
  }
30479
30494
  function sheetFormat(args) {