Skip to content

Commit

Permalink
chore: switch to pnpm (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt authored Jan 26, 2023
1 parent 99f6763 commit 0962dd2
Show file tree
Hide file tree
Showing 8 changed files with 5,453 additions and 3,370 deletions.
40 changes: 40 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Setup
description: Boilerplate steps needed by most jobs.
inputs:
node-version:
description: Version of Node to use.
required: false
default: 18.x
install-deps:
description: Should deps be installed?
required: false
default: 'true'
runs:
using: composite
steps:
- name: Use Node.js ${{inputs.node-version}}
uses: actions/setup-node@v3
with:
node-version: ${{inputs.node-version}}
- name: Enable Corepack
run: |
corepack enable
echo "PnPM version is $(pnpm --version)"
shell: bash
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
shell: bash
if: ${{inputs.install-deps}} == 'true'
29 changes: 24 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,28 @@ name: pr
on:
pull_request: {}
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
format:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: pnpm check:format
types:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: pnpm check:types

tests:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -11,10 +32,8 @@ jobs:
name: Node ${{ matrix.node }} @env ${{matrix.environment}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: prisma/action-node-cache-dependencies@main
- run: yarn build
- run: yarn test --environment ${{ matrix.environment }}
- run: pnpm build
- run: pnpm test -- --environment ${{ matrix.environment }}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
coverage
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "graphql-request",
"version": "0.0.0-dripip",
"packageManager": "pnpm@7.26.0",
"main": "dist/index.js",
"files": [
"dist",
Expand Down Expand Up @@ -37,10 +38,12 @@
"build:docs": "doctoc README.md --notitle",
"dev": "rm -rf dist && tsc --watch",
"format": "prettier --write .",
"prepublishOnly": "yarn build",
"check:types": "pnpm tsc --noEmit",
"check:format": "prettier --check .",
"prepublishOnly": "pnpm build",
"build": "rm -rf dist && tsc --project tsconfig.build.json",
"test": "vitest",
"test:coverage": "yarn test --coverage",
"test:coverage": "pnpm test -- --coverage",
"release:stable": "dripip stable",
"release:preview": "dripip preview",
"release:pr": "dripip pr"
Expand All @@ -61,6 +64,7 @@
"@types/extract-files": "^8.1.1",
"@types/node": "^18.11.18",
"@types/ws": "^8.5.4",
"@vitest/coverage-c8": "^0.28.2",
"apollo-server-express": "^3.11.1",
"body-parser": "^1.20.1",
"doctoc": "^2.2.1",
Expand Down
Loading

0 comments on commit 0962dd2

Please sign in to comment.