diff --git a/.github/.nvmrc b/.github/.nvmrc deleted file mode 100644 index 91d5f6ff8e..0000000000 --- a/.github/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -22.18.0 diff --git a/.github/package.json b/.github/package.json index 1cb0262c74..da1812523b 100644 --- a/.github/package.json +++ b/.github/package.json @@ -1,8 +1,5 @@ { - "scripts": { - "format": "prettier --check .", - "format:fix": "prettier --write ." - }, + "name": "github", "devDependencies": { "prettier": "^3.5.3" } diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 777f1898ec..f91445b8e2 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -33,24 +33,20 @@ jobs: with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './cli/.nvmrc' - registry-url: 'https://registry.npmjs.org' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Setup typescript-sdk - run: pnpm install && pnpm run build - working-directory: ./open-api/typescript-sdk + run: mise run sdk:install && mise run sdk:build - - run: pnpm install --frozen-lockfile - - run: pnpm build - - run: pnpm publish + - name: Install dependencies + run: mise run cli:install + + - name: Run build + run: mise run cli:build + + - name: Publish package + run: pnpm publish if: ${{ github.event_name == 'release' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 2514ee8639..bbf4b3512b 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -55,24 +55,17 @@ jobs: with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './docs/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Run install - run: pnpm install + run: mise run docs:install - name: Check formatting - run: pnpm format + run: mise run docs:format-fix - name: Run build - run: pnpm build + run: mise run docs:build - name: Upload build output uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 diff --git a/.github/workflows/fix-format.yml b/.github/workflows/fix-format.yml index 4c7c57e4f0..6ff205d0ef 100644 --- a/.github/workflows/fix-format.yml +++ b/.github/workflows/fix-format.yml @@ -28,15 +28,11 @@ jobs: token: ${{ steps.generate-token.outputs.token }} persist-credentials: true - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Fix formatting - run: make install-all && make format-all + run: mise run server:format-fix && mise run web:format-fix && mise run docs:format-fix - name: Commit and push uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 70882ea201..198f6f6073 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -46,15 +46,8 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Bump version env: diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index 460e7da4a7..d21613dff3 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -20,20 +20,15 @@ jobs: with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './open-api/typescript-sdk/.nvmrc' - registry-url: 'https://registry.npmjs.org' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - name: Install deps - run: pnpm install --frozen-lockfile + run: mise run sdk:install + - name: Build - run: pnpm build + run: mise run sdk:build + - name: Publish run: pnpm publish env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e3d2c9b0dc..0746e816bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,27 +72,21 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Run package manager install - run: pnpm install + run: mise run server:install - name: Run linter - run: pnpm lint + run: mise run server:lint if: ${{ !cancelled() }} - name: Run formatter - run: pnpm format + run: mise run server:format if: ${{ !cancelled() }} - name: Run tsc - run: pnpm check + run: mise run server:check if: ${{ !cancelled() }} - name: Run small tests & coverage - run: pnpm test + run: mise run server:test if: ${{ !cancelled() }} cli-unit-tests: name: Unit Test CLI @@ -109,30 +103,23 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './cli/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Setup typescript-sdk - run: pnpm install && pnpm run build - working-directory: ./open-api/typescript-sdk + run: mise run sdk:install && mise run sdk:build - name: Install deps - run: pnpm install + run: mise run cli:install - name: Run linter - run: pnpm lint + run: mise run cli:lint if: ${{ !cancelled() }} - name: Run formatter - run: pnpm format + run: mise run cli:format if: ${{ !cancelled() }} - name: Run tsc - run: pnpm check + run: mise run cli:check if: ${{ !cancelled() }} - name: Run unit tests & coverage - run: pnpm test + run: mise run cli:test if: ${{ !cancelled() }} cli-unit-tests-win: name: Unit Test CLI (Windows) @@ -149,25 +136,18 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './cli/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk + run: mise run sdk:install && mise run sdk:build - name: Install deps - run: pnpm install --frozen-lockfile + run: mise run cli:install # Skip linter & formatter in Windows test. - name: Run tsc - run: pnpm check + run: mise run cli:check if: ${{ !cancelled() }} - name: Run unit tests & coverage - run: pnpm test + run: mise run cli:test if: ${{ !cancelled() }} web-lint: name: Lint Web @@ -176,35 +156,25 @@ jobs: runs-on: mich permissions: contents: read - defaults: - run: - working-directory: ./web steps: - name: Checkout code uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './web/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk - - name: Run pnpm install - run: pnpm rebuild && pnpm install --frozen-lockfile + run: mise run sdk:install && mise run sdk:build + - name: Run install + run: mise run web:install - name: Run linter - run: pnpm lint:p + run: mise run web:lint-p if: ${{ !cancelled() }} - name: Run formatter - run: pnpm format + run: mise run web:format if: ${{ !cancelled() }} - name: Run svelte checks - run: pnpm check:svelte + run: mise run web:check-svelte if: ${{ !cancelled() }} web-unit-tests: name: Test Web @@ -213,32 +183,22 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - defaults: - run: - working-directory: ./web steps: - name: Checkout code uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './web/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk + run: mise run sdk:install && mise run sdk:build - name: Run npm install - run: pnpm install --frozen-lockfile + run: mise run web:install - name: Run tsc - run: pnpm check:typescript + run: mise run web:check if: ${{ !cancelled() }} - name: Run unit tests & coverage - run: pnpm test + run: mise run web:test if: ${{ !cancelled() }} i18n-tests: name: Test i18n @@ -252,18 +212,12 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './web/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Install dependencies - run: pnpm --filter=immich-web install --frozen-lockfile + run: mise run web:install - name: Format - run: pnpm --filter=immich-web format:i18n + run: mise run i18n:format-fix - name: Find file changes uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4 id: verify-changed-files @@ -293,29 +247,22 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './e2e/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk + run: mise run sdk:install && mise run sdk:build if: ${{ !cancelled() }} - name: Install dependencies - run: pnpm install --frozen-lockfile + run: mise run e2e:install if: ${{ !cancelled() }} - name: Run linter - run: pnpm lint + run: mise run e2e:lint if: ${{ !cancelled() }} - name: Run formatter - run: pnpm format + run: mise run e2e:format if: ${{ !cancelled() }} - name: Run tsc - run: pnpm check + run: mise run e2e:check if: ${{ !cancelled() }} server-medium-tests: name: Medium Tests (Server) @@ -324,26 +271,17 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - defaults: - run: - working-directory: ./server steps: - name: Checkout code uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run pnpm install - run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 + - name: Run install + run: SHARP_IGNORE_GLOBAL_LIBVIPS=true mise run server:install - name: Run medium tests - run: pnpm test:medium + run: mise run server:test-medium if: ${{ !cancelled() }} e2e-tests-server-cli: name: End-to-End Tests (Server & CLI) @@ -352,9 +290,6 @@ jobs: runs-on: ${{ matrix.runner }} permissions: contents: read - defaults: - run: - working-directory: ./e2e strategy: matrix: runner: [ubuntu-latest, ubuntu-24.04-arm] @@ -364,34 +299,25 @@ jobs: with: persist-credentials: false submodules: 'recursive' - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './e2e/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk + run: mise run sdk:install && mise run sdk:build if: ${{ !cancelled() }} - name: Run setup web - run: pnpm install --frozen-lockfile && pnpm exec svelte-kit sync - working-directory: ./web + run: mise run web:install && mise run web:svelte-kit-sync if: ${{ !cancelled() }} - name: Run setup cli - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./cli + run: mise run cli:install && mise run cli:build if: ${{ !cancelled() }} - name: Install dependencies - run: pnpm install --frozen-lockfile + run: mise run e2e:install if: ${{ !cancelled() }} - name: Docker build - run: docker compose build + run: docker compose -f e2e/docker-compose.yml build if: ${{ !cancelled() }} - name: Run e2e tests (api & cli) - run: pnpm test + run: mise run e2e:test if: ${{ !cancelled() }} e2e-tests-web: name: End-to-End Tests (Web) @@ -400,9 +326,6 @@ jobs: runs-on: ${{ matrix.runner }} permissions: contents: read - defaults: - run: - working-directory: ./e2e strategy: matrix: runner: [ubuntu-latest, ubuntu-24.04-arm] @@ -412,29 +335,26 @@ jobs: with: persist-credentials: false submodules: 'recursive' - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './e2e/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Run setup typescript-sdk - run: pnpm install --frozen-lockfile && pnpm build - working-directory: ./open-api/typescript-sdk + run: mise run sdk:install && mise run sdk:build if: ${{ !cancelled() }} - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Run setup web + run: mise run web:install && mise run web:svelte-kit-sync + if: ${{ !cancelled() }} + - name: Run setup cli + run: mise run cli:install && mise run cli:build if: ${{ !cancelled() }} - name: Install Playwright Browsers run: npx playwright install chromium --only-shell + working-directory: e2e if: ${{ !cancelled() }} - name: Docker build - run: docker compose build + run: docker compose -f e2e/docker-compose.yml build if: ${{ !cancelled() }} - name: Run e2e tests (web) - run: npx playwright test + run: mise run e2e:test-web if: ${{ !cancelled() }} success-check-e2e: name: End-to-End Tests Success @@ -519,18 +439,12 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './.github/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' - - name: Run pnpm install - run: pnpm install --frozen-lockfile + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 + - name: Run install + run: mise run github:install - name: Run formatter - run: pnpm format + run: mise run github:format if: ${{ !cancelled() }} shellcheck: name: ShellCheck @@ -556,18 +470,12 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Install server dependencies - run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm --filter immich install --frozen-lockfile + run: SHARP_IGNORE_GLOBAL_LIBVIPS=true mise run server:install - name: Build the app - run: pnpm --filter immich build + run: mise run server:build - name: Run API generation run: ./bin/generate-open-api.sh working-directory: open-api @@ -611,25 +519,19 @@ jobs: uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - - name: Setup Node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: './server/.nvmrc' - cache: 'pnpm' - cache-dependency-path: '**/pnpm-lock.yaml' + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 - name: Install server dependencies run: SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm install --frozen-lockfile - name: Build the app - run: pnpm build + run: mise run server:build - name: Run existing migrations - run: pnpm migrations:run + run: mise run server:migrations run - name: Test npm run schema:reset command works - run: pnpm schema:reset + run: mise run server:schema-reset - name: Generate new migrations continue-on-error: true - run: pnpm migrations:generate src/TestMigration + run: mise run server:migrations generate src/TestMigration - name: Find file changes uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20.0.4 id: verify-changed-files @@ -646,7 +548,7 @@ jobs: cat ./src/*-TestMigration.ts exit 1 - name: Run SQL generation - run: pnpm sync:sql + run: mise run server:sql env: DB_URL: postgres://postgres:postgres@localhost:5432/immich - name: Find file changes diff --git a/cli/.nvmrc b/cli/.nvmrc deleted file mode 100644 index 91d5f6ff8e..0000000000 --- a/cli/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -22.18.0 diff --git a/cli/package.json b/cli/package.json index 9697ff4d1d..db87a26aea 100644 --- a/cli/package.json +++ b/cli/package.json @@ -42,17 +42,6 @@ "vitest-fetch-mock": "^0.4.0", "yaml": "^2.3.1" }, - "scripts": { - "build": "vite build", - "lint": "eslint \"src/**/*.ts\" --max-warnings 0", - "lint:fix": "npm run lint -- --fix", - "prepack": "npm run build", - "test": "vitest", - "test:cov": "vitest --coverage", - "format": "prettier --check .", - "format:fix": "prettier --write .", - "check": "tsc --noEmit" - }, "repository": { "type": "git", "url": "git+https://github.com/immich-app/immich.git", @@ -67,8 +56,5 @@ "fastq": "^1.17.1", "lodash-es": "^4.17.21", "micromatch": "^4.0.8" - }, - "volta": { - "node": "22.18.0" } } diff --git a/docs/.nvmrc b/docs/.nvmrc deleted file mode 100644 index 91d5f6ff8e..0000000000 --- a/docs/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -22.18.0 diff --git a/docs/docs/developer/database-migrations.md b/docs/docs/developer/database-migrations.md index f032048b7a..a1d7ec3452 100644 --- a/docs/docs/developer/database-migrations.md +++ b/docs/docs/developer/database-migrations.md @@ -5,7 +5,7 @@ After making any changes in the `server/src/schema`, a database migration need t 1. Run the command ```bash -pnpm run migrations:generate +mise run server:migrations generate ``` 2. Check if the migration file makes sense. diff --git a/docs/docs/developer/pr-checklist.md b/docs/docs/developer/pr-checklist.md index ea44367742..747ec017b4 100644 --- a/docs/docs/developer/pr-checklist.md +++ b/docs/docs/developer/pr-checklist.md @@ -8,11 +8,11 @@ When contributing code through a pull request, please check the following: ## Web Checks -- [ ] `pnpm run lint` (linting via ESLint) -- [ ] `pnpm run format` (formatting via Prettier) -- [ ] `pnpm run check:svelte` (Type checking via SvelteKit) -- [ ] `pnpm run check:typescript` (check typescript) -- [ ] `pnpm test` (unit tests) +- [ ] `mise run web:lint` (linting via ESLint) +- [ ] `mise run web:format` (formatting via Prettier) +- [ ] `mise run web:check` (check typescript) +- [ ] `mise run web:check-svelte` (Type checking via SvelteKit) +- [ ] `mise run web:test` (unit tests) ## Documentation @@ -25,17 +25,18 @@ Run all web checks with `pnpm run check:all` ## Server Checks -- [ ] `pnpm run lint` (linting via ESLint) -- [ ] `pnpm run format` (formatting via Prettier) -- [ ] `pnpm run check` (Type checking via `tsc`) -- [ ] `pnpm test` (unit tests) +- [ ] `mise run server:lint` (linting via ESLint) +- [ ] `mise run server:format` (formatting via Prettier) +- [ ] `mise run server:check` (type checking via `tsc`) +- [ ] `mise run server:test` (unit tests) +- [ ] `mise run server:test-medium` (medium tests) :::tip AIO Run all server checks with `pnpm run check:all` ::: :::info Auto Fix -You can use `pnpm run __:fix` to potentially correct some issues automatically for `pnpm run format` and `lint`. +You can use `mise run server:lint-fix` and `mise run server:format-fix` to potentially correct some issues automatically. ::: ## Mobile Checks diff --git a/docs/package.json b/docs/package.json index 7fbcbada5a..ef5acce3d4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,20 +2,6 @@ "name": "documentation", "version": "0.0.0", "private": true, - "scripts": { - "docusaurus": "docusaurus", - "format": "prettier --check .", - "format:fix": "prettier --write .", - "start": "docusaurus start --port 3005", - "copy:openapi": "jq -c < ../open-api/immich-openapi-specs.json > ./static/openapi.json || exit 0", - "build": "npm run copy:openapi && docusaurus build", - "swizzle": "docusaurus swizzle", - "deploy": "docusaurus deploy", - "clear": "docusaurus clear", - "serve": "docusaurus serve", - "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" - }, "dependencies": { "@docusaurus/core": "~3.8.0", "@docusaurus/preset-classic": "~3.8.0", @@ -58,8 +44,5 @@ }, "engines": { "node": ">=20" - }, - "volta": { - "node": "22.18.0" } } diff --git a/e2e/.nvmrc b/e2e/.nvmrc deleted file mode 100644 index 91d5f6ff8e..0000000000 --- a/e2e/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -22.18.0 diff --git a/e2e/package.json b/e2e/package.json index e4f1591e0e..78a94eccb0 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -4,17 +4,6 @@ "description": "", "main": "index.js", "type": "module", - "scripts": { - "test": "vitest --run", - "test:watch": "vitest", - "test:web": "npx playwright test", - "start:web": "npx playwright test --ui", - "format": "prettier --check .", - "format:fix": "prettier --write .", - "lint": "eslint \"src/**/*.ts\" --max-warnings 0", - "lint:fix": "npm run lint -- --fix", - "check": "tsc --noEmit" - }, "keywords": [], "author": "", "license": "GNU Affero General Public License version 3", @@ -52,8 +41,5 @@ "typescript-eslint": "^8.28.0", "utimes": "^5.2.1", "vitest": "^3.0.0" - }, - "volta": { - "node": "22.18.0" } } diff --git a/mise.toml b/mise.toml index 346af53e46..34760c1c56 100644 --- a/mise.toml +++ b/mise.toml @@ -13,3 +13,300 @@ postinstall = "chmod +x $MISE_TOOL_INSTALL_PATH/dcm" experimental = true lockfile = true pin = true + +# .github +[tasks."github:install"] +run = "pnpm install --filter github --frozen-lockfile" + +[tasks."github:format"] +env._.path = "./.github/node_modules/.bin" +dir = ".github" +run = "prettier --check ." + +[tasks."github:format-fix"] +env._.path = "./.github/node_modules/.bin" +dir = ".github" +run = "prettier --write ." + +# @immich/cli +[tasks."cli:install"] +run = "pnpm install --filter @immich/cli --frozen-lockfile" + +[tasks."cli:build"] +env._.path = "./cli/node_modules/.bin" +dir = "cli" +run = "vite build" + +[tasks."cli:test"] +env._.path = "./cli/node_modules/.bin" +dir = "cli" +run = "vite" + +[tasks."cli:lint"] +env._.path = "./cli/node_modules/.bin" +dir = "cli" +run = "eslint \"src/**/*.ts\" --max-warnings 0" + +[tasks."cli:lint-fix"] +run = "mise run cli:lint --fix" + +[tasks."cli:format"] +env._.path = "./cli/node_modules/.bin" +dir = "cli" +run = "prettier --check ." + +[tasks."cli:format-fix"] +env._.path = "./cli/node_modules/.bin" +dir = "cli" +run = "prettier --write ." + +[tasks."cli:check"] +env._.path = "./cli/node_modules/.bin" +dir = "cli" +run = "tsc --noEmit" + +# @immich/sdk +[tasks."sdk:install"] +run = "pnpm install --filter @immich/sdk --frozen-lockfile" + +[tasks."sdk:build"] +env._.path = "./open-api/typescript-sdk/node_modules/.bin" +dir = "./open-api/typescript-sdk" +run = "tsc" + +# docs +[tasks."docs:install"] +run = "pnpm install --filter documentation --frozen-lockfile" + +[tasks."docs:start"] +env._.path = "./docs/node_modules/.bin" +dir = "docs" +run = "docusaurus --port 3005" + +[tasks."docs:build"] +env._.path = "./docs/node_modules/.bin" +dir = "docs" +run = [ + "jq -c < ../open-api/immich-openapi-specs.json > ./static/openapi.json || exit 0", + "docusaurus build", +] + + +[tasks."docs:preview"] +env._.path = "./docs/node_modules/.bin" +dir = "docs" +run = "docusaurus serve" + + +[tasks."docs:format"] +env._.path = "./docs/node_modules/.bin" +dir = "docs" +run = "prettier --check ." + +[tasks."docs:format-fix"] +env._.path = "./docs/node_modules/.bin" +dir = "docs" +run = "prettier --write ." + + +# e2e +[tasks."e2e:install"] +run = "pnpm install --filter immich-e2e --frozen-lockfile" + +[tasks."e2e:test"] +env._.path = "./e2e/node_modules/.bin" +dir = "e2e" +run = "vitest --run" + +[tasks."e2e:test-web"] +env._.path = "./e2e/node_modules/.bin" +dir = "e2e" +run = "playwright test" + +[tasks."e2e:format"] +env._.path = "./e2e/node_modules/.bin" +dir = "e2e" +run = "prettier --check ." + +[tasks."e2e:format-fix"] +env._.path = "./e2e/node_modules/.bin" +dir = "e2e" +run = "prettier --write ." + +[tasks."e2e:lint"] +env._.path = "./e2e/node_modules/.bin" +dir = "e2e" +run = "eslint \"src/**/*.ts\" --max-warnings 0" + +[tasks."e2e:lint-fix"] +run = "mise run e2e:lint --fix" + +[tasks."e2e:check"] +env._.path = "./e2e/node_modules/.bin" +dir = "e2e" +run = "tsc --noEmit" + +# i18n +[tasks."i18n:format"] +run = "mise run i18n:format-fix" + +[tasks."i18n:format-fix"] +run = "pnpm dlx sort-json ./i18n/*.json" + + +# server +[tasks."server:install"] +run = "pnpm install --filter immich --frozen-lockfile" + +[tasks."server:build"] +env._.path = "./server/node_modules/.bin" +dir = "server" +run = "nest build" + +[tasks."server:test"] +env._.path = "./server/node_modules/.bin" +dir = "server" +run = "vitest --config test/vitest.config.mjs" + +[tasks."server:test-medium"] +env._.path = "./server/node_modules/.bin" +dir = "server" +run = "vitest --config test/vitest.config.medium.mjs" + +[tasks."server:format"] +env._.path = "./server/node_modules/.bin" +dir = "server" +run = "prettier --check ." + +[tasks."server:format-fix"] +env._.path = "./server/node_modules/.bin" +dir = "server" +run = "prettier --write ." + +[tasks."server:lint"] +env._.path = "./server/node_modules/.bin" +dir = "server" +run = "eslint \"src/**/*.ts\" \"test/**/*.ts\" --max-warnings 0" + +[tasks."server:lint-fix"] +run = "mise run server:lint --fix" + +[tasks."server:check"] +env._.path = "./server/node_modules/.bin" +dir = "server" +run = "tsc --noEmit" + +[tasks."server:sql"] +dir = "server" +run = "node ./dist/bin/sync-open-api.js" + +[tasks."server:open-api"] +dir = "server" +run = "node ./dist/bin/sync-open-api.js" + +[tasks."server:migrations"] +dir = "server" +run = "node ./dist/bin/migrations.js" +description = "Run database migration commands (create, generate, run, debug, or query)" + +[tasks."server:schema-drop"] +run = "mise run server:migrations query 'DROP schema public cascade; CREATE schema public;'" + +[tasks."server:schema-reset"] +run = "mise run server:schema-drop && mise run server:migrations run" + +[tasks."server:email-dev"] +env._.path = "./server/node_modules/.bin" +dir = "server" +run = "email dev -p 3050 --dir src/emails" + +[tasks."server:checklist"] +run = [ + "mise run server:install", + "mise run server:format", + "mise run server:lint", + "mise run server:check", + "mise run server:test-medium --run", + "mise run server:test --run", +] + + +# web +[tasks."web:install"] +run = "pnpm install --filter immich-web --frozen-lockfile" + +[tasks."web:svelte-kit-sync"] +env._.path = "./web/node_modules/.bin" +dir = "web" +run = "svelte-kit sync" + +[tasks."web:build"] +env._.path = "./web/node_modules/.bin" +dir = "web" +run = "vite build" + +[tasks."web:build-stats"] +env.BUILD_STATS = "true" +env._.path = "./web/node_modules/.bin" +dir = "web" +run = "vite build" + +[tasks."web:preview"] +env._.path = "./web/node_modules/.bin" +dir = "web" +run = "vite preview" + +[tasks."web:start"] +env._.path = "web/node_modules/.bin" +dir = "web" +run = "vite dev --host 0.0.0.0 --port 3000" + +[tasks."web:test"] +depends = "web:svelte-kit-sync" +env._.path = "web/node_modules/.bin" +dir = "web" +run = "vitest" + +[tasks."web:format"] +env._.path = "web/node_modules/.bin" +dir = "web" +run = "prettier --check ." + +[tasks."web:format-fix"] +env._.path = "web/node_modules/.bin" +dir = "web" +run = "prettier --write ." + +[tasks."web:lint"] +env._.path = "web/node_modules/.bin" +dir = "web" +run = "eslint . --max-warnings 0" + +[tasks."web:lint-p"] +env._.path = "web/node_modules/.bin" +dir = "web" +run = "eslint-p . --max-warnings 0 --concurrency=4" + +[tasks."web:lint-fix"] +run = "mise run web:lint --fix" + +[tasks."web:check"] +depends = "web:svelte-kit-sync" +env._.path = "web/node_modules/.bin" +dir = "web" +run = "tsc --noEmit" + +[tasks."web:check-svelte"] +depends = "web:svelte-kit-sync" +env._.path = "web/node_modules/.bin" +dir = "web" +run = "svelte-check --no-tsconfig --fail-on-warnings --compiler-warnings 'reactive_declaration_non_reactive_property:ignore' --ignore src/lib/components/photos-page/asset-grid.svelte" + +[tasks."web:checklist"] +run = [ + "mise run web:install", + "mise run web:format", + "mise run web:check", + "mise run web:test --run", + "mise run web:lint", +] diff --git a/open-api/bin/generate-open-api.sh b/open-api/bin/generate-open-api.sh index 1ce33b96e6..95780a639a 100755 --- a/open-api/bin/generate-open-api.sh +++ b/open-api/bin/generate-open-api.sh @@ -15,7 +15,7 @@ function dart { patch --no-backup-if-mismatch -u api.mustache