Skip to content

docs: Fix: Broken import.meta Docs Link (404 → correct path) & enhance entrypoint guide with examples and Node.js comparison (#25466) - #25468

Closed
gk-anonymous wants to merge 4 commits into
oven-sh:mainfrom
gk-anonymous:fix/docs-entrypoint-25466
Closed

gk-anonymous wants to merge 4 commits into
oven-sh:mainfrom
gk-anonymous:fix/docs-entrypoint-25466

Conversation

@gk-anonymous

Copy link
Copy Markdown

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.
  • Frontmatter is correctly formatted in YAML style.

Fixes #25466

@coderabbitai

coderabbitai Bot commented Dec 11, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

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.

Changes

Cohort / File(s) Change Summary
Documentation Guide Expansion
docs/guides/util/entrypoint.mdx
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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gk-anonymous 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
@gk-anonymous

Copy link
Copy Markdown
Author

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!

@robobun

robobun commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

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.

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.

Issue on docs

2 participants