This is an automated email from the ASF dual-hosted git repository.
msyavuz pushed a commit to branch msyavuz/chore/move-translator
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/msyavuz/chore/move-translator
by this push:
new 079773615b chore: migrate imports
079773615b is described below
commit 079773615b1223fd6dcb5482cfb1937ad2b3eb1a
Author: Mehmet Salih Yavuz <[email protected]>
AuthorDate: Tue Jan 6 20:52:57 2026 +0300
chore: migrate imports
---
superset-frontend/packages/superset-core/package.json | 3 ++-
superset-frontend/packages/superset-core/src/index.ts | 1 +
.../packages/superset-core/src/ui/translation/Translator.ts | 2 +-
superset-frontend/packages/superset-core/src/{ => utils}/index.ts | 4 ++--
.../packages/{superset-ui-core => superset-core}/src/utils/logging.ts | 2 +-
.../packages/{superset-ui-core => superset-core}/types/external.d.ts | 0
superset-frontend/packages/superset-ui-core/src/index.ts | 1 -
.../packages/superset-ui-core/src/query/extractQueryFields.ts | 2 +-
superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts | 2 +-
.../packages/superset-ui-core/src/validator/legacyValidateInteger.ts | 2 +-
.../packages/superset-ui-core/src/validator/legacyValidateNumber.ts | 2 +-
.../packages/superset-ui-core/src/validator/validateInteger.ts | 2 +-
.../superset-ui-core/src/validator/validateMapboxStylesUrl.ts | 2 +-
.../packages/superset-ui-core/src/validator/validateMaxValue.ts | 2 +-
.../packages/superset-ui-core/src/validator/validateNonEmpty.ts | 2 +-
.../packages/superset-ui-core/src/validator/validateNumber.ts | 2 +-
.../superset-ui-core/src/validator/validateServerPagination.ts | 2 +-
.../src/validator/validateTimeComparisonRangeValues.ts | 2 +-
.../plugins/legacy-plugin-chart-horizon/src/controlPanel.ts | 2 +-
superset-frontend/plugins/plugin-chart-table/src/index.ts | 3 ++-
.../plugins/plugin-chart-word-cloud/src/plugin/controlPanel.tsx | 3 ++-
.../plugin-chart-word-cloud/src/plugin/controls/RotationControl.tsx | 2 +-
superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/index.ts | 3 ++-
superset-frontend/src/SqlLab/components/App/index.tsx | 2 +-
superset-frontend/src/SqlLab/constants.ts | 2 +-
superset-frontend/src/components/Chart/chartReducer.ts | 2 +-
superset-frontend/src/dashboard/actions/chartCustomizationActions.ts | 3 ++-
superset-frontend/src/dashboard/actions/dashboardInfo.ts | 3 ++-
superset-frontend/src/extensions/ExtensionPlaceholder.tsx | 2 +-
superset-frontend/src/extensions/ExtensionsList.tsx | 2 +-
superset-frontend/src/features/home/SavedQueries.tsx | 3 ++-
superset-frontend/src/pages/UsersList/index.tsx | 2 +-
32 files changed, 38 insertions(+), 31 deletions(-)
diff --git a/superset-frontend/packages/superset-core/package.json
b/superset-frontend/packages/superset-core/package.json
index ebbb8153cf..cc286d187e 100644
--- a/superset-frontend/packages/superset-core/package.json
+++ b/superset-frontend/packages/superset-core/package.json
@@ -43,7 +43,8 @@
"react-loadable": "^5.5.0",
"tinycolor2": "*",
"lodash": "^4.17.21",
- "antd": "^5.26.0"
+ "antd": "^5.26.0",
+ "jed": "^1.1.1"
},
"scripts": {
"build": "babel src --out-dir lib --extensions \".ts,.tsx\" && tsc
--emitDeclarationOnly",
diff --git a/superset-frontend/packages/superset-core/src/index.ts
b/superset-frontend/packages/superset-core/src/index.ts
index e570f52292..b02156449f 100644
--- a/superset-frontend/packages/superset-core/src/index.ts
+++ b/superset-frontend/packages/superset-core/src/index.ts
@@ -18,3 +18,4 @@
*/
export * from './api';
export * from './ui';
+export * from './utils';
diff --git
a/superset-frontend/packages/superset-core/src/ui/translation/Translator.ts
b/superset-frontend/packages/superset-core/src/ui/translation/Translator.ts
index bf27ec7ce4..52283a7294 100644
--- a/superset-frontend/packages/superset-core/src/ui/translation/Translator.ts
+++ b/superset-frontend/packages/superset-core/src/ui/translation/Translator.ts
@@ -17,7 +17,7 @@
* under the License.
*/
import UntypedJed from 'jed';
-import logging from '../utils/logging';
+import logging from '../../utils/logging';
import {
Jed,
TranslatorConfig,
diff --git a/superset-frontend/packages/superset-core/src/index.ts
b/superset-frontend/packages/superset-core/src/utils/index.ts
similarity index 94%
copy from superset-frontend/packages/superset-core/src/index.ts
copy to superset-frontend/packages/superset-core/src/utils/index.ts
index e570f52292..047635eb7e 100644
--- a/superset-frontend/packages/superset-core/src/index.ts
+++ b/superset-frontend/packages/superset-core/src/utils/index.ts
@@ -16,5 +16,5 @@
* specific language governing permissions and limitations
* under the License.
*/
-export * from './api';
-export * from './ui';
+
+export { default as logging } from './logging';
\ No newline at end of file
diff --git a/superset-frontend/packages/superset-ui-core/src/utils/logging.ts
b/superset-frontend/packages/superset-core/src/utils/logging.ts
similarity index 95%
rename from superset-frontend/packages/superset-ui-core/src/utils/logging.ts
rename to superset-frontend/packages/superset-core/src/utils/logging.ts
index 929c4d0fb9..230dbdf2bd 100644
--- a/superset-frontend/packages/superset-ui-core/src/utils/logging.ts
+++ b/superset-frontend/packages/superset-core/src/utils/logging.ts
@@ -31,7 +31,7 @@ const logger = {
};
/**
- * Superset frontend logger, currently just an alias to console.
+ * Superset logger, currently just an alias to console.
* This may be extended to support numerous console operations safely
* i.e.: https://developer.mozilla.org/en-US/docs/Web/API/Console
*/
diff --git a/superset-frontend/packages/superset-ui-core/types/external.d.ts
b/superset-frontend/packages/superset-core/types/external.d.ts
similarity index 100%
rename from superset-frontend/packages/superset-ui-core/types/external.d.ts
rename to superset-frontend/packages/superset-core/types/external.d.ts
diff --git a/superset-frontend/packages/superset-ui-core/src/index.ts
b/superset-frontend/packages/superset-ui-core/src/index.ts
index 5c0e70e31f..29d7d8154d 100644
--- a/superset-frontend/packages/superset-ui-core/src/index.ts
+++ b/superset-frontend/packages/superset-ui-core/src/index.ts
@@ -20,7 +20,6 @@
export * from './models';
export * from './utils';
export * from './types';
-export * from './translation';
export * from './connection';
export * from './dynamic-plugins';
export * from './query';
diff --git
a/superset-frontend/packages/superset-ui-core/src/query/extractQueryFields.ts
b/superset-frontend/packages/superset-ui-core/src/query/extractQueryFields.ts
index 6cb0af8eec..d544b8fd14 100644
---
a/superset-frontend/packages/superset-ui-core/src/query/extractQueryFields.ts
+++
b/superset-frontend/packages/superset-ui-core/src/query/extractQueryFields.ts
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
import { removeDuplicates } from '../utils';
import getColumnLabel from './getColumnLabel';
import getMetricLabel from './getMetricLabel';
diff --git a/superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts
b/superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts
index 59d5b08bb5..2ca22fcd79 100644
--- a/superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts
+++ b/superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
import { sanitizeHtml } from './html';
const TRUNCATION_STYLE = `
diff --git
a/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts
b/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts
index 7034e58ca5..972fdf855d 100644
---
a/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts
+++
b/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
/**
* formerly called integer()
diff --git
a/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts
b/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts
index 3b63f12840..d6a7b337f0 100644
---
a/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts
+++
b/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
/**
* formerly called numeric()
diff --git
a/superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts
b/superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts
index 1677f0ecf9..bea18dca9d 100644
---
a/superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts
+++
b/superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
export default function validateInteger(v: unknown) {
if (
diff --git
a/superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts
b/superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts
index 89ec2c7383..facbc149ae 100644
---
a/superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts
+++
b/superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
const VALIDE_OSM_URLS = ['https://tile.osm', 'https://tile.openstreetmap'];
diff --git
a/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts
b/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts
index 27f6d0a590..bb7e6c052b 100644
---
a/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts
+++
b/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
export default function validateMaxValue(v: unknown, max: number) {
if (Number(v) > +max) {
diff --git
a/superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts
b/superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts
index af4173cd44..835c433fe2 100644
---
a/superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts
+++
b/superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
export default function validateNonEmpty(v: unknown) {
if (
diff --git
a/superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts
b/superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts
index 3775a56cb5..ce8db32cd2 100644
---
a/superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts
+++
b/superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
export default function validateInteger(v: any) {
if (
diff --git
a/superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts
b/superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts
index 202ca95399..1907a8198c 100644
---
a/superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts
+++
b/superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
export default function validateServerPagination(
v: unknown,
diff --git
a/superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts
b/superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts
index c639ec6caf..b362757db1 100644
---
a/superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts
+++
b/superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts
@@ -18,7 +18,7 @@
*/
import { ComparisonTimeRangeType } from '../time-comparison';
-import { t } from '../translation';
+import { t } from '@apache-superset/core';
import { ensureIsArray } from '../utils';
export const validateTimeComparisonRangeValues = (
diff --git
a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts
b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts
index 51a43a450e..880051fda2 100644
--- a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts
+++ b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
import {
ControlPanelConfig,
formatSelectOptions,
diff --git a/superset-frontend/plugins/plugin-chart-table/src/index.ts
b/superset-frontend/plugins/plugin-chart-table/src/index.ts
index 0518281d9c..48712ebfc2 100644
--- a/superset-frontend/plugins/plugin-chart-table/src/index.ts
+++ b/superset-frontend/plugins/plugin-chart-table/src/index.ts
@@ -16,7 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { Behavior, ChartMetadata, ChartPlugin, t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
+import { Behavior, ChartMetadata, ChartPlugin } from '@superset-ui/core';
import transformProps from './transformProps';
import thumbnail from './images/thumbnail.png';
import thumbnailDark from './images/thumbnail-dark.png';
diff --git
a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.tsx
b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.tsx
index a4d7d689e7..6408c07b2e 100644
---
a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.tsx
+++
b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.tsx
@@ -16,7 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t, validateNonEmpty } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
+import { validateNonEmpty } from '@superset-ui/core';
import {
ControlPanelConfig,
getStandardizedControls,
diff --git
a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/RotationControl.tsx
b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/RotationControl.tsx
index 5c2ea55577..464312ae47 100644
---
a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/RotationControl.tsx
+++
b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/RotationControl.tsx
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
import { Select, SelectValue } from '@superset-ui/core/components';
import { ControlHeader } from '@superset-ui/chart-controls';
import { ControlComponentProps } from '@superset-ui/chart-controls';
diff --git
a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/index.ts
b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/index.ts
index d7cb0ebdfa..a8305489dc 100644
--- a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/index.ts
+++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/index.ts
@@ -17,7 +17,8 @@
* under the License.
*/
-import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
+import { ChartMetadata, ChartPlugin } from '@superset-ui/core';
import transformProps from './transformProps';
import buildQuery from './buildQuery';
import { WordCloudFormData } from '../types';
diff --git a/superset-frontend/src/SqlLab/components/App/index.tsx
b/superset-frontend/src/SqlLab/components/App/index.tsx
index 7e19359a03..efe9597c9f 100644
--- a/superset-frontend/src/SqlLab/components/App/index.tsx
+++ b/superset-frontend/src/SqlLab/components/App/index.tsx
@@ -20,7 +20,7 @@ import { PureComponent } from 'react';
import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom';
import Mousetrap from 'mousetrap';
-import { t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
import { css, styled } from '@apache-superset/core/ui';
import { throttle } from 'lodash';
import {
diff --git a/superset-frontend/src/SqlLab/constants.ts
b/superset-frontend/src/SqlLab/constants.ts
index 4422e4eac5..01c588bb38 100644
--- a/superset-frontend/src/SqlLab/constants.ts
+++ b/superset-frontend/src/SqlLab/constants.ts
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
import type { LabelType } from '@superset-ui/core/components';
export const STATE_TYPE_MAP: Record<string, LabelType> = {
diff --git a/superset-frontend/src/components/Chart/chartReducer.ts
b/superset-frontend/src/components/Chart/chartReducer.ts
index 081bd41547..b4f089feae 100644
--- a/superset-frontend/src/components/Chart/chartReducer.ts
+++ b/superset-frontend/src/components/Chart/chartReducer.ts
@@ -17,7 +17,7 @@
* under the License.
*/
/* eslint camelcase: 0 */
-import { t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
import { omit } from 'lodash';
import { HYDRATE_DASHBOARD } from 'src/dashboard/actions/hydrate';
import { DatasourcesAction } from 'src/dashboard/actions/datasources';
diff --git
a/superset-frontend/src/dashboard/actions/chartCustomizationActions.ts
b/superset-frontend/src/dashboard/actions/chartCustomizationActions.ts
index 309bd3c3c0..b81fe81825 100644
--- a/superset-frontend/src/dashboard/actions/chartCustomizationActions.ts
+++ b/superset-frontend/src/dashboard/actions/chartCustomizationActions.ts
@@ -18,7 +18,8 @@
*/
import { AnyAction } from 'redux';
import { ThunkAction, ThunkDispatch } from 'redux-thunk';
-import { makeApi, t, getClientErrorObject, DataMask } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
+import { makeApi, getClientErrorObject, DataMask } from '@superset-ui/core';
import { addDangerToast } from 'src/components/MessageToasts/actions';
import { DashboardInfo, RootState } from 'src/dashboard/types';
import {
diff --git a/superset-frontend/src/dashboard/actions/dashboardInfo.ts
b/superset-frontend/src/dashboard/actions/dashboardInfo.ts
index 63570638ea..e65b7143fb 100644
--- a/superset-frontend/src/dashboard/actions/dashboardInfo.ts
+++ b/superset-frontend/src/dashboard/actions/dashboardInfo.ts
@@ -17,7 +17,8 @@
* under the License.
*/
import { Dispatch } from 'redux';
-import { makeApi, t, getClientErrorObject } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
+import { makeApi, getClientErrorObject } from '@superset-ui/core';
import { addDangerToast } from 'src/components/MessageToasts/actions';
import {
ChartConfiguration,
diff --git a/superset-frontend/src/extensions/ExtensionPlaceholder.tsx
b/superset-frontend/src/extensions/ExtensionPlaceholder.tsx
index b9b721e084..43a7f81e30 100644
--- a/superset-frontend/src/extensions/ExtensionPlaceholder.tsx
+++ b/superset-frontend/src/extensions/ExtensionPlaceholder.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
import { EmptyState } from '@superset-ui/core/components';
-import { t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
const ExtensionPlaceholder = ({ id }: { id: string }) => (
<EmptyState
diff --git a/superset-frontend/src/extensions/ExtensionsList.tsx
b/superset-frontend/src/extensions/ExtensionsList.tsx
index 894b6e8558..f85c2cad70 100644
--- a/superset-frontend/src/extensions/ExtensionsList.tsx
+++ b/superset-frontend/src/extensions/ExtensionsList.tsx
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
import { useTheme, css } from '@apache-superset/core/ui';
import { FunctionComponent, useMemo } from 'react';
import { useListViewResource } from 'src/views/CRUD/hooks';
diff --git a/superset-frontend/src/features/home/SavedQueries.tsx
b/superset-frontend/src/features/home/SavedQueries.tsx
index ab586a7947..cf20c49265 100644
--- a/superset-frontend/src/features/home/SavedQueries.tsx
+++ b/superset-frontend/src/features/home/SavedQueries.tsx
@@ -18,7 +18,8 @@
*/
import { useCallback, useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
-import { SupersetClient, t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
+import { SupersetClient } from '@superset-ui/core';
import { styled, useTheme, css } from '@apache-superset/core/ui';
import CodeSyntaxHighlighter, {
preloadLanguages,
diff --git a/superset-frontend/src/pages/UsersList/index.tsx
b/superset-frontend/src/pages/UsersList/index.tsx
index f9787a214e..7a71490bc3 100644
--- a/superset-frontend/src/pages/UsersList/index.tsx
+++ b/superset-frontend/src/pages/UsersList/index.tsx
@@ -18,7 +18,7 @@
*/
import { useCallback, useEffect, useMemo, useState } from 'react';
-import { t } from '@superset-ui/core';
+import { t } from '@apache-superset/core';
import { useListViewResource } from 'src/views/CRUD/hooks';
import SubMenu, { SubMenuProps } from 'src/features/home/SubMenu';
import { ActionsBar, ActionProps } from 'src/components/ListView/ActionsBar';