Skip to content

Commit

Permalink
chore: move to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
maraisr committed May 22, 2021
1 parent c357c23 commit c3eabd3
Show file tree
Hide file tree
Showing 6 changed files with 1,987 additions and 2,099 deletions.
108 changes: 58 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,63 @@
name: CI

on:
push:
branches: [main]
pull_request: {}
push:
branches: [main]
pull_request: {}

jobs:
test:
name: Node.js v${{ matrix.nodejs }}
runs-on: ubuntu-latest
strategy:
matrix:
nodejs: [12, 14, 15, 16]
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@main
with:
node-version: ${{ matrix.nodejs }}

- name: (env) yarn global
run: |-
yarn global bin >> $GITHUB_PATH
echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_ENV
- name: (env) cache
uses: actions/cache@main
with:
path: ${{ env.YARN_CACHE_DIR }}
key:
${{ runner.os }}-node${{ matrix.nodejs }}-${{
hashFiles('./package.json', './yarn.lock') }}

- name: Install
run: |-
yarn --frozen-lockfile;
yarn global add nyc;
- name: Compile
run: yarn build

- name: Type Check
run: yarn typecheck

- name: Test w/ Coverage
run: nyc --include=src yarn test

- name: Benchmark
run: yarn bench

- name: Report
if: matrix.nodejs >= 16
run: |-
nyc report --reporter=text-lcov > coverage.lcov;
bash <(curl -s https://codecov.io/bash);
test:
name: Node.js v${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14, 16]
steps:
- uses: actions/checkout@main

- name: (env) setup node v${{ matrix.node }}
uses: actions/setup-node@main
with:
node-version: ${{ matrix.node }}
check-latest: true

- name: (env) prepare
run: curl -L https://pnpm.js.org/pnpm.js | node - add --global pnpm

- name: (env) cache
id: cache
uses: actions/cache@main
with:
path: /tmp/pnpmstore
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-${{ matrix.node }}-

- name: (env) restore cache
if: steps.cache.outputs.cache-hit == 'true'
run: lz4 -d /tmp/pnpmstore | tar -xf - ;

- name: Install
run: |-
pnpm install
pnpm i -g nyc
- name: (env) prepare cache
run: tar -cf - ~/.pnpm-store | lz4 > /tmp/pnpmstore

- name: Compiles
run: pnpm run build

- name: Test w/ Coverage
run: nyc --include=src pnpm test

- name: Check Types
run: pnpm run typecheck

- name: Benchmark
run: pnpm run bench

- name: Report
if: matrix.nodejs >= 16
run: |-
nyc report --reporter=text-lcov > coverage.lcov;
bash <(curl -s https://codecov.io/bash);
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
node_modules
.DS_Store
*-lock.*
*-lock.json
*.lock
*.log

/browser
/node
/types
/coverage

# Yarn
.yarn/
/.pnp*
/.nyc_output

# Editors
*.iml
/.idea
/.vscode

# Code
/browser
/node
/types
/lib
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"bench": "node -r ts-node/register -r ./test/_polyfill.js bench/index.ts",
"build": "rollup -c",
"format": "prettier --write --list-different \"{*,.github/**/*}.+(ts|json|yml|md)\"",
"prepublishOnly": "yarn build",
"prepublishOnly": "pnpm run build",
"test": "uvu -r ts-node/register -r ./test/_polyfill.js -i _polyfill -i mocks test",
"typecheck": "tsc --noEmit"
},
Expand All @@ -66,10 +66,12 @@
"overrides": [
{
"files": [
"*.md"
"*.md",
"*.yml"
],
"options": {
"tabWidth": 2,
"printWidth": 120,
"useTabs": false
}
}
Expand All @@ -78,19 +80,20 @@
"devDependencies": {
"@marais/tsconfig": "0.0.1",
"@n1ru4l/push-pull-async-iterable-iterator": "2.1.4",
"@rollup/plugin-node-resolve": "11.2.1",
"@rollup/plugin-node-resolve": "13.0.0",
"@types/benchmark": "2.1.0",
"@types/node": "14.14.41",
"@types/node": "15.6.0",
"benchmark": "2.1.4",
"fetch-multipart-graphql": "3.0.0",
"it-multipart": "1.0.9",
"prettier": "2.2.1",
"rollup": "2.45.2",
"rollup-plugin-dts": "3.0.1",
"prettier": "2.3.0",
"rollup": "2.48.0",
"rollup-plugin-dts": "3.0.2",
"rollup-plugin-filesize": "9.1.1",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-typescript2": "0.30.0",
"ts-node": "9.1.1",
"tslib": "^2.2.0",
"typescript": "4.2.4",
"uvu": "0.5.1"
},
Expand All @@ -106,7 +109,6 @@
"node": ">=12"
},
"volta": {
"node": "16.0.0",
"yarn": "1.22.10"
"node": "16.2.0"
}
}
Loading

0 comments on commit c3eabd3

Please sign in to comment.