Skip to content

Make the stable task ID property remappable - #30

Merged
callumalpass merged 1 commit into
mainfrom
feat/remappable-id
Nov 17, 2026
Merged

callumalpass merged 1 commit into
mainfrom
feat/remappable-id

Conversation

@callumalpass

Copy link
Copy Markdown
Owner

Adds an id entry to FieldMapping (default id) so the stable task identity can live under another property, e.g. tasknote_id. Requested in callumalpass/tasknotes#2574.

  • mapTaskFromFrontmatter reads the ID from the mapped property instead of the literal id. Mappings saved without the key keep using id.
  • toUserField, lookupMappingKey and validateFieldMapping include it (duplicates with other mapped fields are rejected).
  • buildTaskNotesMdbaseResources uses the mapped name for implements[].fields.id, the schema property, the on_create UUID, the uniqueness rule and mdbase.yaml id_field.
  • resolveTaskNotesModelConfigFromMdbaseType reads a type's fields.id into the mapping. With a remapped ID, a plain id property resolves as a custom field.
  • Reminder object ids are untouched.
  • The default mapping produces the same type as before, so pack digests are unchanged.

Tests: test/id-mapping.test.mjs. npm run typecheck, npm test (149 pass) and npm run test:package pass locally.

Not bumped or published. The TaskNotes plugin PR needs this released (proposed 0.3.1).

FieldMapping gains an optional id entry (default "id"). Reads and the
generated mdbase type use the mapped property, and a type's
implements[].fields.id is read back into the mapping.

Refs callumalpass/tasknotes#2574
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.

1 participant