Skip to content

Commit 89d1381

Browse files
authored
Merge pull request #157 from cryptomator/feature/use-pnpm
Feature: Migrate to pnpm
2 parents 8feaeeb + 6e3325a commit 89d1381

11 files changed

Lines changed: 1012 additions & 1493 deletions

File tree

.github/dependabot.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
version: 2
2+
3+
# Private registry for Font Awesome Pro so Dependabot can resolve
4+
# @awesome.me/* metadata. The token is a Dependabot secret (separate
5+
# from Actions secrets), configured in repo settings.
6+
registries:
7+
fontawesome:
8+
type: npm-registry
9+
url: https://npm.fontawesome.com
10+
token: ${{secrets.FONTAWESOME_AUTH_TOKEN}}
11+
212
updates:
3-
- package-ecosystem: "github-actions"
4-
directory: "/"
13+
- package-ecosystem: npm
14+
directory: /
515
schedule:
6-
interval: "weekly"
16+
interval: monthly
17+
open-pull-requests-limit: 5
18+
registries:
19+
- fontawesome
20+
# Matches the pnpm minimumReleaseAge in pnpm-workspace.yaml so
21+
# Dependabot does not propose versions pnpm would refuse to install.
22+
cooldown:
23+
default-days: 3
24+
groups:
25+
minor-and-patch:
26+
update-types:
27+
- minor
28+
- patch
29+
30+
- package-ecosystem: github-actions
31+
directory: /
32+
schedule:
33+
interval: monthly
734
groups:
835
github-actions:
936
patterns:

.github/workflows/gh-pages.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ jobs:
1919
with:
2020
hugo-version: '0.148.1'
2121
extended: true
22+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
2223
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2324
with:
2425
node-version: 22
25-
cache: 'npm'
26-
cache-dependency-path: package-lock.json
27-
registry-url: 'https://npm.fontawesome.com/'
28-
- name: NPM install
29-
run: |
30-
npm config set "@awesome.me:registry" https://npm.fontawesome.com/
31-
npm ci --ignore-scripts
26+
cache: 'pnpm'
27+
cache-dependency-path: pnpm-lock.yaml
28+
- name: Check lockfile
29+
run: bash scripts/check-lockfile.sh
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
3232
env:
33-
NODE_AUTH_TOKEN: ${{ secrets.FONTAWESOME_AUTH_TOKEN }}
33+
FONTAWESOME_AUTH_TOKEN: ${{ secrets.FONTAWESOME_AUTH_TOKEN }}
3434
- name: Build production
3535
run: hugo --minify --destination public/prod
3636
- name: Build staging

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules/
33
public/
44
*.DS_Store
55
.hugo_build.lock
6+
package-lock.json

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@awesome.me:registry=https://npm.fontawesome.com/
2+
//npm.fontawesome.com/:_authToken=${FONTAWESOME_AUTH_TOKEN}

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,28 @@
22

33
# Usage
44
## Requirements
5+
* pnpm
56
* Hugo
6-
* Font Awesome Pro `npm config set "@awesome.me:registry" https://npm.fontawesome.com/ && npm config set "//npm.fontawesome.com/:_authToken" TOKEN`
7+
* Font Awesome Pro auth token, stored in the `FONTAWESOME_AUTH_TOKEN` environment
8+
variable
79

810
## Building
9-
1. `npm install`
11+
12+
The `packageManager` field in `package.json` pins the pnpm version;
13+
enable Corepack (`corepack enable`) once on your machine and it will
14+
auto-provision the right pnpm release on first use.
15+
16+
1. `pnpm install`
1017
1. run hugo
11-
* for production builds simply run `npm run build`
12-
* for local development run `npm run dev`
13-
* for local production tests `npm run serve`
18+
* for production builds simply run `pnpm build`
19+
* for local development run `pnpm dev`
20+
* for local production tests `pnpm serve`
21+
22+
### Update policy
23+
24+
Due to supply chain attacks, brand-new dependency upgrades are held back until the set cooldown in `pnpm-workspace.yaml` elapses. For an urgent exemption, add the package to `minimumReleaseAgeExclude`.
25+
26+
Routine upgrades land via Dependabot PRs (see `.github/dependabot.yml`); don't run `pnpm up --latest` on `develop` or `main` — review the Dependabot PR or open a PR with explicit version pins.
1427

1528
## Optional Dependencies for Size Optimizations
1629

0 commit comments

Comments
 (0)