Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove semver and depd #113

Merged
merged 2 commits into from
Jun 3, 2024
Merged

feat: remove semver and depd #113

merged 2 commits into from
Jun 3, 2024

Conversation

fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Jun 3, 2024

https://security.snyk.io/package/npm/semver

eggjs/egg-bin#270

Summary by CodeRabbit

  • New Features

    • Added a new script to manage contributors automatically in the project.
  • Documentation

    • Updated README to include a list of contributors with their GitHub profiles and avatars.
  • Refactor

    • Replaced deprecated message logging with console.warn for HTTPS configuration.
    • Removed semver dependency and simplified related logic in the project.
  • Chores

    • Updated Node.js CI workflow to include an additional Node.js version and added CODECOV_TOKEN secret.
    • Updated semver version in package.json and added git-contributor dependency.

Copy link

coderabbitai bot commented Jun 3, 2024

Warning

Rate limit exceeded

@fengmk2 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 39 minutes and 50 seconds before requesting another review.

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.

Commits

Files that changed from the base of the PR and between 0cc2ae2 and 455dd8b.

Walkthrough

The recent updates include adding a CODECOV_TOKEN secret and support for Node.js version 22 in the CI workflow, enhancing contributor visibility in the README, replacing deprecate with console.warn for HTTPS configuration in options.js, updating dependencies and scripts in package.json, and removing semver dependencies in favor of simplified logic in agent.js and test files.

Changes

File Change Summary
.github/workflows/nodejs.yml Added CODECOV_TOKEN secret for node-test job and specified Node.js version 22.
README.md Added contributor list with GitHub profiles and a project update note.
lib/utils/options.js Replaced deprecate with console.warn for HTTPS configuration deprecation message.
package.json Added git-contributor script, updated semver version, added git-contributor dependency.
lib/utils/mode/impl/process/... Removed semver dependency and simplified debug port handling logic in agent.js.
test/master.test.js Removed semver dependency and simplified debugProtocol logic to always use 'inspect'.

Poem

In the code where changes bloom,
Secrets and versions find their room.
Contributors shine with pride and grace,
Deprecations warned, no trace to chase.
Dependencies trimmed, the logic clear,
Our project grows, year by year.
🌟🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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

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

Outside diff range and nitpick comments (3)
package.json (1)

12-12: Add a description for the new "contributor" script in the scripts section.

It would be helpful for maintainability and clarity to include a brief comment or description in the package.json explaining the purpose of the "contributor" script.

lib/utils/options.js (2)

63-63: Clarify the purpose of setting NO_DEPRECATION in the production environment.

The comment could be expanded to explain why deprecation messages are suppressed in production, helping future maintainers understand the decision.


Line range hint 1-1: Consider modernizing the JavaScript syntax and module imports.

- 'use strict';
- const os = require('os');
- const fs = require('fs');
- const path = require('path');
- const assert = require('assert');
+ import os from 'node:os';
+ import fs from 'node:fs';
+ import path from 'node:path';
+ import assert from 'node:assert';

Convert the function expression to an arrow function to enhance readability and align with modern JavaScript practices.

Also applies to: 3-6, 10-73

Tools
Biome

[error] 6-6: A Node.js builtin module should be imported with the node: protocol.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 72f7b33 and 1ef5e79.

Files selected for processing (4)
  • .github/workflows/nodejs.yml (2 hunks)
  • README.md (1 hunks)
  • lib/utils/options.js (3 hunks)
  • package.json (3 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/nodejs.yml
Additional context used
Biome
lib/utils/options.js

[error] 1-1: Redundant use strict directive.


[error] 3-3: A Node.js builtin module should be imported with the node: protocol.


[error] 4-4: A Node.js builtin module should be imported with the node: protocol.


[error] 5-5: A Node.js builtin module should be imported with the node: protocol.


[error] 6-6: A Node.js builtin module should be imported with the node: protocol.


[error] 10-73: This function expression can be turned into an arrow function.


[error] 22-22: Reassigning a function parameter is confusing.


[error] 59-59: Use Number.parseInt instead of the equivalent global.


[error] 60-60: Use Number.parseInt instead of the equivalent global.

LanguageTool
README.md

[uncategorized] ~38-~38: Possible missing article found.
Context: ...fy a callback that will be invoked when application has started. However, master process wi...


[typographical] ~61-~61: Do not use a colon (:) before a series that is introduced by a preposition (‘as’). Remove the colon or add a noun or a noun phrase after the preposition.
Context: ...| startup port of each app worker, such as: [7001, 7002, 7003], only effects when t...


[uncategorized] ~84-~84: It appears that a hyphen is missing (if ‘auto’ is not used in the context of ‘cars’).
Context: ...//github.com/xudafeng/git-contributor), auto updated at Mon Jun 03 2024 10:59:15 GMT+0800....

Markdownlint
README.md

78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


82-82: null
Images should have alternate text (alt text)


82-82: null
Images should have alternate text (alt text)


82-82: null
Images should have alternate text (alt text)


82-82: Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe
Table pipe style


82-82: Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe
Table pipe style


82-82: Expected: 6; Actual: 3; Too few cells, row will be missing data
Table column count

Additional comments not posted (2)
package.json (2)

44-44: Update to [email protected] aligns with security enhancements.

This update addresses the security concerns mentioned in the PR description and is a crucial upgrade.


58-58: Addition of git-contributor to devDependencies.

This addition supports the new "contributor" script and aligns with the changes made in the README.md to automate contributor listings.

README.md Show resolved Hide resolved
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 92.52%. Comparing base (5d1f5d0) to head (455dd8b).
Report is 1 commits behind head on master.

Files Patch % Lines
lib/utils/options.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #113      +/-   ##
==========================================
- Coverage   92.57%   92.52%   -0.05%     
==========================================
  Files          15       15              
  Lines        2021     2021              
  Branches      338      336       -2     
==========================================
- Hits         1871     1870       -1     
- Misses        150      151       +1     

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

Copy link

socket-security bot commented Jun 3, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] environment, shell Transitive: filesystem +46 5.52 MB xudafeng

View full report↗︎

@fengmk2 fengmk2 changed the title feat: use semver@7 and remove depd feat: remove semver and depd Jun 3, 2024
Copy link

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

Outside diff range and nitpick comments (1)
test/master.test.js (1)

Line range hint 1-5: Update imports to use the node: protocol for built-in modules.

- const path = require('path');
- const assert = require('assert');
- const fs = require('fs');
- const { rm } = require('fs/promises');
- const cp = require('child_process');
+ const path = require('node:path');
+ const assert = require('node:assert');
+ const fs = require('node:fs');
+ const { rm } = require('node:fs/promises');
+ const cp = require('node:child_process');
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1ef5e79 and 0cc2ae2.

Files selected for processing (6)
  • .github/workflows/nodejs.yml (2 hunks)
  • README.md (1 hunks)
  • lib/utils/mode/impl/process/agent.js (2 hunks)
  • lib/utils/options.js (3 hunks)
  • package.json (3 hunks)
  • test/master.test.js (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/nodejs.yml
  • package.json
Additional context used
Biome
lib/utils/options.js

[error] 1-1: Redundant use strict directive.


[error] 3-3: A Node.js builtin module should be imported with the node: protocol.


[error] 4-4: A Node.js builtin module should be imported with the node: protocol.


[error] 5-5: A Node.js builtin module should be imported with the node: protocol.


[error] 6-6: A Node.js builtin module should be imported with the node: protocol.


[error] 10-73: This function expression can be turned into an arrow function.


[error] 22-22: Reassigning a function parameter is confusing.


[error] 59-59: Use Number.parseInt instead of the equivalent global.


[error] 60-60: Use Number.parseInt instead of the equivalent global.

lib/utils/mode/impl/process/agent.js

[error] 1-1: Redundant use strict directive.


[error] 3-3: A Node.js builtin module should be imported with the node: protocol.


[error] 49-49: The assignment should not be in an expression.


[error] 50-50: The assignment should not be in an expression.

test/master.test.js

[error] 1-1: A Node.js builtin module should be imported with the node: protocol.


[error] 2-2: A Node.js builtin module should be imported with the node: protocol.


[error] 3-3: A Node.js builtin module should be imported with the node: protocol.


[error] 4-4: A Node.js builtin module should be imported with the node: protocol.


[error] 5-5: A Node.js builtin module should be imported with the node: protocol.


[error] 19-19: Change to an optional chain.


[error] 282-282: Change to an optional chain.


[error] 283-283: Change to an optional chain.


[error] 318-318: Change to an optional chain.


[error] 320-320: Change to an optional chain.


[error] 352-352: Change to an optional chain.


[error] 354-354: Change to an optional chain.

LanguageTool
README.md

[uncategorized] ~38-~38: Possible missing article found.
Context: ...fy a callback that will be invoked when application has started. However, master process wi...


[typographical] ~61-~61: Do not use a colon (:) before a series that is introduced by a preposition (‘as’). Remove the colon or add a noun or a noun phrase after the preposition.
Context: ...| startup port of each app worker, such as: [7001, 7002, 7003], only effects when t...


[uncategorized] ~84-~84: It appears that a hyphen is missing (if ‘auto’ is not used in the context of ‘cars’).
Context: ...//github.com/xudafeng/git-contributor), auto updated at Mon Jun 03 2024 10:59:15 GMT+0800....

Markdownlint
README.md

78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


78-78: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


80-80: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


81-81: null
Images should have alternate text (alt text)


82-82: null
Images should have alternate text (alt text)


82-82: null
Images should have alternate text (alt text)


82-82: null
Images should have alternate text (alt text)


82-82: Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing leading pipe
Table pipe style


82-82: Expected: leading_and_trailing; Actual: no_leading_or_trailing; Missing trailing pipe
Table pipe style


82-82: Expected: 6; Actual: 3; Too few cells, row will be missing data
Table column count

Additional comments not posted (3)
lib/utils/options.js (1)

63-63: Ensure deprecation messages are suppressed in production.

The addition of the environment check to suppress deprecation messages in production is a good practice. It helps in keeping the logs clean and focused on critical issues.

lib/utils/mode/impl/process/agent.js (1)

47-47: Simplify debug port handling.

The simplification of the debug port handling by always using the inspect option is a good change. It reduces complexity and potential errors in managing different debug configurations.

test/master.test.js (1)

691-691: Removal of semver dependency is clean and aligns with PR objectives.

test/master.test.js Show resolved Hide resolved
lib/utils/options.js Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
@fengmk2 fengmk2 merged commit 789a1cd into master Jun 3, 2024
13 of 15 checks passed
@fengmk2 fengmk2 deleted the deps branch June 3, 2024 03:31
fengmk2 pushed a commit that referenced this pull request Jun 3, 2024
[skip ci]

## [2.3.0](v2.2.1...v2.3.0) (2024-06-03)

### Features

* remove semver and depd ([#113](#113)) ([789a1cd](789a1cd))
@coderabbitai coderabbitai bot mentioned this pull request Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant