Skip to content

Commit 0808080

Browse files
committed
build(package): upgrade to yarn v4 (reanahub#420)
Closes reanahub#346 hey
1 parent 48ea4c3 commit 0808080

File tree

8 files changed

+16716
-11884
lines changed

8 files changed

+16716
-11884
lines changed

.github/workflows/ci.yml

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is part of REANA.
2-
# Copyright (C) 2020, 2022, 2024 CERN.
2+
# Copyright (C) 2020, 2022, 2024, 2025 CERN.
33
#
44
# REANA is free software; you can redistribute it and/or modify it
55
# under the terms of the MIT License; see LICENSE file for more details.
@@ -79,8 +79,11 @@ jobs:
7979
with:
8080
node-version: "18"
8181

82-
- name: Install project dependencies
83-
run: yarn global add prettier
82+
- name: Enable corepack and set yarn version
83+
run: corepack enable && yarn set version 4.6.0
84+
85+
- name: Install prettier
86+
run: yarn add prettier
8487

8588
- name: Run prettier code formatter
8689
run: ./run-tests.sh --check-prettier
@@ -96,8 +99,11 @@ jobs:
9699
with:
97100
node-version: "18"
98101

99-
- name: Install project dependencies
100-
run: yarn global add eslint
102+
- name: Enable corepack and set yarn version
103+
run: corepack enable && yarn set version 4.6.0
104+
105+
- name: Install eslint
106+
run: cd reana-ui && yarn add --dev && cd ..
101107

102108
- name: Run prettier code formatter
103109
run: ./run-tests.sh --check-lint
@@ -113,8 +119,8 @@ jobs:
113119
with:
114120
node-version: "18"
115121

116-
- name: Install project dependencies
117-
run: yarn
122+
- name: Enable corepack and set yarn version
123+
run: corepack enable && yarn set version 4.6.0
118124

119125
- name: Run JavaScript tests
120126
run: ./run-tests.sh --check-js-tests

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ENV DEBIAN_FRONTEND=noninteractive
99
WORKDIR /code
1010
COPY . /code
1111

12+
RUN yarn set version 4.6.0
13+
1214
# Build frontend application
1315
# hadolint ignore=DL3003,DL3008
1416
RUN apt-get update -y && \

reana-ui/.eslintrc.json

-16
This file was deleted.

reana-ui/.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

reana-ui/craco.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ module.exports = {
3131
},
3232
],
3333
},
34+
eslint: {
35+
enable: false,
36+
},
3437
};

reana-ui/eslint.config.mjs

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Most of this file is created via running `yarn dlx @eslint/migrate-config .eslintrc.json` on top of our old `.eslintrc.json` file
2+
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
3+
import prettier from "eslint-plugin-prettier";
4+
import babelParser from "@babel/eslint-parser";
5+
import path from "node:path";
6+
import { fileURLToPath } from "node:url";
7+
import js from "@eslint/js";
8+
import { FlatCompat } from "@eslint/eslintrc";
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
});
15+
16+
export default [
17+
...fixupConfigRules(
18+
compat.extends("plugin:prettier/recommended", "react-app", "prettier"),
19+
),
20+
{
21+
plugins: {
22+
prettier: fixupPluginRules(prettier),
23+
},
24+
25+
languageOptions: {
26+
parser: babelParser,
27+
ecmaVersion: 5,
28+
sourceType: "script",
29+
30+
parserOptions: {
31+
requireConfigFile: false,
32+
sourceType: "module",
33+
ecmaVersion: 2022,
34+
35+
babelOptions: {
36+
presets: ["@babel/preset-react"],
37+
},
38+
},
39+
},
40+
41+
rules: {
42+
"prettier/prettier": "error",
43+
"react/jsx-uses-react": "off",
44+
"react/react-in-jsx-scope": "off",
45+
},
46+
},
47+
];

reana-ui/package.json

+13-7
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
"redux-thunk": "^2.3.0",
2626
"semantic-ui-react": "^2.0.0"
2727
},
28-
"resolutions": {
29-
"jsroot/gl/node-gyp": "<9.4.0"
30-
},
3128
"scripts": {
3229
"analyze": "source-map-explorer 'build/static/js/*.js'",
3330
"start": "craco start",
@@ -55,26 +52,35 @@
5552
},
5653
"devDependencies": {
5754
"@babel/core": "^7.23.2",
58-
"@babel/eslint-parser": "^7.16.5",
55+
"@babel/eslint-parser": "^7.26.5",
5956
"@babel/plugin-proposal-private-property-in-object": "^7.16.7",
6057
"@craco/craco": "^7.1.0",
58+
"@eslint/compat": "^1.2.6",
59+
"@eslint/eslintrc": "^3.2.0",
60+
"@eslint/js": "^9.19.0",
6161
"@semantic-ui-react/craco-less": "^3.0.0",
6262
"@semantic-ui-react/css-patch": "^1.0.0",
6363
"@testing-library/jest-dom": "^6.1.4",
6464
"@testing-library/react": "^14.0.0",
65+
"@typescript-eslint/eslint-plugin": "^8.23.0",
66+
"@typescript-eslint/parser": "^8.23.0",
6567
"craco-alias": "^3.0.1",
68+
"eslint": "^9.19.0",
6669
"eslint-config-prettier": "^9.0.0",
6770
"eslint-config-react-app": "^7.0.1",
68-
"eslint-plugin-prettier": "^5.0.1",
71+
"eslint-plugin-import": "^2.31.0",
72+
"eslint-plugin-prettier": "^5.2.3",
6973
"eslint-plugin-react": "^7.23.2",
7074
"npm-run-all": "^4.1.5",
7175
"prettier": "^3.0.3",
7276
"semantic-ui-less": "^2.4.1",
73-
"source-map-explorer": "^2.5.0"
77+
"source-map-explorer": "^2.5.0",
78+
"typescript": "^5.7.3"
7479
},
7580
"jest": {
7681
"transformIgnorePatterns": [
7782
"node_modules/(?!axios)/"
7883
]
79-
}
84+
},
85+
"packageManager": "[email protected]"
8086
}

0 commit comments

Comments
 (0)