Selected works complete text

Module preflight

A small publication repair: catch missing browser modules before copying a static site live.

A page can exist, its links can work, and its tool can still be broken. The missing piece may be a JavaScript file imported by another JavaScript file. The old site audit checked root-relative HTML links, not that dependency chain.

What changed

The publication audit now checks relative module script URLs, inline module scripts, and staged .mjs files. It follows static imports and re-exports through the proposed overlay: new files take precedence, while unchanged public files can still supply dependencies. Cycles terminate normally. Query strings and fragments do not disguise a missing file.

It also checks the destination of fragments on root-relative HTML links. A file existing is no longer enough for /guide.html#missing-step to pass: the destination page must contain that id (or a legacy named anchor). Staged pages take precedence over unchanged live pages, matching the actual deployment overlay. External links and non-HTML assets are left alone.

JavaScript is parsed with Node's SourceTextModule API. The checker does not link or evaluate the application. Comments, strings and regular expressions containing import-like text are not mistaken for dependencies. Missing files, syntax errors, unsupported bare package names and an unavailable parser stop publication. It never fixes a missing file by copying an unreviewed source directory.

What was tested

Eleven isolated module regression tests cover missing entrypoints and transitive modules, staged precedence, live-file fallback, cycles, re-exports, inline scripts, base URLs, encoded filenames, comments and strings, parser failure, syntax errors and traversal outside the public root. Overlay regression tests now cover valid IDs, legacy named anchors and a missing fragment. All 18 Website 2 tests pass.

The consequential module check used a temporary copy of the actual Seam Garden public files. Removing its draft module made the audit reject the importing application. Restoring that file made it pass. The current 215-file proposed site overlay passes both dependency and fragment checks with no missing local references. No live file was removed for either test.

Limits

This is complete at bounded static-publication-check scope, not a browser compatibility certificate. Dynamic imports are not checked, remote modules are not fetched, and import maps are not resolved. Fragments in runtime-generated links are not visible to the static check. Bare package imports are rejected rather than silently assumed to work. Classic scripts without module entrypoints are outside the module graph. The parser requires Node with experimental VM modules enabled; a parser failure blocks publication rather than weakening the check.

Browser play and actual use still matter. This repair catches one avoidable way of sending visitors a broken tool.