From f6a03fe82eec60aced46dd1c9b017719020dd449 Mon Sep 17 00:00:00 2001 From: Maximilien Carbonne Date: Sat, 9 Nov 2024 19:18:44 +0100 Subject: [PATCH 1/4] add minimal devcontainer setup --- .devcontainer/Dockerfile | 2 ++ .devcontainer/devcontainer.json | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000000..e83165a7af447 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,2 @@ +ARG BASEIMAGE=mcr.microsoft.com/devcontainers/typescript-node:22 +FROM ${BASEIMAGE} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000..c80f2b994183e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,19 @@ +{ + "name": "Immich devcontainers", + "build": { + "dockerfile": "Dockerfile", + "args": { + "BASEIMAGE": "mcr.microsoft.com/devcontainers/typescript-node:22" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "svelte.svelte-vscode" + ] + } + }, + "forwardPorts": [], + "postCreateCommand": "make install-all", + "remoteUser": "node" +} \ No newline at end of file From 9ad178614154f81848dd352d1fa569bcafa2ba65 Mon Sep 17 00:00:00 2001 From: Maximilien Carbonne Date: Sat, 9 Nov 2024 19:32:46 +0100 Subject: [PATCH 2/4] fix Makefile & update doc --- Makefile | 2 +- docs/docs/developer/pr-checklist.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2096cf86df09c..4ea88dfb58b62 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ attach-server: renovate: LOG_LEVEL=debug npx renovate --platform=local --repository-cache=reset -MODULES = e2e server web cli sdk +MODULES = e2e server web cli sdk docs audit-%: npm --prefix $(subst sdk,open-api/typescript-sdk,$*) audit fix diff --git a/docs/docs/developer/pr-checklist.md b/docs/docs/developer/pr-checklist.md index d2e7fbee4044f..5bffb3e8067b7 100644 --- a/docs/docs/developer/pr-checklist.md +++ b/docs/docs/developer/pr-checklist.md @@ -1,5 +1,6 @@ # PR Checklist +A minimal devcontainer is supplied with this repository. All commands can be executed directly inside this container to avoid tedious installation of the environment. When contributing code through a pull request, please check the following: ## Web Checks From 335dc793068562eeef38198cb219c8731b0b91c5 Mon Sep 17 00:00:00 2001 From: Maximilien Carbonne Date: Sat, 9 Nov 2024 20:03:55 +0100 Subject: [PATCH 3/4] fix Makefile --- Makefile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 4ea88dfb58b62..0899d82d24e5a 100644 --- a/Makefile +++ b/Makefile @@ -48,11 +48,9 @@ install-%: build-cli: build-sdk build-web: build-sdk build-%: install-% - npm --prefix $(subst sdk,open-api/typescript-sdk,$*) run | grep 'build' >/dev/null \ - && npm --prefix $(subst sdk,open-api/typescript-sdk,$*) run build || true + npm --prefix $(subst sdk,open-api/typescript-sdk,$*) run build format-%: - npm --prefix $(subst sdk,open-api/typescript-sdk,$*) run | grep 'format:fix' >/dev/null \ - && npm --prefix $(subst sdk,open-api/typescript-sdk,$*) run format:fix || true + npm --prefix $* run format:fix lint-%: npm --prefix $* run lint:fix check-%: @@ -79,14 +77,14 @@ test-medium: test-medium-dev: docker exec -it immich_server /bin/sh -c "npm run test:medium" -build-all: $(foreach M,$(MODULES),build-$M) ; +build-all: $(foreach M,$(filter-out e2e,$(MODULES)),build-$M) ; install-all: $(foreach M,$(MODULES),install-$M) ; -check-all: $(foreach M,$(MODULES),check-$M) ; -lint-all: $(foreach M,$(MODULES),lint-$M) ; -format-all: $(foreach M,$(MODULES),format-$M) ; +check-all: $(foreach M,$(filter-out sdk cli docs,$(MODULES)),check-$M) ; +lint-all: $(foreach M,$(filter-out sdk docs,$(MODULES)),lint-$M) ; +format-all: $(foreach M,$(filter-out sdk,$(MODULES)),format-$M) ; audit-all: $(foreach M,$(MODULES),audit-$M) ; hygiene-all: lint-all format-all check-all sql audit-all; -test-all: $(foreach M,$(MODULES),test-$M) ; +test-all: $(foreach M,$(filter-out sdk docs,$(MODULES)),test-$M) ; clean: find . -name "node_modules" -type d -prune -exec rm -rf '{}' + From d057c19e185adfc5c3646b38855ec4ae728305ea Mon Sep 17 00:00:00 2001 From: Maximilien Carbonne Date: Sun, 10 Nov 2024 13:27:45 +0100 Subject: [PATCH 4/4] add warning regarding devcontainer + add newline at EOF --- .devcontainer/devcontainer.json | 3 ++- docs/docs/developer/pr-checklist.md | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c80f2b994183e..b297f9a2d8cc1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,4 +16,5 @@ "forwardPorts": [], "postCreateCommand": "make install-all", "remoteUser": "node" -} \ No newline at end of file +} + diff --git a/docs/docs/developer/pr-checklist.md b/docs/docs/developer/pr-checklist.md index 5bffb3e8067b7..6015694976e37 100644 --- a/docs/docs/developer/pr-checklist.md +++ b/docs/docs/developer/pr-checklist.md @@ -1,6 +1,9 @@ # PR Checklist A minimal devcontainer is supplied with this repository. All commands can be executed directly inside this container to avoid tedious installation of the environment. +:::warning +The provided devcontainer isn't complete at the moment. At least all dockerized steps in the Makefile won't work (`make dev`, ....). Feel free to contribute! +::: When contributing code through a pull request, please check the following: ## Web Checks