Centralize file conventions across discovery, watch, and bundling - #305
Conversation
Coverage Report for CI Build 34180412253Coverage increased (+0.2%) to 96.205%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
dada6b0 to
837619a
Compare
837619a to
c529c0b
Compare
c529c0b to
8e13828
Compare
8e13828 to
a0300e1
Compare
a0300e1 to
828e068
Compare
There was a problem hiding this comment.
🟢 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.jsas 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.
Summary
Closes #296. Stacked on #303.
Validation
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.