Skip to content

Commit 61efa75

Browse files
committed
chore: use pnpm for builds
Conflict Missing dependency gitignore Cli dockerfile Exiftool optional fix Update pnpm version update devcontainer for pnpm
1 parent b1aacfd commit 61efa75

34 files changed

+26135
-41893
lines changed

.devcontainer/server/container-common.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ fix_permissions() {
4949

5050
log "Fixing permissions for ${IMMICH_WORKSPACE}"
5151

52-
run_cmd sudo find "${IMMICH_WORKSPACE}/server/upload" -not -path "${IMMICH_WORKSPACE}/server/upload/postgres/*" -not -path "${IMMICH_WORKSPACE}/server/upload/postgres" -exec chown node {} +
53-
5452
# Change ownership for directories that exist
5553
for dir in "${IMMICH_WORKSPACE}/.vscode" \
54+
"${IMMICH_WORKSPACE}/server/upload" \
55+
"${IMMICH_WORKSPACE}/.pnpm-store" \
56+
"${IMMICH_WORKSPACE}/.github/node_modules" \
5657
"${IMMICH_WORKSPACE}/cli/node_modules" \
5758
"${IMMICH_WORKSPACE}/e2e/node_modules" \
5859
"${IMMICH_WORKSPACE}/open-api/typescript-sdk/node_modules" \

.devcontainer/server/container-compose-overrides.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,24 @@ services:
88
- IMMICH_SERVER_URL=http://127.0.0.1:2283/
99
volumes: !override
1010
- ..:/workspaces/immich
11-
- cli_node_modules:/workspaces/immich/cli/node_modules
12-
- e2e_node_modules:/workspaces/immich/e2e/node_modules
13-
- open_api_node_modules:/workspaces/immich/open-api/typescript-sdk/node_modules
14-
- server_node_modules:/workspaces/immich/server/node_modules
15-
- web_node_modules:/workspaces/immich/web/node_modules
1611
- ${UPLOAD_LOCATION:-upload1-devcontainer-volume}${UPLOAD_LOCATION:+/photos}:/data
1712
- ${UPLOAD_LOCATION:-upload2-devcontainer-volume}${UPLOAD_LOCATION:+/photos/upload}:/data/upload
1813
- /etc/localtime:/etc/localtime:ro
19-
14+
- pnpm-store:/usr/src/app/.pnpm-store
15+
- server-node-modules:/usr/src/app/server/node_modules
16+
- github-node_modules:/usr/src/app/.github/node_modules
17+
- cli-node_modules:/usr/src/app/cli/node_modules
18+
- docs-node_modules:/usr/src/app/docs/node_modules
19+
- e2e-node_modules:/usr/src/app/e2e/node_modules
20+
- sdk-node_modules:/usr/src/app/open-api/typescript-sdk/node_modules
21+
- app-node_modules:/usr/src/app/node_modules
22+
- web-node_modules:/usr/src/app/web/node_modules
23+
- sveltekit:/usr/src/app/web/.svelte-kit
24+
- coverage:/usr/src/app/web/coverage
2025
immich-web:
2126
env_file: !reset []
22-
2327
immich-machine-learning:
2428
env_file: !reset []
25-
2629
database:
2730
env_file: !reset []
2831
environment: !override
@@ -33,17 +36,10 @@ services:
3336
POSTGRES_HOST_AUTH_METHOD: md5
3437
volumes:
3538
- ${UPLOAD_LOCATION:-postgres-devcontainer-volume}${UPLOAD_LOCATION:+/postgres}:/var/lib/postgresql/data
36-
3739
redis:
3840
env_file: !reset []
39-
4041
volumes:
4142
# Node modules for each service to avoid conflicts and ensure consistent dependencies
42-
cli_node_modules:
43-
e2e_node_modules:
44-
open_api_node_modules:
45-
server_node_modules:
46-
web_node_modules:
4743
upload1-devcontainer-volume:
4844
upload2-devcontainer-volume:
4945
postgres-devcontainer-volume:

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33
# shellcheck disable=SC1091
44
source /immich-devcontainer/container-common.sh
55

6+
log "Preparing Immich Nest API Server"
7+
log ""
8+
export CI=1
9+
run_cmd pnpm --filter immich install
10+
611
log "Starting Nest API Server"
712
log ""
813
cd "${IMMICH_WORKSPACE}/server" || (
9-
log "Immich workspace not found"
14+
log "Immich workspace not found"jj
1015
exit 1
1116
)
1217

1318
while true; do
14-
run_cmd node ./node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch
19+
run_cmd pnpm --filter immich exec nest start --debug "0.0.0.0:9230" --watch
1520
log "Nest API Server crashed with exit code $?. Respawning in 3s ..."
1621
sleep 3
1722
done

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
# shellcheck disable=SC1091
44
source /immich-devcontainer/container-common.sh
55

6+
export CI=1
7+
log "Preparing Immich Web Frontend"
8+
log ""
9+
run_cmd pnpm --filter @immich/sdk install
10+
run_cmd pnpm --filter @immich/sdk build
11+
run_cmd pnpm --filter immich-web install
12+
613
log "Starting Immich Web Frontend"
714
log ""
815
cd "${IMMICH_WORKSPACE}/web" || (
@@ -16,7 +23,7 @@ until curl --output /dev/null --silent --head --fail "http://127.0.0.1:${IMMICH_
1623
done
1724

1825
while true; do
19-
run_cmd node ./node_modules/.bin/vite dev --host 0.0.0.0 --port "${DEV_PORT}"
26+
run_cmd pnpm --filter immich-web exec vite dev --host 0.0.0.0 --port "${DEV_PORT}"
2027
log "Web crashed with exit code $?. Respawning in 3s ..."
2128
sleep 3
2229
done

.devcontainer/server/container-start.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ source /immich-devcontainer/container-common.sh
66
log "Setting up Immich dev container..."
77
fix_permissions
88

9-
log "Installing npm dependencies (node_modules)..."
10-
install_dependencies
11-
129
log "Setup complete, please wait while backend and frontend services automatically start"
1310
log
1411
log "If necessary, the services may be manually started using"

.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/docs-build.yml

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

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

65-
- name: Run npm install
66-
run: npm ci
68+
- name: Run install
69+
run: pnpm install
6770

6871
- name: Check formatting
69-
run: npm run format
72+
run: pnpm format
7073

7174
- name: Run build
72-
run: npm run build
75+
run: pnpm build
7376

7477
- name: Upload build output
7578
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/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 }}

0 commit comments

Comments
 (0)