Skip to content

Commit dcaab57

Browse files
authored
feat: migrate to pnpm (#1061)
* feat: migrate to pnpm * fix: tests * fix: pin redis version to fix redis/ioredis#2037
1 parent 6dfa610 commit dcaab57

File tree

24 files changed

+11232
-20219
lines changed

24 files changed

+11232
-20219
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,22 @@ jobs:
2323

2424
- uses: actions/checkout@v6
2525

26+
- uses: pnpm/action-setup@v4
27+
2628
- name: Use Node.js ${{ matrix.node-version }}
2729
uses: actions/setup-node@v6
2830
with:
2931
node-version: ${{ matrix.node-version }}
30-
31-
- name: Load cached dependencies
32-
uses: actions/cache@v5.0.3
33-
id: cache
34-
with:
35-
path: |
36-
**/node_modules
37-
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
32+
cache: 'pnpm'
3833

3934
- name: Set up npmrc
40-
id: setup-npmrc
41-
if: steps.cache.outputs.cache-hit != 'true'
4235
run: echo "@tiptap-cloud:registry=https://registry.tiptap.dev/" >> ~/.npmrc && echo "//registry.tiptap.dev/:_authToken=${{ secrets.TIPTAP_PRIVATE_REGISTRY_NPM_TOKEN }}" >> ~/.npmrc
4336

4437
- name: Install dependencies
45-
id: install-dependencies
46-
if: steps.cache.outputs.cache-hit != 'true'
47-
run: npm ci --force
38+
run: pnpm install --frozen-lockfile
4839

4940
# - name: Lint code
50-
# id: lint
51-
# run: npm run lint
41+
# run: pnpm lint
5242

5343
test:
5444
runs-on: ubuntu-latest
@@ -68,32 +58,22 @@ jobs:
6858

6959
- uses: actions/checkout@v6
7060

61+
- uses: pnpm/action-setup@v4
62+
7163
- name: Use Node.js ${{ matrix.node-version }}
7264
uses: actions/setup-node@v6
7365
with:
7466
node-version: ${{ matrix.node-version }}
75-
76-
- name: Load cached dependencies
77-
uses: actions/cache@v5.0.3
78-
id: cache
79-
with:
80-
path: |
81-
**/node_modules
82-
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
67+
cache: 'pnpm'
8368

8469
- name: Set up npmrc
85-
id: setup-npmrc
86-
if: steps.cache.outputs.cache-hit != 'true'
8770
run: echo "@tiptap-cloud:registry=https://registry.tiptap.dev/" >> ~/.npmrc && echo "//registry.tiptap.dev/:_authToken=${{ secrets.TIPTAP_PRIVATE_REGISTRY_NPM_TOKEN }}" >> ~/.npmrc
8871

8972
- name: Install dependencies
90-
id: install-dependencies
91-
if: steps.cache.outputs.cache-hit != 'true'
92-
run: npm ci --force
73+
run: pnpm install --frozen-lockfile
9374

9475
- name: Run tests
95-
id: test
96-
run: npm run test
76+
run: pnpm test
9777
env:
9878
REDIS_HOST: localhost
9979
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
@@ -111,29 +91,19 @@ jobs:
11191

11292
- uses: actions/checkout@v6
11393

94+
- uses: pnpm/action-setup@v4
95+
11496
- name: Use Node.js ${{ matrix.node-version }}
11597
uses: actions/setup-node@v6
11698
with:
11799
node-version: ${{ matrix.node-version }}
118-
119-
- name: Load cached dependencies
120-
uses: actions/cache@v5.0.3
121-
id: cache
122-
with:
123-
path: |
124-
**/node_modules
125-
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
100+
cache: 'pnpm'
126101

127102
- name: Set up npmrc
128-
id: setup-npmrc
129-
if: steps.cache.outputs.cache-hit != 'true'
130103
run: echo "@tiptap-cloud:registry=https://registry.tiptap.dev/" >> ~/.npmrc && echo "//registry.tiptap.dev/:_authToken=${{ secrets.TIPTAP_PRIVATE_REGISTRY_NPM_TOKEN }}" >> ~/.npmrc
131104

132105
- name: Install dependencies
133-
id: install-dependencies
134-
if: steps.cache.outputs.cache-hit != 'true'
135-
run: npm ci --force
106+
run: pnpm install --frozen-lockfile
136107

137108
- name: Try to build the packages
138-
id: build-packages
139-
run: npm run build:packages
109+
run: pnpm build:packages

.github/workflows/publish.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,23 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v6
20+
21+
- uses: pnpm/action-setup@v4
22+
2023
- uses: actions/setup-node@v6
2124
with:
2225
node-version: 22
2326
registry-url: https://registry.npmjs.org/
24-
25-
- name: Update npm for Trusted Publishing
26-
run: npm install -g npm@11.6.2
27+
cache: 'pnpm'
2728

2829
- name: Set up npmrc
2930
id: setup-npmrc
3031
run: echo "@tiptap-cloud:registry=https://registry.tiptap.dev/" >> ~/.npmrc && echo "//registry.tiptap.dev/:_authToken=${{ secrets.TIPTAP_PRIVATE_REGISTRY_NPM_TOKEN }}" >> ~/.npmrc
3132

32-
- run: npm ci
33+
- run: pnpm install --frozen-lockfile
3334

34-
- run: npm run publish
35+
- run: pnpm publish
3536
if: "!contains(github.ref, '-rc.')"
3637

37-
- run: npm run publish:pre
38+
- run: pnpm publish:pre
3839
if: "contains(github.ref, '-rc.')"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ yarn-debug.log*
1414
yarn-error.log*
1515
/database
1616
.prettierignore
17+
package-lock.json
18+
yarn.lock

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node-linker=hoisted

lerna.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
"packages": [
33
"packages/*"
44
],
5+
"npmClient": "pnpm",
56
"command": {
67
"publish": {
78
"conventionalCommits": true
89
}
910
},
1011
"version": "3.4.6-rc.2",
1112
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
12-
}
13+
}

0 commit comments

Comments
 (0)