Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove yarn in favor pnpm #4504

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ LOG=$(git log --format="%s" -1 | grep -Poe "#\d+")
PR_NUM=${LOG:1}

# for running a dry run
# yarn run lerna version --conventional-commits --no-private --yes --no-git-tag-version --no-push
# pnpm exec lerna version --conventional-commits --no-private --yes --no-git-tag-version --no-push

# for publishing
yarn run lerna publish --conventional-commits --create-release=github --no-verify-access --no-private --yes 2>&1 | tee lerna-output.txt
pnpm exec lerna publish --conventional-commits --create-release=github --no-verify-access --no-private --yes 2>&1 | tee lerna-output.txt

if grep -i "Successfully published" lerna-output.txt; # Leave a Github comment
then
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows-src/partials/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
with:
node-version: 22
- run: corepack enable
- run: yarn install --immutable
- run: pnpm install
# v5 build
- uses: actions/cache@v4
id: site-cache
name: Load webpack cache
with:
path: "packages/documentation-site/.cache"
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- run: yarn build
key: ${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm build
name: Build docs
6 changes: 3 additions & 3 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
with:
node-version: 22
- run: corepack enable
- run: yarn install --immutable
- run: pnpm install
# build
- uses: actions/cache@v4
id: site-cache
name: Load webpack cache
with:
path: "packages/documentation-site/.cache"
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- run: yarn build
key: ${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm build
name: Build docs
- run: node .github/upload-preview.js build/patternfly-org/site site
name: Upload docs
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
with:
node-version: 22
- run: corepack enable
- run: yarn install --immutable
- run: pnpm install
# v6 build
- uses: actions/cache@v4
id: site-cache
name: Load webpack cache
with:
path: "packages/documentation-site/.cache"
key: ${{ runner.os }}-site-${{ hashFiles('yarn.lock') }}
- run: yarn build
key: ${{ runner.os }}-site-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm build
name: Build docs
- run: .github/release.sh
- name: Configure AWS Credentials
Expand All @@ -46,7 +46,7 @@ jobs:
name: Check size of docs
- run: .github/upload-staging.sh
name: Upload docs to staging
- run: yarn build:extensions
- run: pnpm build:extensions
name: Build extension docs
- name: Upload extension only docs
uses: dswistowski/surge-sh-action@v1
Expand Down
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,3 @@ static

size-plugin.json
**/generated/**/*.js

# Yarn
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The PatternFly Org is the source for the official documentation for PatternFly.

## Development

Development setup requires yarn. If you do not already have yarn installed on your system, see https://yarnpkg.com/getting-started.
Development setup requires PNPM. If you do not already have PNPM installed on your system, see https://pnpm.io/installation#using-corepack

A Node version 22 or greater is also required.

Expand All @@ -14,17 +14,23 @@ A Node version 22 or greater is also required.

You can install the NPM dependencies with:

yarn install
```sh
pnpm install
```

A local development server at http://localhost:8003 can be started with:

yarn start
```sh
pnpm start
```

### Build

The site can be built with:

yarn build
```sh
pnpm build
```

The static assets get copied to build/patternfly-org.

Expand All @@ -39,8 +45,8 @@ When PatternFly does a release (currently every 3 weeks) this bucket is copied t
### Update screenshots
To update the screenshots (these are the images that you click on to see a full-page demo):

- open a terminal and run `yarn build && yarn serve`
- in another terminal, run `yarn screenshots`
- open a terminal and run `pnpm build && pnpm serve`
- in another terminal, run `pnpm screenshots`

Make sure that the version of Chromium you are using is relatively recent. Version 112.0.5614.0 (Developer Build), for example, isn't compatible with the latest versions of PatternFly, and your screenshots will be off.

Expand All @@ -50,7 +56,9 @@ Browse the screenshots to make sure that nothing seems super off. You can compar

You might have a dirty file tree with old submodules and folders lying around. You can remove these with:

git clean -dfx
```sh
git clean -dfx
```

### Contribute to HTML/CSS

Expand Down
7 changes: 1 addition & 6 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"npmClient": "yarn",
"npmClient": "pnpm",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
Expand All @@ -10,11 +10,6 @@
"conventionalCommits": true
}
},
"packages": [
"packages/ast-helpers",
"packages/documentation-framework",
"packages/documentation-site"
],
"version": "independent",
"allowBranch": ["main", "v4", "v5"]
}
29 changes: 12 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,24 @@
"version": "0.0.1",
"main": "index.js",
"license": "MIT",
"packageManager": "[email protected]+sha512.3003a14012e2987072d244c720506549c1aab73ee728208f1b2580a9fd67b92d61ba6b08fe93f6dce68fd771e3af1e59a0afa28dd242dd0940d73b95fedd4e90",
"packageManager": "[email protected]+sha512.da3d715bfd22a9a105e6e8088cfc7826699332ded60c423b14ec613a185f1602206702ff0fe4c438cb15c979081ce4cb02568e364b15174503a63c7a8e2a5f6c",
"scripts": {
"analyze": "yarn workspace patternfly-org analyze",
"develop": "yarn workspace patternfly-org develop",
"develop:extensions": "EXTENSIONS_ONLY=true PRERELEASE=true yarn develop",
"build:analyze": "yarn workspace patternfly-org build:analyze && yarn copy",
"build": "yarn workspace patternfly-org build && yarn copy",
"build:extensions": "EXTENSIONS_ONLY=true PRERELEASE=true yarn build",
"analyze": "pnpm --filter patternfly-org analyze",
"develop": "pnpm --filter patternfly-org develop",
"develop:extensions": "EXTENSIONS_ONLY=true PRERELEASE=true pnpm develop",
"build:analyze": "pnpm --filter patternfly-org build:analyze && pnpm copy",
"build": "pnpm --filter patternfly-org build && pnpm copy",
"build:extensions": "EXTENSIONS_ONLY=true PRERELEASE=true pnpm build",
"copy": "rm -rf build/patternfly-org/site && mkdir -p build/patternfly-org && cp -r packages/documentation-site/public build/patternfly-org/site",
"clean": "lerna run clean && rm -rf build",
"serve": "npx pf-docs-framework serve build/patternfly-org/site",
"test": "yarn workspace patternfly-org test:a11y:ci",
"screenshots": "yarn workspace patternfly-org screenshots",
"start": "yarn develop",
"start:extensions": "yarn develop:extensions",
"test": "pnpm --filter patternfly-org test:a11y:ci",
"screenshots": "pnpm --filter patternfly-org screenshots",
"start": "pnpm develop",
"start:extensions": "pnpm develop:extensions",
"uninstall": "find . -name node_modules | xargs rm -rf",
"workflows": "node .github/generate-workflows",
"test:a11y": "yarn workspace patternfly-org test:a11y"
},
"workspaces": {
"packages": [
"packages/*"
]
"test:a11y": "pnpm --filter patternfly-org test:a11y"
},
"devDependencies": {
"@octokit/rest": "^19.0.7",
Expand Down
45 changes: 34 additions & 11 deletions packages/documentation-framework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,71 @@ We publish this theme [on npm.](https://www.npmjs.com/package/@patternfly/docume

1. @patternfly/documentation-framework

`npm i --save-dev @patternfly/documentation-framework`
```sh
npm i --save-dev @patternfly/documentation-framework
```

or

`yarn add -D @patternfly/documentation-framework`
```sh
pnpm add --save-dev @patternfly/documentation-framework
```

2. Provide or install the following either as dependencies if you want to use them in your own project, or as devDependencies:
```
```json
"@patternfly/patternfly": "6.0.0-alpha.205",
"@patternfly/react-core": "6.0.0-alpha.94",
"@patternfly/react-table": "6.0.0-alpha.95",
"@patternfly/react-code-editor": "6.0.0-alpha.94",
```
`yarn add -D @patternfly/patternfly @patternfly/react-core @patternfly/react-table @patternfly/react-code-editor`
```sh
pnpm add --save-dev @patternfly/patternfly @patternfly/react-core @patternfly/react-table @patternfly/react-code-editor
```

## First time setup

### Init documentation project

To get started, you can scaffold out a sample extension docs setup:

`npx pf-docs-framework init --name "My extension"`
```sh
npx pf-docs-framework init --name "My extension"
```

If you also want to add relevant script targets to package.json, pass in `--scripts` as well:

`npx pf-docs-framework init --name "My extension" --scripts`
```sh
npx pf-docs-framework init --name "My extension" --scripts
```

## Usage

For all CLI options, run `npx pf-docs-framework --help`
For all CLI options, run:

```sh
npx pf-docs-framework --help
```

For individual CLI commands, you can also display more information by running:

For individual CLI commands, you can also display more information by running `npx pf-docs-framework <COMMAND> --help`
```sh
npx pf-docs-framework <COMMAND> --help
```

### Develop docs

`npx pf-docs-framework start`
```sh
npx pf-docs-framework start
```

### Build docs

`npx pf-docs-framework build all --output public`
```sh
npx pf-docs-framework build all --output public
```

> NOTE: If you have `sideEffects: false` in your package.json, that will prevent the CSS from loading in the documentation production build. Set it to true or remove it to enable the CSS from being loaded.
> [!NOTE]
> If you have `sideEffects: false` in your package.json, that will prevent the CSS from loading in the documentation production build. Set it to true or remove it to enable the CSS from being loaded.

### Publish docs to patternfly.org

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const serverConfig = async (env, argv) => {
},
resolve: {
alias: {
// This stops prerender from hanging in `yarn build:client`
// This stops prerender from hanging in `pnpm build:client`
'd3-timer': '@patternfly/documentation-framework/helpers/d3-timer',
// The maintainer will not allow his bundle to be required from a node context
// https://github.com/xtermjs/xterm.js/pull/3134
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ In order to develop with PatternFly, you will need to:

1. [Learn about our design token system](/tokens/about-tokens), which enables you to build interfaces with consistent PatternFly styling, including colors, shadows, spacing, and more.

1. Install a package manager to help you install, update, and configure all necessary PatternFly packages. We recommend [npm](https://nodejs.org/en/download) or [Yarn](https://yarnpkg.com/getting-started).
1. Install a package manager to help you install, update, and configure all necessary PatternFly packages. We recommend [NPM](https://nodejs.org/en/download) or [PNPM](https://pnpm.io/installation).

1. Configure your environment to get started with our [React](#develop-with-react) and/or [HTML/CSS](#develop-with-htmlcss) libraries.

## Develop with React

[PatternFly's React library](https://github.com/patternfly/patternfly-react) contains a collection of components that you can use to build interfaces with consistent markup, styling, and behavior. It is composed of a number of React packages, which are published in the following npm packages:
[PatternFly's React library](https://github.com/patternfly/patternfly-react) contains a collection of components that you can use to build interfaces with consistent markup, styling, and behavior. It is composed of a number of React packages, which are published in the following NPM packages:

* [@patternfly/react-core](https://www.npmjs.com/package/@patternfly/react-core): Most React core components.
* [@patternfly/react-charts](https://www.npmjs.com/package/@patternfly/react-charts): PatternFly charting components.
Expand Down Expand Up @@ -59,15 +59,15 @@ To get started:

If you wish to migrate an existing project to PatternFly you must install and configure PatternFly React using either of these methods:

* Using npm, run the following command:
```sh
npm install @patternfly/react-core --save
```
* Using NPM, run the following command:
```sh
npm install @patternfly/react-core
```

* Using Yarn, run the following command:
```sh
yarn add @patternfly/react-core
```
* Using PNPM, run the following command:
```sh
pnpm add @patternfly/react-core
```

## Develop with HTML/CSS

Expand All @@ -86,7 +86,7 @@ Use these files to consume the library. The recommended consumption approach wil

### Install and configure PatternFly HTML/CSS

1. Using npm, run the following command to install the HTML/CSS library:
1. Using NPM, run the following command to install the HTML/CSS library:

```sh
npm install @patternfly/patternfly --save
Expand Down
Loading
Loading