[PR #31286] chore(web): remove version prefixes from package.json #33165

Closed
opened 2026-02-21 20:52:47 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/31286

State: closed
Merged: Yes


  • Add .npmrc with save-exact=true to /web directory
  • Create custom ESLint rule dify-i18n/no-version-prefix
  • Remove version prefixes from all dependencies in /web/package.json
  • Integrate rule into web/eslint.config.mjs
  • Revert changes to sdks directory
  • Fix lockfile mismatch by updating @typescript/native-preview to exact version 7.0.0-dev.20251209.1 and regenerating lockfile
  • Remove auto-fix functionality from ESLint rule (errors will be reported but not automatically fixed)
  • Improve ESLint rule to report errors at specific dependency node locations instead of at the Program level
  • Extract dependency keys and version prefixes as constants for better maintainability
  • Fix ESLint selector to use simpler approach with runtime filtering instead of dynamic regex pattern
Original prompt

This section details on the original issue you should resolve

<issue_title>[Refactor/Chore] No version prefix in package.json</issue_title>
<issue_description>### Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for refactors or chores; if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Description

For an app, we do not need ^ or ~ prefix for the dependencies version.

We also need save-exact = true for .npmrc and a custom ESLint rule.

Motivation

No response

Additional Context

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

**Original Pull Request:** https://github.com/langgenius/dify/pull/31286 **State:** closed **Merged:** Yes --- - [x] Add `.npmrc` with `save-exact=true` to `/web` directory - [x] Create custom ESLint rule `dify-i18n/no-version-prefix` - [x] Remove version prefixes from all dependencies in `/web/package.json` - [x] Integrate rule into `web/eslint.config.mjs` - [x] Revert changes to `sdks` directory - [x] Fix lockfile mismatch by updating `@typescript/native-preview` to exact version `7.0.0-dev.20251209.1` and regenerating lockfile - [x] Remove auto-fix functionality from ESLint rule (errors will be reported but not automatically fixed) - [x] Improve ESLint rule to report errors at specific dependency node locations instead of at the Program level - [x] Extract dependency keys and version prefixes as constants for better maintainability - [x] Fix ESLint selector to use simpler approach with runtime filtering instead of dynamic regex pattern <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[Refactor/Chore] No version prefix in package.json</issue_title> > <issue_description>### Self Checks > > - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). > - [x] This is only for refactors or chores; if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). > - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. > - [x] I confirm that I am using English to submit this report, otherwise it will be closed. > - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) > - [x] Please do not modify this template :) and fill in all the required fields. > > ### Description > > For an app, we do not need `^` or `~` prefix for the dependencies version. > > We also need `save-exact = true` for `.npmrc` and a custom ESLint rule. > > ### Motivation > > _No response_ > > ### Additional Context > > _No response_</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes langgenius/dify#31279 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
yindo added the pull-request label 2026-02-21 20:52:47 -05:00
yindo closed this issue 2026-02-21 20:52:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33165