mirror of https://github.com/langgenius/dify.git
chore(web): remove version prefixes from package.json (#31286)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hyoban <38493346+hyoban@users.noreply.github.com>
This commit is contained in:
parent
3bb80a0934
commit
92fc50ac57
|
|
@ -0,0 +1 @@
|
||||||
|
save-exact=true
|
||||||
|
|
@ -2,6 +2,7 @@ import consistentPlaceholders from './rules/consistent-placeholders.js'
|
||||||
import noAsAnyInT from './rules/no-as-any-in-t.js'
|
import noAsAnyInT from './rules/no-as-any-in-t.js'
|
||||||
import noExtraKeys from './rules/no-extra-keys.js'
|
import noExtraKeys from './rules/no-extra-keys.js'
|
||||||
import noLegacyNamespacePrefix from './rules/no-legacy-namespace-prefix.js'
|
import noLegacyNamespacePrefix from './rules/no-legacy-namespace-prefix.js'
|
||||||
|
import noVersionPrefix from './rules/no-version-prefix.js'
|
||||||
import requireNsOption from './rules/require-ns-option.js'
|
import requireNsOption from './rules/require-ns-option.js'
|
||||||
import validI18nKeys from './rules/valid-i18n-keys.js'
|
import validI18nKeys from './rules/valid-i18n-keys.js'
|
||||||
|
|
||||||
|
|
@ -16,6 +17,7 @@ const plugin = {
|
||||||
'no-as-any-in-t': noAsAnyInT,
|
'no-as-any-in-t': noAsAnyInT,
|
||||||
'no-extra-keys': noExtraKeys,
|
'no-extra-keys': noExtraKeys,
|
||||||
'no-legacy-namespace-prefix': noLegacyNamespacePrefix,
|
'no-legacy-namespace-prefix': noLegacyNamespacePrefix,
|
||||||
|
'no-version-prefix': noVersionPrefix,
|
||||||
'require-ns-option': requireNsOption,
|
'require-ns-option': requireNsOption,
|
||||||
'valid-i18n-keys': validI18nKeys,
|
'valid-i18n-keys': validI18nKeys,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
const DEPENDENCY_KEYS = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']
|
||||||
|
const VERSION_PREFIXES = ['^', '~']
|
||||||
|
|
||||||
|
/** @type {import('eslint').Rule.RuleModule} */
|
||||||
|
export default {
|
||||||
|
meta: {
|
||||||
|
type: 'problem',
|
||||||
|
docs: {
|
||||||
|
description: `Ensure package.json dependencies do not use version prefixes (${VERSION_PREFIXES.join(' or ')})`,
|
||||||
|
},
|
||||||
|
fixable: 'code',
|
||||||
|
},
|
||||||
|
create(context) {
|
||||||
|
const { filename } = context
|
||||||
|
|
||||||
|
if (!filename.endsWith('package.json'))
|
||||||
|
return {}
|
||||||
|
|
||||||
|
const selector = `JSONProperty:matches(${DEPENDENCY_KEYS.map(k => `[key.value="${k}"]`).join(', ')}) > JSONObjectExpression > JSONProperty`
|
||||||
|
|
||||||
|
return {
|
||||||
|
[selector](node) {
|
||||||
|
const versionNode = node.value
|
||||||
|
|
||||||
|
if (versionNode && versionNode.type === 'JSONLiteral' && typeof versionNode.value === 'string') {
|
||||||
|
const version = versionNode.value
|
||||||
|
const foundPrefix = VERSION_PREFIXES.find(prefix => version.startsWith(prefix))
|
||||||
|
|
||||||
|
if (foundPrefix) {
|
||||||
|
const packageName = node.key.value || node.key.name
|
||||||
|
const cleanVersion = version.substring(1)
|
||||||
|
const canAutoFix = /^\d+\.\d+\.\d+$/.test(cleanVersion)
|
||||||
|
context.report({
|
||||||
|
node: versionNode,
|
||||||
|
message: `Dependency "${packageName}" has version prefix "${foundPrefix}" that should be removed (found: "${version}", expected: "${cleanVersion}")`,
|
||||||
|
fix: canAutoFix
|
||||||
|
? fixer => fixer.replaceText(versionNode, `"${cleanVersion}"`)
|
||||||
|
: undefined,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -134,4 +134,14 @@ export default antfu(
|
||||||
'dify-i18n/consistent-placeholders': 'error',
|
'dify-i18n/consistent-placeholders': 'error',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// package.json version prefix validation
|
||||||
|
{
|
||||||
|
files: ['**/package.json'],
|
||||||
|
plugins: {
|
||||||
|
'dify-i18n': difyI18n,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'dify-i18n/no-version-prefix': 'error',
|
||||||
|
},
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
|
||||||
312
web/package.json
312
web/package.json
|
|
@ -52,181 +52,181 @@
|
||||||
"knip": "knip"
|
"knip": "knip"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@amplitude/analytics-browser": "^2.33.1",
|
"@amplitude/analytics-browser": "2.33.1",
|
||||||
"@amplitude/plugin-session-replay-browser": "^1.23.6",
|
"@amplitude/plugin-session-replay-browser": "1.23.6",
|
||||||
"@emoji-mart/data": "^1.2.1",
|
"@emoji-mart/data": "1.2.1",
|
||||||
"@floating-ui/react": "^0.26.28",
|
"@floating-ui/react": "0.26.28",
|
||||||
"@formatjs/intl-localematcher": "^0.5.10",
|
"@formatjs/intl-localematcher": "0.5.10",
|
||||||
"@headlessui/react": "2.2.1",
|
"@headlessui/react": "2.2.1",
|
||||||
"@heroicons/react": "^2.2.0",
|
"@heroicons/react": "2.2.0",
|
||||||
"@lexical/code": "^0.38.2",
|
"@lexical/code": "0.38.2",
|
||||||
"@lexical/link": "^0.38.2",
|
"@lexical/link": "0.38.2",
|
||||||
"@lexical/list": "^0.38.2",
|
"@lexical/list": "0.38.2",
|
||||||
"@lexical/react": "^0.38.2",
|
"@lexical/react": "0.38.2",
|
||||||
"@lexical/selection": "^0.38.2",
|
"@lexical/selection": "0.38.2",
|
||||||
"@lexical/text": "^0.38.2",
|
"@lexical/text": "0.38.2",
|
||||||
"@lexical/utils": "^0.38.2",
|
"@lexical/utils": "0.38.2",
|
||||||
"@monaco-editor/react": "^4.7.0",
|
"@monaco-editor/react": "4.7.0",
|
||||||
"@octokit/core": "^6.1.6",
|
"@octokit/core": "6.1.6",
|
||||||
"@octokit/request-error": "^6.1.8",
|
"@octokit/request-error": "6.1.8",
|
||||||
"@orpc/client": "^1.13.4",
|
"@orpc/client": "1.13.4",
|
||||||
"@orpc/contract": "^1.13.4",
|
"@orpc/contract": "1.13.4",
|
||||||
"@orpc/openapi-client": "^1.13.4",
|
"@orpc/openapi-client": "1.13.4",
|
||||||
"@orpc/tanstack-query": "^1.13.4",
|
"@orpc/tanstack-query": "1.13.4",
|
||||||
"@remixicon/react": "^4.7.0",
|
"@remixicon/react": "4.7.0",
|
||||||
"@sentry/react": "^8.55.0",
|
"@sentry/react": "8.55.0",
|
||||||
"@svgdotjs/svg.js": "^3.2.5",
|
"@svgdotjs/svg.js": "3.2.5",
|
||||||
"@tailwindcss/typography": "^0.5.19",
|
"@tailwindcss/typography": "0.5.19",
|
||||||
"@tanstack/react-form": "^1.23.7",
|
"@tanstack/react-form": "1.23.7",
|
||||||
"@tanstack/react-query": "^5.90.5",
|
"@tanstack/react-query": "5.90.5",
|
||||||
"abcjs": "^6.5.2",
|
"abcjs": "6.5.2",
|
||||||
"ahooks": "^3.9.5",
|
"ahooks": "3.9.5",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "2.1.1",
|
||||||
"cmdk": "^1.1.1",
|
"cmdk": "1.1.1",
|
||||||
"copy-to-clipboard": "^3.3.3",
|
"copy-to-clipboard": "3.3.3",
|
||||||
"cron-parser": "^5.4.0",
|
"cron-parser": "5.4.0",
|
||||||
"dayjs": "^1.11.19",
|
"dayjs": "1.11.19",
|
||||||
"decimal.js": "^10.6.0",
|
"decimal.js": "10.6.0",
|
||||||
"dompurify": "^3.3.0",
|
"dompurify": "3.3.0",
|
||||||
"echarts": "^5.6.0",
|
"echarts": "5.6.0",
|
||||||
"echarts-for-react": "^3.0.5",
|
"echarts-for-react": "3.0.5",
|
||||||
"elkjs": "^0.9.3",
|
"elkjs": "0.9.3",
|
||||||
"emoji-mart": "^5.6.0",
|
"emoji-mart": "5.6.0",
|
||||||
"es-toolkit": "^1.43.0",
|
"es-toolkit": "1.43.0",
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "3.1.3",
|
||||||
"html-entities": "^2.6.0",
|
"html-entities": "2.6.0",
|
||||||
"html-to-image": "1.11.13",
|
"html-to-image": "1.11.13",
|
||||||
"i18next": "^25.7.3",
|
"i18next": "25.7.3",
|
||||||
"i18next-resources-to-backend": "^1.2.1",
|
"i18next-resources-to-backend": "1.2.1",
|
||||||
"immer": "^11.1.0",
|
"immer": "11.1.0",
|
||||||
"jotai": "^2.16.1",
|
"jotai": "2.16.1",
|
||||||
"js-audio-recorder": "^1.0.7",
|
"js-audio-recorder": "1.0.7",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "3.0.5",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
"jsonschema": "^1.5.0",
|
"jsonschema": "1.5.0",
|
||||||
"katex": "^0.16.25",
|
"katex": "0.16.25",
|
||||||
"ky": "^1.12.0",
|
"ky": "1.12.0",
|
||||||
"lamejs": "^1.2.1",
|
"lamejs": "1.2.1",
|
||||||
"lexical": "^0.38.2",
|
"lexical": "0.38.2",
|
||||||
"line-clamp": "^1.0.0",
|
"line-clamp": "1.0.0",
|
||||||
"mermaid": "~11.11.0",
|
"mermaid": "11.11.0",
|
||||||
"mime": "^4.1.0",
|
"mime": "4.1.0",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "3.0.1",
|
||||||
"negotiator": "^1.0.0",
|
"negotiator": "1.0.0",
|
||||||
"next": "~15.5.9",
|
"next": "15.5.9",
|
||||||
"next-themes": "^0.4.6",
|
"next-themes": "0.4.6",
|
||||||
"nuqs": "^2.8.6",
|
"nuqs": "2.8.6",
|
||||||
"pinyin-pro": "^3.27.0",
|
"pinyin-pro": "3.27.0",
|
||||||
"qrcode.react": "^4.2.0",
|
"qrcode.react": "4.2.0",
|
||||||
"qs": "^6.14.1",
|
"qs": "6.14.1",
|
||||||
"react": "19.2.3",
|
"react": "19.2.3",
|
||||||
"react-18-input-autosize": "^3.0.0",
|
"react-18-input-autosize": "3.0.0",
|
||||||
"react-dom": "19.2.3",
|
"react-dom": "19.2.3",
|
||||||
"react-easy-crop": "^5.5.3",
|
"react-easy-crop": "5.5.3",
|
||||||
"react-hotkeys-hook": "^4.6.2",
|
"react-hotkeys-hook": "4.6.2",
|
||||||
"react-i18next": "^16.5.0",
|
"react-i18next": "16.5.0",
|
||||||
"react-markdown": "^9.1.0",
|
"react-markdown": "9.1.0",
|
||||||
"react-multi-email": "^1.0.25",
|
"react-multi-email": "1.0.25",
|
||||||
"react-papaparse": "^4.4.0",
|
"react-papaparse": "4.4.0",
|
||||||
"react-pdf-highlighter": "8.0.0-rc.0",
|
"react-pdf-highlighter": "8.0.0-rc.0",
|
||||||
"react-slider": "^2.0.6",
|
"react-slider": "2.0.6",
|
||||||
"react-sortablejs": "^6.1.4",
|
"react-sortablejs": "6.1.4",
|
||||||
"react-syntax-highlighter": "^15.6.6",
|
"react-syntax-highlighter": "15.6.6",
|
||||||
"react-textarea-autosize": "^8.5.9",
|
"react-textarea-autosize": "8.5.9",
|
||||||
"react-window": "^1.8.11",
|
"react-window": "1.8.11",
|
||||||
"reactflow": "^11.11.4",
|
"reactflow": "11.11.4",
|
||||||
"rehype-katex": "^7.0.1",
|
"rehype-katex": "7.0.1",
|
||||||
"rehype-raw": "^7.0.0",
|
"rehype-raw": "7.0.0",
|
||||||
"remark-breaks": "^4.0.0",
|
"remark-breaks": "4.0.0",
|
||||||
"remark-gfm": "^4.0.1",
|
"remark-gfm": "4.0.1",
|
||||||
"remark-math": "^6.0.0",
|
"remark-math": "6.0.0",
|
||||||
"scheduler": "^0.27.0",
|
"scheduler": "0.27.0",
|
||||||
"semver": "^7.7.3",
|
"semver": "7.7.3",
|
||||||
"sharp": "^0.33.5",
|
"sharp": "0.33.5",
|
||||||
"sortablejs": "^1.15.6",
|
"sortablejs": "1.15.6",
|
||||||
"string-ts": "^2.3.1",
|
"string-ts": "2.3.1",
|
||||||
"tailwind-merge": "^2.6.0",
|
"tailwind-merge": "2.6.0",
|
||||||
"tldts": "^7.0.17",
|
"tldts": "7.0.17",
|
||||||
"use-context-selector": "^2.0.0",
|
"use-context-selector": "2.0.0",
|
||||||
"uuid": "^10.0.0",
|
"uuid": "10.0.0",
|
||||||
"zod": "^3.25.76",
|
"zod": "3.25.76",
|
||||||
"zundo": "^2.3.0",
|
"zundo": "2.3.0",
|
||||||
"zustand": "^5.0.9"
|
"zustand": "5.0.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^7.0.1",
|
"@antfu/eslint-config": "7.0.1",
|
||||||
"@chromatic-com/storybook": "^4.1.1",
|
"@chromatic-com/storybook": "4.1.1",
|
||||||
"@eslint-react/eslint-plugin": "^2.7.0",
|
"@eslint-react/eslint-plugin": "2.7.0",
|
||||||
"@mdx-js/loader": "^3.1.1",
|
"@mdx-js/loader": "3.1.1",
|
||||||
"@mdx-js/react": "^3.1.1",
|
"@mdx-js/react": "3.1.1",
|
||||||
"@next/bundle-analyzer": "15.5.9",
|
"@next/bundle-analyzer": "15.5.9",
|
||||||
"@next/eslint-plugin-next": "15.5.9",
|
"@next/eslint-plugin-next": "15.5.9",
|
||||||
"@next/mdx": "15.5.9",
|
"@next/mdx": "15.5.9",
|
||||||
"@rgrove/parse-xml": "^4.2.0",
|
"@rgrove/parse-xml": "4.2.0",
|
||||||
"@serwist/turbopack": "^9.5.0",
|
"@serwist/turbopack": "9.5.0",
|
||||||
"@storybook/addon-docs": "9.1.13",
|
"@storybook/addon-docs": "9.1.13",
|
||||||
"@storybook/addon-links": "9.1.13",
|
"@storybook/addon-links": "9.1.13",
|
||||||
"@storybook/addon-onboarding": "9.1.13",
|
"@storybook/addon-onboarding": "9.1.13",
|
||||||
"@storybook/addon-themes": "9.1.13",
|
"@storybook/addon-themes": "9.1.13",
|
||||||
"@storybook/nextjs": "9.1.13",
|
"@storybook/nextjs": "9.1.13",
|
||||||
"@storybook/react": "9.1.17",
|
"@storybook/react": "9.1.17",
|
||||||
"@tanstack/eslint-plugin-query": "^5.91.2",
|
"@tanstack/eslint-plugin-query": "5.91.2",
|
||||||
"@tanstack/react-devtools": "^0.9.0",
|
"@tanstack/react-devtools": "0.9.0",
|
||||||
"@tanstack/react-form-devtools": "^0.2.9",
|
"@tanstack/react-form-devtools": "0.2.9",
|
||||||
"@tanstack/react-query-devtools": "^5.90.2",
|
"@tanstack/react-query-devtools": "5.90.2",
|
||||||
"@testing-library/dom": "^10.4.1",
|
"@testing-library/dom": "10.4.1",
|
||||||
"@testing-library/jest-dom": "^6.9.1",
|
"@testing-library/jest-dom": "6.9.1",
|
||||||
"@testing-library/react": "^16.3.0",
|
"@testing-library/react": "16.3.0",
|
||||||
"@testing-library/user-event": "^14.6.1",
|
"@testing-library/user-event": "14.6.1",
|
||||||
"@tsslint/cli": "^3.0.1",
|
"@tsslint/cli": "3.0.1",
|
||||||
"@tsslint/compat-eslint": "^3.0.1",
|
"@tsslint/compat-eslint": "3.0.1",
|
||||||
"@tsslint/config": "^3.0.1",
|
"@tsslint/config": "3.0.1",
|
||||||
"@types/js-cookie": "^3.0.6",
|
"@types/js-cookie": "3.0.6",
|
||||||
"@types/js-yaml": "^4.0.9",
|
"@types/js-yaml": "4.0.9",
|
||||||
"@types/negotiator": "^0.6.4",
|
"@types/negotiator": "0.6.4",
|
||||||
"@types/node": "18.15.0",
|
"@types/node": "18.15.0",
|
||||||
"@types/qs": "^6.14.0",
|
"@types/qs": "6.14.0",
|
||||||
"@types/react": "~19.2.7",
|
"@types/react": "19.2.7",
|
||||||
"@types/react-dom": "~19.2.3",
|
"@types/react-dom": "19.2.3",
|
||||||
"@types/react-slider": "^1.3.6",
|
"@types/react-slider": "1.3.6",
|
||||||
"@types/react-syntax-highlighter": "^15.5.13",
|
"@types/react-syntax-highlighter": "15.5.13",
|
||||||
"@types/react-window": "^1.8.8",
|
"@types/react-window": "1.8.8",
|
||||||
"@types/semver": "^7.7.1",
|
"@types/semver": "7.7.1",
|
||||||
"@types/sortablejs": "^1.15.8",
|
"@types/sortablejs": "1.15.8",
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "10.0.0",
|
||||||
"@typescript-eslint/parser": "^8.53.0",
|
"@typescript-eslint/parser": "8.53.0",
|
||||||
"@typescript/native-preview": "^7.0.0-dev",
|
"@typescript/native-preview": "7.0.0-dev.20251209.1",
|
||||||
"@vitejs/plugin-react": "^5.1.2",
|
"@vitejs/plugin-react": "5.1.2",
|
||||||
"@vitest/coverage-v8": "^4.0.17",
|
"@vitest/coverage-v8": "4.0.17",
|
||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "10.4.21",
|
||||||
"code-inspector-plugin": "1.2.9",
|
"code-inspector-plugin": "1.2.9",
|
||||||
"cross-env": "^10.1.0",
|
"cross-env": "10.1.0",
|
||||||
"esbuild-wasm": "^0.27.2",
|
"esbuild-wasm": "0.27.2",
|
||||||
"eslint": "^9.39.2",
|
"eslint": "9.39.2",
|
||||||
"eslint-plugin-react-hooks": "^7.0.1",
|
"eslint-plugin-react-hooks": "7.0.1",
|
||||||
"eslint-plugin-react-refresh": "^0.4.26",
|
"eslint-plugin-react-refresh": "0.4.26",
|
||||||
"eslint-plugin-sonarjs": "^3.0.5",
|
"eslint-plugin-sonarjs": "3.0.5",
|
||||||
"eslint-plugin-storybook": "^10.1.11",
|
"eslint-plugin-storybook": "10.1.11",
|
||||||
"eslint-plugin-tailwindcss": "^3.18.2",
|
"eslint-plugin-tailwindcss": "3.18.2",
|
||||||
"husky": "^9.1.7",
|
"husky": "9.1.7",
|
||||||
"jsdom": "^27.3.0",
|
"jsdom": "27.3.0",
|
||||||
"jsdom-testing-mocks": "^1.16.0",
|
"jsdom-testing-mocks": "1.16.0",
|
||||||
"knip": "^5.78.0",
|
"knip": "5.78.0",
|
||||||
"lint-staged": "^15.5.2",
|
"lint-staged": "15.5.2",
|
||||||
"nock": "^14.0.10",
|
"nock": "14.0.10",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "8.5.6",
|
||||||
"react-scan": "^0.4.3",
|
"react-scan": "0.4.3",
|
||||||
"sass": "^1.93.2",
|
"sass": "1.93.2",
|
||||||
"serwist": "^9.5.0",
|
"serwist": "9.5.0",
|
||||||
"storybook": "9.1.17",
|
"storybook": "9.1.17",
|
||||||
"tailwindcss": "^3.4.18",
|
"tailwindcss": "3.4.18",
|
||||||
"tsx": "^4.21.0",
|
"tsx": "4.21.0",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "5.9.3",
|
||||||
"uglify-js": "^3.19.3",
|
"uglify-js": "3.19.3",
|
||||||
"vite": "^7.3.1",
|
"vite": "7.3.1",
|
||||||
"vite-tsconfig-paths": "^6.0.4",
|
"vite-tsconfig-paths": "6.0.4",
|
||||||
"vitest": "^4.0.17"
|
"vitest": "4.0.17"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue