Skip to content

Commit a1b3f94

Browse files
committed
wip
1 parent d3b9b59 commit a1b3f94

File tree

12 files changed

+14151
-44961
lines changed

12 files changed

+14151
-44961
lines changed

console2/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
# production
1010
/build
11+
/dist
12+
13+
# Vite
14+
*.local
1115

1216
# misc
1317
.DS_Store

console2/public/index.html renamed to console2/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
77

8+
<!-- Load config before app initialization -->
89
<script src="/api/service/console/cfg"></script>
910

10-
<link id="favicon" rel="shortcut icon" href="%PUBLIC_URL%/favicon.png">
11+
<link id="favicon" rel="shortcut icon" href="/favicon.png">
1112
<base href="/" />
1213
<title>Concord</title>
1314
</head>
@@ -17,6 +18,9 @@
1718
You need to enable JavaScript to run this app.
1819
</noscript>
1920
<div id="root"></div>
21+
22+
<!-- Vite entry point -->
23+
<script type="module" src="/src/index.tsx"></script>
2024
</body>
2125

2226
</html>

console2/package-lock.json

Lines changed: 14009 additions & 44907 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

console2/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
"@testing-library/react": "12.1.2",
99
"@types/jest": "27.0.3",
1010
"@types/lodash": "4.14.178",
11-
"@types/node": "16.11.12",
11+
"@types/node": "20.10.0",
1212
"@types/prop-types": "15.7.4",
13-
"@types/react": "17.0.37",
14-
"@types/react-dom": "17.0.11",
13+
"@types/react": "18.2.45",
14+
"@types/react-dom": "18.2.18",
1515
"@types/react-redux": "7.1.20",
1616
"@types/react-router": "5.1.17",
1717
"@types/react-router-dom": "5.3.2",
1818
"@types/redux-logger": "3.0.9",
1919
"@types/sinon": "10.0.6",
2020
"@types/styled-components": "5.1.17",
21-
"@types/webpack-env": "1.16.3",
2221
"@typescript-eslint/typescript-estree": "5.35.1",
22+
"@vitejs/plugin-react": "^4.2.1",
2323
"babel-cli": "6.26.0",
2424
"babel-core": "7.0.0-bridge.0",
2525
"babel-preset-es2015": "6.24.1",
@@ -31,7 +31,8 @@
3131
"redux-devtools-extension": "2.13.9",
3232
"shx": "0.3.3",
3333
"ts-node": "10.4.0",
34-
"typescript": "4.8.2"
34+
"typescript": "5.3.3",
35+
"vite": "^5.0.8"
3536
},
3637
"dependencies": {
3738
"@monaco-editor/react": "4.3.1",
@@ -45,15 +46,14 @@
4546
"lodash": "4.17.21",
4647
"parse-domain": "4.1.0",
4748
"query-string": "7.0.1",
48-
"react": "17.0.2",
49-
"react-dom": "17.0.2",
49+
"react": "18.2.0",
50+
"react-dom": "18.2.0",
5051
"react-hook-form": "7.21.2",
5152
"react-idle-timer": "5.4.1",
5253
"react-json-view": "1.21.3",
5354
"react-redux": "7.2.6",
5455
"react-router": "5.2.0",
5556
"react-router-dom": "5.2.0",
56-
"react-scripts": "4.0.3",
5757
"react-spring": "9.3.2",
5858
"reakit": "1.3.11",
5959
"redux": "4.1.2",
@@ -68,12 +68,12 @@
6868
"url-search-params-polyfill": "8.1.1"
6969
},
7070
"scripts": {
71-
"start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
72-
"build": "export SET NODE_OPTIONS=--openssl-legacy-provider && ./npm.sh run hack:remove-sui-css-dep && export SET BUILD_PATH='./target/classes/META-INF/console2' && react-scripts build",
73-
"hack:remove-sui-css-dep": "shx --silent sed -i @import /*import node_modules/semantic-ui-css/semantic.min.css > /dev/null 2>&1",
74-
"dev": "export SET NODE_OPTIONS=--openssl-legacy-provider && babel-node --presets es2015 scripts/devServer.js",
75-
"test": "react-scripts test",
76-
"test:watch": "./npm.sh test --watch",
71+
"start": "vite",
72+
"dev": "vite",
73+
"build": "vite build",
74+
"build:check": "tsc && vite build",
75+
"preview": "vite preview",
76+
"test": "vitest",
7777
"pretty": "prettier --tab-width 4 --print-width 100 --single-quote --jsx-bracket-same-line --arrow-parens 'always' parser 'typescript' --write 'src/**/*.{ts,tsx}'"
7878
},
7979
"eslintConfig": {

console2/src/components/organisms/CheckpointView/CheckpointPopup/RestoreProcess.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { AnyAction, Dispatch } from 'redux';
3030
import { ConcordKey } from '../../../../api/common';
3131
import { actions } from '../../../../state/data/processes';
3232
import { isFinal, ProcessStatus } from '../../../../api/process';
33-
import { isFunction } from 'util';
33+
import { isFunction } from 'lodash';
3434

3535
interface ExternalProps {
3636
children?: RenderCallback;

console2/src/components/organisms/ProcessLogActivityV2/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ const ProcessLogActivityV2 = ({
260260

261261
<Button.Group>
262262
<Button
263-
disabled={process === undefined}
263+
disabled={!instanceId}
264264
onClick={() => window.open(`/api/v1/process/${instanceId}/log`, '_blank')}>
265265
Raw
266266
</Button>

console2/src/components/pages/AboutPage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AboutPage extends React.PureComponent {
3737
<p>
3838
Server version: <ServerVersion />
3939
</p>
40-
<p>Console version: {process.env.REACT_APP_CONCORD_VERSION || 'n/a'}</p>
40+
<p>Console version: {import.meta.env.VITE_CONCORD_VERSION || 'n/a'}</p>
4141
<p>Last updated: {window.concord.lastUpdated || 'n/a'}</p>
4242
</>
4343
);

console2/src/index.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
import * as React from 'react';
22-
import * as ReactDOM from 'react-dom';
22+
import { createRoot } from 'react-dom/client';
2323

2424
import 'typeface-lato';
2525
import 'semantic-ui-css/semantic.min.css';
@@ -28,17 +28,9 @@ import App from './App';
2828
import './index.css';
2929

3030
const rootEl = document.getElementById('root') as HTMLElement;
31+
const root = createRoot(rootEl);
3132

32-
ReactDOM.render(<App />, rootEl);
33-
34-
// @ts-ignore
35-
if (module.hot) {
36-
// @ts-ignore
37-
module.hot.accept('./App', () => {
38-
const NextApp = require('./App').default;
39-
ReactDOM.render(<NextApp />, rootEl);
40-
});
41-
}
33+
root.render(<App />);
4234

4335
// remove any old service worker
4436
if (navigator.serviceWorker) {

console2/src/vite-env.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*-
2+
* *****
3+
* Concord
4+
* -----
5+
* Copyright (C) 2017 - 2025 Walmart Inc.
6+
* -----
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* =====
19+
*/
20+
/// <reference types="vite/client" />
21+
22+
interface ImportMetaEnv {
23+
readonly VITE_CONCORD_VERSION?: string;
24+
// Add other env variables as needed
25+
}
26+
27+
interface ImportMeta {
28+
readonly env: ImportMetaEnv;
29+
}

console2/tsconfig.json

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
{
22
"compilerOptions": {
3+
"target": "ES2020",
4+
"useDefineForClassFields": true,
5+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
6+
"module": "ESNext",
7+
"skipLibCheck": true,
8+
9+
/* Bundler mode */
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"noEmit": true,
15+
"jsx": "react-jsx",
16+
17+
/* Linting */
18+
"strict": false,
19+
"noFallthroughCasesInSwitch": true,
20+
21+
/* Existing settings to preserve */
322
"allowJs": true,
423
"allowSyntheticDefaultImports": true,
524
"downlevelIteration": true,
625
"esModuleInterop": true,
726
"forceConsistentCasingInFileNames": true,
8-
"isolatedModules": true,
9-
"jsx": "react-jsx",
10-
"lib": [
11-
"dom",
12-
"dom.iterable",
13-
"esnext"
14-
],
15-
"module": "esnext",
16-
"moduleResolution": "node",
17-
"noEmit": true,
18-
"resolveJsonModule": true,
19-
"skipLibCheck": true,
20-
"strict": true,
21-
"suppressImplicitAnyIndexErrors": true,
22-
"target": "es5",
23-
"noFallthroughCasesInSwitch": true,
24-
"useUnknownInCatchVariables": false
27+
"useUnknownInCatchVariables": false,
28+
29+
/* Path aliases */
30+
"baseUrl": ".",
31+
"paths": {
32+
"@/*": ["./src/*"]
33+
}
2534
},
26-
"include": [
27-
"src"
28-
],
29-
"exclude": [
30-
"node_modules",
31-
"build",
32-
"scripts"
33-
]
35+
"include": ["src"],
36+
"exclude": ["node_modules", "target", "scripts"],
37+
"references": [{ "path": "./tsconfig.node.json" }]
3438
}

0 commit comments

Comments
 (0)