Skip to content

node v 22#61

Merged
9cb14c1ec0 merged 1 commit intomasterfrom
node-v22
Sep 8, 2025
Merged

node v 22#61
9cb14c1ec0 merged 1 commit intomasterfrom
node-v22

Conversation

@9cb14c1ec0
Copy link
Copy Markdown
Collaborator

@9cb14c1ec0 9cb14c1ec0 commented Sep 8, 2025

Fixes # .

Changes proposed in this pull request

To test (it takes a while): npm install github:<username>/venom#<branch>

Summary by CodeRabbit

  • Chores

    • Updated CI environment to Node.js 22 for builds and tests.
    • Upgraded Node.js type definitions in development dependencies.
  • Refactor

    • Strengthened type safety for chat list retrieval by narrowing its return type to a consistent array, reducing ambiguity. Typed integrations may require minor adjustments.

No user-facing behavior changes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Sep 8, 2025

Walkthrough

Node.js runtime in CI updated from 20.x to 22.x. Dev type defs bumped to @types/node ^22.0.0. WAPI type definition narrowed: getAllChats now returns Promise<Chat[]> instead of Promise<(Chat|object)[]>.

Changes

Cohort / File(s) Summary
CI Runtime Update
\.github/workflows/build.yml
Updated Setup Node.js version from 20.x to 22.x; other steps unchanged.
Dev Dependency Types
package.json
Bumped devDependency @types/node from ^20.19.13 to ^22.0.0; no other changes.
WAPI Type Narrowing
src/types/WAPI.d.ts
Changed getAllChats return type from Promise<Chat[] | object[]> to Promise<Chat[]>.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (1 passed, 1 warning, 1 inconclusive)

❌ Failed Checks (1 warning, 1 inconclusive)
Check Name Status Explanation Resolution
Description Check ⚠️ Warning The description contains placeholder text without any linked issue number, details of the changes, or rationale, making it difficult to understand what this pull request actually implements. Please provide a detailed description summarizing the changes and their purpose, link the correct issue number, outline testing steps in context, and consider adding a pull request template to the repository to ensure future descriptions include all necessary information.
Title Check ❓ Inconclusive The title “node v 22” is related to updating the Node.js version but is vague and doesn’t read as a clear, concise sentence summarizing the overall changes in the pull request. Please revise the title to a concise sentence that clearly states the main change, for example “Bump Node.js to v22 and update @types/node and WAPI.getAllChats signature.”
✅ Passed Checks (1 passed)
Check Name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

Hop hop, I bump the Node to twenty-two,
Types align, the d.ts feels new.
Chats return clean, no shape askew—
Fewer doubts in the typing queue.
Build hops faster, carrots in view! 🥕🐇

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  - Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.
  - Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch node-v22

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.

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

🧹 Nitpick comments (3)
.github/workflows/build.yml (1)

21-37: Speed up and stabilize CI: use setup-node cache + npm ci (and drop the manual cache step).

Built-in caching is simpler and npm ci gives reproducible installs if a lockfile is present.

       - name: Setup Node.js
         uses: actions/setup-node@v5
         with:
-          node-version: '22.x'
+          node-version: '22.x'
+          check-latest: true
+          cache: 'npm'
 
-      - name: Cache npm dependencies
-        id: npm-cache
-        uses: actions/cache@v4
-        with:
-          path: ~/.npm
-          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
-          restore-keys: ${{ runner.os }}-node-
+      # Caching handled by setup-node
 
       - name: Install dependencies and build
-        run: npm install
+        run: npm ci
         env:
           PUPPETEER_SKIP_DOWNLOAD: 'true'
package.json (1)

69-69: @types/node → ^22: verify TS config and consider engines.

  • Ensure tsconfig libs don’t clash with Node 22 globals (e.g., DOM types).
  • Consider declaring supported runtimes to help consumers.

Example engines snippet (add near top-level):

"engines": {
  "node": ">=18.17 || >=20.3 || >=22"
}
src/types/WAPI.d.ts (1)

39-41: Narrowed return type may be breaking; document and confirm runtime contract.

If any callers relied on object[], this is a silent break. Add a note and ensure the produced values conform to Chat.

-  getAllChats: () => Promise<Chat[]>;
+  /**
+   * Return type narrowed from Promise<(Chat|object)[]> to Promise<Chat[]>.
+   * Ensure upstream serialization returns Chat-shaped objects.
+   */
+  getAllChats: () => Promise<Chat[]>;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90c575d and f687e1d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • .github/workflows/build.yml (1 hunks)
  • package.json (1 hunks)
  • src/types/WAPI.d.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/types/WAPI.d.ts (1)
src/api/model/chat.ts (1)
  • Chat (5-31)

@9cb14c1ec0 9cb14c1ec0 merged commit b426eff into master Sep 8, 2025
3 checks passed
@9cb14c1ec0 9cb14c1ec0 deleted the node-v22 branch September 8, 2025 21:25
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