Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit aefcfd1

Browse files
chore: LSDV-4894: Update to NodeJS LTS (#1323)
1 parent 6288b80 commit aefcfd1

11 files changed

+410
-319
lines changed

.github/workflows/build_bundle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
env:
1414
# increment it in case if you need to reset cache
1515
CACHE_NAME_PREFIX: v3
16-
NODE: '14'
16+
NODE: '18'
1717

1818
jobs:
1919
build:

.github/workflows/e2e_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
env:
1111
# increment it in case if you need to reset cache
1212
CACHE_NAME_PREFIX: v3
13-
NODE: '14'
13+
NODE: '18'
1414

1515
jobs:
1616
run:

.github/workflows/eslint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
env:
1111
# increment it in case if you need to reset cache
1212
CACHE_NAME_PREFIX: v3
13-
NODE: '14'
13+
NODE: '18'
1414

1515
jobs:
1616
run:

.github/workflows/fun_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
env:
1111
# increment it in case if you need to reset cache
1212
CACHE_NAME_PREFIX: v3
13-
NODE: '14'
13+
NODE: '18'
1414

1515
jobs:
1616
run:

.github/workflows/release-set-version.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ env:
88
LSF_DIR: 'label-studio-frontend'
99
TARGET_REPO: 'heartexlabs/label-studio'
1010
LS_DIR: 'label-studio'
11-
NODE: '14'
11+
NODE: '18'
1212
CACHE_NAME_PREFIX: v1
1313

1414
jobs:

.github/workflows/unit_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
env:
1111
# increment it in case if you need to reset cache
1212
CACHE_NAME_PREFIX: v3
13-
NODE: '14'
13+
NODE: '18'
1414

1515
jobs:
1616
run:

e2e/tests/image.magic-wand.test.js

+13-12
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Scenario('Make sure the magic wand works in a variety of scenarios', async funct
8787

8888
AtImageView.waitForImage();
8989
await AtImageView.lookForStage();
90-
I.executeScript(waitForImage);
9190

9291
I.say('Making sure magic wand button is present');
9392
I.seeElement('.lsf-toolbar__group button[aria-label="magicwand"]');
@@ -113,13 +112,13 @@ Scenario('Make sure the magic wand works in a variety of scenarios', async funct
113112
// magic wand pixel colors more robust.
114113
I.say('Ensuring cloud magic wand pixels are correctly filled color');
115114
await I.executeScript(setKonvaLayersOpacity, [1.0]);
116-
assertMagicWandPixel(I, 0, 0, false, CLOUD.rgbArray,
115+
await assertMagicWandPixel(I, 0, 0, false, CLOUD.rgbArray,
117116
'Far upper left corner should not have magic wand cloud class');
118-
assertMagicWandPixel(I, 260, 50, true, CLOUD.rgbArray,
117+
await assertMagicWandPixel(I, 260, 50, true, CLOUD.rgbArray,
119118
'Upper left should have magic wand cloud class');
120-
assertMagicWandPixel(I, 300, 620, true, CLOUD.rgbArray,
119+
await assertMagicWandPixel(I, 300, 620, true, CLOUD.rgbArray,
121120
'Lower left should have magic wand cloud class');
122-
assertMagicWandPixel(I, 675, 650, false, CLOUD.rgbArray,
121+
await assertMagicWandPixel(I, 675, 650, false, CLOUD.rgbArray,
123122
'Far lower right corner should not have magic wand cloud class');
124123

125124
// Make sure the region made from this is correct.
@@ -139,17 +138,19 @@ Scenario('Make sure the magic wand works in a variety of scenarios', async funct
139138
// 1, then redo it and ensure its back and our region list is still 1 again.
140139
I.say('Undoing last cloud magic wand and ensuring it worked correctly');
141140
I.click('button[aria-label="Undo"]');
142-
assertMagicWandPixel(I, 300, 620, false, CLOUD.rgbArray,
141+
I.wait(1);
142+
await assertMagicWandPixel(I, 300, 620, false, CLOUD.rgbArray,
143143
'Undone lower left should not have magic wand cloud class anymore');
144-
assertMagicWandPixel(I, 260, 50, true, CLOUD.rgbArray,
144+
await assertMagicWandPixel(I, 260, 50, true, CLOUD.rgbArray,
145145
'Upper left should still have magic wand cloud class');
146146
AtSidebar.seeRegions(1);
147147

148148
I.say('Redoing last cloud magic wand and ensuring it worked correctly');
149149
I.click('button[aria-label="Redo"]');
150-
assertMagicWandPixel(I, 300, 620, true, CLOUD.rgbArray,
150+
I.wait(1);
151+
await assertMagicWandPixel(I, 300, 620, true, CLOUD.rgbArray,
151152
'Redone lower left should have magic wand cloud class again');
152-
assertMagicWandPixel(I, 260, 50, true, CLOUD.rgbArray,
153+
await assertMagicWandPixel(I, 260, 50, true, CLOUD.rgbArray,
153154
'Upper left should still have magic wand cloud class');
154155
AtSidebar.seeRegions(1);
155156

@@ -180,9 +181,9 @@ Scenario('Make sure the magic wand works in a variety of scenarios', async funct
180181

181182
I.say('Ensuring cloud shadow magic wand pixels are correctly filled color');
182183
await I.executeScript(setKonvaLayersOpacity, [1.0]);
183-
assertMagicWandPixel(I, 0, 0, false, CLOUDSHADOW.rgbArray,
184+
await assertMagicWandPixel(I, 0, 0, false, CLOUDSHADOW.rgbArray,
184185
'Zoomed upper left corner should not have cloud shadow');
185-
assertMagicWandPixel(I, 350, 360, true, CLOUDSHADOW.rgbArray,
186+
await assertMagicWandPixel(I, 350, 360, true, CLOUDSHADOW.rgbArray,
186187
'Center area should have magic wand cloud shadow class');
187188

188189
// Make sure if you have a region selected then change the class the region class changes.
@@ -192,6 +193,6 @@ Scenario('Make sure the magic wand works in a variety of scenarios', async funct
192193
AtSidebar.dontSee('Cloud Shadow');
193194
AtSidebar.see('Haze');
194195
await I.executeScript(setKonvaLayersOpacity, [1.0]);
195-
assertMagicWandPixel(I, 350, 360, true, HAZE.rgbArray,
196+
await assertMagicWandPixel(I, 350, 360, true, HAZE.rgbArray,
196197
'Center area should have magic wand haze class');
197198
});

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
"@types/jest": "^29.2.3",
121121
"@types/keymaster": "^1.6.30",
122122
"@types/lodash.ismatch": "^4.4.6",
123+
"@types/mini-css-extract-plugin": "^2.5.1",
123124
"@types/nanoid": "^3.0.0",
124125
"@types/offscreencanvas": "^2019.6.4",
125126
"@types/react-dom": "^17.0.11",
@@ -135,7 +136,7 @@
135136
"babel-plugin-import": "^1.13.5",
136137
"babel-plugin-remove-webpack": "^1.1.0",
137138
"chroma-js": "^2.1.1",
138-
"css-loader": "^5.0.2",
139+
"css-loader": "^6.7.3",
139140
"css-minimizer-webpack-plugin": "^3.0.2",
140141
"date-fns": "^2.20.1",
141142
"dotenv-defaults": "^2.0.2",
@@ -160,7 +161,7 @@
160161
"lodash.get": "^4.4.0",
161162
"lodash.ismatch": "^4.4.0",
162163
"lodash.throttle": "^4.1.1",
163-
"mini-css-extract-plugin": "^1.4.0",
164+
"mini-css-extract-plugin": "^2.7.5",
164165
"mobx": "^5.15.4",
165166
"mobx-react": "^6",
166167
"mobx-state-tree": "^3.16.0",
@@ -195,9 +196,9 @@
195196
"typescript": "^4.2.3",
196197
"url-loader": "^4.1.1",
197198
"wavesurfer.js": "^6.0.1",
198-
"webpack": "^5.30.0",
199-
"webpack-cli": "^4.6.0",
200-
"webpack-dev-server": "^4.2.1",
199+
"webpack": "^5.79.0",
200+
"webpack-cli": "^5.0.1",
201+
"webpack-dev-server": "^4.13.3",
201202
"xml2js": "^0.4.23",
202203
"xpath-range": "^1.1.1"
203204
},

src/env/development.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ import { ClassificationMixed } from '../examples/classification_mixed';
7575
*/
7676
// import { AllTypes } from "../examples/all_types";
7777

78-
const data = Ranker;
78+
const data = ImageBbox;
7979

8080
function getData(task) {
8181
if (task && task.data) {

webpack.config-builder.js

+21-18
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ const Dotenv = require("dotenv-webpack");
66
const TerserPlugin = require("terser-webpack-plugin");
77
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
88
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
9-
const ESLintPlugin = require('eslint-webpack-plugin');
10-
const { EnvironmentPlugin, DefinePlugin } = require("webpack");
9+
const { EnvironmentPlugin } = require("webpack");
1110

1211
const workingDirectory = process.env.WORK_DIR
1312
? path.resolve(__dirname, process.env.WORK_DIR)
@@ -49,13 +48,13 @@ console.log(LOCAL_ENV);
4948
const babelOptimizeOptions = () => {
5049
return BUILD.NO_MINIMIZE
5150
? {
52-
compact: false,
53-
cacheCompression: false,
54-
}
51+
compact: false,
52+
cacheCompression: false,
53+
}
5554
: {
56-
compact: true,
57-
cacheCompression: true,
58-
};
55+
compact: true,
56+
cacheCompression: true,
57+
};
5958
};
6059

6160
const optimizer = () => {
@@ -83,7 +82,7 @@ const optimizer = () => {
8382

8483
if (BUILD.NO_CHUNKS) {
8584
result.runtimeChunk = false;
86-
result.splitChunks = {cacheGroups: { default: false }}
85+
result.splitChunks = { cacheGroups: { default: false } }
8786
}
8887

8988
return result;
@@ -166,9 +165,13 @@ const babelLoader = {
166165
};
167166

168167
const cssLoader = (withLocalIdent = true) => {
169-
const rules = [MiniCssExtractPlugin.loader];
168+
const rules = [{
169+
loader: MiniCssExtractPlugin.loader,
170+
}];
170171

171-
const localIdent = withLocalIdent ? LOCAL_ENV.CSS_PREFIX + "[local]" : "[local]";
172+
const localIdent = withLocalIdent
173+
? LOCAL_ENV.CSS_PREFIX + "[local]"
174+
: "[local]";
172175

173176
const cssLoader = {
174177
loader: "css-loader",
@@ -199,7 +202,9 @@ const cssLoader = (withLocalIdent = true) => {
199202
options: {
200203
sourceMap: true,
201204
stylusOptions: {
202-
import: [path.resolve(__dirname, "./src/themes/default/colors.styl")],
205+
import: [
206+
path.resolve(__dirname, "./src/themes/default/colors.styl")
207+
],
203208
},
204209
},
205210
};
@@ -271,8 +276,9 @@ if (BUILD.DIAGNOSTICS) {
271276

272277
const sourceMap = isDevelopment ? "cheap-module-source-map" : "source-map";
273278

274-
module.exports = ({withDevServer = true} = {}) => ({
279+
module.exports = ({ withDevServer = true } = {}) => ({
275280
mode: DEFAULT_NODE_ENV || "development",
281+
target: process.env.NODE_ENV === "development" ? "web" : "browserslist",
276282
devtool: sourceMap,
277283
...(withDevServer ? devServer() : {}),
278284
entry: {
@@ -330,7 +336,7 @@ module.exports = ({withDevServer = true} = {}) => ({
330336
},
331337
{
332338
test: /\.css$/i,
333-
use: [MiniCssExtractPlugin.loader, "css-loader", "postcss-loader"],
339+
use: [{ loader: MiniCssExtractPlugin.loader }, "css-loader", "postcss-loader"],
334340
},
335341
{
336342
test: /\.styl$/i,
@@ -353,9 +359,6 @@ module.exports = ({withDevServer = true} = {}) => ({
353359
loader: MiniCssExtractPlugin.loader,
354360
options: {
355361
esModule: false,
356-
modules: {
357-
namedExport: false,
358-
},
359362
},
360363
},
361364
{
@@ -364,8 +367,8 @@ module.exports = ({withDevServer = true} = {}) => ({
364367
sourceMap: true,
365368
importLoaders: 2,
366369
esModule: false,
370+
// exportType: "string",
367371
modules: {
368-
compileType: "module",
369372
mode: "local",
370373
auto: true,
371374
namedExport: false,

0 commit comments

Comments
 (0)