Skip to content

feat: update and rename type exports#313

Merged
gmaclennan merged 1 commit intomainfrom
feat/type-exports
Oct 21, 2025
Merged

feat: update and rename type exports#313
gmaclennan merged 1 commit intomainfrom
feat/type-exports

Conversation

@gmaclennan
Copy link
Copy Markdown
Member

@gmaclennan gmaclennan commented Oct 21, 2025

  • Rename Mapeo type exports to Comapeo naming.
  • Deprecate Mapeo type exports
  • Update ComapeoDoc and ComapeoValue type exports to accept a parameter specifying the doc type (schema name).
  • Remove unused types
  • Export ComapeoDocType convencience - union of all doc types / schema names
  • Avoid repeated type definitions in both src/types.ts and generated dist/schema/index.ts

This should not include any breaking changes, only deprecating some type exports, and adding new ones with Comapeo naming, and additional functionality of accepting a parameter to narrow the doc type.

Note on naming: I have chosen Comapeo rather than CoMapeo (lowercase m) because the capitalized M in CoMapeo is a branding decision and does not demarcate a word boundary, so, following Pascal Case and Camel Case conventions, as we do with other type names and variable names, I think it makes sense to keep the m lowercase.

@gmaclennan gmaclennan self-assigned this Oct 21, 2025
Copy link
Copy Markdown
Contributor

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Are these changes in service to the new categories change?

Agree re Comapeo vs CoMapeo.

@gmaclennan
Copy link
Copy Markdown
Member Author

Are these changes in service to the new categories change?

No, it's just that this has been bothering me for a while, and in particular when I was looking at your PR for comapeo-cloud, I wanted to use ComapeoDoc<'observation'> instead of Extract<ComapeoDoc, { schemaName: 'observation' }> which is unnecessarily complicated.

@gmaclennan gmaclennan merged commit 0a24958 into main Oct 21, 2025
10 checks passed
@gmaclennan gmaclennan deleted the feat/type-exports branch October 21, 2025 14:26
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.

2 participants