Skip to content

Commit 2963c7e

Browse files
authored
chore: use pnpm and tsup (#69)
* chore: use pnpm and tsup also updates devDependencies * chore: update prettierignore
1 parent 35a959a commit 2963c7e

File tree

11 files changed

+6181
-7282
lines changed

11 files changed

+6181
-7282
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches:
66
- main
77

8-
env:
9-
YARN_CACHE_FOLDER: ~/.yarn
10-
118
jobs:
129
release:
1310
name: Release
@@ -19,27 +16,28 @@ jobs:
1916
fetch-depth: 0
2017

2118
- name: Setup Node.js
22-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v2
2320
with:
24-
node-version: 14
21+
node-version: '14'
2522

26-
- name: Caching
23+
- name: Cache pnpm modules
2724
uses: actions/cache@v2
2825
with:
29-
path: ${{ env.YARN_CACHE_FOLDER }}
30-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
26+
path: ~/.pnpm-store
27+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3128
restore-keys: |
32-
${{ runner.OS }}-yarn-${{ env.cache-name }}
33-
${{ runner.OS }}-yarn-
29+
${{ runner.os }}-
3430
35-
- name: Installing dependencies
36-
run: yarn install --frozen-lockfile
31+
- uses: pnpm/[email protected]
32+
with:
33+
version: 6
34+
run_install: true
3735

3836
- name: Build
39-
run: yarn build
37+
run: pnpm run build
4038

4139
- name: Release
4240
env:
4341
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4442
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45-
run: yarn release
43+
run: pnpm run release

.github/workflows/tests.yml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Tests
2-
32
on:
43
pull_request:
54
branches:
@@ -8,9 +7,6 @@ on:
87
branches:
98
- main
109

11-
env:
12-
YARN_CACHE_FOLDER: ~/.yarn
13-
1410
jobs:
1511
unit-tests:
1612
name: Unit tests
@@ -22,24 +18,25 @@ jobs:
2218
fetch-depth: 0
2319

2420
- name: Setup Node.js
25-
uses: actions/setup-node@v1
21+
uses: actions/setup-node@v2
2622
with:
27-
node-version: 14
23+
node-version: '14'
2824

29-
- name: Caching
25+
- name: Cache pnpm modules
3026
uses: actions/cache@v2
3127
with:
32-
path: ${{ env.YARN_CACHE_FOLDER }}
33-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
28+
path: ~/.pnpm-store
29+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3430
restore-keys: |
35-
${{ runner.OS }}-yarn-${{ env.cache-name }}
36-
${{ runner.OS }}-yarn-
31+
${{ runner.os }}-
3732
38-
- name: Installing dependencies
39-
run: yarn install --frozen-lockfile
33+
- uses: pnpm/[email protected]
34+
with:
35+
version: 6
36+
run_install: true
4037

4138
- name: Unit test
42-
run: yarn test
39+
run: pnpm run test
4340

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

5956
- name: Setup Node.js
60-
uses: actions/setup-node@v1
57+
uses: actions/setup-node@v2
6158
with:
62-
node-version: 14
59+
node-version: '14'
6360

64-
- name: Caching
61+
- name: Cache pnpm modules
6562
uses: actions/cache@v2
6663
with:
67-
path: ${{ env.YARN_CACHE_FOLDER }}
68-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
64+
path: ~/.pnpm-store
65+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
6966
restore-keys: |
70-
${{ runner.OS }}-yarn-${{ env.cache-name }}
71-
${{ runner.OS }}-yarn-
67+
${{ runner.os }}-
7268
73-
- name: Installing dependencies
74-
run: yarn install --frozen-lockfile
69+
- uses: pnpm/[email protected]
70+
with:
71+
version: 6
72+
run_install: true
7573

7674
- name: Typecheck
77-
run: yarn typecheck
75+
run: pnpm run typecheck
7876

7977
lint:
8078
name: Lint
@@ -86,24 +84,25 @@ jobs:
8684
fetch-depth: 0
8785

8886
- name: Setup Node.js
89-
uses: actions/setup-node@v1
87+
uses: actions/setup-node@v2
9088
with:
91-
node-version: 14
89+
node-version: '14'
9290

93-
- name: Caching
91+
- name: Cache pnpm modules
9492
uses: actions/cache@v2
9593
with:
96-
path: ${{ env.YARN_CACHE_FOLDER }}
97-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
94+
path: ~/.pnpm-store
95+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
9896
restore-keys: |
99-
${{ runner.OS }}-yarn-${{ env.cache-name }}
100-
${{ runner.OS }}-yarn-
97+
${{ runner.os }}-
10198
102-
- name: Installing dependencies
103-
run: yarn install --frozen-lockfile
99+
- uses: pnpm/[email protected]
100+
with:
101+
version: 6
102+
run_install: true
104103

105104
- name: Lint
106-
run: yarn lint
105+
run: pnpm run lint
107106

108107
check-format:
109108
name: Check format
@@ -115,21 +114,22 @@ jobs:
115114
fetch-depth: 0
116115

117116
- name: Setup Node.js
118-
uses: actions/setup-node@v1
117+
uses: actions/setup-node@v2
119118
with:
120-
node-version: 14
119+
node-version: '14'
121120

122-
- name: Caching
121+
- name: Cache pnpm modules
123122
uses: actions/cache@v2
124123
with:
125-
path: ${{ env.YARN_CACHE_FOLDER }}
126-
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
124+
path: ~/.pnpm-store
125+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
127126
restore-keys: |
128-
${{ runner.OS }}-yarn-${{ env.cache-name }}
129-
${{ runner.OS }}-yarn-
127+
${{ runner.os }}-
130128
131-
- name: Installing dependencies
132-
run: yarn install --frozen-lockfile
129+
- uses: pnpm/[email protected]
130+
with:
131+
version: 6
132+
run_install: true
133133

134134
- name: Check format
135-
run: yarn lint:format
135+
run: pnpm run lint:format

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
dist/
22
coverage/
3+
pnpm-lock.yaml
4+
report.json

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Config } from '@jest/types';
2-
import { pathsToModuleNameMapper } from 'ts-jest/utils';
2+
import { pathsToModuleNameMapper } from 'ts-jest';
33

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

package.json

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,48 @@
77
"license": "MIT",
88
"exports": {
99
".": {
10-
"import": "./dist/index.esm.js",
11-
"require": "./dist/index.cjs.js"
10+
"import": "./dist/index.mjs",
11+
"require": "./dist/index.js"
1212
}
1313
},
14-
"main": "./dist/index.cjs.js",
15-
"module": "./dist/index.esm.js",
14+
"main": "./dist/index.js",
15+
"module": "./dist/index.mjs",
1616
"types": "./dist/index.d.ts",
1717
"files": [
1818
"/dist"
1919
],
2020
"scripts": {
21-
"build": "rollup -c rollup.config.ts --configPlugin rollup-plugin-typescript2",
21+
"build": "tsup src/index.ts --dts --format cjs,esm",
2222
"clean": "rm -rf dist/ node_modules/",
2323
"lint": "eslint --max-warnings 0 .",
2424
"lint:format": "prettier --check .",
25-
"start": "yarn build --watch",
25+
"start": "pnpm run build -- --watch",
2626
"test": "jest --forceExit --detectOpenHandles --testLocationInResults --json --outputFile=report.json",
27-
"test:watch": "yarn test --watch",
27+
"test:watch": "pnpm run test -- --watch",
2828
"typecheck": "tsc --noEmit",
2929
"release": "semantic-release"
3030
},
3131
"dependencies": {
3232
"sift": "^15.0.0"
3333
},
3434
"devDependencies": {
35-
"@feathersjs/feathers": "5.0.0-pre.15",
3635
"@feathersjs/adapter-commons": "5.0.0-pre.15",
37-
"@geprog/eslint-config": "0.0.1",
36+
"@feathersjs/feathers": "5.0.0-pre.15",
37+
"@geprog/eslint-config": "1.0.2",
3838
"@geprog/semantic-release-config": "1.0.0",
39-
"@jest/types": "27.2.5",
40-
"@types/jest": "26.0.23",
41-
"@types/node": "15.12.4",
42-
"@vue/test-utils": "2.0.0-rc.16",
43-
"eslint": "7.29.0",
44-
"jest": "27.3.1",
45-
"prettier": "2.3.1",
46-
"rollup": "2.52.2",
47-
"rollup-plugin-dts": "3.0.2",
48-
"rollup-plugin-typescript2": "0.30.0",
49-
"semantic-release": "18.0.0",
50-
"ts-jest": "27.0.7",
51-
"ts-node": "10.0.0",
52-
"typescript": "4.2.4",
53-
"vue": "3.2.21"
39+
"@jest/types": "27.4.2",
40+
"@types/jest": "27.4.0",
41+
"@types/node": "17.0.13",
42+
"@vue/test-utils": "2.0.0-rc.18",
43+
"eslint": "8.8.0",
44+
"jest": "27.4.7",
45+
"prettier": "2.5.1",
46+
"semantic-release": "19.0.2",
47+
"ts-jest": "27.1.3",
48+
"ts-node": "10.4.0",
49+
"tsup": "5.11.13",
50+
"typescript": "4.5.5",
51+
"vue": "3.2.29"
5452
},
5553
"peerDependencies": {
5654
"@feathersjs/adapter-commons": "^5.0.0-pre.3",

0 commit comments

Comments
 (0)