Skip to content

Commit

Permalink
chore: upgrade Yarn to a supported version
Browse files Browse the repository at this point in the history
Closes patternfly#9959

Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops committed Jun 6, 2024
1 parent 71d32a6 commit 28f430e
Show file tree
Hide file tree
Showing 16 changed files with 22,656 additions and 16,605 deletions.
10 changes: 7 additions & 3 deletions .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ runs:
node-version: 20
check-latest: true

- name: Enable Corepack
shell: bash
run: corepack enable

- name: Get Yarn configuration
id: yarn-config
shell: bash
run: |
echo "cache-directory=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "cache-folder=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
# TODO: This can be simplified to use the `cache` option of the `actions/setup-node` action when it supports Corepack.
# See: https://github.com/actions/setup-node/issues/531
Expand All @@ -31,14 +35,14 @@ runs:
# Also cache Cypress binary.
path: |
~/.cache/Cypress
${{ steps.yarn-config.outputs.cache-directory }}
${{ steps.yarn-config.outputs.cache-folder }}
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-cache-
- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile
run: yarn install --immutable

- uses: actions/cache@v4
if: inputs.skip-build != 'true' && inputs.skip-build-cache != 'true'
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: pnpm
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ git fetch upstream

2. Set up tooling

[Install Node.js](https://nodejs.org/en/download/package-manager) version 20 (or higher). Then install the project dependencies and build it by running:
[Install Node.js](https://nodejs.org/en/download/package-manager) version 20 (or higher), and make sure to [enable Corepack](https://nodejs.org/api/corepack.html). Then install the project dependencies and build it by running:

```sh
yarn install
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Before you begin, check out this [overview of PatternFly](http://patternfly.org/
Install a package manager before using the PatternFly libraries.

* [Use npm](https://nodejs.org/en/download/package-manager)
* [Use Yarn](https://yarnpkg.com/en/docs/getting-started)
* [Use Yarn](https://yarnpkg.com/getting-started/install)


#### Start with PatternFly React seed
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"url": "https://github.com/patternfly/patternfly-react.git"
},
"engines": {
"node": ">=20",
"yarn": ">=1.6.0"
"node": ">=20"
},
"packageManager": "[email protected]+sha512.c44e283c54e02de9d1da8687025b030078c1b9648d2895a65aab8e64225bfb7becba87e1809fc0b4b6778bbd47a1e2ab6ac647de4c5e383a53a7c17db6c3ff4b",
"keywords": [
"react",
"patternfly",
Expand Down Expand Up @@ -38,6 +38,7 @@
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "29.5.12",
"@types/node": "^20.12.7",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^5.62.0",
Expand All @@ -46,8 +47,10 @@
"concurrently": "^7.6.0",
"eslint": "^8.39.0",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-patternfly-react": "workspace:^",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-testing-library": "^6.2.2",
"fs-extra": "^11.2.0",
"glob": "^9.3.5",
Expand All @@ -67,6 +70,7 @@
"rollup-plugin-scss": "^4.0.0",
"rollup-plugin-svg": "^2.0.0",
"sass": "^1.77.4",
"semver": "^7.6.2",
"surge": "^0.23.1",
"ts-node": "^10.9.2",
"ts-patch": "^2.1.0",
Expand All @@ -86,7 +90,7 @@
"clean:build": "rimraf .cache .eslintcache coverage",
"clean:exports": "lerna run clean:exports --parallel --stream",
"generate": "yarn plop",
"lint": "node --max-old-space-size=4096 node_modules/.bin/eslint --ext js,jsx,ts,tsx --cache --cache-strategy content",
"lint": "eslint --ext js,jsx,ts,tsx --cache --cache-strategy content",
"lint:all": "yarn lint:md && yarn lint:versions && yarn lint:ts",
"lint:md": "yarn eslint packages --ext md --no-eslintrc --config .eslintrc-md.json --cache --cache-strategy content",
"lint:ts": "yarn lint packages/*/src",
Expand Down Expand Up @@ -119,6 +123,5 @@
"packages": [
"packages/**"
]
},
"dependencies": {}
}
}
3 changes: 1 addition & 2 deletions packages/eslint-plugin-patternfly-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "eslint-plugin-patternfly-react",
"version": "5.4.0-prerelease.3",
"private": false,
"main": "./lib/index.js",
"license": "MIT",
"publishConfig": {
Expand Down Expand Up @@ -34,7 +33,7 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-rulesdir": "^0.2.0",
"eslint-plugin-standard": "^4.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/react-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@patternfly/react-icons": "^5.4.0-prerelease.5",
"@patternfly/react-styles": "^5.4.0-prerelease.6",
"@patternfly/react-tokens": "^5.4.0-prerelease.5",
"file-selector": "^0.6.0",
"focus-trap": "7.5.4",
"react-dropzone": "^14.2.3",
"tslib": "^2.6.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { render } from '@testing-library/react';
import * as ReactCoreUtils from '@patternfly/react-core/src/helpers/util';
import * as ReactCoreUtils from '../../../../helpers/util';

import { NavList } from '../../NavList';
import { NavContext } from '../../Nav';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import userEvent from '@testing-library/user-event';

import { TextInput, TextInputBase } from '../TextInput';
import { ValidatedOptions } from '../../../helpers/constants';
import * as ReactCoreUtils from '@patternfly/react-core/src/helpers/util';
import * as ReactCoreUtils from '../../../helpers/util';

const props = {
onChange: jest.fn(),
Expand Down
4 changes: 3 additions & 1 deletion packages/react-drag-drop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/modifiers": "^6.0.1",
"@dnd-kit/sortable": "^7.0.2",
"@dnd-kit/utilities": "^3.2.2",
"@patternfly/react-core": "^5.4.0-prerelease.15",
"@patternfly/react-icons": "^5.4.0-prerelease.5",
"@patternfly/react-styles": "^5.4.0-prerelease.6",
"memoize-one": "^5.1.0",
"resize-observer-polyfill": "^1.5.1"
"resize-observer-polyfill": "^1.5.1",
"tslib": "^2.6.2"
},
"peerDependencies": {
"react": "^17 || ^18",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-integration/demo-app-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"react-router-dom": "^5.3.4"
},
"devDependencies": {
"@types/react-router-dom": "^5.3.3",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react-swc": "^3.7.0",
"vite": "^5.2.12"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"serve:integration": "cd demo-app-ts && yarn preview",
"test:integration": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run"
"test:integration": "cypress run"
},
"devDependencies": {
"cypress": "^8.7.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/react-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
"lodash": "^4.17.21",
"tslib": "^2.6.2"
},
"devDependencies": {
"@types/lodash": "^4.17.0",
"typescript": "^4.7.4"
},
"peerDependencies": {
"react": "^17 || ^18",
"react-dom": "^17 || ^18"
Expand Down
1 change: 1 addition & 0 deletions packages/react-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"devDependencies": {
"@patternfly/patternfly": "5.4.0-prerelease.3",
"@patternfly/react-tokens": "^5.4.0-prerelease.5",
"css": "^2.2.4",
"fs-extra": "^11.2.0",
"glob": "^7.2.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"assumeChangesOnlyAffectDirectDependencies": true,
"jsx": "react",
"lib": [
"es2015",
"dom"
"ES2017",
"DOM"
],
"target": "es2015",
"module": "es2015",
Expand Down
Loading

0 comments on commit 28f430e

Please sign in to comment.