Skip to content

Commit de78f83

Browse files
committed
work in prod pleeeease
1 parent 30755f5 commit de78f83

File tree

7 files changed

+307
-356
lines changed

7 files changed

+307
-356
lines changed

packages/selenium-ide/package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seleniumhq/selenium-ide",
3-
"version": "4.0.0-alpha.44",
3+
"version": "4.0.0-alpha.45",
44
"private": true,
55
"description": "Selenium IDE electron app",
66
"author": "Todd <[email protected]>",
@@ -93,12 +93,11 @@
9393
"hoistingLimits": "workspaces"
9494
},
9595
"dependencies": {
96-
"@emotion/react": "^11.8.1",
97-
"@emotion/styled": "^11.8.1",
98-
"@fontsource/roboto": "^4.5.0",
99-
"@mui/icons-material": "^5.5.0",
100-
"@mui/lab": "^5.0.0-alpha.72",
101-
"@mui/material": "^5.5.0",
96+
"@emotion/react": "^11.11.1",
97+
"@emotion/styled": "^11.11.0",
98+
"@fontsource/roboto": "^5.0.5",
99+
"@mui/icons-material": "^5.14.1",
100+
"@mui/material": "^5.14.1",
102101
"@seleniumhq/code-export-csharp-nunit": "^4.0.0-alpha.1",
103102
"@seleniumhq/code-export-csharp-xunit": "^4.0.0-alpha.1",
104103
"@seleniumhq/code-export-java-junit": "^4.0.0-alpha.1",
@@ -110,17 +109,17 @@
110109
"@seleniumhq/side-api": "^4.0.0-alpha.25",
111110
"@seleniumhq/side-model": "^4.0.0-alpha.4",
112111
"@seleniumhq/side-runtime": "^4.0.0-alpha.25",
113-
"dnd-core": "16.0.1",
112+
"dnd-core": "^16.0.1",
114113
"electron-chromedriver": "^25.3.0",
115114
"electron-log": "^4.4.8",
116115
"electron-store": "^8.1.0",
117116
"electron-unhandled": "^4.0.1",
118117
"fs-extra": "^11.1.1",
119118
"lodash": "4.17.21",
120-
"react": "^17.0.2",
121-
"react-dnd": "^15.1.1",
122-
"react-dnd-html5-backend": "^15.1.2",
123-
"react-dom": "^17.0.2",
119+
"react": "^18.2.0",
120+
"react-dnd": "^16.0.1",
121+
"react-dnd-html5-backend": "^16.0.1",
122+
"react-dom": "^18.2.0",
124123
"v8-compile-cache": "^2.3.0"
125124
},
126125
"devDependencies": {
@@ -130,16 +129,17 @@
130129
"@types/electron-devtools-installer": "^2.2.2",
131130
"@types/fs-extra": "^11.0.1",
132131
"@types/lodash": "^4.14.186",
133-
"@types/react": "^17.0.14",
134-
"@types/react-dom": "^17.0.9",
132+
"@types/react": "^18.2.15",
133+
"@types/react-dom": "^18.2.7",
135134
"@types/webpack-env": "^1.16.0",
136135
"copy-webpack-plugin": "^10.2.4",
137-
"css-loader": "^6.1.0",
136+
"css-loader": "^6.8.1",
138137
"electron": "^25.2.0",
139138
"electron-builder": "^24.4.0",
140139
"electron-devtools-installer": "^3.2.0",
141140
"fork-ts-checker-webpack-plugin": "^8.0.0",
142141
"html-webpack-plugin": "^5.5.3",
142+
"mini-css-extract-plugin": "^2.7.6",
143143
"npm-run-all": "^4.1.5",
144144
"run-script-os": "^1.1.6",
145145
"scroll-into-view-if-needed": "^3.0.10",

packages/selenium-ide/src/browser/components/AppPanelWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { FC } from 'react'
33
import AppWrapper from './AppWrapper'
44
import PanelNav from './PanelNav'
55

6-
interface AppPanelWrapperProps {
6+
interface AppPanelWrapperProps extends React.HTMLAttributes<HTMLDivElement> {
77
horizontal?: boolean
88
}
99

packages/selenium-ide/src/browser/components/AppWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import '@fontsource/roboto/500.css'
88
import '@fontsource/roboto/700.css'
99
import React, { FC } from 'react'
1010

11-
interface AppWrapperProps {
11+
interface AppWrapperProps extends React.HTMLAttributes<HTMLDivElement> {
1212
className?: string
1313
}
1414

1515
const AppWrapper: FC<AppWrapperProps> = ({ children }) => {
1616
const [themePref, setThemePref] = React.useState<ThemePref>('System')
1717
React.useEffect(() => {
18-
if (!window?.sideAPI?.state) return;
18+
if (!window?.sideAPI?.state) return
1919
window.sideAPI.state
2020
.getUserPrefs()
2121
.then((prefs) => setThemePref(prefs.themePref || 'System'))

packages/selenium-ide/src/browser/components/PanelNav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Paper } from '@mui/material'
33

4-
interface PanelNavProps {
4+
interface PanelNavProps extends React.HTMLAttributes<HTMLDivElement> {
55
horizontal?: boolean
66
}
77

packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Suites/Editor/CurrentSuiteTestRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Close } from '@mui/icons-material'
1+
import Close from '@mui/icons-material/Close'
22
import { IconButton } from '@mui/material'
33
import Box from '@mui/material/Box'
44
import ListItemText from '@mui/material/ListItemText'

packages/selenium-ide/webpack.config.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,33 @@ import fs from 'fs'
33
import CopyWebpackPlugin from 'copy-webpack-plugin'
44
import HtmlWebpackPlugin from 'html-webpack-plugin'
55
import kebabCase from 'lodash/fp/kebabCase'
6+
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
67
import path from 'path'
78
import {
89
Configuration,
910
SourceMapDevToolPlugin,
1011
WebpackPluginInstance,
1112
} from 'webpack'
1213

14+
const isProduction = process.env.NODE_ENV === 'production'
15+
1316
const commonPlugins: WebpackPluginInstance[] = [
1417
new ForkTsCheckerWebpackPlugin(),
1518
new SourceMapDevToolPlugin({
1619
filename: '[file].map',
1720
}),
1821
]
22+
if (isProduction) {
23+
commonPlugins.push(new MiniCssExtractPlugin())
24+
}
25+
1926
const commonConfig: Pick<
2027
Configuration,
2128
'devtool' | 'externals' | 'mode' | 'module' | 'resolve' | 'output'
2229
> = {
2330
devtool: 'source-map',
2431
externals: ['utf-8-validate', 'bufferutil'],
25-
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
32+
mode: isProduction ? 'production' : 'development',
2633
module: {
2734
rules: [
2835
{
@@ -40,7 +47,10 @@ const commonConfig: Pick<
4047
},
4148
{
4249
test: /\.css$/i,
43-
use: ['style-loader', 'css-loader'],
50+
use: [
51+
isProduction ? MiniCssExtractPlugin.loader : 'style-loader',
52+
'css-loader',
53+
],
4454
},
4555
{
4656
test: /\.(png|woff|woff2|eot|ttf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
@@ -53,6 +63,11 @@ const commonConfig: Pick<
5363
api: path.resolve(__dirname, 'src/api'),
5464
browser: path.resolve(__dirname, 'src/browser'),
5565
main: path.resolve(__dirname, 'src/main'),
66+
'@mui/base': '@mui/base/modern',
67+
'@mui/material': '@mui/material/modern',
68+
'@mui/styled-engine': '@mui/styled-engine/modern',
69+
'@mui/system': '@mui/system/modern',
70+
'@mui/utils': '@mui/utils/modern',
5671
},
5772
extensions: ['.tsx', '.ts', '.js'],
5873
},
@@ -138,7 +153,13 @@ function getBrowserPlugin(filename: string) {
138153
<html>
139154
<head>
140155
<title>${title}</title>
156+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
141157
<link rel="stylesheet" href="index.css" type="text/css">
158+
${
159+
isProduction
160+
? `<link rel="stylesheet" href="${filename}.css" type="text/css">\n`
161+
: ''
162+
}
142163
<script defer src="${filename}-bundle.js"></script>
143164
</head>
144165
<body>

0 commit comments

Comments
 (0)