docs(core): document loaderFS option#5950
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (4)
📝 WalkthroughWalkthroughThis PR adds documentation for a new ChangesLoaderFS Documentation Sync
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Deploying egg with
|
| Latest commit: |
c8c8345
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://164e547b.egg-cci.pages.dev |
| Branch Preview URL: | https://agent-egg-doc-4ce1c080.egg-cci.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR syncs documentation across the core package README, the English/Chinese loader docs, and the internal wiki so that the public loaderFS LoaderOptions entry is discoverable and described consistently.
Changes:
- Documented
loaderFSin@eggjs/coreLoaderOptionstable. - Added
loaderFSnotes to the loader docs in both English and Chinese. - Updated the core wiki page metadata and appended a wiki log entry for the docs sync.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
wiki/packages/core.md |
Adds additional doc/README sources and updates the page timestamp to reflect the docs sync. |
wiki/log.md |
Adds a new wiki log entry recording the LoaderFS/loaderFS docs synchronization. |
site/docs/advanced/loader.md |
Documents loaderFS in the LoaderOptions section for English site docs. |
site/docs/zh-CN/advanced/loader.md |
Documents loaderFS in the LoaderOptions section for Chinese site docs. |
packages/core/README.md |
Fixes/standardizes the LoaderOptions table formatting and adds the loaderFS row. |
|
|
||
| ## [2026-05-13] docs | sync LoaderFS loader option docs | ||
|
|
||
| - sources touched: `packages/core/src/loader/loader_fs.ts`, `packages/core/src/loader/file_loader.ts`, `packages/core/src/loader/egg_loader.ts` |
There was a problem hiding this comment.
Code Review
This pull request documents the loaderFS option within LoaderOptions across the core README, site documentation (English and Chinese), and the project wiki. The changes also include formatting refinements to the existing documentation. Review feedback suggests including 'JSON reads' in the loaderFS description for technical accuracy and correcting several grammatical inconsistencies in the README's parameter table.
| Customize the filesystem boundary used by `loadToApp` and `loadToContext` for file discovery, file stats, and module loading. | ||
| By default, Egg uses `RealLoaderFS`, which delegates to the local filesystem and keeps the existing runtime behavior. |
There was a problem hiding this comment.
The description of loaderFS should include "JSON reads" for completeness, as the LoaderFS interface provides readJSON. Additionally, using backticks for function and class names improves readability and consistency with other parts of the documentation.
| Customize the filesystem boundary used by `loadToApp` and `loadToContext` for file discovery, file stats, and module loading. | |
| By default, Egg uses `RealLoaderFS`, which delegates to the local filesystem and keeps the existing runtime behavior. | |
| Customize the filesystem boundary used by `loadToApp` and `loadToContext` for file discovery, file stats, JSON reads, and module loading. | |
| By default, Egg uses `RealLoaderFS`, which delegates to the local filesystem and keeps the existing runtime behavior. |
| 自定义 `loadToApp` 和 `loadToContext` 使用的文件系统边界,用于文件发现、文件状态读取和模块加载。 | ||
| 默认使用 `RealLoaderFS`,它会委托给本地文件系统,以保持现有运行时行为。 |
There was a problem hiding this comment.
建议在 loaderFS 的描述中增加 "JSON 读取",以保持与英文文档和 LoaderFS 接口定义的一致性。同时,为函数和类名添加反引号以提高可读性。
| 自定义 `loadToApp` 和 `loadToContext` 使用的文件系统边界,用于文件发现、文件状态读取和模块加载。 | |
| 默认使用 `RealLoaderFS`,它会委托给本地文件系统,以保持现有运行时行为。 | |
| 自定义 `loadToApp` 和 `loadToContext` 使用的文件系统边界,用于文件发现、文件状态读取、JSON 读取和模块加载。 | |
| 默认使用 `RealLoaderFS`,它会委托给本地文件系统,以保持现有运行时行为。 |
| | target | `Object` | attach the target object from loaded files | | ||
| | match | `String/Array` | match the files when load, default to `**/*.js` (if `process.env.EGG_TYPESCRIPT` is true, default to `[ '**/*.(js\|ts)', '!**/*.d.ts' ]`) | | ||
| | ignore | `String/Array` | ignore the files when load | | ||
| | initializer | `Function` | custom file exports, receive two parameters, first is the inject object (if not js file, will be content buffer), second is an `options` object that contain `path` | |
There was a problem hiding this comment.
Fix grammar: "contain" should be "contains" when referring to the options object.
| | initializer | `Function` | custom file exports, receive two parameters, first is the inject object (if not js file, will be content buffer), second is an `options` object that contain `path` | | |
| | initializer | Function | custom file exports, receive two parameters, first is the inject object (if not js file, will be content buffer), second is an `options` object that contains `path` | |
| | inject | `Object` | an object that be the argument when invoke the function | | ||
| | filter | `Function` | a function that filter the exports which can be loaded | |
There was a problem hiding this comment.
Improve the grammar for the inject and filter descriptions to make them more idiomatic and consistent with the rest of the table.
| | inject | `Object` | an object that be the argument when invoke the function | | |
| | filter | `Function` | a function that filter the exports which can be loaded | | |
| | inject | Object | an object that is the argument when invoking the function | | |
| | filter | Function | a function that filters the exports which can be loaded | |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/core/README.md (1)
239-239: 💤 Low valueMinor inconsistency: loaderFS description mentions "JSON reads" but site docs omit it.
The loaderFS description here includes "JSON reads" in the list of capabilities ("file stats, JSON reads, and module loading"), but the corresponding documentation in
site/docs/advanced/loader.md(line 500-501) andsite/docs/zh-CN/advanced/loader.md(line 505-506) only mention "file stats, and module loading" without explicitly calling out JSON reads.For consistency, consider either adding "JSON reads" to the site docs or removing it from this README if it's covered implicitly by "file stats" or "module loading".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/README.md` at line 239, The README entry for LoaderFS lists "JSON reads" but the advanced loader docs (English and Chinese) omit it; update the two advanced loader docs to include "JSON reads" in the capability list for LoaderFS so the descriptions match, i.e., edit the advanced loader documentation pages to add "JSON reads" alongside "file stats" and "module loading" where LoaderFS is described (referencing the LoaderFS symbol/section) to keep both languages consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/core/README.md`:
- Line 239: The README entry for LoaderFS lists "JSON reads" but the advanced
loader docs (English and Chinese) omit it; update the two advanced loader docs
to include "JSON reads" in the capability list for LoaderFS so the descriptions
match, i.e., edit the advanced loader documentation pages to add "JSON reads"
alongside "file stats" and "module loading" where LoaderFS is described
(referencing the LoaderFS symbol/section) to keep both languages consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f97824d1-ced4-4756-85dd-c41d7bad11cf
📒 Files selected for processing (5)
packages/core/README.mdsite/docs/advanced/loader.mdsite/docs/zh-CN/advanced/loader.mdwiki/log.mdwiki/packages/core.md
Deploying egg-v3 with
|
| Latest commit: |
c8c8345
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fcf6cbc6.egg-v3.pages.dev |
| Branch Preview URL: | https://agent-egg-doc-4ce1c080.egg-v3.pages.dev |
Summary
loaderFSLoaderOptions entry inpackages/coreREADMEloadToApp/loadToContextValidation
git diff --checkpnpm run fmtcheckattempted, butoxfmtis not installed becausenode_modulesis missing in this checkoutSummary by CodeRabbit