Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Apr 17, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@trojs/deep-merge 1.0.1 -> 1.1.0 age adoption passing confidence

Release Notes

trojs/deep-merge (@​trojs/deep-merge)

v1.1.0

Compare Source

What's Changed

Full Changelog: trojs/deep-merge@1.0.1...1.1.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Summary by CodeRabbit

  • Chores
    • Simplified and centralized ESLint configuration for easier maintenance.
    • Updated development dependencies to use a consolidated linting package.
    • Enhanced test scripts to include coverage and multiple reporting options.
  • Style
    • Reformatted source and test files for consistent indentation and spacing.

@coderabbitai
Copy link

coderabbitai bot commented Apr 17, 2025

Walkthrough

This update consolidates and simplifies the project's ESLint configuration by replacing multiple individual plugin imports and rule definitions with a single, centralized configuration sourced from the @trojs/lint package. The package management file (package.json) reflects this change by updating the version, refining test scripts to include enhanced coverage reporting, and streamlining ESLint-related dependencies. The source and test files (src/model.js and src/model.test.js) were reformatted for improved code style and consistency, but their logic and exported interfaces remain unchanged.

Changes

File(s) Change Summary
eslint.config.js Replaced multiple explicit plugin imports and rule configurations with a single configuration from @trojs/lint. All overrides, custom rules, and plugin-specific settings were removed. Configuration is now centralized and streamlined.
package.json Updated version to 1.1.0. Enhanced test scripts to include coverage and reporting. Replaced multiple ESLint-related devDependencies with @trojs/lint. Retained essential devDependencies.
src/model.js Reformatted code for consistent indentation and whitespace. No changes to logic, control flow, or exports.
src/model.test.js Reformatted test code for consistent style and spacing. No changes to test logic, assertions, or exports.

Poem

In the warren, linting’s now a breeze,
One package rules—no more dependencies!
Scripts are sharper, tests now gleam,
With coverage reports to crown the dream.
The code’s well-groomed, the carrots sweet,
This rabbit’s work is now complete! 🥕✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

@w3nl w3nl requested a review from Copilot April 17, 2025 08:00
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

The PR updates the dependency @trojs/deep-merge to v1.1.0 for improved compatibility and dependency upgrades.

  • Updates dependency versions and related tool configurations
  • Minor formatting adjustment in tests
Files not reviewed (1)
  • package.json: Language not supported

@w3nl
Copy link
Contributor

w3nl commented Apr 17, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Apr 17, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@renovate
Copy link
Contributor Author

renovate bot commented Apr 17, 2025

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

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: 3

🔭 Outside diff range comments (1)
package.json (1)

50-54: ⚠️ Potential issue

Dependency version not updated – contradicts PR title

The PR is meant to upgrade @trojs/deep-merge to 1.1.0, but package.json still specifies ^1.0.0.
This prevents consumers from receiving the intended bug‑fixes and could mask breaking‑changes during CI.

-        "@trojs/deep-merge": "^1.0.0",
+        "@trojs/deep-merge": "^1.1.0",
🧹 Nitpick comments (3)
src/model.js (1)

32-34: Guard against schemas without properties

Object.entries(schema.properties) will throw when properties is undefined.
Consider adding a fallback so the helper works for simple type: 'object' schemas that omit the properties field.

-  Object.entries(schema.properties).map(createPropertyWithDefaultValue)
+  Object.entries(schema.properties ?? {}).map(createPropertyWithDefaultValue)
package.json (1)

15-18: Ensure coverage directory exists before writing lcov.info

Node’s built‑in test runner will fail if the coverage folder does not exist.
Consider pre‑creating it in the script or switching the destination to coverage/lcov.info while relying on mkdirp behaviour.

eslint.config.js (1)

20-24: rules.all may be overly strict

Importing ...rules.all enables every rule from every included plugin, including purely stylistic ones.
If the intention was to enforce only recommended/essential rules, replace with rules.recommended or a curated subset to avoid noisy CI failures.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a15732c and 5eb18d3.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • eslint.config.js (1 hunks)
  • package.json (3 hunks)
  • src/model.js (1 hunks)
  • src/model.test.js (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/model.test.js (1)
src/model.js (1)
  • openapiToModel (36-98)
🔇 Additional comments (1)
src/model.js (1)

63-65: Check compatibility with @trojs/[email protected]

deepMerge() is invoked as deepMerge(emptyObject, data).
If the updated library changed the argument order or default merge strategy, this could silently corrupt data. Please verify the new version still behaves as expected (left‑to‑right, second argument overriding the first).

-      const newData = deepMerge(emptyObject, data)
+      // ensure `data` overrides defaults after the upgrade to deep‑merge v1.1
+      const newData = deepMerge(emptyObject, data)

Comment on lines +120 to +126
error.data,
{
baz: {
qux: '42'
}
}
)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix error.data expectation – value type mismatch

The data handed to the constructor uses the number 42 (qux: 42), but the assertion expects a string ('42').
This causes a false‑negative test failure.

-      assert.deepEqual(
-        error.data,
-        {
-          baz: {
-            qux: '42'
-          }
-        }
-      )
+      assert.deepEqual(
+        error.data,
+        {
+          baz: {
+            qux: 42
+          }
+        }
+      )
📝 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
error.data,
{
baz: {
qux: '42'
}
}
)
assert.deepEqual(
error.data,
{
baz: {
qux: 42
}
}
)

Comment on lines +128 to +136
error.newData,
{
bar: 42,
baz: {
quux: 3.14,
qux: '42'
},
foo: 'bar'
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update error.newData expectation to match corrected input

After merging defaults, newData should also contain the number 42, not the string.

-          baz: {
-            quux: 3.14,
-            qux: '42'
-          },
+          baz: {
+            quux: 3.14,
+            qux: 42
+          },
📝 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
error.newData,
{
bar: 42,
baz: {
quux: 3.14,
qux: '42'
},
foo: 'bar'
}
error.newData,
{
bar: 42,
baz: {
quux: 3.14,
qux: 42
},
foo: 'bar'
}

Comment on lines +93 to +99
try {
new ExampleModel({
baz: {
qux: 42
}
})
})
} catch (error) {
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Assert the error is actually thrown

The current try / catch block silently passes the test when the constructor does not throw.
Use assert.throws() (or at least add an explicit assert.fail() after the constructor call) so that the test fails when the expected validation error is missing.

-    try {
-      new ExampleModel({
-        baz: {
-          qux: 42
-        }
-      })
-    } catch (error) {
+    assert.throws(() => {
+      new ExampleModel({
+        baz: {
+          qux: 42
+        }
+      })
+    }, /Invalid data/, 'Model should throw when data is invalid')
+
+    /** @type {any} */ const error = /** @type {any} */ (assert.throws.lastError)

Committable suggestion skipped: line range outside the PR's diff.

@w3nl w3nl merged commit 5383b51 into main Apr 17, 2025
10 checks passed
@renovate renovate bot deleted the renovate/trojs-deep-merge-1.x-lockfile branch April 17, 2025 08:09
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.

2 participants