Skip to content

refactor: extract remaining internal exports#833

Merged
james-elicx merged 1 commit intomainfrom
james/remaining-internal-exports
Apr 13, 2026
Merged

refactor: extract remaining internal exports#833
james-elicx merged 1 commit intomainfrom
james/remaining-internal-exports

Conversation

@james-elicx
Copy link
Copy Markdown
Collaborator

No description provided.

@james-elicx
Copy link
Copy Markdown
Collaborator Author

/bigbonk review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 13, 2026

Open in StackBlitz

npm i https://pkg.pr.new/vinext@833

commit: 13af001

@github-actions
Copy link
Copy Markdown

Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

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

Clean extraction — the code is moved verbatim into well-scoped modules, imports are updated correctly, and no stale references remain.

Verified:

  • Faithful extraction: all three functions (stripServerExports, hasMdxFiles/mdxScanCache, scanPublicFileRoutes) are byte-for-byte identical to their former inline versions, with the expected import additions (parseAst/MagicString, fs/path).
  • No dangling references: no remaining _hasMdxFiles, _mdxScanCache, _scanPublicFileRoutes, or _stripServerExports anywhere in the codebase.
  • Cache isolation preserved: mdxScanCache is still module-level in utils/mdx-scan.ts, so the singleton behavior is maintained — index.ts and the tests import from the same module.
  • Public API unaffected: the removed re-exports were underscore-prefixed internal exports, not part of the package.json exports map. No external consumers are broken.
  • Test imports correct: all three test files now import directly from the new module paths and use the non-prefixed names.
  • File placement makes sense: strip-server-exports under plugins/ (it's a transform), mdx-scan and public-routes under utils/.

No issues found.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 13, 2026

Reviewed and approved PR #833. The refactoring is a clean extraction of three internal utilities from the monolithic index.ts into dedicated modules:

  • stripServerExports -> plugins/strip-server-exports.ts
  • hasMdxFiles + mdxScanCache -> utils/mdx-scan.ts
  • scanPublicFileRoutes -> utils/public-routes.ts

The code is moved verbatim, all imports are updated correctly (both in index.ts and in the three test files), and the underscore-prefixed internal re-exports are properly removed since tests now import directly from the new modules. No behavioral changes, no public API impact.

github run

@james-elicx james-elicx marked this pull request as ready for review April 13, 2026 09:49
@james-elicx james-elicx merged commit e81a621 into main Apr 13, 2026
32 checks passed
@james-elicx james-elicx deleted the james/remaining-internal-exports branch April 13, 2026 09:49
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.

1 participant