From 35141196ae32d85977e2bd3631ae4289aa6ba86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E7=86=B1?= Date: Tue, 2 Jul 2024 12:46:02 +0800 Subject: [PATCH] build: fix lodash's globalName (#2651) * build: fix lodash's globalName * chore(data-validation): update index.ts --- .../auto-externalize-dependency-plugin.js | 2 +- .../src/services/locale/locale.service.ts | 2 +- packages/data-validation/src/index.ts | 30 ++++++++----------- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/common/shared/vite/auto-externalize-dependency-plugin.js b/common/shared/vite/auto-externalize-dependency-plugin.js index f51e30744f..d7e29f1e6a 100644 --- a/common/shared/vite/auto-externalize-dependency-plugin.js +++ b/common/shared/vite/auto-externalize-dependency-plugin.js @@ -45,7 +45,7 @@ exports.autoExternalizeDependency = function autoExternalizeDependency() { version: '>=1.11.0', }, lodash: { - global: 'lodash', + global: '_', name: 'lodash', version: '>=4.0.0', }, diff --git a/packages/core/src/services/locale/locale.service.ts b/packages/core/src/services/locale/locale.service.ts index c54f305950..bb2f754ea3 100644 --- a/packages/core/src/services/locale/locale.service.ts +++ b/packages/core/src/services/locale/locale.service.ts @@ -74,7 +74,7 @@ export class LocaleService extends Disposable { * t('foo.bar', 'World') => 'Hello World' */ t = (key: string, ...args: string[]): string => { - if (!this._locales) throw new Error('Locale not initialized'); + if (!this._locales) throw new Error('[LocaleService]: Locale not initialized'); const keys = key.split('.'); const resolvedValue = this.resolveKeyPath(this._locales[this._currentLocale], keys); diff --git a/packages/data-validation/src/index.ts b/packages/data-validation/src/index.ts index f754fb88ee..992ea35905 100644 --- a/packages/data-validation/src/index.ts +++ b/packages/data-validation/src/index.ts @@ -18,24 +18,6 @@ export { UniverDataValidationPlugin } from './plugin'; export { DataValidatorRegistryService, DataValidatorRegistryScope } from './services/data-validator-registry.service'; export { DataValidationModel } from './models/data-validation-model'; -export type { - IRemoveDataValidationCommandParams, - IAddDataValidationCommandParams, - IRemoveAllDataValidationCommandParams, -} from './commands/commands/data-validation.command'; - -export { - AddDataValidationMutation, - RemoveDataValidationMutation, - UpdateDataValidationMutation, -} from './commands/mutations/data-validation.mutation'; - -export type { - IAddDataValidationMutationParams, - IRemoveDataValidationMutationParams, - IUpdateDataValidationMutationParams, -} from './commands/mutations/data-validation.mutation'; - export { createDefaultNewRule, getRuleOptions, @@ -66,6 +48,18 @@ export { UpdateDataValidationSettingCommand, RemoveAllDataValidationCommand, removeDataValidationUndoFactory, + type IRemoveDataValidationCommandParams, + type IAddDataValidationCommandParams, + type IRemoveAllDataValidationCommandParams, } from './commands/commands/data-validation.command'; +export { + AddDataValidationMutation, + RemoveDataValidationMutation, + UpdateDataValidationMutation, + type IAddDataValidationMutationParams, + type IRemoveDataValidationMutationParams, + type IUpdateDataValidationMutationParams, +} from './commands/mutations/data-validation.mutation'; + // #endregion