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: support cjs and esm both by tshy #26

Merged
merged 2 commits into from
Feb 4, 2025
Merged

feat: support cjs and esm both by tshy #26

merged 2 commits into from
Feb 4, 2025

Conversation

fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Feb 4, 2025

BREAKING CHANGE: drop Node.js < 18.19.0 support

part of eggjs/egg#3644

eggjs/egg#5257

Summary by CodeRabbit

  • Documentation

    • Updated README featuring refreshed badges, streamlined installation instructions, and added sections for questions and contributor information.
  • New Features

    • Rebranded the package under the new namespace (@eggjs/…) to simplify installation and usage.
  • Configuration Updates

    • Enhanced the default plugin configuration to align with modern standards for a smoother integration experience.

BREAKING CHANGE: drop Node.js < 18.19.0 support

part of eggjs/egg#3644

eggjs/egg#5257
Copy link

coderabbitai bot commented Feb 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request makes extensive configuration updates and file reorganizations across the repository. ESLint configurations are modified to include additional rules and TypeScript support. Several GitHub Actions workflows are added, updated, or removed for CI, CodeQL analysis, and release processes. Documentation and package metadata are revised for rebranding and dependency updates. Test files, TypeScript configurations, and minor code adjustments like removing strict mode directives are also included.

Changes

File(s) Change Summary
.eslintrc, boilerplate/.eslintrc Updated ESLint configuration: replaced single extension with an array including additional rules (enforce-node-prefix) and, in the boilerplate, added TypeScript support.
.github/PULL_REQUEST_TEMPLATE.md, boilerplate/.github/PULL_REQUEST_TEMPLATE.md Removed pull request template files.
.github/workflows/codeql.yml Removed CodeQL workflow configuration.
.github/workflows/nodejs.yml, boilerplate/.github/workflows/nodejs.yml Updated/renamed CI workflow (from "Node.js CI" to "CI") to use an external reusable workflow with specified OS and Node.js versions.
.github/workflows/release.yml, boilerplate/.github/workflows/release.yml Added new release workflow using an external workflow and configured secrets for NPM and Git authentication.
README.md, boilerplate/README.md Updated documentation: added Node.js CI badge, new sections (Questions & Suggestions, License, Contributors), rebranded package name (egg-{{name}}@eggjs/{{name}}), and updated configuration file references.
boilerplate/.eslintignore Added new ignore entries: test/fixtures and __snapshots__.
package.json, boilerplate/_package.json Revised package configuration: package name updated to scoped @eggjs/{{name}}, publishConfig added, dependencies/scripts modified, and unused dependencies removed.
boilerplate/config/config.default.js, boilerplate/src/config/config.default.ts Removed the JavaScript default config file and introduced a TypeScript configuration with a new plugin interface and default settings.
boilerplate/src/typings/index.d.ts Added an import for the 'egg' typings to support proper TypeScript declaration merging.
boilerplate/test/fixtures/apps/example/... Minor test file changes: logging added to controller; removal of 'use strict'; in router and config files.
boilerplate/test/index.test.js, boilerplate/test/index.test.ts Replaced a JavaScript test file with a new TypeScript test suite using @eggjs/mock.
boilerplate/tsconfig.json Added a new TypeScript configuration file extending @eggjs/tsconfig with strict type-checking and ES2022 target.
index.js Removed 'use strict'; directive from the main module.

Sequence Diagram(s)

sequenceDiagram
    participant Commit as Git Commit
    participant CI as CI Workflow (nodejs.yml)
    participant External as External Node Test Workflow
    Commit->>CI: Push/Pull Request on master
    CI->>External: Trigger tests on Ubuntu, macOS, Windows (Node 18,20,22)
    External-->>CI: Return test results
    CI-->>Commit: Report CI status
Loading
sequenceDiagram
    participant Push as Commit/Push to master
    participant Release as Release Workflow (release.yml)
    participant ExRelease as External Release Workflow
    Push->>Release: Trigger release process
    Release->>ExRelease: Execute release using NPM and Git tokens
    ExRelease-->>Release: Complete release tasks
    Release-->>Push: Report release outcome
Loading

Poem

I’m a hopping rabbit full of glee,
Skipping through changes in our repository.
New workflows and configs, oh my, so neat,
With badges, tests, and scripts that compete.
I nibble on code with a joyful beat,
Celebration hops in every commit!
🥕🐇 Celebrate the updates, light and sweet!


📜 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 1b5f8c0 and cd0a2ca.

📒 Files selected for processing (25)
  • .eslintrc (1 hunks)
  • .github/PULL_REQUEST_TEMPLATE.md (0 hunks)
  • .github/workflows/codeql.yml (0 hunks)
  • .github/workflows/nodejs.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • README.md (1 hunks)
  • boilerplate/.eslintignore (1 hunks)
  • boilerplate/.eslintrc (1 hunks)
  • boilerplate/.github/PULL_REQUEST_TEMPLATE.md (0 hunks)
  • boilerplate/.github/workflows/nodejs.yml (1 hunks)
  • boilerplate/.github/workflows/release.yml (1 hunks)
  • boilerplate/README.md (5 hunks)
  • boilerplate/_package.json (2 hunks)
  • boilerplate/config/config.default.js (0 hunks)
  • boilerplate/src/config/config.default.ts (1 hunks)
  • boilerplate/src/index.ts (1 hunks)
  • boilerplate/src/typings/index.d.ts (1 hunks)
  • boilerplate/test/fixtures/apps/example/app/controller/home.js (1 hunks)
  • boilerplate/test/fixtures/apps/example/app/router.js (0 hunks)
  • boilerplate/test/fixtures/apps/example/config/config.default.js (0 hunks)
  • boilerplate/test/index.test.js (0 hunks)
  • boilerplate/test/index.test.ts (1 hunks)
  • boilerplate/tsconfig.json (1 hunks)
  • index.js (0 hunks)
  • package.json (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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>, please review it.
    • 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 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 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 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. (Beta)
  • @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

socket-security bot commented Feb 4, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] 🔁 npm/[email protected] Transitive: eval, network, shell, unsafe +290 17.6 MB fengmk2
npm/[email protected] 🔁 npm/[email protected] Transitive: environment, eval, filesystem, unsafe +173 18.6 MB fengmk2

🚮 Removed packages: npm/[email protected], npm/[email protected]

View full report↗︎

@fengmk2 fengmk2 merged commit 52df3aa into master Feb 4, 2025
12 of 13 checks passed
@fengmk2 fengmk2 deleted the egg-v4 branch February 4, 2025 03:39
fengmk2 pushed a commit that referenced this pull request Feb 4, 2025
[skip ci]

## [3.0.0](v2.2.0...v3.0.0) (2025-02-04)

### ⚠ BREAKING CHANGES

* drop Node.js < 18.19.0 support

part of eggjs/egg#3644

eggjs/egg#5257

### Features

* support cjs and esm both by tshy ([#26](#26)) ([52df3aa](52df3aa))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant