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

chore: use pnpm and tsup #69

Merged
merged 2 commits into from
Jan 30, 2022
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
26 changes: 12 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches:
- main

env:
YARN_CACHE_FOLDER: ~/.yarn

jobs:
release:
name: Release
Expand All @@ -19,27 +16,28 @@ jobs:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 14
node-version: '14'

- name: Caching
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ${{ env.YARN_CACHE_FOLDER }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.OS }}-yarn-${{ env.cache-name }}
${{ runner.OS }}-yarn-
${{ runner.os }}-

- name: Installing dependencies
run: yarn install --frozen-lockfile
- uses: pnpm/[email protected]
with:
version: 6
run_install: true

- name: Build
run: yarn build
run: pnpm run build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release
run: pnpm run release
88 changes: 44 additions & 44 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Tests

on:
pull_request:
branches:
Expand All @@ -8,9 +7,6 @@ on:
branches:
- main

env:
YARN_CACHE_FOLDER: ~/.yarn

jobs:
unit-tests:
name: Unit tests
Expand All @@ -22,24 +18,25 @@ jobs:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 14
node-version: '14'

- name: Caching
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ${{ env.YARN_CACHE_FOLDER }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.OS }}-yarn-${{ env.cache-name }}
${{ runner.OS }}-yarn-
${{ runner.os }}-

- name: Installing dependencies
run: yarn install --frozen-lockfile
- uses: pnpm/[email protected]
with:
version: 6
run_install: true

- name: Unit test
run: yarn test
run: pnpm run test

- uses: artiomtr/[email protected]
if: "github.event_name == 'pull_request'"
Expand All @@ -57,24 +54,25 @@ jobs:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 14
node-version: '14'

- name: Caching
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ${{ env.YARN_CACHE_FOLDER }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.OS }}-yarn-${{ env.cache-name }}
${{ runner.OS }}-yarn-
${{ runner.os }}-

- name: Installing dependencies
run: yarn install --frozen-lockfile
- uses: pnpm/[email protected]
with:
version: 6
run_install: true

- name: Typecheck
run: yarn typecheck
run: pnpm run typecheck

lint:
name: Lint
Expand All @@ -86,24 +84,25 @@ jobs:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 14
node-version: '14'

- name: Caching
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ${{ env.YARN_CACHE_FOLDER }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.OS }}-yarn-${{ env.cache-name }}
${{ runner.OS }}-yarn-
${{ runner.os }}-

- name: Installing dependencies
run: yarn install --frozen-lockfile
- uses: pnpm/[email protected]
with:
version: 6
run_install: true

- name: Lint
run: yarn lint
run: pnpm run lint

check-format:
name: Check format
Expand All @@ -115,21 +114,22 @@ jobs:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 14
node-version: '14'

- name: Caching
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ${{ env.YARN_CACHE_FOLDER }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.OS }}-yarn-${{ env.cache-name }}
${{ runner.OS }}-yarn-
${{ runner.os }}-

- name: Installing dependencies
run: yarn install --frozen-lockfile
- uses: pnpm/[email protected]
with:
version: 6
run_install: true

- name: Check format
run: yarn lint:format
run: pnpm run lint:format
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
dist/
coverage/
pnpm-lock.yaml
report.json
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Config } from '@jest/types';
import { pathsToModuleNameMapper } from 'ts-jest/utils';
import { pathsToModuleNameMapper } from 'ts-jest';

import { compilerOptions } from './tsconfig.json';

Expand Down
46 changes: 22 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,48 @@
"license": "MIT",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js"
"import": "./dist/index.mjs",
"require": "./dist/index.js"
}
},
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"/dist"
],
"scripts": {
"build": "rollup -c rollup.config.ts --configPlugin rollup-plugin-typescript2",
"build": "tsup src/index.ts --dts --format cjs,esm",
"clean": "rm -rf dist/ node_modules/",
"lint": "eslint --max-warnings 0 .",
"lint:format": "prettier --check .",
"start": "yarn build --watch",
"start": "pnpm run build -- --watch",
"test": "jest --forceExit --detectOpenHandles --testLocationInResults --json --outputFile=report.json",
"test:watch": "yarn test --watch",
"test:watch": "pnpm run test -- --watch",
"typecheck": "tsc --noEmit",
"release": "semantic-release"
},
"dependencies": {
"sift": "^15.0.0"
},
"devDependencies": {
"@feathersjs/feathers": "5.0.0-pre.15",
"@feathersjs/adapter-commons": "5.0.0-pre.15",
"@geprog/eslint-config": "0.0.1",
"@feathersjs/feathers": "5.0.0-pre.15",
"@geprog/eslint-config": "1.0.2",
"@geprog/semantic-release-config": "1.0.0",
"@jest/types": "27.2.5",
"@types/jest": "26.0.23",
"@types/node": "15.12.4",
"@vue/test-utils": "2.0.0-rc.16",
"eslint": "7.29.0",
"jest": "27.3.1",
"prettier": "2.3.1",
"rollup": "2.52.2",
"rollup-plugin-dts": "3.0.2",
"rollup-plugin-typescript2": "0.30.0",
"semantic-release": "18.0.0",
"ts-jest": "27.0.7",
"ts-node": "10.0.0",
"typescript": "4.2.4",
"vue": "3.2.21"
"@jest/types": "27.4.2",
"@types/jest": "27.4.0",
"@types/node": "17.0.13",
"@vue/test-utils": "2.0.0-rc.18",
"eslint": "8.8.0",
"jest": "27.4.7",
"prettier": "2.5.1",
"semantic-release": "19.0.2",
"ts-jest": "27.1.3",
"ts-node": "10.4.0",
"tsup": "5.11.13",
"typescript": "4.5.5",
"vue": "3.2.29"
},
"peerDependencies": {
"@feathersjs/adapter-commons": "^5.0.0-pre.3",
Expand Down
Loading