Skip to content

Commit

Permalink
Switch to pnpm (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj authored Dec 29, 2022
1 parent 633b1cb commit ebc52c4
Show file tree
Hide file tree
Showing 12 changed files with 4,401 additions and 15,199 deletions.
14 changes: 0 additions & 14 deletions .github/actions/setup-npm-cache/action.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/actions/setup-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See also https://github.com/actions/cache/blob/main/examples.md#node---npm

name: Setup pnpm
runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7

- name: Get pnpm store directory
id: pnpm-cache-dir
shell: bash
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
8 changes: 4 additions & 4 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
with:
node-version: 16

- name: Setup NPM cache
uses: ./.github/actions/setup-npm-cache
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

- name: Install dependencies
run: npm ci && npm install --global concurrently
run: pnpm install && pnpm add --global concurrently

- name: Lint & Format
run: concurrently --prefix none --group "npm:lint" "npm:format"
run: concurrently --prefix none --group "pnpm:lint" "pnpm:format"
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
node-version: 16
registry-url: https://registry.npmjs.org

- name: Setup NPM cache
uses: ./.github/actions/setup-npm-cache
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

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

- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish
run: pnpm publish
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Setup NPM cache
uses: ./.github/actions/setup-npm-cache
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

- name: Install dependencies
run: npm ci && npm install --global concurrently
run: pnpm install && pnpm add --global concurrently

- name: Build & Test
run: concurrently --prefix none --group "npm:build" "npm:test"
run: concurrently --prefix none --group "pnpm:build" "pnpm:test"

- name: Submit coverage
uses: coverallsapp/github-action@master
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist
coverage
pacakge-lock.json
pnpm-lock.yaml
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updated.

## Code Format & Linting

Code format and lint checks are performed locally when committing to ensure the changes align with the configured rules of this repository. This happens with the help of the tools [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks) and [lint-staged](https://github.com/okonet/lint-staged) which are automatically installed and configured on `npm install` (no further steps required).
Code format and lint checks are performed locally when committing to ensure the changes align with the configured rules of this repository. This happens with the help of the tools [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks) and [lint-staged](https://github.com/okonet/lint-staged) which are automatically installed and configured on `pnpm install` (no further steps required).

In case of problems, a corresponding message is displayed in your terminal.
Please fix them and then run the commit command again.
Expand All @@ -20,5 +20,5 @@ Please fix them and then run the commit command again.
Tests can be executed with the following command:

```bash
npm test
pnpm test
```
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* While in local development, make sure you've run `npm run build` first.
* While in local development, make sure you've run `pnpm run build` first.
*/

// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand Down
2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* While in local development, make sure you've run `npm run build` first.
* While in local development, make sure you've run `pnpm run build` first.
*/

import concurrently from './dist/src/index.js';
Expand Down
Loading

0 comments on commit ebc52c4

Please sign in to comment.