Skip to content

Centralize file conventions across discovery, watch, and bundling - #305

Merged
bcomnes merged 1 commit into
masterfrom
bret/file-conventions
Sep 8, 2026
Merged

bcomnes merged 1 commit into
masterfrom
bret/file-conventions

Conversation

@bcomnes

@bcomnes bcomnes commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #296. Stacked on #303.

  • Centralize filenames, suffixes, runtime-dependent TypeScript support, draft names, and bundle/rebuild categories in a small internal convention registry.
  • Reuse the definitions in discovery, watcher filtering/classification, esbuild entry selection, and static-copy exclusions.
  • Preserve the existing discovery exports and filename precedence.
  • Fix the mismatch where JSX/TSX clients were supported by discovery and esbuild but excluded from watch add/remove events.

Validation

  • Full Node suite, TypeScript, ESLint, installed dependency checks, and Playwright passed after rebasing onto the merged layout/subscription work.
  • Filesystem-watch tests used Chokidar polling because native watchers are exhausted on this host.
  • All three convention tests and the 26-test watch suite pass, including JSX client add/remove, global-data-only imports, and failed-build recovery.

Merge order

Merge #303 before this PR. The watch-planner PR is based on this branch so its review diff only contains the planner extraction.

@coveralls

coveralls commented Sep 6, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34180412253

Coverage increased (+0.2%) to 96.205%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: 138 of 138 lines across 5 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 8036
Covered Lines: 7872
Line Coverage: 97.96%
Relevant Branches: 1951
Covered Branches: 1736
Branch Coverage: 88.98%
Branches in Coverage %: Yes
Coverage Strength: 308.72 hits per line

💛 - Coveralls

@bcomnes
bcomnes force-pushed the bret/file-conventions branch from dada6b0 to 837619a Compare September 6, 2026 04:26
@bcomnes
bcomnes marked this pull request as ready for review September 6, 2026 04:55
@bcomnes
bcomnes force-pushed the bret/file-conventions branch from 837619a to c529c0b Compare September 7, 2026 17:34
@bcomnes
bcomnes force-pushed the bret/file-conventions branch from c529c0b to 8e13828 Compare September 7, 2026 20:53
@bcomnes
bcomnes force-pushed the bret/file-conventions branch from 8e13828 to a0300e1 Compare September 8, 2026 02:28
Base automatically changed from bret/watch-lifecycle to master September 8, 2026 02:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes consistently centralize and reuse convention logic across subsystems and are supported by targeted new tests covering the previously broken JSX client watch add/remove path.

Pull request overview

This pull request centralizes DOMStack’s source-file conventions (supported names/suffixes, draft variants, and change/bundle roles) into a single internal registry and then reuses that registry across page discovery, watcher filtering/classification, esbuild entry selection, and static copy exclusions, addressing the prior watch add/remove gap for JSX/TSX clients.

Changes:

  • Introduces lib/file-conventions.js as the canonical convention registry plus helpers (classifyFile, isProcessedFile, and bundle-asset collectors).
  • Updates discovery, watch handling, esbuild entry selection, and static-copy exclusions to reuse the shared convention definitions.
  • Adds focused tests for the convention registry and for JSX client add/remove watch behavior.
File summaries
File Description
test-cases/watch/index.test.js Adds a watch regression test ensuring JSX client add/remove updates the page bundle.
lib/identify-pages.js Replaces in-file convention lists with imports from the centralized convention registry while preserving exported constants.
lib/file-conventions.test.js Adds table-driven tests for convention classification, runtime TS support, and static-copy exclusions.
lib/file-conventions.js Adds the centralized convention registry and helper utilities for classification and bundle asset enumeration.
lib/build-static/index.js Uses shared processed-extension list to build the static-copy exclusion glob.
lib/build-esbuild/index.js Collects browser entry points via shared bundle-asset helpers to avoid duplicated selection logic.
index.js Uses shared processed-extension filtering for watch ignores and shared classification for esbuild entry detection on add/unlink.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bcomnes
bcomnes merged commit ba3c6d5 into master Sep 8, 2026
11 checks passed
@bcomnes
bcomnes deleted the bret/file-conventions branch September 8, 2026 04:57
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.

Centralize DOMStack file conventions

3 participants