From 7e361db1ce1c4eb5fb54b89eeb6bdce1f1e2736a Mon Sep 17 00:00:00 2001 From: Jon Koops Date: Wed, 1 May 2024 01:22:42 +0200 Subject: [PATCH] chore: upgrade to Node.js version 20 Signed-off-by: Jon Koops --- .github/actions/setup-project/action.yml | 2 +- CONTRIBUTING.md | 51 +++++++++++-------- README.md | 2 +- package.json | 2 +- .../eslint-plugin-patternfly-react/README.md | 4 +- packages/react-charts/README.md | 19 +------ packages/react-code-editor/README.md | 23 ++------- packages/react-core/CONTRIBUTING.md | 2 - packages/react-table/README.md | 19 +------ packages/react-templates/README.md | 19 +------ 10 files changed, 45 insertions(+), 98 deletions(-) diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml index b0a93cde289..b51a8ba250a 100644 --- a/.github/actions/setup-project/action.yml +++ b/.github/actions/setup-project/action.yml @@ -14,7 +14,7 @@ runs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 check-latest: true - name: Get Yarn configuration diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b0b8205c972..470a424cfe6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 ``` @@ -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//patternfly-react.git # Navigate to the newly cloned directory @@ -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). 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 ``` @@ -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: diff --git a/README.md b/README.md index 697a5524414..843af600b4b 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ 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 npm](https://nodejs.org/en/download/package-manager) * [Use Yarn](https://yarnpkg.com/en/docs/getting-started) diff --git a/package.json b/package.json index a84001c45f6..51bf68cac5e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/patternfly/patternfly-react.git" }, "engines": { - "node": ">=18.0.0", + "node": ">=20", "yarn": ">=1.6.0" }, "keywords": [ diff --git a/packages/eslint-plugin-patternfly-react/README.md b/packages/eslint-plugin-patternfly-react/README.md index f60a9ae6b58..347fa5ad0ed 100644 --- a/packages/eslint-plugin-patternfly-react/README.md +++ b/packages/eslint-plugin-patternfly-react/README.md @@ -4,13 +4,13 @@ This package provides PatternFly React all ESLint rules bundled together for use ### Installing -``` +```sh yarn add -D eslint-plugin-patternfly-react ``` or -``` +```sh npm install eslint-plugin-patternfly-react --save-dev ``` diff --git a/packages/react-charts/README.md b/packages/react-charts/README.md index f4afdae7292..b249e79b697 100644 --- a/packages/react-charts/README.md +++ b/packages/react-charts/README.md @@ -2,30 +2,15 @@ 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 -``` +```sh yarn add @patternfly/react-charts ``` or -``` +```sh npm install @patternfly/react-charts --save ``` diff --git a/packages/react-code-editor/README.md b/packages/react-code-editor/README.md index 9c9343c4cb5..2ca36514021 100644 --- a/packages/react-code-editor/README.md +++ b/packages/react-code-editor/README.md @@ -2,42 +2,27 @@ 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 -``` +```sh yarn add @patternfly/react-code-editor ``` or -``` +```sh npm install @patternfly/react-code-editor ``` [!NOTE] For TypeScript type definitions, this package uses the `monaco-editor` package as a peer dependency. So, if you need types and don't already have the `monaco-editor package` installed, you will need to do so: -``` +```sh yarn add --dev monaco-editor ``` or -``` +```sh npm install --dev monaco-editor ``` diff --git a/packages/react-core/CONTRIBUTING.md b/packages/react-core/CONTRIBUTING.md index e1d84283a7d..8ce6f8e1bc3 100644 --- a/packages/react-core/CONTRIBUTING.md +++ b/packages/react-core/CONTRIBUTING.md @@ -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 diff --git a/packages/react-table/README.md b/packages/react-table/README.md index de10fe45c43..427bc16e063 100644 --- a/packages/react-table/README.md +++ b/packages/react-table/README.md @@ -2,30 +2,15 @@ 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 -``` +```sh yarn add @patternfly/react-table ``` or -``` +```sh npm install @patternfly/react-table --save ``` diff --git a/packages/react-templates/README.md b/packages/react-templates/README.md index dae23cecda9..8ec96c5c3bf 100644 --- a/packages/react-templates/README.md +++ b/packages/react-templates/README.md @@ -2,30 +2,15 @@ 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 -``` +```sh yarn add @patternfly/react-templates ``` or -``` +```sh npm install @patternfly/react-templates --save ```