Skip to content

fix: ensure latest compression-webpack-plugin is installed#1035

Merged
justin808 merged 3 commits intoshakacode:mainfrom
G-Rath:patch-3
Mar 30, 2026
Merged

fix: ensure latest compression-webpack-plugin is installed#1035
justin808 merged 3 commits intoshakacode:mainfrom
G-Rath:patch-3

Conversation

@G-Rath
Copy link
Copy Markdown
Contributor

@G-Rath G-Rath commented Mar 30, 2026

Summary

While v12 is allowed as a peer dependency, the install script currently does not use the latest version.

Pull Request checklist

  • Add/update test to cover these changes
  • Update documentation
  • Update CHANGELOG file

Other Information

fwiw I think there's a few ways this could be improved, e.g.:

  • have a CI check that ensures the file is in sync
  • don't store ranges here, since you always want to install the latest version (would let you simplify the install script a bit)
  • use node_modules/shakapacker/package.json directly to get the version ranges (so this file would just hold arrays for the groupings)

Summary by CodeRabbit

  • Chores
    • Updated internal dependencies to support newer package versions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 30, 2026

Warning

Rate limit exceeded

@G-Rath has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 9 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 16 minutes and 9 seconds.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8690fa66-9032-4942-a3dd-55a37e0d800a

📥 Commits

Reviewing files that changed from the base of the PR and between 4c25eaa and 86f57f9.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • docs/peer-dependencies.md

Walkthrough

Updated the common.compression-webpack-plugin dependency version range in lib/install/package.json to support ^12.0.0 while maintaining ^10.0.0 compatibility, with formatting corrections applied to the version specification.

Changes

Cohort / File(s) Summary
Dependency Version Update
lib/install/package.json
Updated common.compression-webpack-plugin dependency to support versions ^12.0.0 and ^10.0.0 with formatting corrections.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A version bump, so neat and tidy,
The plugin dances, Friday to Monday,
From ten to twelve, the range expands,
With commas clean and formatting hands,
Our webpack friend now stronger stands! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: updating the compression-webpack-plugin dependency to support v12, which enables installation of the latest version.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 30, 2026

Greptile Summary

This PR aligns lib/install/package.json with the root package.json peer dependency declaration for compression-webpack-plugin by adding ^12.0.0 to the install-time version range. It also fixes a minor pre-existing formatting inconsistency (^10.0.0||^10.0.0 ||).

Key points:

  • The root package.json already declares "compression-webpack-plugin": "^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0" as a peer dependency (line 109), so this install-file change is a correct synchronization.
  • The install script (lib/install/template.rb) reads lib/install/package.json and passes the version string as-is to the package manager (because it starts with ^), so npm/yarn will now resolve and install the latest v12 release.
  • The PR checklist explicitly notes that the CHANGELOG has not been updated — this is the one outstanding item before merging.

Confidence Score: 5/5

Safe to merge — tiny, correct one-line fix with no logic changes.

The change is a straightforward synchronization of a version range string that was already declared in package.json peerDependencies. No logic is altered. The only open checklist item (CHANGELOG) is a documentation housekeeping task flagged by the author themselves and does not affect correctness.

No files require special attention.

Important Files Changed

Filename Overview
lib/install/package.json Adds ^12.0.0 to the compression-webpack-plugin version range, aligning with the already-declared peer dependency in the root package.json (line 109); also fixes a missing space in the pre-existing `^10.0.0

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[rails shakapacker:install] --> B[template.rb reads lib/install/package.json]
    B --> C{SHAKAPACKER_ASSETS_BUNDLER}
    C -->|webpack| D[Fetch 'webpack' group]
    C -->|rspack| E[Fetch 'rspack' group]
    D --> F[Fetch 'common' group]
    E --> F
    F --> G["compression-webpack-plugin:\n^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0"]
    G --> H{version starts with ^ or ~?}
    H -->|yes| I["Use version string as-is"]
    H -->|no| J["Extract last major version number"]
    I --> K[package_manager.add! production deps]
    J --> K
    K --> L[npm/yarn installs latest matching version → v12.x.x]
Loading

Reviews (1): Last reviewed commit: "docs: add changelog entry" | Re-trigger Greptile

Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/install/package.json`:
- Line 18: The docs still list compression-webpack-plugin support only up to
^11.0.0 while package.json now allows ^12.0.0; update docs/peer-dependencies.md
to include ^12.0.0 for compression-webpack-plugin (or change the wording to
reflect support for ^9–^12) so the documented peer-dependency range matches the
"compression-webpack-plugin" entry in package.json.
🪄 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

Run ID: 559505bd-6420-476a-92a2-d2444698734f

📥 Commits

Reviewing files that changed from the base of the PR and between aacbb99 and 4c25eaa.

📒 Files selected for processing (1)
  • lib/install/package.json

Comment thread lib/install/package.json
@justin808 justin808 merged commit c1990ab into shakacode:main Mar 30, 2026
24 checks passed
@justin808
Copy link
Copy Markdown
Member

@G-Rath thank you!

justin808 pushed a commit that referenced this pull request Mar 30, 2026
### Summary

<!--
Describe the code changes in your pull request here - were there any
bugs you had fixed, features you added, tradeoffs you made?
If so, mention them. If these changes have open GitHub issues, tag them
here as well to keep the conversation linked.
-->

The current logic ends up passing the full constraint range which TIL is
actually valid, but still confusing and ultimately this can be
simplified.

### Pull Request checklist

<!-- If any of the items on this checklist do not apply to the PR, both
check it out and wrap it by `~`. -->

- [x] ~Add/update test to cover these changes~
- [x] ~Update documentation~
- [x] ~Update CHANGELOG file~

### Other Information

<!--
Mention any other important information that might relate to this PR but
that don't belong in the summary,
  like detailed benchmarks or possible follow-up changes.
-->

I came across this while checking out #1035

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved how dependency version constraints are processed during
package installation, ensuring more consistent handling of complex
version specifications.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@G-Rath G-Rath deleted the patch-3 branch March 30, 2026 22:05
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