From 76c39d0e26f9b4a2e3bacaf2f895bf5e65ebcec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Szab=C3=B3?= Date: Wed, 1 Mar 2023 22:33:33 +0100 Subject: [PATCH] Avoid use of require() in default-config.tsx (#1225) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Which problem is this PR solving? - Split from https://github.com/jaegertracing/jaeger-ui/pull/1212 ## Short description of the changes This needs to be an import for an eventual build system switch, since Vite uses ES modules. It also helps make things more consistent. The UI package version in the About Jaeger dropdown still shows up. --------- Signed-off-by: Máté Szabó --- packages/jaeger-ui/src/constants/default-config.tsx | 2 +- packages/jaeger-ui/tsconfig.lint.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/jaeger-ui/src/constants/default-config.tsx b/packages/jaeger-ui/src/constants/default-config.tsx index 492d626353..a631fc501a 100644 --- a/packages/jaeger-ui/src/constants/default-config.tsx +++ b/packages/jaeger-ui/src/constants/default-config.tsx @@ -17,7 +17,7 @@ import deepFreeze from 'deep-freeze'; import { FALLBACK_DAG_MAX_NUM_SERVICES } from './index'; import getVersion from '../utils/version/get-version'; -const { version } = require('../../package.json'); +import { version } from '../../package.json'; export default deepFreeze( Object.defineProperty( diff --git a/packages/jaeger-ui/tsconfig.lint.json b/packages/jaeger-ui/tsconfig.lint.json index 2a44b81358..0820cf3cca 100644 --- a/packages/jaeger-ui/tsconfig.lint.json +++ b/packages/jaeger-ui/tsconfig.lint.json @@ -52,6 +52,7 @@ "src/selectors/trace.js", "src/utils/configure-store.js", "src/utils/sort.js", - "src/utils/TreeNode.js" + "src/utils/TreeNode.js", + "package.json" ] }