Skip to content

feat: added design comment system support to cli to make it easier fo…#52

Merged
dlabaj merged 1 commit into
patternfly:mainfrom
dlabaj:design-comments
Jun 19, 2026
Merged

feat: added design comment system support to cli to make it easier fo…#52
dlabaj merged 1 commit into
patternfly:mainfrom
dlabaj:design-comments

Conversation

@dlabaj

@dlabaj dlabaj commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What / why

To make it easier for users to setup and run the new patternfly design commenting system, we added it to the cli.

How to test

In a repo run where you want to add the design commenting system run:

patternfly-cli add-design-comments

launch the application and verify that the design commenting system has been added.

Checklist

  • [ x ] Tests added or updated where appropriate
  • [ x ] npm run lint and npm test pass locally
  • [ x ] Commit messages follow Conventional Commits (required for semantic-release), e.g. feat:, fix:, docs:, chore:

Summary by CodeRabbit

  • New Features
    • Added add-design-comments CLI command to install and integrate @patternfly/design-comments into React projects, with support for an optional target path and --git-init flag for automatic Git repository initialization.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 77979451-2fcd-4829-bf5a-029a2bee358f

📥 Commits

Reviewing files that changed from the base of the PR and between 027ae7b and 2ae50d8.

📒 Files selected for processing (3)
  • src/__tests__/add-design-comments.test.ts
  • src/add-design-comments.ts
  • src/cli.ts

Walkthrough

Adds a runAddDesignComments utility (src/add-design-comments.ts) that validates a project root, conditionally initializes Git, detects the package manager from lockfiles, installs @patternfly/design-comments, and runs npx design-comments init. The utility is exposed as a new add-design-comments CLI subcommand in src/cli.ts, and a Jest suite covers all code paths.

Changes

add-design-comments feature

Layer / File(s) Summary
runAddDesignComments implementation and CLI wiring
src/add-design-comments.ts, src/cli.ts
Defines RunAddDesignCommentsOptions (cwd, optional gitInit) and runAddDesignComments, which checks for package.json, conditionally runs git init and promptAndSetLocalGitUser, detects yarn/pnpm/npm from lockfiles, installs @patternfly/design-comments via execa, and runs npx design-comments init. Wires this as the add-design-comments commander subcommand with [path] and --git-init, delegating to runAddDesignComments and exiting with code 1 on failure.
Jest test suite
src/__tests__/add-design-comments.test.ts
Mocks fs-extra, execa, and promptAndSetLocalGitUser with a helper to configure pathExists responses per scenario. Tests cover: missing package.json error, git init presence/absence branching, npm/yarn/pnpm command selection, gitInit flag conditionally calling promptAndSetLocalGitUser, call ordering, expected console log messages, and error propagation from both the install and design-comments init steps.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title describes the main feature addition (design comment system support to CLI) and is consistent with the changeset, though it appears truncated mid-sentence.
Description check ✅ Passed The description includes all required sections (What/why, How to test, Checklist) with substantive content and checkmarks indicating completion of the checklist items.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@dlabaj dlabaj requested a review from cdcabrera June 17, 2026 17:11
@dlabaj dlabaj merged commit ce032cd into patternfly:main Jun 19, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant