Skip to content

Commit

Permalink
chore: upgrade Yarn and Node.js to latest version
Browse files Browse the repository at this point in the history
Closes patternfly#9959

Signed-off-by: Jon Koops <jonkoops@gmail.com>
  • Loading branch information
jonkoops committed Apr 30, 2024
1 parent ca3f174 commit 6d0c4e5
Show file tree
Hide file tree
Showing 12 changed files with 28,250 additions and 19,881 deletions.
12 changes: 8 additions & 4 deletions .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ runs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
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: 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": "yarn@4.1.1",
"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
15 changes: 0 additions & 15 deletions packages/react-table/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

This package provides Table PatternFly components based on [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 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
15 changes: 0 additions & 15 deletions packages/react-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

This package provides wrapped Patternfly component demos with a streamlined API for ease of use.

### 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 from the [Yarn](https://yarnpkg.com/) home page.

### Installing

```
Expand Down
Loading

0 comments on commit 6d0c4e5

Please sign in to comment.