diff --git a/.prettierignore b/.prettierignore index d52e89e20..0893dd1fd 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,5 +14,4 @@ packages/core/client/src/locale/* **/.dumi/tmp-production packages/core/cli/templates/plugin/src/client/*.tpl packages/app/client/src/.plugins -packages/**/locale/** storage diff --git a/.prettierrc.js b/.prettierrc.js index 29687401a..f7405bce7 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,5 +1,10 @@ module.exports = { - plugins: ['prettier-plugin-sql', 'prettier-plugin-packagejson', '@ianvs/prettier-plugin-sort-imports'], + plugins: [ + 'prettier-plugin-sql', + 'prettier-plugin-packagejson', + '@ianvs/prettier-plugin-sort-imports', + 'prettier-plugin-sort-json', + ], singleQuote: true, trailingComma: 'all', printWidth: 120, @@ -17,7 +22,18 @@ module.exports = { overrides: [ { files: '.prettierrc', - options: { parser: 'json' }, + options: { + parser: 'json', + }, + }, + { + files: 'packages/**/locale/**/*.json', + options: { + parser: 'json', + plugins: ['prettier-plugin-sort-json'], + // 字母按字典顺序排序 + jsonSortOrder: '{ "/^[^\\\\d+]/": "lexical", "/^\\\\d+/": "numeric" }', + }, }, { files: '*.sql', diff --git a/package.json b/package.json index 66834a671..568de1566 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "lint-staged": "^13.3.0", "prettier": "^3.2.5", "prettier-plugin-packagejson": "^2.5.0", + "prettier-plugin-sort-json": "^4.0.0", "prettier-plugin-sql": "^0.17.1", "pretty-format": "^24.9.0", "pretty-quick": "^3.3.1", diff --git a/packages/plugins/@tachybase/plugin-audit-logs/src/locale/zh-CN.json b/packages/plugins/@tachybase/plugin-audit-logs/src/locale/zh-CN.json index 73aa73b72..db5c5d4c3 100644 --- a/packages/plugins/@tachybase/plugin-audit-logs/src/locale/zh-CN.json +++ b/packages/plugins/@tachybase/plugin-audit-logs/src/locale/zh-CN.json @@ -9,9 +9,9 @@ "Audit logs": "审计日志", "Before change": "变化前", "Cancel": "取消", + "Collection": "数据集", "Collection display name": "数据集显示名称", "Collection name": "数据集名称", - "Collection": "数据集", "Collections": "数据集", "Column width": "列宽", "Configure actions": "操作配置", @@ -20,25 +20,25 @@ "Created at": "创建于", "Created by": "由创建", "Data changes": "数据变化", - "Delete record": "删除数据", "Delete": "删除", - "Details of changes": "变化详情", + "Delete record": "删除数据", "Details": "详情", + "Details of changes": "变化详情", "Display association fields": "显示关联字段", "Display fields": "显示字段", "Enable actions": "启用的操作", + "Field": "字段", "Field display name": "字段显示名称", "Field value changes": "字段值变化", - "Field": "字段", "Filter": "过滤", "Insert": "插入", "Record ID": "数据 ID", "Records per page": "每页数据", "Refresh": "刷新", "Submit": "提交", - "Update record": "编辑数据", "Update": "编辑", + "Update record": "编辑数据", "User": "用户", - "View record": "查看数据", - "View": "查看" + "View": "查看", + "View record": "查看数据" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c6317f324..d41f1848f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -107,6 +107,9 @@ importers: prettier-plugin-packagejson: specifier: ^2.5.0 version: 2.5.0(prettier@3.2.5) + prettier-plugin-sort-json: + specifier: ^4.0.0 + version: 4.0.0(prettier@3.2.5) prettier-plugin-sql: specifier: ^0.17.1 version: 0.17.1(prettier@3.2.5) @@ -133,10 +136,10 @@ importers: version: 8.4.0(eslint@9.10.0)(typescript@5.4.5) umi: specifier: ^4.3.3 - version: 4.3.3(@babel/core@7.25.2)(@types/node@20.14.2)(@types/react@18.3.3)(eslint@9.10.0)(lightningcss@1.26.0)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.29.4)(sass@1.77.8)(stylelint@16.8.2(typescript@5.4.5))(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.5)(webpack@5.93.0) + version: 4.3.3(@babel/core@7.22.10)(@types/node@20.14.2)(@types/react@18.3.3)(eslint@9.10.0)(lightningcss@1.26.0)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.29.4)(sass@1.77.8)(stylelint@16.8.2(typescript@5.4.5))(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.5)(webpack@5.93.0) vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@20.14.2)(jsdom@24.1.1(canvas@2.11.2(encoding@0.1.13)))(less@4.2.0)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6) + version: 1.6.0(@types/node@20.14.2)(jsdom@24.1.1(canvas@2.11.2(encoding@0.1.13)))(less@4.1.3)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6) packages/core/acl: dependencies: @@ -1010,7 +1013,7 @@ importers: version: 5.4.4 umi: specifier: ^4.3.3 - version: 4.3.3(@babel/core@7.22.10)(@types/node@20.14.2)(@types/react@18.3.3)(eslint@8.55.0)(lightningcss@1.26.0)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.29.4)(sass@1.77.8)(stylelint@16.8.2(typescript@5.4.4))(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.4)(webpack@5.93.0) + version: 4.3.3(@babel/core@7.25.2)(@types/node@20.14.2)(@types/react@18.3.3)(eslint@8.55.0)(lightningcss@1.26.0)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.29.4)(sass@1.77.8)(stylelint@16.8.2(typescript@5.4.4))(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.4)(webpack@5.93.0) packages/core/evaluators: dependencies: @@ -12991,6 +12994,7 @@ packages: eslint@8.55.0: resolution: {integrity: sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true eslint@9.10.0: @@ -16844,6 +16848,12 @@ packages: prettier: optional: true + prettier-plugin-sort-json@4.0.0: + resolution: {integrity: sha512-zV5g+bWFD2zAqyQ8gCkwUTC49o9FxslaUdirwivt5GZHcf57hCocavykuyYqbExoEsuBOg8IU36OY7zmVEMOWA==} + engines: {node: '>=18.0.0'} + peerDependencies: + prettier: ^3.0.0 + prettier-plugin-sql@0.17.1: resolution: {integrity: sha512-CR9UpTkUSC/f69AV597hnYcBo77iUhsBPkUER7BUa4YHRRtRUJGfL5LDoHAlUHWGTZNiJdHHELlzK6I3R9XuAw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -16995,6 +17005,7 @@ packages: engines: {node: '>=0.6.0', teleport: '>=0.2.0'} deprecated: |- You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. + (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) qrcode.react@3.1.0: @@ -26613,10 +26624,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@9.10.0)(typescript@5.4.5))(eslint@9.10.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@8.4.0(eslint@9.10.0)(typescript@5.4.5))(eslint@9.10.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 5.62.0(eslint@9.10.0)(typescript@5.4.5) + '@typescript-eslint/parser': 8.4.0(eslint@9.10.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/type-utils': 5.62.0(eslint@9.10.0)(typescript@5.4.5) '@typescript-eslint/utils': 5.62.0(eslint@9.10.0)(typescript@5.4.5) @@ -27155,7 +27166,7 @@ snapshots: '@babel/core': 7.23.6 '@babel/eslint-parser': 7.23.3(@babel/core@7.23.6)(eslint@9.10.0) '@stylelint/postcss-css-in-js': 0.38.0(postcss-syntax@0.36.2(postcss@8.4.39))(postcss@8.4.39) - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@9.10.0)(typescript@5.4.5))(eslint@9.10.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@8.4.0(eslint@9.10.0)(typescript@5.4.5))(eslint@9.10.0)(typescript@5.4.5) '@typescript-eslint/parser': 5.62.0(eslint@9.10.0)(typescript@5.4.5) '@umijs/babel-preset-umi': 4.3.3 eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@9.10.0)(typescript@5.4.5))(eslint@9.10.0)(typescript@5.4.5))(eslint@9.10.0)(typescript@5.4.5) @@ -30693,7 +30704,7 @@ snapshots: '@typescript-eslint/utils': 5.62.0(eslint@9.10.0)(typescript@5.4.5) eslint: 9.10.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@9.10.0)(typescript@5.4.5))(eslint@9.10.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@8.4.0(eslint@9.10.0)(typescript@5.4.5))(eslint@9.10.0)(typescript@5.4.5) transitivePeerDependencies: - supports-color - typescript @@ -35357,6 +35368,10 @@ snapshots: optionalDependencies: prettier: 3.2.5 + prettier-plugin-sort-json@4.0.0(prettier@3.2.5): + dependencies: + prettier: 3.2.5 + prettier-plugin-sql@0.17.1(prettier@3.2.5): dependencies: jsox: 1.2.119 @@ -38429,19 +38444,19 @@ snapshots: uglify-to-browserify@1.0.2: optional: true - umi@4.3.3(@babel/core@7.22.10)(@types/node@20.14.2)(@types/react@18.3.3)(eslint@8.55.0)(lightningcss@1.26.0)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.29.4)(sass@1.77.8)(stylelint@16.8.2(typescript@5.4.4))(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.4)(webpack@5.93.0): + umi@4.3.3(@babel/core@7.22.10)(@types/node@20.14.2)(@types/react@18.3.3)(eslint@9.10.0)(lightningcss@1.26.0)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.29.4)(sass@1.77.8)(stylelint@16.8.2(typescript@5.4.5))(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.5)(webpack@5.93.0): dependencies: '@babel/runtime': 7.23.6 '@umijs/bundler-utils': 4.3.3 - '@umijs/bundler-webpack': 4.3.3(type-fest@4.25.0)(typescript@5.4.4)(webpack@5.93.0) + '@umijs/bundler-webpack': 4.3.3(type-fest@4.25.0)(typescript@5.4.5)(webpack@5.93.0) '@umijs/core': 4.3.3 - '@umijs/lint': 4.3.3(eslint@8.55.0)(stylelint@16.8.2(typescript@5.4.4))(typescript@5.4.4) - '@umijs/preset-umi': 4.3.3(@types/node@20.14.2)(@types/react@18.3.3)(lightningcss@1.26.0)(rollup@3.29.4)(sass@1.77.8)(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.4)(webpack@5.93.0) + '@umijs/lint': 4.3.3(eslint@9.10.0)(stylelint@16.8.2(typescript@5.4.5))(typescript@5.4.5) + '@umijs/preset-umi': 4.3.3(@types/node@20.14.2)(@types/react@18.3.3)(lightningcss@1.26.0)(rollup@3.29.4)(sass@1.77.8)(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.5)(webpack@5.93.0) '@umijs/renderer-react': 4.3.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@umijs/server': 4.3.3 '@umijs/test': 4.3.3(@babel/core@7.22.10) '@umijs/utils': 4.3.3 - prettier-plugin-organize-imports: 3.2.4(prettier@3.2.5)(typescript@5.4.4) + prettier-plugin-organize-imports: 3.2.4(prettier@3.2.5)(typescript@5.4.5) prettier-plugin-packagejson: 2.4.3(prettier@3.2.5) transitivePeerDependencies: - '@babel/core' @@ -38476,19 +38491,19 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - umi@4.3.3(@babel/core@7.25.2)(@types/node@20.14.2)(@types/react@18.3.3)(eslint@9.10.0)(lightningcss@1.26.0)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.29.4)(sass@1.77.8)(stylelint@16.8.2(typescript@5.4.5))(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.5)(webpack@5.93.0): + umi@4.3.3(@babel/core@7.25.2)(@types/node@20.14.2)(@types/react@18.3.3)(eslint@8.55.0)(lightningcss@1.26.0)(prettier@3.2.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.29.4)(sass@1.77.8)(stylelint@16.8.2(typescript@5.4.4))(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.4)(webpack@5.93.0): dependencies: '@babel/runtime': 7.23.6 '@umijs/bundler-utils': 4.3.3 - '@umijs/bundler-webpack': 4.3.3(type-fest@4.25.0)(typescript@5.4.5)(webpack@5.93.0) + '@umijs/bundler-webpack': 4.3.3(type-fest@4.25.0)(typescript@5.4.4)(webpack@5.93.0) '@umijs/core': 4.3.3 - '@umijs/lint': 4.3.3(eslint@9.10.0)(stylelint@16.8.2(typescript@5.4.5))(typescript@5.4.5) - '@umijs/preset-umi': 4.3.3(@types/node@20.14.2)(@types/react@18.3.3)(lightningcss@1.26.0)(rollup@3.29.4)(sass@1.77.8)(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.5)(webpack@5.93.0) + '@umijs/lint': 4.3.3(eslint@8.55.0)(stylelint@16.8.2(typescript@5.4.4))(typescript@5.4.4) + '@umijs/preset-umi': 4.3.3(@types/node@20.14.2)(@types/react@18.3.3)(lightningcss@1.26.0)(rollup@3.29.4)(sass@1.77.8)(terser@5.31.6)(type-fest@4.25.0)(typescript@5.4.4)(webpack@5.93.0) '@umijs/renderer-react': 4.3.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@umijs/server': 4.3.3 '@umijs/test': 4.3.3(@babel/core@7.25.2) '@umijs/utils': 4.3.3 - prettier-plugin-organize-imports: 3.2.4(prettier@3.2.5)(typescript@5.4.5) + prettier-plugin-organize-imports: 3.2.4(prettier@3.2.5)(typescript@5.4.4) prettier-plugin-packagejson: 2.4.3(prettier@3.2.5) transitivePeerDependencies: - '@babel/core' @@ -38844,6 +38859,23 @@ snapshots: string_decoder: 1.3.0 util-deprecate: 1.0.2 + vite-node@1.6.0(@types/node@20.14.2)(less@4.1.3)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6): + dependencies: + cac: 6.7.14 + debug: 4.3.6(supports-color@8.1.1) + pathe: 1.1.2 + picocolors: 1.0.1 + vite: 5.2.13(@types/node@20.14.2)(less@4.1.3)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + vite-node@1.6.0(@types/node@20.14.2)(less@4.2.0)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6): dependencies: cac: 6.7.14 @@ -38884,6 +38916,19 @@ snapshots: sass: 1.77.8 terser: 5.31.6 + vite@5.2.13(@types/node@20.14.2)(less@4.1.3)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6): + dependencies: + esbuild: 0.20.2 + postcss: 8.4.39 + rollup: 4.14.1 + optionalDependencies: + '@types/node': 20.14.2 + fsevents: 2.3.3 + less: 4.1.3 + lightningcss: 1.26.0 + sass: 1.77.8 + terser: 5.31.6 + vite@5.2.13(@types/node@20.14.2)(less@4.2.0)(lightningcss@1.26.0)(sass@1.75.0)(terser@5.31.6): dependencies: esbuild: 0.20.2 @@ -38944,6 +38989,40 @@ snapshots: - supports-color - terser + vitest@1.6.0(@types/node@20.14.2)(jsdom@24.1.1(canvas@2.11.2(encoding@0.1.13)))(less@4.1.3)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6): + dependencies: + '@vitest/expect': 1.6.0 + '@vitest/runner': 1.6.0 + '@vitest/snapshot': 1.6.0 + '@vitest/spy': 1.6.0 + '@vitest/utils': 1.6.0 + acorn-walk: 8.3.2 + chai: 4.3.10 + debug: 4.3.5(supports-color@5.5.0) + execa: 8.0.1 + local-pkg: 0.5.0 + magic-string: 0.30.8 + pathe: 1.1.2 + picocolors: 1.0.1 + std-env: 3.7.0 + strip-literal: 2.0.0 + tinybench: 2.6.0 + tinypool: 0.8.3 + vite: 5.2.13(@types/node@20.14.2)(less@4.1.3)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6) + vite-node: 1.6.0(@types/node@20.14.2)(less@4.1.3)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6) + why-is-node-running: 2.2.2 + optionalDependencies: + '@types/node': 20.14.2 + jsdom: 24.1.1(canvas@2.11.2(encoding@0.1.13)) + transitivePeerDependencies: + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + vitest@1.6.0(@types/node@20.14.2)(jsdom@24.1.1(canvas@2.11.2(encoding@0.1.13)))(less@4.2.0)(lightningcss@1.26.0)(sass@1.77.8)(terser@5.31.6): dependencies: '@vitest/expect': 1.6.0