Skip to content

refactor!: narrow public API and use consistent conversion entry-point names #66

Description

@jstet

src/index.ts exports internal helpers alongside the actual conversion API: TypeMapper, FieldSanitizer, XLSFormParser, XLSLoader, TSVGenerator, ConfigManager and XLSValidator. Every one of these is now public API under semver, so any refactor of them (see #60–#65) becomes a breaking change.

The conversion entry points are also named inconsistently:

  • xlsform → lstsv: new XLSFormToTSVConverter().convert() (a class)
  • xlsform → ddi: buildDdiXml()
  • lstsv → ddi: lstsvToDdiXml()
  • lstsv → xlsform: lstsvToXlsform()

Proposal

  • Offer a uniform set of functions: xlsformToLstsv, xlsformToDdi, lstsvToDdi, lstsvToXlsform, plus the existing data/CSV helpers. Keep XLSFormToTSVConverter as a thin wrapper marked deprecated.
  • Move the internals to a subpath export (@correlaid/formtransform/internals) with no stability promise, or stop exporting them. First check which of them formtransform-app and qwacback actually import.
  • Keep QUESTION_TYPES, APPEARANCES and TYPE_MAPPINGS in the main entry point; they are the intended public catalogue.

This is a breaking change, so it should ship in a minor bump with a deprecation period.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions