-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix undefined process in package #1997
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,8 +164,7 @@ | |
"source-map-explorer": "^2.5.3", | ||
"stylelint": "^15.11.0", | ||
"ts-jest": "^29.2.5", | ||
"typescript": "^5.7.3", | ||
"webpack": "^5.98.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need to install it explicitly |
||
"typescript": "^5.7.3" | ||
}, | ||
"peerDependencies": { | ||
"monaco-yql-languages": ">=1.3.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ import {Lang, defaultLang} from '../../utils/i18n'; | |
import type {SettingProps, SettingsInfoFieldProps} from './Setting'; | ||
import i18n from './i18n'; | ||
|
||
import packageJson from '../../../package.json'; | ||
|
||
export interface SettingsSection { | ||
id: string; | ||
title: string; | ||
|
@@ -141,7 +143,7 @@ export const autocompleteOnEnterSetting: SettingProps = { | |
export const interfaceVersionInfoField: SettingsInfoFieldProps = { | ||
title: i18n('settings.about.interfaceVersionInfoField.title'), | ||
type: 'info', | ||
content: process.env.UI_VERSION, | ||
content: packageJson.version, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you tried sth like window.ui_version? the same way it is used for react_app_disable_checks Still feel that using package.json directly may have pitfalls. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried |
||
}; | ||
|
||
export const appearanceSection: SettingsSection = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's wrong with this approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.env
values are embedded in build, so in build I haveversion: process.env.UI_VERSION
->version: 8.11.0
However, when we use it as a package, we have only
process.env.UI_VERSION
in our code, when we import it and try to open in UI we receiveprocess
is not defined error, no variables are exposed