You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs: Fix: Broken import.meta Docs Link (404 → correct path) & enhance entrypoint guide with examples and Node.js comparison (#25466) - #25468
This PR fixes issue #25466 in /guides/util/entrypoint.
Corrected the broken documentation link: updated "See Docs > API > import.meta" to the correct path (/runtime/module-resolution#import-meta) to prevent 404 errors.
Expanded the documentation with detailed examples for CLI tools, in-file tests, and module usage.
Added Node.js comparison for users migrating to Bun.
Improved readability with headings and proper code formatting.
Expanded the entrypoint guide documentation with narrative explanation of import.meta.main behavior, practical examples for CLI tools, testing patterns, and module usage, alongside a Node.js comparison section. Restructured initial code example by removing the else branch.
Added narrative explanation of import.meta.main behavior (true when run directly, false when imported). Introduced "Why would you use this?" section with three practical examples: CLI tools that are also libraries, running tests in the same file, and adding example usage to modules. Added "Coming from Node.js?" comparison section contrasting CommonJS/ESM with Bun's import.meta.main pattern. Updated reference link to Module Resolution section. Removed else branch from initial code example.
Suggested reviewers
Jarred-Sumner
lydiahallie
Pre-merge checks
✅ Passed checks (4 passed)
Check name
Status
Explanation
Description check
✅ Passed
The description covers the key improvements (broken link fix, expanded examples, Node.js comparison, improved readability) and references the fixed issue, though it lacks explicit 'How did you verify your code works?' section from the template.
Linked Issues check
✅ Passed
The PR successfully addresses all objectives from issue #25466: fixes broken documentation link, expands examples for CLI tools/tests/modules, adds Node.js comparison, and improves formatting/readability in the entrypoint guide.
Out of Scope Changes check
✅ Passed
All changes are scoped to the entrypoint guide documentation file as specified in issue #25466; no unrelated modifications to other files or functionality are present.
Title check
✅ Passed
The title directly addresses the main changes: fixing a broken documentation link and enhancing the entrypoint guide with examples and Node.js comparison.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
gk-anonymous
changed the title
docs: enhance entrypoint guide with examples and Node.js comparison (#25466)
docs: Fix: Broken import.meta Docs Link (404 → correct path) & enhance entrypoint guide with examples and Node.js comparison (#25466)
Dec 11, 2025
Hi! This PR is ready for review.
I’ve fixed the broken import.meta documentation link and expanded the entrypoint guide with examples.
Please let me know if any changes are needed. Thanks!
Thanks for the PR. On main, docs/guides/util/entrypoint.mdx links to /runtime/module-resolution#import-meta in both places, and that section exists in docs/runtime/module-resolution.mdx, so the link works. The closing line of the page was also reworded in 16a7269 (#33112), which is the line this PR touches.
The pages under docs/guides are kept short and focused on a single task, so the additional sections here (CLI and library pattern, in-file tests, Node.js comparison) were not picked up. If you would still like to see that material in the docs, please open an issue proposing it (the import.meta section of the module resolution page is probably the better home) so it can be discussed before writing it up. Closing this one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes issue #25466 in /guides/util/entrypoint.
Fixes #25466