Skip to content

Commit b9f1b85

Browse files
committed
Use pnpm for builds
1 parent 98b1df7 commit b9f1b85

File tree

254 files changed

+28035
-46939
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+28035
-46939
lines changed

.devcontainer/server/container-start-backend.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ cd "${IMMICH_WORKSPACE}/server" || (
1010
exit 1
1111
)
1212

13+
CI=1 pnpm install
1314
while true; do
14-
run_cmd node ./node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch
15+
run_cmd pnpm exec nest start --debug "0.0.0.0:9230" --watch
1516
log "Nest API Server crashed with exit code $?. Respawning in 3s ..."
1617
sleep 3
1718
done

.devcontainer/server/container-start-frontend.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ until curl --output /dev/null --silent --head --fail "http://127.0.0.1:${IMMICH_
1616
done
1717

1818
while true; do
19-
run_cmd node ./node_modules/.bin/vite dev --host 0.0.0.0 --port "${DEV_PORT}"
19+
run_cmd pnpm exec vite dev --host 0.0.0.0 --port "${DEV_PORT}"
2020
log "Web crashed with exit code $?. Respawning in 3s ..."
2121
sleep 3
2222
done

.github/package-lock.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/cli.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,24 @@ jobs:
3333
with:
3434
persist-credentials: false
3535

36-
# Setup .npmrc file to publish to npm
37-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
36+
- name: Setup pnpm
37+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
38+
39+
- name: Setup Node
40+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3841
with:
39-
node-version-file: './cli/.nvmrc'
42+
node-version-file: './server/.nvmrc'
4043
registry-url: 'https://registry.npmjs.org'
41-
cache: 'npm'
42-
cache-dependency-path: '**/package-lock.json'
43-
44-
- name: Prepare SDK
45-
run: npm ci --prefix ../open-api/typescript-sdk/
46-
- name: Build SDK
47-
run: npm run build --prefix ../open-api/typescript-sdk/
48-
- run: npm ci
49-
- run: npm run build
50-
- run: npm publish
44+
cache: 'pnpm'
45+
cache-dependency-path: '**/pnpm-lock.yaml'
46+
47+
- name: Setup typescript-sdk
48+
run: pnpm install && pnpm run build
49+
working-directory: ./open-api/typescript-sdk
50+
51+
- run: pnpm install --frozen-lockfile
52+
- run: pnpm build
53+
- run: pnpm publish
5154
if: ${{ github.event_name == 'release' }}
5255
env:
5356
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
# Initializes the CodeQL tools for scanning.
5252
- name: Initialize CodeQL
53-
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
53+
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
5454
with:
5555
languages: ${{ matrix.language }}
5656
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -63,7 +63,7 @@ jobs:
6363
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6464
# If this step fails, then you should remove it and run the build manually (see below)
6565
- name: Autobuild
66-
uses: github/codeql-action/autobuild@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
66+
uses: github/codeql-action/autobuild@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
6767

6868
# ℹ️ Command-line programs to run using the OS shell.
6969
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -76,6 +76,6 @@ jobs:
7676
# ./location_of_script_within_repo/buildscript.sh
7777

7878
- name: Perform CodeQL Analysis
79-
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
79+
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
8080
with:
8181
category: '/language:${{matrix.language}}'

.github/workflows/docs-build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,24 @@ jobs:
5353
with:
5454
persist-credentials: false
5555

56+
- name: Setup pnpm
57+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
58+
5659
- name: Setup Node
5760
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
5861
with:
59-
node-version-file: './docs/.nvmrc'
60-
cache: 'npm'
61-
cache-dependency-path: '**/package-lock.json'
62+
node-version-file: './cli/.nvmrc'
63+
cache: 'pnpm'
64+
cache-dependency-path: '**/pnpm-lock.yaml'
6265

63-
- name: Run npm install
64-
run: npm ci
66+
- name: Run install
67+
run: pnpm install
6568

6669
- name: Check formatting
67-
run: npm run format
70+
run: pnpm format
6871

6972
- name: Run build
70-
run: npm run build
73+
run: pnpm build
7174

7275
- name: Upload build output
7376
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

.github/workflows/fix-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
node-version-file: './server/.nvmrc'
3535
cache: 'npm'
36-
cache-dependency-path: '**/package-lock.json'
36+
cache-dependency-path: '**/pnpm-lock.yaml'
3737

3838
- name: Fix formatting
3939
run: make install-all && make format-all

.github/workflows/org-checks.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/sdk.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,21 @@ jobs:
2020
with:
2121
persist-credentials: false
2222

23+
- name: Setup pnpm
24+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
25+
2326
# Setup .npmrc file to publish to npm
2427
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2528
with:
2629
node-version-file: './open-api/typescript-sdk/.nvmrc'
2730
registry-url: 'https://registry.npmjs.org'
28-
cache: 'npm'
29-
cache-dependency-path: '**/package-lock.json'
31+
cache: 'pnpm'
32+
cache-dependency-path: '**/pnpm-lock.yaml'
3033
- name: Install deps
31-
run: npm ci
34+
run: pnpm install --frozen-lockfile
3235
- name: Build
33-
run: npm run build
36+
run: pnpm build
3437
- name: Publish
35-
run: npm publish
38+
run: pnpm publish
3639
env:
3740
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/static_analysis.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ jobs:
4242
runs-on: ubuntu-latest
4343
permissions:
4444
contents: read
45-
defaults:
46-
run:
47-
working-directory: ./mobile
4845
steps:
4946
- name: Checkout code
5047
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -59,23 +56,27 @@ jobs:
5956

6057
- name: Install dependencies
6158
run: dart pub get
59+
working-directory: ./mobile
6260

6361
- name: Install DCM
64-
# TODO: Move to upstream after https://github.com/CQLabs/setup-dcm/pull/235 merges
65-
uses: bo0tzz/setup-dcm@b4952ab813659c03513b57bd78bfe3f634171f8a
66-
with:
67-
github-token: ${{ secrets.GITHUB_TOKEN }}
68-
version: auto
69-
working-directory: ./mobile
62+
run: |
63+
sudo apt-get update
64+
wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg
65+
echo 'deb [signed-by=/usr/share/keyrings/dcm.gpg arch=amd64] https://dcm.dev/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
66+
sudo apt-get update
67+
sudo apt-get install dcm
7068
7169
- name: Generate translation file
7270
run: make translation
71+
working-directory: ./mobile
7372

7473
- name: Run Build Runner
7574
run: make build
75+
working-directory: ./mobile
7676

7777
- name: Generate platform API
7878
run: make pigeon
79+
working-directory: ./mobile
7980

8081
- name: Find file changes
8182
uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4
@@ -97,16 +98,19 @@ jobs:
9798
9899
- name: Run dart analyze
99100
run: dart analyze --fatal-infos
101+
working-directory: ./mobile
100102

101103
- name: Run dart format
102104
run: dart format lib/ --set-exit-if-changed
105+
working-directory: ./mobile
103106

104107
- name: Run dart custom_lint
105108
run: dart run custom_lint
109+
working-directory: ./mobile
106110

107-
# TODO: Use https://github.com/CQLabs/dcm-action
108111
- name: Run DCM
109112
run: dcm analyze lib --fatal-style --fatal-warnings
113+
working-directory: ./mobile
110114

111115
zizmor:
112116
name: zizmor
@@ -130,7 +134,7 @@ jobs:
130134
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131135

132136
- name: Upload SARIF file
133-
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
137+
uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
134138
with:
135139
sarif_file: results.sarif
136140
category: zizmor

0 commit comments

Comments
 (0)