Skip to content

PP-2787 fix(deps): Security Updates, Dependency Upgrades & Cursor Rules - #51

Merged
sergak01 merged 5 commits into
developfrom
pp-2787-updates
Feb 23, 2026
Merged

PP-2787 fix(deps): Security Updates, Dependency Upgrades & Cursor Rules#51
sergak01 merged 5 commits into
developfrom
pp-2787-updates

Conversation

@sergak01

@sergak01 sergak01 commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

This PR addresses security vulnerabilities (minimatch ReDoS), upgrades dependencies across the root package and all templates, adds npm/Node engine requirements, introduces a postbuild script for pack artifacts, and adds Cursor rules for PR and release workflows.

✨ Key Features & Improvements

  • Security Fix - Add npm overrides for minimatch ^10.2.2 to fix ReDoS vulnerability (GHSA-3ppc-4f35-3m26) across all transitive dependencies
  • @clack/prompts - Upgrade from ^0.7.0 to ^1.0.1 for vulnerability fix
  • Template Upgrades - Upgrade all template packages to latest versions (@metricinsights/pp-dev, typescript-eslint, eslint, prettier, typescript, etc.)
  • Engine Requirements - Set node >=22.0.0 and npm >=10.0.0 in root and all templates
  • Postbuild Script - Add scripts/postbuild.js to copy pack tarball as latest.tgz
  • Cursor Rules - Add Create PR and Create release workflow rules for AI-assisted PR/release creation

📊 Impact Summary

  • 10 files changed with security and dependency improvements
  • 755 insertions, 871 deletions - Net reduction from lockfile deduplication
  • 4 templates updated - React, Next.js, Vanilla, Vanilla-TS

🔄 Breaking Changes

  • Node 22+ required - Minimum Node version raised from 18 to 22 across all packages
  • npm 10+ required - Needed for overrides support

🧪 Testing & Quality Assurance

  • npm audit reports 0 vulnerabilities after changes
  • npm run build succeeds with postbuild pack + copy
  • Templates include minimatch override for downstream projects

📝 Included Commits

  • ee27478 fix(deps): add minimatch override and upgrade packages for security
  • 14141f8 chore: add postbuild script and gitignore for latest tgz
  • 029973e feat(cursor): add Create PR and Create release rules

🏷️ Release Notes

  • Resolves 14 high-severity minimatch vulnerabilities
  • Aligns templates with latest stable dependencies
  • Improves developer workflow with Cursor rules

✅ Ready for develop

  • All changes tested and verified
  • No breaking changes to template API or CLI behavior

Merge Request: pp-2787-updatesorigin/develop
Status: Ready for Review ✅

Summary by CodeRabbit

  • New Features

    • Enhanced input validation for project and package names to handle edge cases more robustly.
  • Chores

    • Updated minimum Node.js requirement to 22.0.0 and npm to 10.0.0.
    • Updated development dependencies and tooling versions for improved build and linting capabilities.

- Add npm overrides for minimatch ^10.2.2 to fix ReDoS vulnerability
- Upgrade @clack/prompts to ^1.0.1
- Upgrade template packages to latest versions
- Set node >=22.0.0 and npm >=10.0.0 in engines for all packages
@sergak01 sergak01 self-assigned this Feb 23, 2026
- Fix validate callbacks to accept string | undefined
- Fix p.select generic (use single Framework type arg)
- Fix pkgJson.dependencies for vanilla templates (no deps key)
- Fix spawn.sync: pass command and args separately for install
@coderabbitai

coderabbitai Bot commented Feb 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pp-2787-updates

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.

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

🧹 Nitpick comments (2)
scripts/postbuild.js (2)

12-20: Consider potential edge case with stale tarballs.

The script finds all .tgz files matching the package name and selects the latest by modification time. If stale tarballs from previous builds accumulate in the root directory, they won't cause issues due to the mtime sorting, but they may clutter the directory over time.

Consider adding cleanup of old tarballs or documenting that developers should periodically clean them. This is optional and doesn't block the PR.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/postbuild.js` around lines 12 - 20, The tgzFiles collection (built
using readdirSync, filter by .tgz and packName, mapped with statSync mtime and
sorted) can leave stale tarballs that clutter rootDir; update the script after
building to remove older artifacts by keeping only the most recent N entries
from tgzFiles (e.g., 1 or configurable retention) and unlinking the rest (use
fs.unlinkSync or fs.promises.unlink) with proper error handling and a short log
message, or alternatively add a documented note about manual cleanup if you
prefer not to auto-delete.

31-31: Regex handles common semver patterns but has a minor limitation.

The regex /-[\d.]+(-[a-z0-9.-]+)?\.tgz$/ correctly handles versions like 1.0.0, 0.5.5-beta.2, etc. However, the prerelease pattern [a-z0-9.-]+ only matches lowercase letters. While semver technically allows uppercase in prerelease identifiers (e.g., 1.0.0-RC.1), this is uncommon in npm packages.

For robustness, consider using case-insensitive matching:

♻️ Optional: Support uppercase prerelease identifiers
-const latestNameNew = latestName.replace(/-[\d.]+(-[a-z0-9.-]+)?\.tgz$/, "-latest.tgz");
+const latestNameNew = latestName.replace(/-[\d.]+(-[a-z0-9.-]+)?\.tgz$/i, "-latest.tgz");

Or explicitly include uppercase:

-const latestNameNew = latestName.replace(/-[\d.]+(-[a-z0-9.-]+)?\.tgz$/, "-latest.tgz");
+const latestNameNew = latestName.replace(/-[\d.]+(-[a-zA-Z0-9.-]+)?\.tgz$/, "-latest.tgz");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/postbuild.js` at line 31, The regex used to build latestNameNew
(const latestNameNew = latestName.replace(/-[\d.]+(-[a-z0-9.-]+)?\.tgz$/,
"-latest.tgz")) only matches lowercase prerelease identifiers; update the
replace call to allow uppercase prerelease identifiers by making the regex
case-insensitive (add the i flag) or expand the character class (e.g.,
[A-Za-z0-9.-]) so 1.0.0-RC.1 and similar tags are handled correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.cursor/rules/create-pr.mdc:
- Around line 33-40: Update the example PR message in
.cursor/rules/create-pr.mdc by changing the commit type header "## 🚀 feat: Add
minimatch override for security" to use the correct maintenance type (e.g., "##
🚧 chore: Add minimatch override for security") and expand the body to include
the required sections: Summary (2–3 sentences), Key Features & Improvements,
Impact Summary (file/code stats), Breaking Changes, Testing & Quality Assurance,
Included Commits, Release Notes, and Ready for [Target] status so the template
enforces required content and correct commit type for dependency/security
maintenance.

In @.cursor/rules/create-release.mdc:
- Around line 8-37: The release rule currently instructs manual tagging and
pushing (git fetch/git tag/git push); update it to align with semantic-release
by removing the manual tag/push commands and replacing Steps 4–5 with guidance
to trigger the semantic-release workflow from a merged PR (ensuring releases are
created by semantic-release on origin/main), and add a verification step to
check the tag created by semantic-release on origin/main; reference the existing
rule headings/steps ("Read version from package.json", "Strip beta suffix", "Tag
name", and the current "Create tag on latest origin/main"/"Push tag") so the
manual commands are replaced with "Use semantic-release" and "Verify tag"
instructions.

---

Nitpick comments:
In `@scripts/postbuild.js`:
- Around line 12-20: The tgzFiles collection (built using readdirSync, filter by
.tgz and packName, mapped with statSync mtime and sorted) can leave stale
tarballs that clutter rootDir; update the script after building to remove older
artifacts by keeping only the most recent N entries from tgzFiles (e.g., 1 or
configurable retention) and unlinking the rest (use fs.unlinkSync or
fs.promises.unlink) with proper error handling and a short log message, or
alternatively add a documented note about manual cleanup if you prefer not to
auto-delete.
- Line 31: The regex used to build latestNameNew (const latestNameNew =
latestName.replace(/-[\d.]+(-[a-z0-9.-]+)?\.tgz$/, "-latest.tgz")) only matches
lowercase prerelease identifiers; update the replace call to allow uppercase
prerelease identifiers by making the regex case-insensitive (add the i flag) or
expand the character class (e.g., [A-Za-z0-9.-]) so 1.0.0-RC.1 and similar tags
are handled correctly.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ca7135 and b994e40.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (10)
  • .cursor/rules/create-pr.mdc
  • .cursor/rules/create-release.mdc
  • .gitignore
  • package.json
  • scripts/postbuild.js
  • src/index.ts
  • template-nextjs/package.json
  • template-react/package.json
  • template-vanilla-ts/package.json
  • template-vanilla/package.json

Comment thread .cursor/rules/create-pr.mdc
Comment thread .cursor/rules/create-release.mdc
@sergak01
sergak01 merged commit bdd109d into develop Feb 23, 2026
2 checks passed
@sergak01
sergak01 deleted the pp-2787-updates branch February 23, 2026 12:44
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.

1 participant