Commit Graph

2 Commits

Author SHA1 Message Date
Nathan Nguyen 9bab92f012 test(deploy): cover generated worker package exports (#1807)
Generated worker entries can import vinext subpaths that must resolve from the published package. Missing package exports break consumers even when the generated template itself looks correct.

Add deploy coverage that extracts vinext subpath imports from generated App and Pages worker entries and verifies each one is covered by packages/vinext/package.json exports.

Tighten the prefer-shared-utils lint rule so copied shared helpers in repo tests are reported too. Test files mask template literal fixture payloads, while source files still scan generated-source templates.
2026-06-07 21:58:41 +01:00
Nathan Nguyen b324cbe04c refactor(utils): dedupe shared helpers and lint redefinitions (#1793)
* refactor(utils): dedupe shared helpers and lint redefinitions

Shared helper logic was being reimplemented across generated entries, runtime modules, and shims. That made small utility semantics easy to drift and gave agents no mechanical feedback when they hand-rolled copies.

Add a local Oxlint rule that discovers exported shared helpers and reports local redefinitions, including helpers embedded in generated source strings. Centralize the existing low-risk duplicates through shared utility modules.

* fix(lint): harden shared utility rule validation

* test(lint): avoid matching oxlint success summary

* fix(lint): make shared utility rule cwd independent

* fix(lint): address bonk review comments

- Drop redundant "default" export conditions in package.json; the
  generated worker template resolves these subpaths via "import" like
  its siblings (request-pipeline, pages-i18n, config-matchers).
- Mask backtick template literals in prefer-shared-utils so an
  apostrophe or comment sequence inside generated template source can
  no longer open string/comment masking and swallow a subsequent
  helper definition (false negative). Template bodies stay scannable.

---------

Co-authored-by: James <james@eli.cx>
2026-06-06 22:56:55 +01:00