Skip to content

build: add Node.js engines constraint requirement in package.json#726

Closed
Rish-2006 wants to merge 2 commits into
Karanjot786:mainfrom
Rish-2006:patch-3
Closed

build: add Node.js engines constraint requirement in package.json#726
Rish-2006 wants to merge 2 commits into
Karanjot786:mainfrom
Rish-2006:patch-3

Conversation

@Rish-2006
Copy link
Copy Markdown
Contributor

@Rish-2006 Rish-2006 commented Jun 4, 2026

Closes #725

Summary by CodeRabbit

  • Chores
    • Updated development tooling configuration to include an automated code formatting script.

@Rish-2006 Rish-2006 requested a review from Karanjot786 as a code owner June 4, 2026 17:31
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a new format npm script to package.json that runs Prettier across the repository. The script enables developers to format code consistently using npm run format.

Changes

Prettier format script

Layer / File(s) Summary
Format script addition
package.json
Adds scripts.format entry executing prettier --write "." to format repository files with Prettier.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

quality:clean

Suggested reviewers

  • Karanjot786

Poem

A formatting script takes its place, 🐰
Prettier keeps the code space clean and bright,
No more messy indents in the race,
DevOps dreams come true every night! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete. It only includes 'Closes #725' but omits most required template sections including description, type of change, and checklist items. Complete the PR description by filling in all required sections: add a 1-3 sentence description of the change, select the appropriate type of change, and complete the checklist verification items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a Node.js engines constraint to package.json, which is directly reflected in the modifications shown in the raw summary.
Linked Issues check ✅ Passed The PR meets the requirement from issue #725 to add an engines field constraint to package.json to specify required Node.js versions.
Out of Scope Changes check ✅ Passed All changes are in-scope: the package.json modification adds the Node.js engines constraint as specified in issue #725 with no unrelated alterations detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions github-actions Bot added the type:devops +15 pts. CI, build, or release. label Jun 4, 2026
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: 2

🤖 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 18: package.json's scripts.format references "prettier" but prettier is
not listed in dependencies/devDependencies; add prettier to devDependencies
(e.g., run `bun add -d prettier@latest` or add a "prettier": "<version>" entry
under devDependencies in package.json) so that `bun run format` succeeds; ensure
the package.json key affected is devDependencies and leave the existing "format"
script unchanged.
- Around line 20-22: The package.json contains a duplicate "engines" key; remove
the earlier/first "engines" declaration so only the complete "engines" object
(the one that includes both "bun" and "node" constraints) remains, ensuring
there is a single "engines" key 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 52447b10-1a57-443c-b819-49c4780ed070

📥 Commits

Reviewing files that changed from the base of the PR and between f90f75c and ac6818d.

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

Comment thread package.json
"bench": "bun packages/core/src/benchmark/render-loop.ts",
"clean": "turbo run clean && rm -rf node_modules"
"clean": "turbo run clean && rm -rf node_modules",
"format": "prettier --write \".\""
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 | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if prettier is declared in package.json dependencies

cat package.json | jq -r '.devDependencies.prettier // .dependencies.prettier // "NOT_FOUND"'

Repository: Karanjot786/TermUI

Length of output: 72


Add missing prettier dependency for bun run format

  • package.json references prettier in scripts.format, but prettier is not declared in either dependencies or devDependencies (jq result: NOT_FOUND), so bun run format will fail without it.
🤖 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 18, package.json's scripts.format references "prettier"
but prettier is not listed in dependencies/devDependencies; add prettier to
devDependencies (e.g., run `bun add -d prettier@latest` or add a "prettier":
"<version>" entry under devDependencies in package.json) so that `bun run
format` succeeds; ensure the package.json key affected is devDependencies and
leave the existing "format" script unchanged.

Comment thread package.json
Comment on lines +20 to 22
"engines": {
"node": ">=18.0.0"
},
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 | ⚡ Quick win

Remove duplicate engines key.

The engines field is declared twice in package.json (lines 20-22 and lines 33-36). JSON does not allow duplicate keys in the same object. Most parsers will use the last occurrence (lines 33-36), making this first declaration dead code.

🐛 Proposed fix: Remove the first engines block
-  },
-  "engines": {
-    "node": ">=18.0.0"
   },
   "devDependencies": {

The complete engines block at lines 33-36 already declares both bun and node constraints.

🧰 Tools
🪛 Biome (2.4.16)

[error] 20-20: The key engines was already declared.

(lint/suspicious/noDuplicateObjectKeys)

🤖 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` around lines 20 - 22, The package.json contains a duplicate
"engines" key; remove the earlier/first "engines" declaration so only the
complete "engines" object (the one that includes both "bun" and "node"
constraints) remains, ensuring there is a single "engines" key in package.json.

@Karanjot786 Karanjot786 added gssoc:approved Approved PR. Earns +50 base points. quality:clean x 1.2 multiplier. Clean implementation. level:beginner +20 pts. Entry-level task. labels Jun 5, 2026
@Karanjot786
Copy link
Copy Markdown
Owner

Review: prettier not declared

Your format script calls prettier but prettier is missing from devDependencies. Fresh installs and CI will fail.

Add it to root package.json:

"devDependencies": {
    "prettier": "^3.3.0"
}

Also remove the duplicate engines key flagged at lines 20-22.

@Karanjot786
Copy link
Copy Markdown
Owner

Closing — both the format script and the engines.node constraint are already on main (merged via #723 and a prior commit). No new changes remain.

@Karanjot786 Karanjot786 closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved PR. Earns +50 base points. level:beginner +20 pts. Entry-level task. quality:clean x 1.2 multiplier. Clean implementation. type:devops +15 pts. CI, build, or release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: add Node.js engines constraint requirement in package.json

2 participants