Skip to content

Centralize DOMStack file conventions #296

Description

@bcomnes

Problem

DOMStack's file conventions are represented by filename and suffix lists in page discovery, then interpreted again by watch event classification, bundle entry collection, and static-copy exclusions.

Some constants are already shared.
The remaining duplication is in their meaning: whether a file is a page, layout asset, global asset, worker, settings module, or generated-page owner, and which build work it affects.
Adding a convention requires coordinating several separate branches.

Proposed direction

Introduce a small internal declarative registry for supported filenames and suffixes, their roles, and their static build/invalidation categories.
Extend the existing shared constants into reusable classification and selection helpers.

Keep runtime dependency decisions in the watch planner and dependency tracker.
The registry should describe file conventions without becoming a second dependency graph or a new public plugin API.

Acceptance criteria

  • Discovery and watch classification use the same convention definitions.
  • Bundle entry selection and copy exclusions reuse those definitions or clearly documented derived rules where applicable.
  • Table-driven tests cover supported extensions, Node-dependent TypeScript support, draft names, precedence, and classification.
  • Existing supported filenames, warnings, output paths, and granular rebuild behavior are preserved.
  • Adding an ordinary supported extension or filename no longer requires duplicating classification rules across subsystems.

Sequencing

Implement against the result of #294.
Coordinate with the separate watch-planner extraction so the planner consumes the shared classification helpers.
This is a maintainability improvement after the watch correctness fixes, not a v12 release blocker.

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