From e7baea8de2c23155f6497699e2c225a7f1a7d06b Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 23 Oct 2025 10:52:56 +1100 Subject: [PATCH 1/9] added the workflows --- .github/workflows/commitlint.yml | 36 +++++++++++++++++ .github/workflows/depcheck.yml | 22 +++++++++++ .github/workflows/linting.yml | 60 +++++++++++++++++++++++++++++ .github/workflows/pipeline.yml | 66 ++++++++++++++++++++++++++++++++ .github/workflows/scorecard.yml | 41 ++++++++++++++++++++ .github/workflows/test.yml | 64 +++++++++++++++++++++++++++++++ .github/workflows/typecheck.yml | 43 +++++++++++++++++++++ .github/workflows/unused.yml | 42 ++++++++++++++++++++ 8 files changed, 374 insertions(+) create mode 100644 .github/workflows/commitlint.yml create mode 100644 .github/workflows/depcheck.yml create mode 100644 .github/workflows/linting.yml create mode 100644 .github/workflows/pipeline.yml create mode 100644 .github/workflows/scorecard.yml create mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/typecheck.yml create mode 100644 .github/workflows/unused.yml diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..73283c8 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,36 @@ +name: Commits + +on: + workflow_call: + inputs: + ref: + required: true + type: string + +permissions: + contents: read + +jobs: + lint-commits: + permissions: + contents: read + pull-requests: read + runs-on: ubuntu-latest + name: Validate Commits + + steps: + - name: Harden runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ inputs.ref }} + fetch-depth: 0 + + - name: Inspect Commits + uses: mridang/action-commit-lint@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/depcheck.yml b/.github/workflows/depcheck.yml new file mode 100644 index 0000000..c265886 --- /dev/null +++ b/.github/workflows/depcheck.yml @@ -0,0 +1,22 @@ +name: Dependency Review + +on: + pull_request: + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Review Dependencies + uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..b7d34b1 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,60 @@ +name: Linting + +on: + workflow_call: + inputs: + ref: + required: true + type: string + commit_changes: + required: false + type: boolean + default: false + +defaults: + run: + working-directory: ./ + +permissions: + contents: read + +jobs: + lint-format: + permissions: + contents: write + runs-on: ubuntu-latest + name: Reformat Code + + steps: + - name: Harden runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ inputs.ref }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + cache: 'npm' + node-version-file: '.nvmrc' + + - name: Install Dependencies + run: npm ci --no-progress + + - name: Run Formatter + run: npm run format + + - name: Commit Changes + if: ${{ inputs.commit_changes == true }} + uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0 + with: + commit_message: 'style: Apply automated code formatting [skip ci]' + commit_options: '--no-verify' + repository: . + commit_user_name: github-actions[bot] + commit_user_email: github-actions[bot]@users.noreply.github.com + commit_author: github-actions[bot] diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..be969a2 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,66 @@ +name: Pipeline + +on: + push: + +permissions: + contents: write + actions: read + checks: write + pull-requests: write + +jobs: + lint-commits: + name: Run Commitlint Checks + if: github.event_name == 'pull_request' + uses: ./.github/workflows/commitlint.yml + with: + ref: ${{ github.event.pull_request.head.sha }} + secrets: inherit + + code-style: + name: Run Linter Formatter + uses: ./.github/workflows/linting.yml + with: + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} + commit_changes: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + secrets: inherit + + type-check: + name: Run Type Checks + uses: ./.github/workflows/typecheck.yml + with: + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} + secrets: inherit + + run-tests: + name: Run Test Suite + uses: ./.github/workflows/test.yml + with: + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} + secrets: inherit + + check-deps: + name: Run Dependency Checks + uses: ./.github/workflows/unused.yml + with: + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} + secrets: inherit + + all-passed: + name: Check Build Status + runs-on: ubuntu-latest + needs: + - lint-commits + - code-style + - type-check + - run-tests + - check-deps + steps: + - name: Harden runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Report Success + run: echo "All required checks passed successfully." diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000..f65b9c8 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,41 @@ +name: Scorecard Analysis + +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + scorecard_analysis: + name: Scorecard Analysis + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + id-token: write + + steps: + - name: Harden runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Checkout Repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Run Checks + uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + + - name: Upload Results + uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 + with: + sarif_file: results.sarif diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..00762e6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,64 @@ +name: Testing + +on: + workflow_call: + inputs: + ref: + required: true + type: string + +defaults: + run: + working-directory: ./ + +jobs: + app-testing: + runs-on: ubuntu-latest + name: Run Tests + + steps: + - name: Harden runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ inputs.ref }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + cache: 'npm' + node-version-file: '.nvmrc' + + - name: Install Dependencies + run: npm ci --no-progress + + - name: Run Tests + run: npm run test + + - name: Generate coverage report + uses: mridang/action-test-reporter@v1 + if: always() + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + coverage-file: 'build/coverage/clover.xml' + + - name: Upload Results + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: always() + with: + name: test-results + path: build/reports/**/*.xml + + - name: Generate Report + if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) }} + uses: dorny/test-reporter@6e6a65b7a0bd2c9197df7d0ae36ac5cee784230c # v2.0.0 + with: + name: Tests + path: build/reports/**/*.xml + reporter: java-junit + fail-on-error: 'false' + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml new file mode 100644 index 0000000..a2905f6 --- /dev/null +++ b/.github/workflows/typecheck.yml @@ -0,0 +1,43 @@ +name: Typecheck + +on: + workflow_call: + inputs: + ref: + required: true + type: string + +defaults: + run: + working-directory: ./ + +permissions: + contents: read + +jobs: + tsc-check: + runs-on: ubuntu-latest + name: Inspect Code + + steps: + - name: Harden runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ inputs.ref }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + cache: 'npm' + node-version-file: '.nvmrc' + + - name: Install Dependencies + run: npm ci --no-progress + + - name: Run Typecheck + run: npm run prepack diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml new file mode 100644 index 0000000..f526df6 --- /dev/null +++ b/.github/workflows/unused.yml @@ -0,0 +1,42 @@ +name: Dependencies + +on: + workflow_call: + inputs: + ref: + required: true + type: string + +permissions: + contents: read + +jobs: + lint-dependencies: + permissions: + contents: read + pull-requests: read + runs-on: ubuntu-latest + name: Lint Dependencies + + steps: + - name: Harden runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ inputs.ref }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + cache: 'npm' + node-version-file: '.nvmrc' + + - name: Install Dependencies + run: npm ci --no-progress + + - name: Inspect Dependencies + uses: mridang/action-dependency-insight@v1 From 891ba98115a854b25674b64b011197882958f498 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 23 Oct 2025 10:57:02 +1100 Subject: [PATCH 2/9] chore(deps): fixed the knip dependency version --- package-lock.json | 497 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 3 +- 2 files changed, 496 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 649155a..52be5ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "eslint-config-prettier": "^10.0.1", "eslint-plugin-svelte": "^3.0.0", "globals": "^16.0.0", + "knip": "^5.64.1", "prettier": "^3.6.2", "prettier-plugin-svelte": "^3.4.0", "prettier-plugin-tailwindcss": "^0.6.11", @@ -105,6 +106,40 @@ } } }, + "node_modules/@emnapi/core": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.6.0.tgz", + "integrity": "sha512-zq/ay+9fNIJJtJiZxdTnXS20PllcYMX3OE23ESc4HK/bdYu3cOWYVhsOhVnXALfU/uqJIxn5NBPd9z4v+SfoSg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.1.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.6.0.tgz", + "integrity": "sha512-obtUmAHTMjll499P+D9A3axeJFlhdjOWdKUNs/U6QIGT7V5RjcUW1xToAzjvmgTSQhDbYn/NwfTRoJcQ2rNBxA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.8", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.8.tgz", @@ -807,6 +842,19 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.0.7.tgz", + "integrity": "sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.5.0", + "@emnapi/runtime": "^1.5.0", + "@tybys/wasm-util": "^0.10.1" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -845,6 +893,275 @@ "node": ">= 8" } }, + "node_modules/@oxc-resolver/binding-android-arm-eabi": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.11.1.tgz", + "integrity": "sha512-v5rtczLD5d8lasBdP6GXoM7VQ1Av9pZyWGXF5afQawRZcWTVvncrIzu9nhKpvIhhmC4C6MYdXA3CNZc60LvUig==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-android-arm64": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.11.1.tgz", + "integrity": "sha512-0QqKsM8/XRNDGZy1/rxys53U/aCLVBKV2jgGFr3msypTZtNH/d4qao7QULM++H4hcaXghfXaB4xVCPDg3tHCvQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-arm64": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.11.1.tgz", + "integrity": "sha512-xdHj8Mn3WB+dTGWcMzC07pZiSvQfKxcCEIlmDGrwwLmS4MgyJcraDDykFg4NXwd8dJNKOLqEfV3RMLRYgE2f8w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-x64": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.11.1.tgz", + "integrity": "sha512-t9ImHoJXhFimPx3u0UMbQzADUBq/xnQY1eGc3bfOu5l4h0k/3rlsO16Fe8dheG8Iuvc3j2lh8H8dFg/Los4WeQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-freebsd-x64": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.11.1.tgz", + "integrity": "sha512-aK7b1Yr2VkC2efK0w63v7gZkCqYmhR4XTCCYgA5KbtpJVg1OwFXVRjO1vfWNn5osk9dNpaIdeo3C1IfWPhW68w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.11.1.tgz", + "integrity": "sha512-9wHEYo+1VLoCjX4iI29ZR2ExdcGbG8JlmSR0aRW/A/NuzKxFB+bfiPkwUrvdSv7syXS8CrixvLdqAkBoXgk/rQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-musleabihf": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.11.1.tgz", + "integrity": "sha512-Mf8wZJEeGAQ1WAwp6nvtxucYAQDDtj9Qhv1BaQS8SbeR3na203RUFdEm6F5ptWzF8cuY+ye+FsGKr8lKG3pvWg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-gnu": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.11.1.tgz", + "integrity": "sha512-Fk8BrFBfKzUveCEAXZ6kDhyc5RLWIWOI0+UZGp1G3WQIFo9HDEqnYtsOtUbzLtjifbyMhtaTteElRSGNKTJ3nA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-musl": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.11.1.tgz", + "integrity": "sha512-jbsO1/VTDRb5FAvWnxEIFOnFHA7dALBn5HPdxdoAbnuvjgjIPYMVvTFEBPNLz3BSFxWdounZasZDYYFhBhFzmQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-ppc64-gnu": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.11.1.tgz", + "integrity": "sha512-+aY2AjUQkByiOtKUU0RyqB7VV7HIh3SMBh54/9nzUbHN5RiF0As5DApV/IwbQjB2oKc0VywQZzE+/Wj/Ijvd/Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-gnu": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.11.1.tgz", + "integrity": "sha512-HqBogCmIl344en3EAhC9vSm/h52fb5BA0eFxsgsH9HgwYY6qH4th4msBqBAiMRCKcC6hVwjh0fmzHgST2rx4Cw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-musl": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.11.1.tgz", + "integrity": "sha512-9dXyIMQMrh76WyMtNDJhsRYqc6KDsQe3/ja9fAPBk28p7kltEvZvHpivq1Xa8Ca/JCa8QgTROgLInChNEF27bQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-s390x-gnu": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.11.1.tgz", + "integrity": "sha512-Ybp/bSJmnl0sr8zh+nIz0cpU077tDZDYRYDhZiWN+f7rcWF7D8Z/pKD9zPxRocvJieZGfzrIwmHiHf9eY47P9w==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-gnu": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.11.1.tgz", + "integrity": "sha512-uVWj/UI6+l5/CeV2d4XpjycJNDkk/JfxNzQLAFCsVl5ZbrIfWQ9TzEzAi7xsDgVZYLBuL7iSowQ7YYRp1LQZlA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-musl": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.11.1.tgz", + "integrity": "sha512-Q9kQmiZn4bNnCOqPHvdF4bHdKXBa7Ow6yfeKTWPNOHyoZXdyxIu5C+3jSjo+SJiFNhmnh0hEAN8om6GEuJEYCA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.11.1.tgz", + "integrity": "sha512-skGIwjoRwEh2qFIaG/wwa74i5KcoWNTEy1ycB6qdRV+OOSlkosVFIzXPYzjcuwtIL1M6pC7+M+56TgQQEzOUmw==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.0.7" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@oxc-resolver/binding-win32-arm64-msvc": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.11.1.tgz", + "integrity": "sha512-5R2GVH44JXGoI+gVlR4+O3ql6KZICQlCmIB0ZbpiYbEHNxaB47v3aSMVxcCuwhYKndJUJZwRXnYzoCfMEu4o0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxc-resolver/binding-win32-ia32-msvc": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-11.11.1.tgz", + "integrity": "sha512-iB/ljDyPJCMIO7WPx2bj8fRCB1TxmHSv/t3oyUwOiz79Q0A33QbwZWhdx+ZXdazGPer71mYZfr3eb0hAnmlgrg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxc-resolver/binding-win32-x64-msvc": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.11.1.tgz", + "integrity": "sha512-OtUpzpStS5bgVGXV7eaBr7Spot9lXu/wyd0yWEyoG2tyzm/bwdRKCwJQzxWIhlecRxMDGA+qlLRRicTNOejkSQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@panva/hkdf": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@panva/hkdf/-/hkdf-1.2.1.tgz", @@ -1485,6 +1802,17 @@ "vite": "^5.2.0 || ^6 || ^7" } }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", @@ -2407,6 +2735,16 @@ "reusify": "^1.0.4" } }, + "node_modules/fd-package-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fd-package-json/-/fd-package-json-2.0.0.tgz", + "integrity": "sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "walk-up-path": "^4.0.0" + } + }, "node_modules/fdir": { "version": "6.4.6", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", @@ -2485,6 +2823,22 @@ "dev": true, "license": "ISC" }, + "node_modules/formatly": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/formatly/-/formatly-0.3.0.tgz", + "integrity": "sha512-9XNj/o4wrRFyhSMJOvsuyMwy8aUfBaZ1VrqHVfohyXf0Sw0e+yfKG+xZaY3arGCOMdwFsqObtzVOc1gU9KiT9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fd-package-json": "^2.0.0" + }, + "bin": { + "formatly": "bin/index.mjs" + }, + "engines": { + "node": ">=18.3.0" + } + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -2636,9 +2990,9 @@ "license": "ISC" }, "node_modules/jiti": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", - "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "devOptional": true, "license": "MIT", "bin": { @@ -2707,6 +3061,61 @@ "node": ">=6" } }, + "node_modules/knip": { + "version": "5.66.2", + "resolved": "https://registry.npmjs.org/knip/-/knip-5.66.2.tgz", + "integrity": "sha512-5wvsdc17C5bMxjuGfN9KVS/tW5KIvzP1RClfpTMdLYm8IXIsfWsiHlFkTvZIca9skwoVDyTyXmbRq4w1Poim+A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/webpro" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/knip" + } + ], + "license": "ISC", + "dependencies": { + "@nodelib/fs.walk": "^1.2.3", + "fast-glob": "^3.3.3", + "formatly": "^0.3.0", + "jiti": "^2.6.0", + "js-yaml": "^4.1.0", + "minimist": "^1.2.8", + "oxc-resolver": "^11.8.3", + "picocolors": "^1.1.1", + "picomatch": "^4.0.1", + "smol-toml": "^1.4.1", + "strip-json-comments": "5.0.2", + "zod": "^4.1.11" + }, + "bin": { + "knip": "bin/knip.js", + "knip-bun": "bin/knip-bun.js" + }, + "engines": { + "node": ">=18.18.0" + }, + "peerDependencies": { + "@types/node": ">=18", + "typescript": ">=5.0.4 <7" + } + }, + "node_modules/knip/node_modules/strip-json-comments": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.2.tgz", + "integrity": "sha512-4X2FR3UwhNUE9G49aIsJW5hRRR3GXGTBTZRMfv568O60ojM8HcWjV/VxAxCDW3SUND33O6ZY66ZuRcdkj73q2g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/known-css-properties": { "version": "0.37.0", "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.37.0.tgz", @@ -3055,6 +3464,16 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -3183,6 +3602,37 @@ "node": ">= 0.8.0" } }, + "node_modules/oxc-resolver": { + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.11.1.tgz", + "integrity": "sha512-4Z86u4xQAxl2IC1OAAdHjk/S9GNbE2ewALQVOpBk9F8NkfqXlglY6R2ts+HEgY/Q3T9m/H8W0G4id71muw/Nng==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxc-resolver/binding-android-arm-eabi": "11.11.1", + "@oxc-resolver/binding-android-arm64": "11.11.1", + "@oxc-resolver/binding-darwin-arm64": "11.11.1", + "@oxc-resolver/binding-darwin-x64": "11.11.1", + "@oxc-resolver/binding-freebsd-x64": "11.11.1", + "@oxc-resolver/binding-linux-arm-gnueabihf": "11.11.1", + "@oxc-resolver/binding-linux-arm-musleabihf": "11.11.1", + "@oxc-resolver/binding-linux-arm64-gnu": "11.11.1", + "@oxc-resolver/binding-linux-arm64-musl": "11.11.1", + "@oxc-resolver/binding-linux-ppc64-gnu": "11.11.1", + "@oxc-resolver/binding-linux-riscv64-gnu": "11.11.1", + "@oxc-resolver/binding-linux-riscv64-musl": "11.11.1", + "@oxc-resolver/binding-linux-s390x-gnu": "11.11.1", + "@oxc-resolver/binding-linux-x64-gnu": "11.11.1", + "@oxc-resolver/binding-linux-x64-musl": "11.11.1", + "@oxc-resolver/binding-wasm32-wasi": "11.11.1", + "@oxc-resolver/binding-win32-arm64-msvc": "11.11.1", + "@oxc-resolver/binding-win32-ia32-msvc": "11.11.1", + "@oxc-resolver/binding-win32-x64-msvc": "11.11.1" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -3742,6 +4192,19 @@ "node": ">=18" } }, + "node_modules/smol-toml": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.2.tgz", + "integrity": "sha512-rInDH6lCNiEyn3+hH8KVGFdbjc099j47+OSgbMrfDYX1CmXLfdKd7qi6IfcWj2wFxvSVkuI46M+wPGYfEOEj6g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -3941,6 +4404,14 @@ "typescript": ">=4.8.4" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -4109,6 +4580,16 @@ } } }, + "node_modules/walk-up-path": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-4.0.0.tgz", + "integrity": "sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4177,6 +4658,16 @@ "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz", "integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==", "license": "MIT" + }, + "node_modules/zod": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.12.tgz", + "integrity": "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/package.json b/package.json index 4a44297..719971d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "tailwindcss": "^4.0.0", "typescript": "^5.0.0", "typescript-eslint": "^8.20.0", - "vite": "^7.0.4" + "vite": "^7.0.4", + "knip": "^5.64.1" }, "dependencies": { "@auth/core": "^0.40.0", From fef11fdea28d94de64d15d6d6f3fd531acf842e5 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 23 Oct 2025 11:04:35 +1100 Subject: [PATCH 3/9] chore(ci): added a command to run typechecking --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 719971d..2f5b93a 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "vite dev", "build": "vite build", + "prepack": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "preview": "vite preview", "prepare": "svelte-kit sync || echo ''", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", From fb7f26b86aa2b495c9e60643815183b49429a6a2 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 23 Oct 2025 11:11:15 +1100 Subject: [PATCH 4/9] refactor: removed the unused data variable --- src/routes/+layout.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 1d65b67..bd8c13d 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,8 +1,6 @@ From 58136c2a88b30c72592ea2de3d7fd07241669417 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 23 Oct 2025 11:46:33 +1100 Subject: [PATCH 5/9] refactor: suppressed checks for these env vars as the .env file does not exist on CI --- src/lib/auth/auth.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/auth/auth.ts b/src/lib/auth/auth.ts index 5598ff4..a1f6147 100644 --- a/src/lib/auth/auth.ts +++ b/src/lib/auth/auth.ts @@ -1,9 +1,12 @@ +// @ts-ignore + import { SvelteKitAuth } from '@auth/sveltekit'; import Zitadel from '@auth/sveltekit/providers/zitadel'; import { randomUUID } from 'crypto'; import * as oidc from 'openid-client'; import type { JWT } from '@auth/core/jwt'; import { ZITADEL_SCOPES } from './scopes'; +// @ts-nocheck import { SESSION_DURATION, SESSION_SECRET, From 0eb6910ae5aadf24e9344b9d655bfd856b7141b9 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 23 Oct 2025 11:50:27 +1100 Subject: [PATCH 6/9] refactor: suppressed checks for these env vars as the .env file does not exist on CI --- src/lib/auth/auth.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/auth/auth.ts b/src/lib/auth/auth.ts index a1f6147..edcdf31 100644 --- a/src/lib/auth/auth.ts +++ b/src/lib/auth/auth.ts @@ -10,9 +10,13 @@ import { ZITADEL_SCOPES } from './scopes'; import { SESSION_DURATION, SESSION_SECRET, + // @ts-nocheck ZITADEL_CLIENT_ID, + // @ts-nocheck ZITADEL_CLIENT_SECRET, + // @ts-nocheck ZITADEL_DOMAIN, + // @ts-nocheck ZITADEL_POST_LOGOUT_URL, } from '$env/static/private'; From abd697da6731e0a9683f964a34068591c9521a96 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 23 Oct 2025 11:53:51 +1100 Subject: [PATCH 7/9] refactor: suppressed checks for these env vars as the .env file does not exist on CI --- src/app.d.ts | 11 +++++++++-- src/lib/auth/auth.ts | 7 ------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app.d.ts b/src/app.d.ts index 520c421..d432393 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,5 +1,3 @@ -// See https://svelte.dev/docs/kit/types#app.d.ts -// for information about these interfaces declare global { namespace App { // interface Error {} @@ -10,4 +8,13 @@ declare global { } } +declare module '$env/static/private' { + export const SESSION_DURATION: string; + export const SESSION_SECRET: string; + export const ZITADEL_CLIENT_ID: string; + export const ZITADEL_CLIENT_SECRET: string; + export const ZITADEL_DOMAIN: string; + export const ZITADEL_POST_LOGOUT_URL: string; +} + export {}; diff --git a/src/lib/auth/auth.ts b/src/lib/auth/auth.ts index edcdf31..5598ff4 100644 --- a/src/lib/auth/auth.ts +++ b/src/lib/auth/auth.ts @@ -1,22 +1,15 @@ -// @ts-ignore - import { SvelteKitAuth } from '@auth/sveltekit'; import Zitadel from '@auth/sveltekit/providers/zitadel'; import { randomUUID } from 'crypto'; import * as oidc from 'openid-client'; import type { JWT } from '@auth/core/jwt'; import { ZITADEL_SCOPES } from './scopes'; -// @ts-nocheck import { SESSION_DURATION, SESSION_SECRET, - // @ts-nocheck ZITADEL_CLIENT_ID, - // @ts-nocheck ZITADEL_CLIENT_SECRET, - // @ts-nocheck ZITADEL_DOMAIN, - // @ts-nocheck ZITADEL_POST_LOGOUT_URL, } from '$env/static/private'; From 74979f89fdc1de3585f67cb3ed4f76f30502152c Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 23 Oct 2025 14:26:20 +1100 Subject: [PATCH 8/9] test: added playwright based tests --- .github/workflows/test.yml | 7 ----- package-lock.json | 64 ++++++++++++++++++++++++++++++++++++++ package.json | 8 +++-- playwright.config.ts | 54 ++++++++++++++++++++++++++++++++ test/app.spec.ts | 6 ++++ 5 files changed, 129 insertions(+), 10 deletions(-) create mode 100644 playwright.config.ts create mode 100644 test/app.spec.ts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 00762e6..1b4d9fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,13 +39,6 @@ jobs: - name: Run Tests run: npm run test - - name: Generate coverage report - uses: mridang/action-test-reporter@v1 - if: always() - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - coverage-file: 'build/coverage/clover.xml' - - name: Upload Results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: always() diff --git a/package-lock.json b/package-lock.json index 52be5ef..23ba872 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "devDependencies": { "@eslint/compat": "^1.2.5", "@eslint/js": "^9.18.0", + "@playwright/test": "^1.56.1", "@sveltejs/adapter-auto": "^6.0.0", "@sveltejs/kit": "^2.22.0", "@sveltejs/vite-plugin-svelte": "^6.0.0", @@ -1171,6 +1172,22 @@ "url": "https://github.com/sponsors/panva" } }, + "node_modules/@playwright/test": { + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.1.tgz", + "integrity": "sha512-vSMYtL/zOcFpvJCW71Q/OEGQb7KYBPAdKh35WNSkaZA75JlAO8ED8UN6GUNTm3drWomcbcqRPFqQbLae8yBTdg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.56.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@polka/url": { "version": "1.0.0-next.29", "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", @@ -3716,6 +3733,53 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/playwright": { + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz", + "integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.56.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz", + "integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/playwright/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/postcss": { "version": "8.5.6", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", diff --git a/package.json b/package.json index 2f5b93a..36c74cd 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,13 @@ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "format": "prettier --write .", - "lint": "prettier --check . && eslint ." + "lint": "prettier --check . && eslint .", + "test": "playwright test" }, "devDependencies": { "@eslint/compat": "^1.2.5", "@eslint/js": "^9.18.0", + "@playwright/test": "^1.56.1", "@sveltejs/adapter-auto": "^6.0.0", "@sveltejs/kit": "^2.22.0", "@sveltejs/vite-plugin-svelte": "^6.0.0", @@ -26,6 +28,7 @@ "eslint-config-prettier": "^10.0.1", "eslint-plugin-svelte": "^3.0.0", "globals": "^16.0.0", + "knip": "^5.64.1", "prettier": "^3.6.2", "prettier-plugin-svelte": "^3.4.0", "prettier-plugin-tailwindcss": "^0.6.11", @@ -34,8 +37,7 @@ "tailwindcss": "^4.0.0", "typescript": "^5.0.0", "typescript-eslint": "^8.20.0", - "vite": "^7.0.4", - "knip": "^5.64.1" + "vite": "^7.0.4" }, "dependencies": { "@auth/core": "^0.40.0", diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..f4dc7a9 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,54 @@ +import { defineConfig, devices } from '@playwright/test'; + +const testEnv = { + NODE_ENV: 'test', + PORT: '3000', + SESSION_SECRET: 'test-session-secret-for-e2e-tests-only', + SESSION_DURATION: '3600', + ZITADEL_DOMAIN: 'https://test.zitadel.cloud', + ZITADEL_CLIENT_ID: 'test-client-id', + ZITADEL_CLIENT_SECRET: 'test-client-secret', + ZITADEL_CALLBACK_URL: 'http://localhost:3000/api/auth/callback', + ZITADEL_POST_LOGOUT_URL: 'http://localhost:3000/api/auth/logout/callback', + AUTH_URL: 'http://localhost:3000', + PUBLIC_API_URL: 'http://localhost:3000', +}; + +// noinspection JSUnusedGlobalSymbols +export default defineConfig({ + testDir: './test', + outputDir: './build/playwright', + fullyParallel: true, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: process.env.CI ? 1 : undefined, + reporter: [ + ['html', { outputFolder: './build/playwright-report' }], + ['list'], + [ + 'junit', + { + outputFile: './build/reports/junit.xml', + }, + ], + ], + use: { + baseURL: 'http://localhost:3000', + trace: 'on-first-retry', + screenshot: 'only-on-failure', + video: 'retain-on-failure', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], + webServer: { + command: 'npm run dev', + url: 'http://localhost:3000', + reuseExistingServer: !process.env.CI, + timeout: 120000, + env: testEnv, + }, +}); diff --git a/test/app.spec.ts b/test/app.spec.ts new file mode 100644 index 0000000..8e38a27 --- /dev/null +++ b/test/app.spec.ts @@ -0,0 +1,6 @@ +import { test, expect } from '@playwright/test'; + +test('app returns 200', async ({ page }) => { + const response = await page.goto('/'); + expect(response?.status()).toBe(200); +}); From 612f94a59d7020a7066d1c690ddc23a599931ea0 Mon Sep 17 00:00:00 2001 From: Mridang Agarwalla Date: Thu, 23 Oct 2025 14:38:15 +1100 Subject: [PATCH 9/9] ci: installed the playwright browsers to ensure that tests can run --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b4d9fa..a58ec49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,6 +36,9 @@ jobs: - name: Install Dependencies run: npm ci --no-progress + - name: Install Playwright Browsers + run: npx playwright install --with-deps chromium + - name: Run Tests run: npm run test