rsek / datasworn

The successor to the original Datasworn repository and Dataforged package, which provide game rules from the Ironsworn and Ironsworn: Starforged TTRPGs in JSON.
https://ko-fi.com/r_sek
120 stars 26 forks source link

Revise ID format to `{type}:{package_id}/{path}` #27

Closed rsek closed 3 weeks ago

rsek commented 1 month ago

This should simplify composition and parsing of the IDs, and make it very clear what object type an ID belongs to (as the type ID fragment will always be 1:1 with the object's type value).

examples:

Aside from rewriting the utilities that interact with IDs, some migration utilities should be provided. The simplest (and most portable) way to do this might be a set of regular expressions. Alternatively, they might be written in Haxe to see how well its cross-compilation holds up.

rsek commented 1 month ago

TODO

rsek commented 3 weeks ago

current line of thinking: IDs will be restructured to {type}:${path}, where path is the package ID followed by one or more dictionary keys/indices separated by slashes. examples:

this groups all arbitrary path elements together, making globbing much simpler. for example, oracle_collection:** can now match all oracles (currently, the same match is */collections/oracles/**/*). it also makes globstars for non-recursive types more attractive, e.g. asset:**, so i'll probably implement those.

embedded types will be standardized to {parentType}.{embeddedType}:${parentPath}.${embeddedPath}. asset abilities may be folded in to this:

rsek commented 3 weeks ago

merged to v0.1.0