Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Jun 6, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of certain conditions in the CLI to ensure more accurate checks when processing user input.
  • Chores

    • Updated dependency versions to improve compatibility.
    • Moved TypeScript to main dependencies for better package management.

@JounQin JounQin self-assigned this Jun 6, 2025
Copilot AI review requested due to automatic review settings June 6, 2025 06:59
@JounQin JounQin added the bug Something isn't working label Jun 6, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jun 6, 2025

🦋 Changeset detected

Latest commit: d7bcd12

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/doom Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jun 6, 2025

Walkthrough

A patch changeset was added for the "@alauda/doom" package to document a fix involving the when expression. The package.json was updated to broaden the version range for @cspell/eslint-plugin and move typescript to dependencies. The logic for handling the when variable in src/cli/new.ts was refined for more precise checks.

Changes

File(s) Change Summary
.changeset/proud-masks-kiss.md Added changeset documenting a patch for correct when expression checking in "@alauda/doom".
package.json Broadened @cspell/eslint-plugin version range; moved typescript to dependencies.
src/cli/new.ts Refined logic to check when is defined before checking against falsy values.

Poem

A patch for "when" has hopped in today,
With careful checks to light the way.
Dependencies shuffled, neat and precise,
The package garden grows so nice.
🐇✨
Here's to code that hops along—
In every fix, a rabbit's song!

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

Copilot AI left a comment

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 the incorrect handling of the when expression in the CLI command and makes updates to dependency management in package.json.

  • Update null check logic for the when expression in the CLI command (src/cli/new.ts).
  • Adjust the version range for @cspell/eslint-plugin in package.json.
  • Move the TypeScript dependency from devDependencies to dependencies in package.json.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/cli/new.ts Refines the when condition to first ensure a non-null value before evaluation.
package.json Updates dependency version ranges and adjusts the placement of the TypeScript dependency.
Comments suppressed due to low confidence (2)

package.json:101

  • Verify that moving the 'typescript' dependency from devDependencies to dependencies is intentional, to ensure it is included only when appropriate.
    "typescript": "^5.8.3",

package.json:60

  • Confirm that the updated version range for '@cspell/eslint-plugin' meets your compatibility requirements and does not introduce regressions.
    "@cspell/eslint-plugin": "^8.19.4 || ^9.0.2",

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 6, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@alauda/doom@69

commit: d7bcd12

Signed-off-by: JounQin <admin@1stg.me>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ddbf36 and d7bcd12.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • .changeset/proud-masks-kiss.md (1 hunks)
  • package.json (2 hunks)
  • src/cli/new.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/cli/new.ts (1)
src/shared/constants.ts (1)
  • JS_STR_FALSY_VALUES (17-25)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
🔇 Additional comments (3)
package.json (1)

60-60:

Details

✅ Verification successful

Verify the version range broadening for @cspell/eslint-plugin.

The dependency now accepts both ^8.19.4 and ^9.0.2, which is a significant version range. Ensure this change doesn't introduce compatibility issues between the different major versions.


🏁 Script executed:

#!/bin/bash
# Check for breaking changes between @cspell/eslint-plugin versions 8.x and 9.x
curl -s https://registry.npmjs.org/@cspell/eslint-plugin | jq '.versions | keys[]' | grep -E '^"(8\.|9\.)'

Length of output: 681


To verify whether v9 introduced any breaking changes, let’s pull the changelog for the 9.0.0 release:


🏁 Script executed:

#!/bin/bash
set -e

# 1. Get the package repo URL
repo=$(curl -s https://registry.npmjs.org/@cspell/eslint-plugin \
  | jq -r '.repository.url' \
  | sed -e 's/^git+//' -e 's/\.git$//')

# 2. Try both common default branches
for branch in main master; do
  raw_url=$(echo "$repo" \
    | sed 's#github.com#raw.githubusercontent.com#')"/$branch/CHANGELOG.md"
  echo "Fetching from $raw_url" >&2

  if data=$(curl -fsS "$raw_url"); then
    echo "$data" \
      | sed -n '/^## \[9\.0\.0\]/,/^## /p'
    exit 0
  fi
done

echo "⚠️ Could not fetch 9.0.0 changelog – please check the repository’s default branch or file path." >&2
exit 1

Length of output: 66222


@cspell/eslint-plugin v8 → v9 Compatibility Confirmed
I checked the v9.0.0 release notes and it only includes a version bump for the monorepo (no API or behavior changes), so widening the range to ^8.19.4 ‖ ^9.0.2 poses no compatibility risk.

src/cli/new.ts (1)

224-226: Excellent fix for the when expression logic!

This change correctly addresses a logical bug in the condition evaluation. The previous logic when && JS_STR_FALSY_VALUES.has(when) had a flaw: it would only check the falsy values set if when was truthy, but values like null, undefined, and '' are both falsy AND present in the JS_STR_FALSY_VALUES set.

The new logic when != null && JS_STR_FALSY_VALUES.has(when) properly:

  • Treats null/undefined as "no condition specified" (process the layout)
  • Only skips processing when when has a defined value that evaluates to falsy (like 'false', '0', '', etc.)

This ensures that scaffolding layouts are processed correctly based on their conditional expressions.

.changeset/proud-masks-kiss.md (1)

1-6: Well-documented changeset for the fix.

The changeset appropriately documents this as a patch-level fix with a clear description of what was corrected.

@JounQin JounQin merged commit 13eeacf into main Jun 6, 2025
18 of 20 checks passed
@JounQin JounQin deleted the fix/template branch June 6, 2025 07:11
github-actions bot pushed a commit that referenced this pull request Jun 6, 2025
JounQin added a commit that referenced this pull request Jun 6, 2025
JounQin added a commit that referenced this pull request Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants