Skip to content

fix: target ES2020 for Node <15 compatibility#32

Merged
JounQin merged 2 commits intomainfrom
fix/target
May 13, 2025
Merged

fix: target ES2020 for Node <15 compatibility#32
JounQin merged 2 commits intomainfrom
fix/target

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented May 13, 2025

close #31


Important

Fix capitalization in URL for [JounQin] link in README.md.

  • Documentation:
    • Fix capitalization in URL for [JounQin] link in README.md.

This description was created by Ellipsis for 6dece47. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • Bug Fixes

    • Resolved compatibility issues with Node.js versions earlier than 15 by updating the ECMAScript target to ES2020.
  • Documentation

    • Corrected the casing in a URL within the README for consistency and accuracy.

@JounQin JounQin requested a review from Copilot May 13, 2025 05:35
@JounQin JounQin self-assigned this May 13, 2025
@JounQin JounQin added the bug Something isn't working label May 13, 2025
@changeset-bot
Copy link

changeset-bot bot commented May 13, 2025

🦋 Changeset detected

Latest commit: 70d767e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
napi-postinstall Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented May 13, 2025

Walkthrough

The changes update the TypeScript target from ES2021 to ES2020 in the configuration file, add a changeset documenting this update for the napi-postinstall package, and correct the casing of a URL in the README. These modifications aim to improve compatibility with older Node.js versions.

Changes

File(s) Change Summary
tsconfig.json Changed TypeScript target from ES2021 to ES2020.
.changeset/wet-bottles-boil.md Added changeset documenting the patch to fix ECMAScript target for compatibility with Node.js < 15.
README.md Corrected the casing in a markdown link URL for the [JounQin] reference.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant tsconfig.json
    participant Node.js

    Developer->>tsconfig.json: Set target to ES2020
    tsconfig.json-->>Node.js: Compiled output uses ES2020 features
    Node.js-->>Developer: Ensures compatibility with Node < 15
Loading

Assessment against linked issues

Objective Addressed Explanation
Ensure compatibility with Node < 15 by targeting ES2020 and avoiding ES2021 features (#31)

Possibly related PRs

Poem

A hop and a skip, a version we flip,
ES2021 to 2020—let’s not let support slip!
Now older Nodes can join the fun,
With URLs neat and changes done.
🐇✨
“Patch in the meadow, code on the run—
Compatibility for everyone!”

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd27f65 and 70d767e.

📒 Files selected for processing (3)
  • .changeset/wet-bottles-boil.md (1 hunks)
  • README.md (1 hunks)
  • tsconfig.json (1 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/wet-bottles-boil.md

[grammar] ~5-~5: After the number ‘15’, use a plural noun. Did you mean “compatibilities”?
Context: ... --- fix: target ES2020 for Node <15 compatibility

(CD_NNU)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Lint and Test with Node.js 20 on windows-latest
  • GitHub Check: Lint and Test with Node.js 22 on windows-latest
  • GitHub Check: Lint and Test with Node.js 18 on windows-latest
🔇 Additional comments (3)
tsconfig.json (1)

10-10:

Details

❓ Verification inconclusive

Verify ES2020 target and lib settings.

Updating from "ES2021" to "ES2020" rightly aligns with Node.js <15 support. Please ensure that all language features you rely on (e.g., optional chaining, nullish coalescing) are covered by the ES2020 lib. If you use newer APIs, consider adding appropriate entries to "lib" (for example, "ES2020.String").

Run:

to confirm your lib settings include needed ECMAScript features.


🏁 Script executed:

rg -n '"lib"' -n tsconfig.json

Length of output: 32


🏁 Script executed:

#!/bin/bash
# Search for any explicit "lib" settings in all tsconfig files
rg -n '"lib"' -g "tsconfig*.json"

# Check if tsconfig.json extends another config that may define "lib"
rg -n '"extends"' -g "tsconfig*.json"

Length of output: 166


Verify ES2020 lib configuration across extended TS configs

I didn’t find any explicit "lib" entries in your local tsconfig.json or src/tsconfig.json, yet you’re targeting ES2020 by extending @1stg/tsconfig/node. Please confirm that the base config includes all ES2020 APIs you rely on (optional chaining, nullish coalescing, String.prototype.replaceAll, etc.). If it doesn’t, add an explicit "lib": ["ES2020"] (and any other required libs) to your root or project tsconfig.

To verify, run:

rg -n '"lib"' -g 'tsconfig*.json'
rg -n '"lib"' -g 'node_modules/@1stg/tsconfig'
.changeset/wet-bottles-boil.md (1)

1-6: Approve changeset content.

The front matter correctly specifies a patch version bump and the summary succinctly describes the ES2020 targeting fix for Node <15 compatibility. Formatting and grammar look good.

🧰 Tools
🪛 LanguageTool

[grammar] ~5-~5: After the number ‘15’, use a plural noun. Did you mean “compatibilities”?
Context: ... --- fix: target ES2020 for Node <15 compatibility

(CD_NNU)

README.md (1)

131-131: Approve URL casing fix.

Changing https://GitHub.com/JounQin to https://github.com/JounQin standardizes link casing and prevents potential redirect issues.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to fix the target configuration for ES2020 to ensure compatibility with Node versions earlier than 15 and includes documentation updates.

  • Updated the target configuration to ES2020 for Node <15 compatibility.
  • Corrected the URL capitalization for the JounQin link in the README.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 6dece47 in 28 seconds. Click for details.
  • Reviewed 11 lines of code in 1 files
  • Skipped 1 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. README.md:128
  • Draft comment:
    Minor fix: Corrected URL case for JounQin to use lowercase 'github.com' for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. README.md:131
  • Draft comment:
    Typographical error: The URL for [JounQin] was updated to use lowercase 'github.com' instead of 'GitHub.com'. This correction ensures consistency and avoids potential issues with case-sensitive systems.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, pointing out a typographical change in a URL. It doesn't suggest any code changes or improvements, nor does it ask for confirmation of intent or testing. It simply informs about a change that was made.

Workflow ID: wflow_DUV8mSSHD2WJkPvZ

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@pkg-pr-new
Copy link

pkg-pr-new bot commented May 13, 2025

Open in StackBlitz

npm i https://pkg.pr.new/napi-postinstall@32

commit: 70d767e

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
lib/index.js 2.76 KB (0%)

@github-actions
Copy link
Contributor

Deploy preview for napi-postinstall ready!

✅ Preview
https://napi-postinstall-gxalgo9sx-1stg.vercel.app

Built with commit 6dece47.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link
Contributor

📊 Package size report   0.2%↑

File Before After
lib/helpers.js 7.4 kB 0.5%↑7.4 kB
lib/helpers.js.map 6.5 kB 0.6%↑6.6 kB
Total (Includes all files) 51.9 kB 0.2%↑52.0 kB
Tarball size 14.3 kB 0.1%↑14.3 kB
Unchanged files
File Size
lib/cli.d.ts 31 B
lib/cli.js 306 B
lib/cli.js.map 317 B
lib/constants.d.ts 412 B
lib/constants.js 703 B
lib/constants.js.map 519 B
lib/helpers.d.ts 841 B
lib/index.d.ts 415 B
lib/index.js 10.4 kB
lib/index.js.map 8.9 kB
lib/target.d.ts 101 B
lib/target.js 1.6 kB
lib/target.js.map 1.5 kB
lib/types.d.ts 825 B
lib/types.js 110 B
lib/types.js.map 102 B
LICENSE 1.1 kB
package.json 3.4 kB
README.md 6.4 kB

🤖 This report was automatically generated by pkg-size-action

@codecov
Copy link

codecov bot commented May 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.41%. Comparing base (dd27f65) to head (70d767e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #32   +/-   ##
=======================================
  Coverage   34.41%   34.41%           
=======================================
  Files           6        6           
  Lines         587      587           
  Branches       57       57           
=======================================
  Hits          202      202           
  Misses        385      385           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JounQin JounQin merged commit 6195df6 into main May 13, 2025
16 checks passed
@JounQin JounQin deleted the fix/target branch May 13, 2025 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not compatible with Node < 15

2 participants