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: use pnpm instead npm #852

Merged
merged 9 commits into from
Apr 16, 2023
Merged
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
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
Loading