asset details (WIP)

This commit is contained in:
2026-03-24 13:42:52 +00:00
parent a958052bbf
commit c0051e62cb
32 changed files with 35 additions and 135 deletions
@@ -73,7 +73,6 @@ final class PackerRuntimeAssetMaterializerTest {
"uuid",
"asset",
AssetFamilyCatalog.TILE_BANK,
Map.of(),
List.of(),
OutputFormatCatalog.TILES_INDEXED_V1,
OutputCodecCatalog.NONE,
@@ -271,8 +271,7 @@ final class FileSystemPackerWorkspaceServiceTest {
assertTrue(updateResult.success());
final var manifest = MAPPER.readTree(assetRoot.resolve("asset.json").toFile());
assertTrue(manifest.path("inputs").isObject());
assertTrue(manifest.path("inputs").isEmpty());
assertTrue(manifest.path("inputs").isMissingNode());
assertTrue(manifest.path("artifacts").isArray());
assertTrue(manifest.path("artifacts").isEmpty());
@@ -304,8 +303,7 @@ final class FileSystemPackerWorkspaceServiceTest {
assertEquals(1, loader.loadCount());
final var manifest = MAPPER.readTree(assetRoot.resolve("asset.json").toFile());
assertTrue(manifest.path("inputs").isObject());
assertTrue(manifest.path("inputs").isEmpty());
assertTrue(manifest.path("inputs").isMissingNode());
assertEquals("cancel.png", manifest.path("artifacts").get(0).path("file").asText());
assertEquals(0, manifest.path("artifacts").get(0).path("index").asInt());
assertEquals("confirm.png", manifest.path("artifacts").get(1).path("file").asText());
@@ -497,7 +495,6 @@ final class FileSystemPackerWorkspaceServiceTest {
"asset_uuid": "shared-uuid",
"name": "ui_atlas",
"type": "IMAGE/bank",
"inputs": {},
"output": {
"format": "TILES/indexed_v1",
"codec": "none"
@@ -513,7 +510,6 @@ final class FileSystemPackerWorkspaceServiceTest {
"asset_uuid": "shared-uuid",
"name": "ui_clone",
"type": "IMAGE/bank",
"inputs": {},
"output": {
"format": "TILES/indexed_v1",
"codec": "none"
@@ -62,7 +62,7 @@ final class PackerAssetDeclarationParserTest {
}
@Test
void rejectsUntrustedInputPaths() throws Exception {
void rejectsLegacyInputsField() throws Exception {
final Path manifest = tempDir.resolve("asset.json");
Files.writeString(manifest, """
{
@@ -79,7 +79,7 @@ final class PackerAssetDeclarationParserTest {
final var result = parser.parse(manifest);
assertFalse(result.valid());
assertTrue(result.diagnostics().stream().anyMatch(diagnostic -> diagnostic.message().contains("untrusted path")));
assertTrue(result.diagnostics().stream().anyMatch(diagnostic -> diagnostic.message().contains("no longer supported")));
}
@Test
@@ -91,7 +91,6 @@ final class PackerAssetDeclarationParserTest {
"asset_uuid": "uuid-video",
"name": "bad_asset",
"type": "video_bank",
"inputs": { "sprites": ["atlas.png"] },
"output": { "format": "TILES/indexed_v1", "codec": "NONE" },
"preload": { "enabled": true }
}
@@ -64,8 +64,8 @@ final class PackerAssetDetailsServiceTest {
final ObjectMapper mapper = new ObjectMapper();
final ObjectNode manifest = (ObjectNode) mapper.readTree(manifestPath.toFile());
final ObjectNode inputs = manifest.putObject("inputs");
inputs.putArray("sprites").add("confirm.png");
final var artifacts = manifest.putArray("artifacts");
artifacts.addObject().put("file", "confirm.png").put("index", 0);
mapper.writerWithDefaultPrettyPrinter().writeValue(manifestPath.toFile(), manifest);
final PackerAssetDetailsService service = service();
@@ -81,7 +81,7 @@ final class PackerAssetDetailsServiceTest {
}
@Test
void prefersArtifactsSelectionOrderOverLegacyInputs() throws Exception {
void prefersArtifactsSelectionOrder() throws Exception {
final Path projectRoot = copyFixture("workspaces/managed-basic", tempDir.resolve("managed-artifacts-order"));
final Path assetRoot = projectRoot.resolve("assets/ui/atlas");
final BufferedImage tile = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
@@ -91,8 +91,6 @@ final class PackerAssetDetailsServiceTest {
final ObjectMapper mapper = new ObjectMapper();
final ObjectNode manifest = (ObjectNode) mapper.readTree(manifestPath.toFile());
final ObjectNode inputs = manifest.putObject("inputs");
inputs.putArray("sprites").add("a.png");
final var artifacts = manifest.putArray("artifacts");
artifacts.addObject().put("file", "b.png").put("index", 0);
artifacts.addObject().put("file", "a.png").put("index", 1);
@@ -54,7 +54,6 @@ final class PackerRuntimeRegistryTest {
"asset_uuid": "runtime-refresh-uuid",
"name": "ui_sounds",
"type": "audio.bank",
"inputs": {},
"output": {
"format": "SOUND/bank_v1",
"codec": "none"
@@ -3,9 +3,6 @@
"asset_uuid": "future-uuid-1",
"name": "future_asset",
"type": "tile_bank",
"inputs": {
"sprites": ["future.png"]
},
"output": {
"format": "TILES/indexed_v1",
"codec": "NONE"
@@ -3,9 +3,6 @@
"asset_uuid": "fixture-uuid-1",
"name": "ui_atlas",
"type": "tile_bank",
"inputs": {
"sprites": ["sprites/confirm.png"]
},
"output": {
"format": "TILES/indexed_v1",
"codec": "NONE"
@@ -3,9 +3,6 @@
"asset_uuid": "orphan-uuid-1",
"name": "ui_sounds",
"type": "sound_bank",
"inputs": {
"sources": ["confirm.wav"]
},
"output": {
"format": "SOUND/bank_v1",
"codec": "NONE"
@@ -3,9 +3,6 @@
"asset_uuid": "orphan-uuid-2",
"name": "ui_sounds",
"type": "sound_bank",
"inputs": {
"sources": ["confirm.wav"]
},
"output": {
"format": "SOUND/bank_v1",
"codec": "NONE"
@@ -3,9 +3,6 @@
"asset_uuid": "uuid-1",
"name": "ui_atlas",
"type": "tile_bank",
"inputs": {
"sprites": ["sprites/confirm.png"]
},
"output": {
"format": "TILES/indexed_v1",
"codec": "NONE"