Skip to content

Commit

Permalink
Merge pull request #852 from await-ovo/feat-pnpm
Browse files Browse the repository at this point in the history
feat: use pnpm instead npm
  • Loading branch information
gregberge committed Apr 16, 2023
2 parents be5d3a8 + d32f583 commit 79233c0
Show file tree
Hide file tree
Showing 30 changed files with 16,615 additions and 2,035 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,20 @@ jobs:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3

- name: Use latest npm
run: npm i -g npm@latest --registry=https://registry.npmjs.org
if: ${{ matrix.node-version == '14.x' }}
- name: Use latest pnpm
run: npm i -g pnpm@latest --registry=https://registry.npmjs.org

- name: Install dependencies
run: npm ci
run: pnpm install

- name: Build
run: npm run build
run: pnpm run build

- name: Lint
run: npm run lint
run: pnpm run lint

- name: Test
run: npm run test -- --ci --coverage
run: pnpm run test --ci --coverage

- name: Codecov
run: npx codecov
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ lerna.json
dist/
.next/
/website/.cache/
/website/public/
/website/public/
pnpm-workspace.yaml
pnpm-lock.yaml
15 changes: 9 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ We expect project participants to adhere to our Code of Conduct. Please read [th

All work on SVGR happens directly on [GitHub](/). Both core team members and external contributors send pull requests which go through the same review process.

The SVGR repo is a monorepo using pnpm workspaces and [Lerna](https://lerna.js.org/docs/recipes/using-pnpm-with-lerna). The package manager used to install and link dependencies must be [pnpm](https://pnpm.io/). Note that website still uses npm, as there are some errors reported when using pnpm in gatsby.

### Online one click Setup

You can use Gitpod(An Online Open Source VS Code like IDE which is free for Open Source) for contributing online. With a single click it will start a workspace and automatically:

- clone the `svgr` repo.
- install all the dependencies in `/` and `/website`.
- run `npm run dev` in `/`.
- install dependencies in '/': `pnpm install`
- install dependencies in '/website': `npm install`
- run `pnpm run dev` in `/`.
- run `npm run dev` in `/website` to start the dev server.

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
Expand All @@ -37,27 +40,27 @@ _Before_ submitting a pull request, please make sure the following is done…

Note: Replace `<your_username>` with your GitHub username

2. Run `npm install` and `npm run build`.
2. Run `pnpm install` and `pnpm run build`.

3. If you've added code that should be tested, add tests. You can use watch mode that continuously transforms changed files to make your life easier.

```sh
# in the background
npm run dev
pnpm run dev
```

4. If you've changed APIs, update the documentation.

5. Ensure the linting is good via `npm run lint`.

```sh-session
$ npm run lint
$ pnpm run lint
```

6. Ensure the test suite passes via `npm run test`.

```sh-session
$ npm run test
$ pnpm run test
```

## Bugs
Expand Down

1 comment on commit 79233c0

@vercel
Copy link

@vercel vercel bot commented on 79233c0 Apr 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

svgr – ./

svgr-git-main-gregberge.vercel.app
api.react-svgr.com
svgr-gregberge.vercel.app

Please sign in to comment.