Skip to content

docs(create-node-app-core): add JSDoc comments to core module functions - #285

Merged
ulises-jeremias merged 7 commits into
Create-Node-App:mainfrom
mynolog:docs/add-jsdoc-core
Jul 27, 2026
Merged

docs(create-node-app-core): add JSDoc comments to core module functions#285
ulises-jeremias merged 7 commits into
Create-Node-App:mainfrom
mynolog:docs/add-jsdoc-core

Conversation

@mynolog

@mynolog mynolog commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What's this PR do?

Add JSDoc comments to core module functions in packages/create-node-app-core.

  • index.ts (createNodeApp, checkNodeVersion, checkForLatestVersion)
  • installer.ts (createApp, run)
  • loaders.ts (loadFiles, 4 loaders)
  • git.ts, paths.ts, config.ts

Fixes #234

@ulises-jeremias

Summary by CodeRabbit

  • Documentation
    • Added comprehensive inline documentation for template configuration, project scaffolding, repository caching, version checks, file loading, path resolution, and app creation workflows.
    • Clarified expected parameters, return values, validation behavior, and error-handling semantics.
  • Style
    • Reformatted several conditional expressions and error-message constructions for improved readability without changing behavior.

Copilot AI review requested due to automatic review settings July 27, 2026 11:53
@mynolog
mynolog requested a review from ulises-jeremias as a code owner July 27, 2026 11:53
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mynolog, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e1919ba-65fd-482c-b500-55452704092e

📥 Commits

Reviewing files that changed from the base of the PR and between 74345ba and dd7890a.

📒 Files selected for processing (4)
  • packages/create-node-app-core/config.ts
  • packages/create-node-app-core/index.ts
  • packages/create-node-app-core/installer.ts
  • packages/create-node-app-core/paths.ts
📝 Walkthrough

Walkthrough

The 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.

Changes

Core API documentation

Layer / File(s) Summary
Configuration and path contracts
packages/create-node-app-core/config.ts, packages/create-node-app-core/paths.ts
Documents configuration types, directory validation, package-path resolution, and template-directory resolution.
Scaffolding and installation entry points
packages/create-node-app-core/index.ts, packages/create-node-app-core/installer.ts
Documents version checks, update checks, app creation, and the installation pipeline; reformats one Windows path condition without changing logic.
File loading and repository operations
packages/create-node-app-core/loaders.ts, packages/create-node-app-core/git.ts
Documents loader behavior, dispatch, cache metadata handling, and repository downloads; reformats equivalent loader expressions and error messages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: copilot, ulises-jeremias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the PR’s main change: adding JSDoc comments to core module functions.
Linked Issues check ✅ Passed The changes add docs across the listed public exports in index.ts, installer.ts, loaders.ts, git.ts, paths.ts, and config.ts.
Out of Scope Changes check ✅ Passed The diff is limited to documentation and minor formatting, with no unrelated runtime or API changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.ts and config/types/errors in config.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 the opts description.
 * @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.

Comment thread packages/create-node-app-core/installer.ts
Comment thread packages/create-node-app-core/paths.ts
Comment thread packages/create-node-app-core/index.ts
Comment thread packages/create-node-app-core/config.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2e16890 and 74345ba.

📒 Files selected for processing (6)
  • packages/create-node-app-core/config.ts
  • packages/create-node-app-core/git.ts
  • packages/create-node-app-core/index.ts
  • packages/create-node-app-core/installer.ts
  • packages/create-node-app-core/loaders.ts
  • packages/create-node-app-core/paths.ts

customOptions?: CnaCustomOption[];
};

export const NON_EMPTY_DIR_ERROR_CODE = "CNA_NON_EMPTY_TARGET_DIR";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 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.

Suggested change
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.

Comment thread packages/create-node-app-core/index.ts
Comment thread packages/create-node-app-core/installer.ts
Comment thread packages/create-node-app-core/paths.ts
@ulises-jeremias

Copy link
Copy Markdown
Member

Hey @mynolog! Great work on this — the JSDoc coverage across the core module is exactly what the project needed. Thanks for the thorough contribution!

Merging this now. 🎉


Come join our community Discord for quick questions and coordination: Discord — always happy to have active contributors there!

@ulises-jeremias
ulises-jeremias merged commit 80ac426 into Create-Node-App:main Jul 27, 2026
@mynolog

mynolog commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review and merge! I'm glad I could help. I'll definitely check out the Discord server as well. 🙃

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.

docs: add JSDoc to public API of @create-node-app/core

3 participants