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 Apr 22, 2024
1 parent 860a06a commit 1b17b68
Show file tree
Hide file tree
Showing 14 changed files with 28,272 additions and 20,025 deletions.
6 changes: 3 additions & 3 deletions .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runs:
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 +31,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'
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ jobs:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN_REDALLEN }} # needs to be an admin token to get around branch protection
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install deps
run: yarn install --frozen-lockfile
- uses: ./.github/actions/setup-project
- name: Build dist
run: yarn build && yarn build:umd
- name: Deploy to NPM and Github
Expand Down
105 changes: 7 additions & 98 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- uses: actions/setup-node@v1
with:
node-version: '18'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -62,20 +49,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- uses: actions/setup-node@v1
with:
node-version: '18'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: ./.github/actions/setup-project
- uses: actions/cache@v2
id: lint-cache
name: Load lint cache
Expand All @@ -102,20 +76,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- uses: actions/setup-node@v1
with:
node-version: '18'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -151,20 +112,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- uses: actions/setup-node@v1
with:
node-version: '18'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -211,20 +159,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- uses: actions/setup-node@v1
with:
node-version: '18'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -267,20 +202,7 @@ jobs:
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
fi
- uses: actions/setup-node@v1
with:
node-version: '18'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down Expand Up @@ -321,20 +243,7 @@ jobs:
token: ${{ secrets.GH_TOKEN_REDALLEN }} # needs to be an admin token to get around branch protection
fetch-depth: '0'
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-node@v1
with:
node-version: '18'
- uses: actions/cache@v2
id: yarn-cache
name: Cache npm deps
with:
path: |
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: ./.github/actions/setup-project
- uses: actions/cache@v2
id: dist
name: Cache dist
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
51 changes: 30 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ To make contributing components and packages easier a generator utility has been

To start the generator run:

```bash
```sh
yarn generate
```

Expand Down Expand Up @@ -179,9 +179,9 @@ Please ensure that all React UI components contributed meet the following guidel

Adhering to the following process is the best way to get your work included in the project:

1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:
1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:

```bash
```sh
# Clone your fork of the repo into the current directory
git clone https://github.com/<your-username>/patternfly-react.git
# Navigate to the newly cloned directory
Expand All @@ -192,15 +192,24 @@ git remote add upstream https://github.com/patternfly/patternfly-react.git
git fetch upstream
```

2. Create a branch:
2. Set up tooling

```text
$ git checkout -b my-branch upstream/main
[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
yarn build
```

3. Generate your component
3. Create a branch:

```sh
git checkout -b my-branch upstream/main
```

```bash
4. Generate your component

```sh
# Run the tool to Generate the component scaffolding
yarn generate
```
Expand All @@ -214,37 +223,37 @@ $ git checkout -b my-branch upstream/main
ComponentName.md - Component Docs
```

4. Develop your component. After development is complete, run build and ensure tests and lint standards pass.
5. Develop your component. After development is complete, run build and ensure tests and lint standards pass.

```text
$ yarn build
$ yarn test
```sh
yarn build
yarn test
```

Ensure no lint errors are introduced in `yarn-error.log` after running this command.

***Note to Windows users:*** you may need to change the path for the lint script in package.json to be `node_modules/eslint/bin/eslint`

5. Add a commit using `git commit`:
6. Add a commit using `git commit`:

This project uses [`lerna`](https://lernajs.io/) to do automatic releases and generate a changelog based on the commit history. So we follow [a convention][3] for commit messages. Please follow this convention for your commit messages.

6. Rebase
7. Rebase

Use `git rebase` (not `git merge`) to sync your work from time to time. Ensure all commits related to a single issue have been [squashed](https://github.com/ginatrapani/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit).

```text
$ git fetch upstream
$ git rebase upstream/main
```sh
git fetch upstream
git rebase upstream/main
```

7. Push
8. Push

```text
$ git push origin my-branch
```sh
git push origin my-branch
```

8. Create a pull request
9. Create a pull request

[Open a pull request](https://help.github.com/articles/using-pull-requests/) with a clear title and description against the `main` branch. Please be sure to include all of the following in your PR:

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Before you begin, check out this [overview of PatternFly](http://patternfly.org/
#### Install a package manager
Install a package manager before using the PatternFly libraries.

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


#### Start with PatternFly React seed
Expand Down
7 changes: 3 additions & 4 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": ">=18.0.0",
"yarn": ">=1.6.0"
"node": ">=20"
},
"packageManager": "[email protected]",
"keywords": [
"react",
"patternfly",
Expand Down Expand Up @@ -111,6 +111,5 @@
"packages": [
"packages/**"
]
},
"dependencies": {}
}
}
1 change: 0 additions & 1 deletion 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.0",
"private": false,
"main": "./lib/index.js",
"license": "MIT",
"publishConfig": {
Expand Down
15 changes: 0 additions & 15 deletions packages/react-charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

This package provides PatternFly charting components for [PatternFly][patternfly].

### Prerequisite

#### Node Environment

This project currently supports Node [Active LTS](https://github.com/nodejs/Release#release-schedule) releases. Please stay current with Node Active LTS when developing patternfly-react.

For example, to develop with Node 8, use the following:

```
nvm install 8
nvm use 8
```

This project also requires a Yarn version of >=1.6.0. The latest version can be installed [here](https://yarnpkg.com/).

### Installing

```
Expand Down
15 changes: 0 additions & 15 deletions packages/react-code-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

This package provides a PatternFly wrapper for the Monaco code editor, using the `@monaco-editor/react` package.

### Prerequisite

#### Node Environment

This project currently supports Node [Active LTS](https://github.com/nodejs/Release#release-schedule) releases. Please stay current with Node Active LTS when developing patternfly-react.

For example, to develop with Node 18, use the following:

```
nvm install 18
nvm use 18
```

This project also requires a Yarn version of >=1.6.0. The latest version can be installed [here](https://yarnpkg.com/).

### Installing

```
Expand Down
2 changes: 0 additions & 2 deletions packages/react-core/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ $ git checkout -b my-branch -t upstream/main

While developing, you can run the patternfly-react workspace to view the component docs with live examples.

**Note:** Be sure you are using node version >= 18.0.0

```bash
# Start up the workspace locally on port 8002
yarn install && yarn start
Expand Down
Loading

0 comments on commit 1b17b68

Please sign in to comment.