Skip to content

Split the manifest implementation into focused modules #298

Description

@bcomnes

Problem

lib/domstack-manifest/index.js contains 1,044 lines covering schema declarations and derived types, option normalization, output records, reconciliation, content hashing, metadata inference, hooks, and file I/O.

These operations belong to the same feature but have distinct responsibilities.
Keeping them in one module makes changes harder to review and obscures which code owns a particular part of the manifest contract.

Proposed direction

Extract focused internal modules for:

  • Schema definitions and derived public types.
  • Settings normalization and hook configuration.
  • Record normalization and metadata inference.
  • Reconciliation and version hashing.
  • Hook execution and file writing.

Keep index.js as the public facade.
Choose the final boundaries around dependency direction so the extraction does not create circular imports.
Continue using the schema as the source of truth for its derived types.

Acceptance criteria

  • Existing public exports and supported import paths remain compatible.
  • Generated schema content remains unchanged.
  • For equivalent inputs, manifest entries, ordering, revisions, integrity values, version hashes, warnings, and hook behavior remain equivalent.
  • Existing manifest/build tests pass, with focused regression coverage for any boundary that proves difficult to preserve.
  • Published type compatibility is checked in coordination with the strict consumer validation tracked in Published v12 declarations fail strict consumer type-checking #291.
  • No generated declaration artifacts are left in the working tree after any necessary type-build checks.

Sequencing

This can follow #294 independently of the watch refactor.
Keep it a behavior-preserving extraction and track any discovered semantic changes separately.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions