diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 078722cb7c..18a88bd617 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -674,11 +674,8 @@ jobs: - name: Install server dependencies run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich install --frozen-lockfile - - name: Build the app - run: pnpm --filter immich build - - name: Run API generation - run: ./bin/generate-open-api.sh + run: mise //:open-api working-directory: open-api - name: Find file changes @@ -770,7 +767,7 @@ jobs: exit 1 - name: Run SQL generation - run: pnpm sync:sql + run: mise //:sql env: DB_URL: postgres://postgres:postgres@localhost:5432/immich diff --git a/Makefile b/Makefile index 0b77da3a7f..648aed5120 100644 --- a/Makefile +++ b/Makefile @@ -37,16 +37,11 @@ prod-scale: .PHONY: open-api open-api: - cd ./open-api && bash ./bin/generate-open-api.sh - -open-api-dart: - cd ./open-api && bash ./bin/generate-open-api.sh dart - -open-api-typescript: - cd ./open-api && bash ./bin/generate-open-api.sh typescript + @printf "This command has been removed. Please use:\n\n mise open-api # or mise //:open-api from another directory\n\n"\n\n >&2 && exit 1 sql: - pnpm --filter immich run sync:sql + @printf "This command has been removed. Please use:\n\n mise sql # or mise //:sql from another directory\n\n"\n\n >&2 && exit 1 + renovate: LOG_LEVEL=debug pnpm exec renovate --platform=local --repository-cache=reset diff --git a/docs/docs/developer/devcontainers.md b/docs/docs/developer/devcontainers.md index f912c78490..99f340c557 100644 --- a/docs/docs/developer/devcontainers.md +++ b/docs/docs/developer/devcontainers.md @@ -243,8 +243,8 @@ To connect the mobile app to your Dev Container: - **Server code** (`/server`): Changes trigger automatic restart - **Web code** (`/web`): Changes trigger hot module replacement -- **Database migrations**: Run `pnpm run sync:sql` in the server directory -- **API changes**: Regenerate TypeScript SDK with `make open-api` +- **Database migrations**: Run `mise //:sql` +- **API changes**: Regenerate TypeScript SDK with `mise //:open-api` ## Testing @@ -289,7 +289,7 @@ make open-api-typescript # Generate TypeScript SDK make open-api-dart # Generate Dart SDK # Database -make sql # Sync database schema +mise sql # Sync database schema ``` ### Debugging diff --git a/misc/release/pump-version.sh b/misc/release/pump-version.sh index 8b06c3a23b..39a3364723 100755 --- a/misc/release/pump-version.sh +++ b/misc/release/pump-version.sh @@ -70,9 +70,7 @@ if [ "$CURRENT_SERVER" != "$NEXT_SERVER" ]; then pnpm version "$NEXT_SERVER" --no-git-tag-version --prefix packages/sdk # copy version to open-api spec - pnpm install --frozen-lockfile --prefix server - pnpm --prefix server run build - ( cd ./open-api && bash ./bin/generate-open-api.sh ) + mise run //:open-api uv version --directory machine-learning "$NEXT_SERVER" diff --git a/mise.toml b/mise.toml index 38123a062d..21022238cd 100644 --- a/mise.toml +++ b/mise.toml @@ -40,6 +40,31 @@ macos-arm64 = { asset_pattern = "jellyfin-ffmpeg_*_portable_macarm64-gpl.tar.xz" experimental = true pin = true +[tasks.open-api-typescript] +run = [ + "pnpm dlx oazapfts --optimistic --argumentStyle=object --useEnumType --allSchemas open-api/immich-openapi-specs.json packages/sdk/src/fetch-client.ts", + { task = "//:sdk:install" }, + { task = "//:sdk:build" }, +] + +[tasks.open-api-dart] +dir = "open-api" +run = "bash ./bin/generate-dart-sdk.sh" + +[tasks.open-api] +env = { SHARP_IGNORE_GLOBAL_LIBVIPS = true } +run = [ + { task = "//server:install" }, + { task = "//server:build" }, + { task = "//server:sync-open-api" }, + { task = ":open-api-typescript"}, + { task = ":open-api-dart"}, +] + +[tasks.sql] +dir = "server" +run = "node ./dist/bin/sync-sql.js" + # SDK tasks [tasks."sdk:install"] dir = "packages/sdk" diff --git a/open-api/bin/generate-dart-sdk.sh b/open-api/bin/generate-dart-sdk.sh new file mode 100755 index 0000000000..e81d28096f --- /dev/null +++ b/open-api/bin/generate-dart-sdk.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +OPENAPI_GENERATOR_VERSION=v7.12.0 + +set -euo pipefail + +# usage: ./bin/generate-dart-sdk.sh + +rm -rf ../mobile/openapi +cd ./templates/mobile/serialization/native +wget -O native_class.mustache https://raw.githubusercontent.com/OpenAPITools/openapi-generator/$OPENAPI_GENERATOR_VERSION/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache +patch --no-backup-if-mismatch -u native_class.mustache