chore: 修复 locale 问题

This commit is contained in:
winixt 2025-09-11 16:46:04 +08:00
parent 42b2f38c2b
commit 30b6b0d7ac
5 changed files with 86 additions and 50 deletions

View File

@ -17,12 +17,12 @@
<script> <script>
import { FScrollbar, FTooltip } from '@fesjs/fes-design'; import { FScrollbar, FTooltip } from '@fesjs/fes-design';
import { LanguageOutlined } from '@fesjs/fes-design/icon'; import { LanguageOutlined } from '@fesjs/fes-design/icon';
import { useI18n } from 'vue-i18n';
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import langUConfigMap from '../langUConfigMap'; import { useI18n } from 'vue-i18n';
import { locale as _locale } from '../core'; import { locale as _locale } from '../core';
import langUConfigMap from '../langUConfigMap';
export default { export default {
components: { components: {
FTooltip, FTooltip,

View File

@ -1,7 +1,7 @@
import { readdirSync, readFileSync, statSync } from 'node:fs'; import { readdirSync, readFileSync, statSync } from 'node:fs';
import { basename, dirname, extname, join } from 'node:path'; import { basename, dirname, extname, join } from 'node:path';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import { generator, lodash, logger, parser, winPath } from '@fesjs/utils'; import { generate, lodash, logger, parser, winPath } from '@fesjs/utils';
import { parse } from '@vue/compiler-sfc'; import { parse } from '@vue/compiler-sfc';
import { runtimePath } from '../../../utils/constants'; import { runtimePath } from '../../../utils/constants';
@ -92,13 +92,15 @@ function getRouteMeta(content) {
&& expression.expression.callee.name === 'defineRouteMeta', && expression.expression.callee.name === 'defineRouteMeta',
)[0]; )[0];
if (defineRouteExpression) { if (defineRouteExpression) {
const argument = generator(defineRouteExpression.expression.arguments[0]); const argument = generate(defineRouteExpression.expression.arguments[0]);
// eslint-disable-next-line no-eval // eslint-disable-next-line no-eval
const fn = eval(`() => (${argument.code})`); const fn = eval(`() => (${argument.code})`);
return fn(); return fn();
} }
} }
catch (err) {} catch (err) {
}
return null; return null;
} }

View File

@ -30,9 +30,9 @@
"access": "public" "access": "public"
}, },
"dependencies": { "dependencies": {
"@babel/generator": "^7.21.3", "@babel/generator": "^7.28.3",
"@babel/parser": "^7.21.3", "@babel/parser": "^7.28.4",
"@babel/traverse": "^7.21.3", "@babel/traverse": "^7.28.4",
"chalk": "^4.1.2", "chalk": "^4.1.2",
"chokidar": "^3.5.2", "chokidar": "^3.5.2",
"debug": "^4.3.2", "debug": "^4.3.2",

View File

@ -1,4 +1,4 @@
import generator from '@babel/generator'; import { generate } from '@babel/generator';
import * as parser from '@babel/parser'; import * as parser from '@babel/parser';
import traverse from '@babel/traverse'; import traverse from '@babel/traverse';
import chalk from 'chalk'; import chalk from 'chalk';
@ -33,7 +33,7 @@ export {
chokidar, chokidar,
createDebug, createDebug,
deepmerge, deepmerge,
generator, generate,
glob, glob,
lodash, lodash,
logger, logger,

112
pnpm-lock.yaml generated
View File

@ -637,8 +637,8 @@ importers:
specifier: workspace:* specifier: workspace:*
version: link:../utils version: link:../utils
'@vueuse/core': '@vueuse/core':
specifier: ^10.9.0 specifier: ^13.0.0
version: 10.11.1(vue@3.5.21(typescript@5.9.2)) version: 13.9.0(vue@3.5.21(typescript@5.9.2))
vue: vue:
specifier: ^3.5.21 specifier: ^3.5.21
version: 3.5.21(typescript@5.9.2) version: 3.5.21(typescript@5.9.2)
@ -955,14 +955,14 @@ importers:
packages/utils: packages/utils:
dependencies: dependencies:
'@babel/generator': '@babel/generator':
specifier: ^7.21.3 specifier: ^7.28.3
version: 7.28.3 version: 7.28.3
'@babel/parser': '@babel/parser':
specifier: ^7.21.3 specifier: ^7.28.4
version: 7.28.3 version: 7.28.4
'@babel/traverse': '@babel/traverse':
specifier: ^7.21.3 specifier: ^7.28.4
version: 7.28.3 version: 7.28.4
chalk: chalk:
specifier: ^4.1.2 specifier: ^4.1.2
version: 4.1.2 version: 4.1.2
@ -1270,6 +1270,11 @@ packages:
engines: {node: '>=6.0.0'} engines: {node: '>=6.0.0'}
hasBin: true hasBin: true
'@babel/parser@7.28.4':
resolution: {integrity: sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==}
engines: {node: '>=6.0.0'}
hasBin: true
'@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.27.1': '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.27.1':
resolution: {integrity: sha512-QPG3C9cCVRQLxAVwmefEmwdTanECuUBMQZ/ym5kiw3XKCGA7qkuQLcjWWHcrD/GKbn/WmJwaezfuuAOcyKlRPA==} resolution: {integrity: sha512-QPG3C9cCVRQLxAVwmefEmwdTanECuUBMQZ/ym5kiw3XKCGA7qkuQLcjWWHcrD/GKbn/WmJwaezfuuAOcyKlRPA==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
@ -1713,10 +1718,18 @@ packages:
resolution: {integrity: sha512-7w4kZYHneL3A6NP2nxzHvT3HCZ7puDZZjFMqDpBPECub79sTtSO5CGXDkKrTQq8ksAwfD/XI2MRFX23njdDaIQ==} resolution: {integrity: sha512-7w4kZYHneL3A6NP2nxzHvT3HCZ7puDZZjFMqDpBPECub79sTtSO5CGXDkKrTQq8ksAwfD/XI2MRFX23njdDaIQ==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
'@babel/traverse@7.28.4':
resolution: {integrity: sha512-YEzuboP2qvQavAcjgQNVgsvHIDv6ZpwXvcvjmyySP2DIMuByS/6ioU5G9pYrWHM6T2YDfc7xga9iNzYOs12CFQ==}
engines: {node: '>=6.9.0'}
'@babel/types@7.28.2': '@babel/types@7.28.2':
resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==} resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
'@babel/types@7.28.4':
resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==}
engines: {node: '>=6.9.0'}
'@clack/core@0.5.0': '@clack/core@0.5.0':
resolution: {integrity: sha512-p3y0FIOwaYRUPRcMO7+dlmLh8PSRcrjuTndsiA0WAFbWES0mLZlrjVoBRZ9DzkPFJZG6KGkJmoEAY0ZcVWTkow==} resolution: {integrity: sha512-p3y0FIOwaYRUPRcMO7+dlmLh8PSRcrjuTndsiA0WAFbWES0mLZlrjVoBRZ9DzkPFJZG6KGkJmoEAY0ZcVWTkow==}
@ -8695,7 +8708,7 @@ snapshots:
'@babel/generator@7.28.3': '@babel/generator@7.28.3':
dependencies: dependencies:
'@babel/parser': 7.28.3 '@babel/parser': 7.28.4
'@babel/types': 7.28.2 '@babel/types': 7.28.2
'@jridgewell/gen-mapping': 0.3.13 '@jridgewell/gen-mapping': 0.3.13
'@jridgewell/trace-mapping': 0.3.30 '@jridgewell/trace-mapping': 0.3.30
@ -8703,7 +8716,7 @@ snapshots:
'@babel/helper-annotate-as-pure@7.27.3': '@babel/helper-annotate-as-pure@7.27.3':
dependencies: dependencies:
'@babel/types': 7.28.2 '@babel/types': 7.28.4
'@babel/helper-compilation-targets@7.27.2': '@babel/helper-compilation-targets@7.27.2':
dependencies: dependencies:
@ -8721,7 +8734,7 @@ snapshots:
'@babel/helper-optimise-call-expression': 7.27.1 '@babel/helper-optimise-call-expression': 7.27.1
'@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.3) '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.3)
'@babel/helper-skip-transparent-expression-wrappers': 7.27.1 '@babel/helper-skip-transparent-expression-wrappers': 7.27.1
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
semver: 6.3.1 semver: 6.3.1
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -8748,15 +8761,15 @@ snapshots:
'@babel/helper-member-expression-to-functions@7.27.1': '@babel/helper-member-expression-to-functions@7.27.1':
dependencies: dependencies:
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
'@babel/types': 7.28.2 '@babel/types': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@babel/helper-module-imports@7.27.1': '@babel/helper-module-imports@7.27.1':
dependencies: dependencies:
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
'@babel/types': 7.28.2 '@babel/types': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -8765,13 +8778,13 @@ snapshots:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-module-imports': 7.27.1 '@babel/helper-module-imports': 7.27.1
'@babel/helper-validator-identifier': 7.27.1 '@babel/helper-validator-identifier': 7.27.1
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@babel/helper-optimise-call-expression@7.27.1': '@babel/helper-optimise-call-expression@7.27.1':
dependencies: dependencies:
'@babel/types': 7.28.2 '@babel/types': 7.28.4
'@babel/helper-plugin-utils@7.27.1': {} '@babel/helper-plugin-utils@7.27.1': {}
@ -8780,7 +8793,7 @@ snapshots:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-annotate-as-pure': 7.27.3 '@babel/helper-annotate-as-pure': 7.27.3
'@babel/helper-wrap-function': 7.28.3 '@babel/helper-wrap-function': 7.28.3
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -8789,14 +8802,14 @@ snapshots:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-member-expression-to-functions': 7.27.1 '@babel/helper-member-expression-to-functions': 7.27.1
'@babel/helper-optimise-call-expression': 7.27.1 '@babel/helper-optimise-call-expression': 7.27.1
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@babel/helper-skip-transparent-expression-wrappers@7.27.1': '@babel/helper-skip-transparent-expression-wrappers@7.27.1':
dependencies: dependencies:
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
'@babel/types': 7.28.2 '@babel/types': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -8809,25 +8822,29 @@ snapshots:
'@babel/helper-wrap-function@7.28.3': '@babel/helper-wrap-function@7.28.3':
dependencies: dependencies:
'@babel/template': 7.27.2 '@babel/template': 7.27.2
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
'@babel/types': 7.28.2 '@babel/types': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@babel/helpers@7.28.3': '@babel/helpers@7.28.3':
dependencies: dependencies:
'@babel/template': 7.27.2 '@babel/template': 7.27.2
'@babel/types': 7.28.2 '@babel/types': 7.28.4
'@babel/parser@7.28.3': '@babel/parser@7.28.3':
dependencies: dependencies:
'@babel/types': 7.28.2 '@babel/types': 7.28.4
'@babel/parser@7.28.4':
dependencies:
'@babel/types': 7.28.4
'@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.27.1(@babel/core@7.28.3)': '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.27.1(@babel/core@7.28.3)':
dependencies: dependencies:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -8854,7 +8871,7 @@ snapshots:
dependencies: dependencies:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -8924,7 +8941,7 @@ snapshots:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.28.3) '@babel/helper-remap-async-to-generator': 7.27.1(@babel/core@7.28.3)
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -8971,7 +8988,7 @@ snapshots:
'@babel/helper-globals': 7.28.0 '@babel/helper-globals': 7.28.0
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.3) '@babel/helper-replace-supers': 7.27.1(@babel/core@7.28.3)
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -8985,7 +9002,7 @@ snapshots:
dependencies: dependencies:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -9042,7 +9059,7 @@ snapshots:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-compilation-targets': 7.27.2 '@babel/helper-compilation-targets': 7.27.2
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -9088,7 +9105,7 @@ snapshots:
'@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.3) '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.3)
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/helper-validator-identifier': 7.27.1 '@babel/helper-validator-identifier': 7.27.1
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -9128,7 +9145,7 @@ snapshots:
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/plugin-transform-destructuring': 7.28.0(@babel/core@7.28.3) '@babel/plugin-transform-destructuring': 7.28.0(@babel/core@7.28.3)
'@babel/plugin-transform-parameters': 7.27.7(@babel/core@7.28.3) '@babel/plugin-transform-parameters': 7.27.7(@babel/core@7.28.3)
'@babel/traverse': 7.28.3 '@babel/traverse': 7.28.4
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -9350,7 +9367,7 @@ snapshots:
dependencies: dependencies:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/types': 7.28.2 '@babel/types': 7.28.4
esutils: 2.0.3 esutils: 2.0.3
'@babel/preset-typescript@7.27.1(@babel/core@7.28.3)': '@babel/preset-typescript@7.27.1(@babel/core@7.28.3)':
@ -9369,7 +9386,7 @@ snapshots:
'@babel/template@7.27.2': '@babel/template@7.27.2':
dependencies: dependencies:
'@babel/code-frame': 7.27.1 '@babel/code-frame': 7.27.1
'@babel/parser': 7.28.3 '@babel/parser': 7.28.4
'@babel/types': 7.28.2 '@babel/types': 7.28.2
'@babel/traverse@7.28.3': '@babel/traverse@7.28.3':
@ -9377,9 +9394,21 @@ snapshots:
'@babel/code-frame': 7.27.1 '@babel/code-frame': 7.27.1
'@babel/generator': 7.28.3 '@babel/generator': 7.28.3
'@babel/helper-globals': 7.28.0 '@babel/helper-globals': 7.28.0
'@babel/parser': 7.28.3 '@babel/parser': 7.28.4
'@babel/template': 7.27.2 '@babel/template': 7.27.2
'@babel/types': 7.28.2 '@babel/types': 7.28.4
debug: 4.4.1
transitivePeerDependencies:
- supports-color
'@babel/traverse@7.28.4':
dependencies:
'@babel/code-frame': 7.27.1
'@babel/generator': 7.28.3
'@babel/helper-globals': 7.28.0
'@babel/parser': 7.28.4
'@babel/template': 7.27.2
'@babel/types': 7.28.4
debug: 4.4.1 debug: 4.4.1
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -9389,6 +9418,11 @@ snapshots:
'@babel/helper-string-parser': 7.27.1 '@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.27.1 '@babel/helper-validator-identifier': 7.27.1
'@babel/types@7.28.4':
dependencies:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.27.1
'@clack/core@0.5.0': '@clack/core@0.5.0':
dependencies: dependencies:
picocolors: 1.1.1 picocolors: 1.1.1
@ -10586,7 +10620,7 @@ snapshots:
'@types/babel__generator@7.27.0': '@types/babel__generator@7.27.0':
dependencies: dependencies:
'@babel/types': 7.28.2 '@babel/types': 7.28.4
'@types/babel__traverse@7.28.0': '@types/babel__traverse@7.28.0':
dependencies: dependencies:
@ -10925,14 +10959,14 @@ snapshots:
'@babel/core': 7.28.3 '@babel/core': 7.28.3
'@babel/helper-module-imports': 7.27.1 '@babel/helper-module-imports': 7.27.1
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/parser': 7.28.3 '@babel/parser': 7.28.4
'@vue/compiler-sfc': 3.5.21 '@vue/compiler-sfc': 3.5.21
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@vue/compiler-core@3.5.21': '@vue/compiler-core@3.5.21':
dependencies: dependencies:
'@babel/parser': 7.28.3 '@babel/parser': 7.28.4
'@vue/shared': 3.5.21 '@vue/shared': 3.5.21
entities: 4.5.0 entities: 4.5.0
estree-walker: 2.0.2 estree-walker: 2.0.2