Skip to content

Add object template support - #5

Merged
coat merged 4 commits into
mainfrom
object-templates
Apr 8, 2026
Merged

coat merged 4 commits into
mainfrom
object-templates

Conversation

@coat

@coat coat commented Apr 8, 2026

Copy link
Copy Markdown
Owner

First pass at adding object template support.

Closes #3

coat added 4 commits April 5, 2026 11:10
Move Object into its own module (src/object.zig) and add support for
.tj template files. When an object references a template, field values
and properties from the template are applied as defaults; instance values
always take precedence. Instance properties with the same key as a
template property correctly free the template allocation before replacing
it.
- Property.property_type defaults to null to avoid requiring callers to
  set it explicitly
- Expose standardOptimizeOption in the build so the module respects
  release modes
- Remove empty propertytype strings from test fixture
- Bump version to 0.2.4
Test that template field values are applied when absent from the instance
(height, rotation), that instance values take precedence (width, name,
visible), and that properties from both sources are merged with instance
winning on key conflicts. Adds dedicated fixture files to cover the
property-override case not exercised by the existing map.tmj.
@coat coat self-assigned this Apr 8, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coat
coat merged commit c965161 into main Apr 8, 2026
4 checks passed
@coat
coat deleted the object-templates branch April 10, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add templated object support

2 participants