docs(create-node-app-core): add JSDoc comments to core module functions - #285
Conversation
|
Warning Review limit reached
Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe core package adds JSDoc documentation for public configuration, path, scaffolding, installation, file-loading, cache, and repository APIs. Several expressions are reformatted without changing runtime logic or exported signatures. ChangesCore API documentation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Pull request overview
This PR addresses #234 by adding TSDoc/JSDoc comments to the public API surface of @create-node-app/core, improving IDE tooltips and onboarding. It also includes a few formatting-only changes (line wrapping) in touched files.
Changes:
- Added doc comments for core public exports like
createNodeApp,checkNodeVersion,checkForLatestVersion, and key installer/loaders/path helpers. - Documented cache meta helpers in
git.tsand config/types/errors inconfig.ts. - Applied minor formatting adjustments to improve readability in a few expressions.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/create-node-app-core/index.ts | Adds docs for the main entry points and version helpers. |
| packages/create-node-app-core/installer.ts | Adds docs for the app creation pipeline (run, createApp) and wraps some long lines. |
| packages/create-node-app-core/loaders.ts | Adds docs for file loaders and loadFiles, plus minor formatting. |
| packages/create-node-app-core/paths.ts | Adds docs for path resolution helpers (getPackagePath, getTemplateDirPath). |
| packages/create-node-app-core/git.ts | Adds docs for cache meta helpers and enhances existing repository download docs. |
| packages/create-node-app-core/config.ts | Adds docs for config types and directory validation error/assertion. |
Comments suppressed due to low confidence (2)
packages/create-node-app-core/installer.ts:465
- In this new TSDoc block,
@param options.<prop>?won’t match actual property names, so IDEs may not show these docs. Consider using TSDoc/JSDoc optional syntax ([options.verbose], etc.) and add hyphens for consistency with the other doc blocks in this PR.
* @param options - App creation options (see {@link CreateAppOptions})
* @param options.name Name of the app (used as the directory name)
* @param options.verbose? Enable verbose output from the package manager (default: `false`)
* @param options.force? Proceed even if the target directory is not empty (default: `false`)
* @param options.packageManager? Package manager to use
packages/create-node-app-core/paths.ts:341
- This new doc block uses
@param opts?, which won’t match the actual parameter name (opts) in most TSDoc/JSDoc parsers, so the tooltip may not show theoptsdescription.
* @param templateOrExtensionUrl Template or extension URL to resolve
* @param opts? Cache and network options (see {@link GetTemplatePathOptions})
* @returns Absolute path to the directory containing the template files
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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.
Inline comments:
In `@packages/create-node-app-core/config.ts`:
- Line 20: Add a concise JSDoc comment directly above the exported
NON_EMPTY_DIR_ERROR_CODE constant in config.ts, describing that it identifies
the error raised when the target directory is not empty. Keep the existing
constant value and export unchanged.
In `@packages/create-node-app-core/index.ts`:
- Around line 38-43: Update the JSDoc for checkNodeVersion so the description
says “Prints an error message and exits with code 1,” correcting the verb
agreement and explicitly retaining the exit code.
In `@packages/create-node-app-core/installer.ts`:
- Around line 197-219: Update the JSDoc for the run function: correct the
“Excutes” and “intall” typos, and change the documented default for
options.installDependencies to true to match the destructuring default in run.
In `@packages/create-node-app-core/paths.ts`:
- Around line 259-271: Update the public JSDoc for the path-resolution API:
change “throws then resolving” to “throws when resolving” in the `ignorePackage`
parameter description, and change “Resolve” to “Resolves” in the corresponding
documentation around the adjacent declaration.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: fa74449e-6c1b-4ebd-ae0d-e8902523e889
📒 Files selected for processing (6)
packages/create-node-app-core/config.tspackages/create-node-app-core/git.tspackages/create-node-app-core/index.tspackages/create-node-app-core/installer.tspackages/create-node-app-core/loaders.tspackages/create-node-app-core/paths.ts
| customOptions?: CnaCustomOption[]; | ||
| }; | ||
|
|
||
| export const NON_EMPTY_DIR_ERROR_CODE = "CNA_NON_EMPTY_TARGET_DIR"; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Document the exported error-code constant.
Line 20 is re-exported from packages/create-node-app-core/index.ts, but NON_EMPTY_DIR_ERROR_CODE still has no JSDoc. Add a short description so this public export is covered by the PR objective.
Proposed documentation
+/** Error code for a non-empty scaffolding target directory. */
export const NON_EMPTY_DIR_ERROR_CODE = "CNA_NON_EMPTY_TARGET_DIR";📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export const NON_EMPTY_DIR_ERROR_CODE = "CNA_NON_EMPTY_TARGET_DIR"; | |
| /** Error code for a non-empty scaffolding target directory. */ | |
| export const NON_EMPTY_DIR_ERROR_CODE = "CNA_NON_EMPTY_TARGET_DIR"; |
🤖 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/create-node-app-core/config.ts` at line 20, Add a concise JSDoc
comment directly above the exported NON_EMPTY_DIR_ERROR_CODE constant in
config.ts, describing that it identifies the error raised when the target
directory is not empty. Keep the existing constant value and export unchanged.
|
Thanks for the quick review and merge! I'm glad I could help. I'll definitely check out the Discord server as well. 🙃 |
What's this PR do?
Add JSDoc comments to core module functions in
packages/create-node-app-core.Fixes #234
@ulises-jeremias
Summary by CodeRabbit