Skip to content

fix(deps): update dependency reduce-configs to v2#63

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/reduce-configs-2.x
Open

fix(deps): update dependency reduce-configs to v2#63
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/reduce-configs-2.x

Conversation

@renovate

@renovate renovate Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
reduce-configs ^1.1.2^2.0.1 age confidence

Release Notes

rstackjs/reduce-configs (reduce-configs)

v2.0.1

Compare Source

What's Changed

Full Changelog: rstackjs/reduce-configs@v2.0.0...v2.0.1

v2.0.0

Compare Source

Breaking Changes

  • This package is now a pure ESM package.
  • reduceConfigs and reduceConfigsWithContext now return Promise<T>.
  • reduceConfigsAsyncWithContext, reduceConfigsMergeContext has been removed.

What's Changed

Full Changelog: rstackjs/reduce-configs@v1.1.2...v2.0.0


Configuration

📅 Schedule: (in timezone Asia/Shanghai)

  • Branch creation
    • Between 12:00 AM and 03:59 AM, on day 1 and 15 of the month (* 0-3 1,15 * *)
  • 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.

@renovate renovate Bot force-pushed the renovate/reduce-configs-2.x branch 2 times, most recently from 7a88742 to 6a7d4e1 Compare June 6, 2026 05:24
@renovate renovate Bot force-pushed the renovate/reduce-configs-2.x branch from 6a7d4e1 to a5811e0 Compare June 11, 2026 13:57
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates the reduce-configs dependency in package.json from version ^1.1.2 to ^2.0.1. This is a major version bump that introduces a new minor release of the package. The change is isolated to a single line in the dependencies section of the manifest file.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: updating the reduce-configs dependency to v2, which is the sole focus of the changeset.
Description check ✅ Passed The description is directly related to the changeset, providing detailed information about the dependency update including version change, breaking changes, and release notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
  • Commit unit tests in branch renovate/reduce-configs-2.x

Comment @coderabbitai help to get the list of available commands and usage tips.

@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: 1

🤖 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 `@package.json`:
- Line 34: reduce-configs v2 returns a Promise but src/index.ts assigns const
pugOptions = reduceConfigs(...) without awaiting, causing an unresolved Promise
to be spread into Pug options; modify the surrounding function (e.g., the
function that calls reduceConfigs in src/index.ts) to be async and await
reduceConfigs(...) (await const pugOptions = ...) before using or spreading
...pugOptions, and update any upstream callers to handle the async behavior
(either await this function or propagate async) so that Pug receives a resolved
options object rather than a Promise.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b3ee76cf-d775-4098-bdea-28ac1bb999de

📥 Commits

Reviewing files that changed from the base of the PR and between e832ead and a5811e0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json

Comment thread package.json
"lodash": "^4.18.1",
"pug": "^3.0.4",
"reduce-configs": "^1.1.2"
"reduce-configs": "^2.0.1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Find all usages of reduceConfigs to verify Promise handling

# Search for reduceConfigs function calls
rg -nP '\breduceConfigs\s*\(' -A 3 -B 1

Repository: rstackjs/rsbuild-plugin-pug

Length of output: 1947


🏁 Script executed:

#!/bin/bash
# Find reduce-configs usages that may require Promise/removed-API updates
rg -nP '\breduceConfigs(?:\w+)?\s*\(' src -S
rg -nP '\b(pugOptions|options\.pugOptions)\b' src -S

Repository: rstackjs/rsbuild-plugin-pug

Length of output: 315


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect async context and callsite around reduceConfigs
sed -n '1,140p' src/index.ts | nl -ba

# Check for other reduce-configs API usages that may also be breaking
rg -nP '\b(reduceConfigsWithContext|reduceConfigsAsyncWithContext|reduceConfigsMergeContext)\b' src -S || true

Repository: rstackjs/rsbuild-plugin-pug

Length of output: 114


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show beginning + area around the reduceConfigs call and the spread usage
cat -n src/index.ts | sed -n '1,140p'

# Find any other reduce-configs API usages
rg -nP '\b(reduceConfigsWithContext|reduceConfigsAsyncWithContext|reduceConfigsMergeContext|reduceConfigs)\b' src -S

Repository: rstackjs/rsbuild-plugin-pug

Length of output: 4207


🌐 Web query:

reduce-configs v2 reduceConfigs returns Promise<T> pure ESM breaking changes

💡 Result:

The release of reduce-configs v2.0.0 introduced several major breaking changes, including the transition to a pure ESM package and asynchronous reducer execution [1][2]. Key changes in v2.0.0 include: 1. Return Type Change: The primary functions, reduceConfigs and reduceConfigsWithContext, now return a Promise instead of a synchronous T [1][3]. This accommodates the new support for asynchronous configuration callbacks [1][3]. 2. Pure ESM: The package has dropped CommonJS support entirely [2]. It is now an ESM-only package, requiring the use of "type": "module" in package.json or an ESM environment to consume it [2][4]. 3. Removed Exports: Legacy exports, including reduceConfigsAsyncWithContext and reduceConfigsMergeContext, have been removed [1]. These changes were implemented to unify the API and simplify the codebase [1][2]. Users upgrading to v2 must ensure their consuming code handles the asynchronous nature of these functions (e.g., using await) and supports ESM imports [1][2].

Citations:


🏁 Script executed:

#!/bin/bash
rg -nP '\breduceConfigs(?:WithContext|MergeContext)?\s*\(' -S src

Repository: rstackjs/rsbuild-plugin-pug

Length of output: 126


reduce-configs v2 returns a Promise, but src/index.ts still uses it synchronously

src/index.ts assigns const pugOptions = reduceConfigs(...) without await and later spreads ...pugOptions into the Pug options; with reduce-configs@^2.0.1 (v2) returning Promise<T>, this will pass an unresolved Promise to Pug.

Required fix
-    const pugOptions = reduceConfigs({
+    const pugOptions = await reduceConfigs({
       initial: {
         doctype: 'html',
         compileDebug: false,
       },
       config: options.pugOptions,
     });
🤖 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 `@package.json` at line 34, reduce-configs v2 returns a Promise but
src/index.ts assigns const pugOptions = reduceConfigs(...) without awaiting,
causing an unresolved Promise to be spread into Pug options; modify the
surrounding function (e.g., the function that calls reduceConfigs in
src/index.ts) to be async and await reduceConfigs(...) (await const pugOptions =
...) before using or spreading ...pugOptions, and update any upstream callers to
handle the async behavior (either await this function or propagate async) so
that Pug receives a resolved options object rather than a Promise.

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.

0 participants