Skip to content

bump deps version#816

Merged
hexqi merged 1 commit intoopentiny:refactor/developfrom
chilingling:feat/bumpDepsVersion
Sep 27, 2024
Merged

bump deps version#816
hexqi merged 1 commit intoopentiny:refactor/developfrom
chilingling:feat/bumpDepsVersion

Conversation

@chilingling
Copy link
Member

@chilingling chilingling commented Sep 25, 2024

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

What is the current behavior?

  1. 升级 vite^5.4.2
  2. 升级 @vitejs/plugin-vue^5.1.2
  3. 升级 @vitejs/plugin-vue-jsx^4.0.1
  4. 升级 vite-plugin-static-copy^1.0.6
  5. package.json 中加上 "type": "module"描述(消除升级 vite5 的警告)。
  6. 升级 pnpm & node 最低依赖:
{
  "engine": {
    "node": ">=16",
    "pnpm": ">=8"
  }
}
  1. 删除根目录 package.json 中非必要的依赖。

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Introduced support for ECMAScript modules across multiple packages.
  • Dependency Updates

    • Upgraded @vitejs/plugin-vue and vite to newer versions in various packages for enhanced performance and compatibility.
    • Added new dependencies to improve tooling related to Vue.js support.
  • Chores

    • Removed several outdated development dependencies to streamline the project.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 25, 2024

Walkthrough

The pull request involves significant updates to multiple package.json files across various modules, primarily focusing on upgrading development dependencies such as @vitejs/plugin-vue, @vitejs/plugin-vue-jsx, and vite. Additionally, several packages have adopted ECMAScript module syntax by adding the "type": "module" field. The changes reflect a shift towards newer versions of tools and a reduction in the number of dependencies in some cases.

Changes

File Path Change Summary
designer-demo/package.json Updated @vitejs/plugin-vue from ^5.0.4 to ^5.1.2, and vite from ^5.2.7 to ^5.4.2.
package.json Removed multiple devDependencies, retained only vue-eslint-parser, updated engines section to require Node 16 and pnpm 8.
packages/blockToWebComponentTemplate/package.json Incremented version to 2.0.0-alpha.2, added "type": "module", updated @vitejs/plugin-vue from ^4.5.2 to ^5.1.2, @vitejs/plugin-vue-jsx from ^3.1.0 to ^4.0.1, and vite from ^4.3.7 to ^5.4.2.
packages/build/vite-config/package.json Updated @vitejs/plugin-vue from ^4.2.3 to ^5.1.2, @vitejs/plugin-vue-jsx from ^3.1.0 to ^4.0.1, vite from ^4.3.7 to ^5.4.2, vite-plugin-static-copy from ^0.16.0 to ^1.0.6, and rollup-plugin-polyfill-node from ^0.12.0 to ^0.13.0.
packages/build/vite-plugin-meta-comments/package.json Updated @vitejs/plugin-vue from ^5.0.4 to ^5.1.2, and vite from ^5.2.7 to ^5.4.2.
packages/builtinComponent/package.json Added "type": "module", updated @vitejs/plugin-vue from ^4.2.3 to ^5.1.2, @vitejs/plugin-vue-jsx from ^3.1.0 to ^4.0.1, and vite from ^4.5.0 to ^5.4.2.
packages/canvas/package.json Added "type": "module", updated @vitejs/plugin-vue from ^4.2.3 to ^5.1.2, @vitejs/plugin-vue-jsx from ^3.1.0 to ^4.0.1, and vite from ^4.3.7 to ^5.4.2, replaced rollup-plugin-terser with rollup-plugin-polyfill-node.
packages/common/package.json Added "type": "module", updated @vitejs/plugin-vue from ^4.2.3 to ^5.1.2, @vitejs/plugin-vue-jsx from ^3.1.0 to ^4.0.1, and vite from ^4.3.7 to ^5.4.2.
packages/configurator/package.json Added @vitejs/plugin-vue with version ^5.1.2, added @vitejs/plugin-vue-jsx with version ^4.0.1, updated vite from ^4.3.7 to ^5.4.2.
packages/design-core/package.json Updated @vitejs/plugin-vue from ^4.2.3 to ^5.1.2, @vitejs/plugin-vue-jsx from ^3.1.0 to ^4.0.1, added vite with version ^5.4.2, and added rollup-plugin-polyfill-node with version ^0.13.0.
packages/engine-cli/template/designer/package.json Updated @vitejs/plugin-vue from ^5.0.4 to ^5.1.2, and vite from ^5.2.7 to ^5.4.2.
packages/http/package.json Added "type": "module", updated @vitejs/plugin-vue from ^4.2.3 to ^5.1.2, @vitejs/plugin-vue-jsx from ^3.1.0 to ^4.0.1, and vite from ^4.3.7 to ^5.4.2.
packages/i18n/package.json Added "type": "module", updated @vitejs/plugin-vue from ^2.2.0 to ^5.1.2, and vite from ^2.9.1 to ^5.4.2.
packages/layout/package.json Updated @vitejs/plugin-vue from ^5.0.4 to ^5.1.2, added @vitejs/plugin-vue-jsx with version ^4.0.1, and updated vite from ^5.1.6 to ^5.4.2.
packages/plugins/block/package.json Added "type": "module", updated @vitejs/plugin-vue from ^4... (incomplete summary).

Possibly related PRs

🐰 In the garden, where the bunnies play,
New tools and changes brighten the day.
With plugins updated and modules anew,
We hop with joy, for there's much we can do!
So let’s dance and twirl, in the fields so wide,
With every new version, we bounce with pride! 🌼✨


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 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.

@chilingling chilingling added the ready_for_review This PR requires more reviews label Sep 25, 2024
Copy link
Contributor

@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.

Caution

Inline review comments failed to post

🛑 Comments failed to post (24)
packages/theme/base/package.json (2)

26-28: 💡 Codebase verification

Rimraf usage still detected in theme packages

  • packages/theme/dark/package.json:
    • "rimraf": "^6.0.1" in devDependencies
    • Build script: "build": "vite build && rimraf dist/index.js"
  • packages/theme/light/package.json:
    • "rimraf": "^6.0.1" in devDependencies
    • Build script: "build": "vite build && rimraf dist/index.js"

Please remove the rimraf dependency from all theme package.json files and update the build scripts to use native Node.js fs methods or the rm command in Unix-like systems.

🔗 Analysis chain

Removal of rimraf dependency

The AI summary indicates that the rimraf dependency has been removed from devDependencies.

Please ensure that any scripts or processes that previously used rimraf have been updated. Run the following script to check for any remaining usage:

If rimraf was used in npm scripts, consider replacing it with native Node.js fs methods or the rm command in Unix-like systems.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining usage of rimraf

# Test: Search for rimraf usage in scripts. Expect: No results if all usage has been removed or replaced.
rg 'rimraf' packages/theme/base/package.json

Length of output: 143


Script:

#!/bin/bash
# Description: Comprehensive search for any remaining usage of rimraf across the entire codebase

# Test: Search for 'rimraf' in all files. Expect: No results if all usage has been removed or replaced.
rg 'rimraf' .

Length of output: 303


10-10: 💡 Codebase verification

CommonJS syntax still present after migrating to ECMAScript modules

Found multiple require statements and module.exports usage in the codebase, which may conflict with the "type": "module" setting in package.json.

  • scripts/copyToVscode.js
  • scripts/buildComponentSchemas.js
  • scripts/setup.js
  • mockServer/gulpfile.js
  • mockServer/src/services/schema2code.js
  • mockServer/src/services/app.js
  • mockServer/src/assets/js/*.umd.js
  • packages/engine-cli/bin/cli.js
  • packages/vue-generator/src/generator/page.js
  • packages/vue-generator/src/utils/vue-sfc-validator.js
  • packages/vue-generator/test/utils/logger/index.js
  • packages/vue-generator/test/testcases/full/index.js
  • packages/settings/design/src/convertToSchema.js
  • .eslintrc.js
  • lint-staged.config.js
  • mockServer/src/config/config.js
  • mockServer/src/middleware/ErrorRoutesCatch.js
  • mockServer/src/routes/error-routes.js
  • mockServer/pm2.js
🔗 Analysis chain

Addition of ECMAScript module type

The addition of "type": "module" indicates a shift to using ECMAScript modules. This is a positive change that aligns with modern JavaScript practices.

To ensure compatibility, please verify that all imports in the project are updated to use ESM syntax. Run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for CommonJS require statements that might need updating

# Test: Search for require statements. Expect: No results if all imports have been updated.
rg --type js --type ts 'require\(' packages/theme/base

Length of output: 143


Script:

#!/bin/bash
# Description: Check for any CommonJS require statements or module.exports usage

# Search for 'require(' and 'module.exports' in JavaScript and TypeScript files
rg --type js --type ts 'require\('
rg --type js --type ts 'module\.exports'

Length of output: 4876

packages/vue-generator/test/testcases/generator/expected/appdemo01/package.json (1)

9-9: 💡 Codebase verification

ES Modules Compatibility Issues Detected

The codebase contains several CommonJS patterns that are incompatible with ES modules:

  • CommonJS module.exports found in multiple files:

    • .eslintrc.js
    • packages/vue-generator/test/testcases/full/index.config.js
    • packages/vue-generator/test/utils/logger/index.js
    • (and others as listed in the script output)
  • Usage of __dirname and __filename in various scripts and configuration files:

    • scripts/copyToVscode.js
    • designer-demo/vite.config.js
    • packages/engine-cli/src/commands/create.js
    • (and others as listed in the script output)

Action Required:

  • Refactor the identified CommonJS modules to use ES module syntax (export and import).
  • Replace __dirname and __filename with appropriate ES module alternatives.
  • Ensure the build environment has npm available to successfully run build scripts.
🔗 Analysis chain

Verify compatibility with ES modules

The addition of "type": "module" indicates a shift to using ES modules. This change may affect how the project is built and how modules are imported/exported throughout the codebase.

To ensure compatibility, please run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential incompatibilities with ES modules

# Test 1: Check for CommonJS require statements
echo "Checking for CommonJS require statements:"
rg --type js 'require\(' -g '!node_modules'

# Test 2: Check for module.exports statements
echo "Checking for module.exports statements:"
rg --type js 'module\.exports' -g '!node_modules'

# Test 3: Check for __dirname and __filename usage
echo "Checking for __dirname and __filename usage:"
rg --type js '__dirname|__filename' -g '!node_modules'

echo "If any of the above checks return results, those areas may need to be updated for ES module compatibility."

Length of output: 11790

packages/builtinComponent/package.json (1)

7-7: 💡 Codebase verification

ESM Compatibility Issue Found: Usage of __dirname in vite.config.js

The vite.config.js file contains usage of __dirname, which is not available in ESM and may cause compatibility issues.

  • File: packages/builtinComponent/vite.config.js
  • Issue: Usage of __dirname in path.resolve(__dirname, './index.js')

Please update the vite.config.js to use ESM-compatible path resolution, such as leveraging import.meta.url with URL-based methods.

🔗 Analysis chain

Verify compatibility with ECMAScript modules

The addition of "type": "module" indicates that this package will now use ECMAScript modules. This is a significant change that affects how the package is interpreted and how its modules are loaded.

Please ensure that:

  1. All files in the package are compatible with ESM syntax.
  2. Any CommonJS dependencies are properly handled.
  3. The build process and any scripts are updated to work with ESM.

Run the following script to check for potential compatibility issues:


Copy link
Collaborator

@yy-wow yy-wow left a comment

Choose a reason for hiding this comment

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

LGTM

@hexqi hexqi merged commit f02d458 into opentiny:refactor/develop Sep 27, 2024
yy-wow pushed a commit to yy-wow/tiny-engine that referenced this pull request Oct 10, 2024
@coderabbitai coderabbitai bot mentioned this pull request Nov 5, 2024
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready_for_review This PR requires more reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants