@heroiclands/package-build 22.15.0 → 22.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 +8 -0
- package/engine/itinerary-scenes.mjs +4 -2
- package/engine/map-raster.mjs +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
|
+
import { resolvePackageBuildConfig } from "../config.mjs";
|
|
9
10
|
|
|
10
11
|
import { buildMaps, relatedPlaces } from "./map-build.mjs";
|
|
11
12
|
import { renderDot } from "./map-graphviz.mjs";
|
|
@@ -74,6 +75,7 @@ export function buildItineraryScenes({
|
|
|
74
75
|
stats,
|
|
75
76
|
foreign = loadForeignIndexes(config, [config.contentPackage]),
|
|
76
77
|
}) {
|
|
78
|
+
const buildConfig = resolvePackageBuildConfig(config);
|
|
77
79
|
const world = mapWorld({ records, foreignIndex: foreign.index, contentBase, config });
|
|
78
80
|
const centres = relatedPlaces(world.places).filter((sc) => world.places.get(sc)?.local);
|
|
79
81
|
const findings = foreign.stale.map((stale) => ({
|
|
@@ -83,7 +85,7 @@ export function buildItineraryScenes({
|
|
|
83
85
|
}));
|
|
84
86
|
const assetDir = path.resolve(
|
|
85
87
|
config.rootDir,
|
|
86
|
-
|
|
88
|
+
buildConfig.stageDir,
|
|
87
89
|
"assets/maps/generated-itineraries",
|
|
88
90
|
);
|
|
89
91
|
fs.rmSync(assetDir, { recursive: true, force: true });
|
|
@@ -112,7 +114,7 @@ export function buildItineraryScenes({
|
|
|
112
114
|
const [width, height] = pngDimensions(png);
|
|
113
115
|
const positions = pinPositions(fs.readFileSync(plain, "utf8"), width, height);
|
|
114
116
|
const sceneId = makeId("itinerary-scene", `${config.contentPackage}:${centre}`);
|
|
115
|
-
const src = `${
|
|
117
|
+
const src = `${buildConfig.packageKind}/${buildConfig.packageId}/assets/maps/generated-itineraries/from-${centre}.png`;
|
|
116
118
|
const scene = buildScene(
|
|
117
119
|
{
|
|
118
120
|
id: sceneId,
|
package/engine/map-raster.mjs
CHANGED
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { Resvg } from "@resvg/resvg-js";
|
|
8
|
+
import { resolvePackageBuildConfig } from "../config.mjs";
|
|
8
9
|
|
|
9
10
|
/** Rasterize an authored SVG map into the staged Foundry package. */
|
|
10
11
|
export function rasterizeMapSvg({ foundryPath, width, height, sceneId, config }) {
|
|
11
12
|
if (!config) throw new Error("SVG map rasterization requires the package build configuration");
|
|
13
|
+
const buildConfig = resolvePackageBuildConfig(config);
|
|
12
14
|
if (![width, height].every((value) => Number.isInteger(value) && value > 0)) {
|
|
13
15
|
throw new Error("an SVG map needs `sohl.dimensions: [width, height]` in whole pixels");
|
|
14
16
|
}
|
|
@@ -25,7 +27,7 @@ export function rasterizeMapSvg({ foundryPath, width, height, sceneId, config })
|
|
|
25
27
|
}
|
|
26
28
|
const staged = path.resolve(
|
|
27
29
|
config.rootDir,
|
|
28
|
-
|
|
30
|
+
buildConfig.stageDir,
|
|
29
31
|
"assets/maps/rasterized",
|
|
30
32
|
`${sceneId}.png`,
|
|
31
33
|
);
|
|
@@ -45,5 +47,5 @@ export function rasterizeMapSvg({ foundryPath, width, height, sceneId, config })
|
|
|
45
47
|
cause: error,
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
|
-
return `${
|
|
50
|
+
return `${buildConfig.packageKind}/${buildConfig.packageId}/assets/maps/rasterized/${sceneId}.png`;
|
|
49
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heroiclands/package-build",
|
|
3
|
-
"version": "22.15.
|
|
3
|
+
"version": "22.15.1",
|
|
4
4
|
"description": "Shared toolchain for building and shipping a HeroicLands Foundry VTT package — content compilation, manifest, localization, staging, bundle, release and deployment.",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|