Skip to content

fix(core): handle findUp options correctly#418

Merged
JounQin merged 2 commits intomasterfrom
fix/options
Jun 3, 2025
Merged

fix(core): handle findUp options correctly#418
JounQin merged 2 commits intomasterfrom
fix/options

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Jun 3, 2025

Important

Fixes handling of options in findUp function to correctly merge entryOrOptions with options.

  • Behavior:
    • Fixes handling of options in findUp function in helpers.ts to correctly merge entryOrOptions with options when entryOrOptions is not a string.
  • Misc:
    • Adds changeset tasty-mayflies-build.md for patch update of @pkgr/core.

This description was created by Ellipsis for c329fe3. You can customize this summary. It will automatically update as commits are pushed.

@JounQin JounQin requested a review from Copilot June 3, 2025 14:34
@JounQin JounQin self-assigned this Jun 3, 2025
@JounQin JounQin added the bug Something isn't working label Jun 3, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jun 3, 2025

🦋 Changeset detected

Latest commit: 84fc4ab

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

This PR includes changesets to release 1 package
Name Type
@pkgr/core 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 3, 2025

Warning

Rate limit exceeded

@JounQin has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1640416 and 84fc4ab.

📒 Files selected for processing (2)
  • .changeset/tasty-mayflies-build.md (1 hunks)
  • packages/core/src/helpers.ts (1 hunks)
✨ 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.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 3, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 3, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to b0a81a6 in 57 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/core/src/helpers.ts:93
  • Draft comment:
    Merge options correctly: The new 'else if' branch now spreads entryOrOptions and options. Consider using a fallback (e.g. ...(options ?? {})) to ensure options is always an object.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_MkKt8SvBHSJOt8tm

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 3, 2025

Open in StackBlitz

@pkgr/browser

npm i https://pkg.pr.new/@pkgr/browser@418

@pkgr/core

npm i https://pkg.pr.new/@pkgr/core@418

@pkgr/es-modules

npm i https://pkg.pr.new/@pkgr/es-modules@418

@pkgr/imagemin

npm i https://pkg.pr.new/@pkgr/imagemin@418

@pkgr/rollup

npm i https://pkg.pr.new/@pkgr/rollup@418

@pkgr/umd-globals

npm i https://pkg.pr.new/@pkgr/umd-globals@418

@pkgr/utils

npm i https://pkg.pr.new/@pkgr/utils@418

commit: 84fc4ab

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2025

📊 Package size report   No changes

File Before After
Total (Includes all files) 3.1 MB 3.1 MB
Tarball size 1.1 MB 1.1 MB
Unchanged files
File Size
.changeset/config.json 309 B
.changeset/README.md 510 B
.codesandbox/ci.json 76 B
.editorconfig 145 B
.gitattributes 35 B
.github/workflows/autofix.yml 921 B
.github/workflows/ci.yml 1.7 kB
.github/workflows/pkg-pr-new.yml 645 B
.github/workflows/pkg-size.yml 727 B
.github/workflows/release.yml 1.5 kB
.github/workflows/vercel.yml 1.0 kB
.markuplintrc 43 B
.nano-staged.js 48 B
.nvmrc 6 B
.prettierignore 6 B
.remarkrc 42 B
.renovaterc 49 B
.simple-git-hooks.js 49 B
.stylelintignore 99 B
.stylelintrc 42 B
.yarn/plugins/plugin-prepare-lifecycle.cjs 202 B
.yarn/releases/yarn-4.9.1.cjs 3.0 MB
.yarnrc.yml 397 B
CHANGELOG.md 486 B
docs/App.tsx 1.2 kB
docs/global.css 321 B
docs/index.tsx 299 B
eslint.config.js 302 B
index.html 402 B
LICENSE 1.1 kB
package.json 3.0 kB
packages/browser/CHANGELOG.md 1.7 kB
packages/browser/index.d.cts 60 B
packages/browser/index.ts 4.7 kB
packages/browser/openChrome.applescript 2.5 kB
packages/browser/package.json 998 B
packages/browser/tsconfig.json 139 B
packages/core/CHANGELOG.md 3.3 kB
packages/core/index.d.cts 54 B
packages/core/package.json 945 B
packages/core/src/constants.ts 538 B
packages/core/src/helpers.ts 2.7 kB
packages/core/src/index.ts 60 B
packages/core/tsconfig.json 154 B
packages/es-modules/CHANGELOG.md 5.2 kB
packages/es-modules/index.d.cts 64 B
packages/es-modules/index.ts 1.4 kB
packages/es-modules/package.json 1.0 kB
packages/es-modules/README.md 3.7 kB
packages/es-modules/test/test.spec.ts 936 B
packages/es-modules/tsconfig.json 139 B
packages/imagemin/CHANGELOG.md 9.2 kB
packages/imagemin/index.d.cts 57 B
packages/imagemin/package.json 1.3 kB
packages/imagemin/src/cli.ts 508 B
packages/imagemin/src/index.ts 1.2 kB
packages/imagemin/tsconfig.json 154 B
packages/rollup/CHANGELOG.md 22.4 kB
packages/rollup/package.json 1.5 kB
packages/rollup/shim.d.ts 647 B
packages/rollup/src/cli.ts 4.0 kB
packages/rollup/src/config.ts 11.9 kB
packages/rollup/tsconfig.json 132 B
packages/umd-globals/CHANGELOG.md 6.2 kB
packages/umd-globals/index.d.cts 66 B
packages/umd-globals/index.ts 1.8 kB
packages/umd-globals/package.json 919 B
packages/umd-globals/README.md 3.4 kB
packages/umd-globals/test/test.spec.ts 1.9 kB
packages/umd-globals/tsconfig.json 139 B
packages/utils/CHANGELOG.md 12.7 kB
packages/utils/index.d.cts 51 B
packages/utils/package.json 961 B
packages/utils/src/constants.ts 497 B
packages/utils/src/helpers.ts 2.8 kB
packages/utils/src/index.ts 117 B
packages/utils/src/monorepo.ts 691 B
packages/utils/tsconfig.json 154 B
README.md 4.1 kB
test/global.d.ts 41 B
test/tsconfig.json 96 B
tsconfig.base.json 172 B
tsconfig.json 395 B
vercel.json 190 B
vite.config.ts 544 B
vitest.config.ts 342 B

🤖 This report was automatically generated by pkg-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2025

Deploy preview for pkgr ready!

✅ Preview
https://pkgr-9kfea6rmd-1stg.vercel.app

Built with commit 84fc4ab.
This pull request is being automatically deployed with vercel-action

Copy link

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 fixes the logic in findUp so that when callers pass an options object as the first argument, it’s merged correctly into the existing options.

  • Adds an else if branch to merge entryOrOptions into options when it’s provided as an object.
  • Ensures both entry and search parameters can be overridden via the first-argument options.
Comments suppressed due to low confidence (2)

packages/core/src/helpers.ts:94

  • Add or update unit tests to cover this new merge branch (when entryOrOptions is an options object) to ensure expected behavior and catch regressions.
    options = { ...entryOrOptions, ...options }

packages/core/src/helpers.ts:93

  • Make the branch condition more explicit by checking for an object type (e.g., typeof entryOrOptions === 'object') instead of relying on truthiness, to avoid unintentionally handling non-object values.
  } else if (entryOrOptions) {

@codecov
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 9.67%. Comparing base (1640416) to head (84fc4ab).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
packages/core/src/helpers.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master    #418      +/-   ##
=========================================
- Coverage    9.72%   9.67%   -0.05%     
=========================================
  Files          12      12              
  Lines         432     434       +2     
  Branches      185     187       +2     
=========================================
  Hits           42      42              
- Misses        390     392       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed c329fe3 in 1 minute and 38 seconds. Click for details.
  • Reviewed 24 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/core/src/helpers.ts:93
  • Draft comment:
    Avoid reassigning the parameter 'options'; consider using a new variable for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. .changeset/tasty-mayflies-build.md:5
  • Draft comment:
    Typo: 'hadnle' should be corrected to 'handle'.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_y1VNgMyzu2vDysf2

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@JounQin JounQin changed the title fix(core): hadnle findUp options correctly fix(core): handle findUp options correctly Jun 3, 2025
@JounQin JounQin merged commit b858867 into master Jun 3, 2025
34 of 36 checks passed
@JounQin JounQin deleted the fix/options branch June 3, 2025 14:43
@JounQin JounQin mentioned this pull request Jun 3, 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