Skip to content

Commit

Permalink
Switch from yarn to pnpm
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Mior <[email protected]>
  • Loading branch information
michaelmior committed Nov 2, 2024
1 parent 41ae108 commit 2ffb7f4
Show file tree
Hide file tree
Showing 10 changed files with 16,525 additions and 17,099 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ jobs:
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn
run: pnpm install
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v1
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,29 @@ jobs:
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'

- run: yarn install
- run: yarn lint
- run: yarn flow
- run: yarn test --coverage
- run: yarn build
- run: yarn esdoc
- run: pnpm install
- run: pnpm run lint
- run: pnpm run flow
- run: pnpm run test --coverage
- run: pnpm run build
- run: pnpm esdoc

- name: BundleWatch
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
CI_BRANCH_BASE: main
if: ${{ matrix.os == 'ubuntu-latest' }}
run: yarn run bundlewatch
run: pnpm bundlewatch

- name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
if: ${{ matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main' }}
run: yarn coveralls
run: pnpm run coveralls
shell: bash
3 changes: 2 additions & 1 deletion .github/workflows/flow-typed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ jobs:
with:
ref: main

- uses: pnpm/action-setup@v4
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn install --frozen-lockfile --non-interactive
- run: pnpm install --frozen-lockfile
- run: npx flow-typed install

- name: Create Pull Request
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo

In the project directory, you can run:

### `yarn start`
### `pnpm start`

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `yarn test`
### `pnpm test`

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`
### `pnpm build`

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br />

### `yarn flow`
### `pnpm flow`

Type check all files in the `src` folder using [Flow](https://flow.org/).
This check will also be run before commits.

### `yarn lint`
### `pnpm lint`

Lint all files in `src` using [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/).
Files which have changed are also linted before every commit.
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build]
# Build command.
command = "yarn run netlify-build"
command = "pnpm run netlify-build"

# Publish diretory
publish = "build/"
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@
"build": "react-scripts build",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token \"$CHROMATIC_PROJECT_TOKEN\"",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"eject": "react-scripts eject",
"flow": "flow check src",
"lint": "node_modules/.bin/prettier --check src/**/*.{js,json} && eslint --ext .js,.yml . && npmPkgJsonLint -q . && pkg-ok && markdownlint *.md",
"lint": "prettier --check src/**/*.{js,json} && eslint --ext .js,.yml . && npmPkgJsonLint -q . && pkg-ok && markdownlint *.md",
"netlify-build": "REACT_APP_GIT_SHA=`([ -n \"$COMMIT_REF\" ] && echo \"$COMMIT_REF\") || git rev-parse HEAD` react-scripts build && storybook build -o build/storybook/ && esdoc && mv docs/ build/",
"preinstall": "npx only-allow pnpm",
"prepare": "husky",
"start": "react-scripts start",
"storybook": "storybook dev -p 9009",
Expand Down Expand Up @@ -113,6 +114,7 @@
"storybook": "^8.4.0",
"stylelint": "^16.9.0",
"stylelint-config-standard": "^36.0.1",
"universal-cookie": "^7.2.2",
"webpack": "5"
},
"engines": {
Expand All @@ -137,5 +139,10 @@
}
]
},
"packageManager": "[email protected]"
"pnpm": {
"overrides": {
"jest-environment-jsdom": "27.4.6"
}
},
"packageManager": "[email protected]+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee"
}
Loading

0 comments on commit 2ffb7f4

Please sign in to comment.