diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a4e45e..4efa7b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,13 +31,13 @@ jobs: run: | pnpm install - - name: Prettier + - name: Format run: | - pnpm run prettier + pnpm run format:check - # - name: Lint - # run: | - # pnpm run lint + - name: Lint + run: | + pnpm run lint - name: Build run: | diff --git a/.github/workflows/coana-analysis.yml b/.github/workflows/coana-analysis.yml deleted file mode 100644 index d3f3b2c..0000000 --- a/.github/workflows/coana-analysis.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Coana Vulnerability Analysis - -on: - schedule: - - cron: '0 3 * * *' # every day at 3 AM - workflow_dispatch: - inputs: - tags: - description: 'Manually run vulnerability analysis' - # Required by the return-dispatch action - distinct_id: - -jobs: - coana-vulnerability-analysis: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Run Coana CLI - id: coana-cli - uses: docker://coana/coana:latest - with: - args: | - coana run . \ - --api-key ${{ secrets.COANA_API_KEY }} \ - --repo-url https://github.com/${{github.repository}} diff --git a/.github/workflows/coana-guardrail.yml b/.github/workflows/coana-guardrail.yml deleted file mode 100644 index 6928ce0..0000000 --- a/.github/workflows/coana-guardrail.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Coana Guardrail - -on: pull_request - -jobs: - guardrail: - runs-on: ubuntu-latest - - steps: - - name: Checkout the ${{github.base_ref}} branch - uses: actions/checkout@v4 - with: - ref: ${{github.base_ref}} # checkout the base branch (usually master/main). - - - name: Fetch the PR branch - run: | - git fetch ${{ github.event.pull_request.head.repo.clone_url }} ${{ github.head_ref }}:${{ github.head_ref }} --depth=1 - - - name: Get list of changed files relative to the main/master branch - id: changed-files - run: | - echo "all_changed_files=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | tr '\n' ' ')" >> $GITHUB_OUTPUT - - - name: Use Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: 20.x - - - name: Run Coana on the ${{github.base_ref}} branch - run: | - npx @coana-tech/cli run . \ - --guardrail-mode \ - --api-key ${{ secrets.COANA_API_KEY || 'api-key-unavailable' }} \ - -o /tmp/main-branch \ - --changed-files ${{ steps.changed-files.outputs.all_changed_files }} \ - --lightweight-reachability \ - - # Reset file permissions. - # This is necessary because the Coana CLI may add - # new files with root ownership since it's using docker. - # These files will not be deleted by the clean step in checkout - # if the permissions are not reset. - - name: Reset file permissions - run: sudo chown -R $USER:$USER . - - - name: Checkout the current branch - uses: actions/checkout@v4 - with: - clean: true - - - name: Run Coana on the current branch - run: | - npx @coana-tech/cli run . \ - --guardrail-mode \ - --api-key ${{ secrets.COANA_API_KEY || 'api-key-unavailable' }} \ - -o /tmp/current-branch \ - --changed-files ${{ steps.changed-files.outputs.all_changed_files }} \ - --lightweight-reachability \ - - - name: Run Report Comparison - run: | - npx @coana-tech/cli compare-reports \ - --api-key ${{ secrets.COANA_API_KEY || 'api-key-unavailable' }} \ - /tmp/main-branch/coana-report.json \ - /tmp/current-branch/coana-report.json - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000..0d47d41 --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,17 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "trailingComma": "all", + "tabWidth": 2, + "semi": true, + "singleQuote": true, + "printWidth": 120, + "sortPackageJson": false, + "ignorePatterns": [ + "dist/", + "node_modules/", + "pnpm-lock.yaml", + "**/build/", + "**/public/", + "example/src/routeTree.gen.ts" + ] +} diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000..d859a01 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": null, + "categories": {}, + "rules": {}, + "ignorePatterns": ["dist/", "example/src/routeTree.gen.ts"] +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 0ea9a64..0000000 --- a/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -**/build -**/public -pnpm-lock.yaml -example/src/routeTree.gen.ts diff --git a/example/.prettierignore b/example/.prettierignore deleted file mode 100644 index 7d725a4..0000000 --- a/example/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -**/build -**/public -pnpm-lock.yaml -src/routeTree.gen.ts \ No newline at end of file diff --git a/package.json b/package.json index 29d7425..fb27c69 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,11 @@ "dev": "tsc --watch", "prebuild": "npm run clean", "build": "tsc -p tsconfig.build.json", - "prepublishOnly": "npm run build && npm run prettier && npm run typecheck && npm test", + "prepublishOnly": "npm run build && npm run format:check && npm run lint && npm run typecheck && npm test", "typecheck": "tsc --noEmit", - "prettier": "prettier --check .", - "format": "prettier --write .", + "lint": "oxlint", + "format": "oxfmt .", + "format:check": "oxfmt --check .", "test": "vitest run", "test:watch": "vitest", "test:ui": "vitest --ui", @@ -84,7 +85,8 @@ "@vitest/coverage-v8": "4.0.15", "@vitest/ui": "^4.0.15", "happy-dom": "^20.0.11", - "prettier": "^3.7.4", + "oxfmt": "^0.35.0", + "oxlint": "^1.50.0", "react": "^19.2.3", "react-dom": "^19.2.3", "tsup": "^8.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cdd6f90..6667588 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,9 +48,12 @@ importers: happy-dom: specifier: ^20.0.11 version: 20.0.11 - prettier: - specifier: ^3.7.4 - version: 3.7.4 + oxfmt: + specifier: ^0.35.0 + version: 0.35.0 + oxlint: + specifier: ^1.50.0 + version: 1.53.0 react: specifier: ^19.2.3 version: 19.2.3 @@ -436,6 +439,234 @@ packages: resolution: {integrity: sha512-hAX0pT/73190NLqBPPWSdBVGtbY6VOhWYK3qqHqtXQ1gK7kS2yz4+ivsN07hpJ6I3aeMtKP6J6npsEKOAzuTLA==} engines: {node: '>=20.0'} + '@oxfmt/binding-android-arm-eabi@0.35.0': + resolution: {integrity: sha512-BaRKlM3DyG81y/xWTsE6gZiv89F/3pHe2BqX2H4JbiB8HNVlWWtplzgATAE5IDSdwChdeuWLDTQzJ92Lglw3ZA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxfmt/binding-android-arm64@0.35.0': + resolution: {integrity: sha512-/O+EbuAJYs6nde/anv+aID6uHsGQApyE9JtYBo/79KyU8e6RBN3DMbT0ix97y1SOnCglurmL2iZ+hlohjP2PnQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxfmt/binding-darwin-arm64@0.35.0': + resolution: {integrity: sha512-pGqRtqlNdn9d4VrmGUWVyQjkw79ryhI6je9y2jfqNUIZCfqceob+R97YYAoG7C5TFyt8ILdLVoN+L2vw/hSFyA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxfmt/binding-darwin-x64@0.35.0': + resolution: {integrity: sha512-8GmsDcSozTPjrCJeGpp+sCmS9+9V5yRrdEZ1p/sTWxPG5nYeAfSLuS0nuEYjXSO+CtdSbStIW6dxa+4NM58yRw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxfmt/binding-freebsd-x64@0.35.0': + resolution: {integrity: sha512-QyfKfTe0ytHpFKHAcHCGQEzN45QSqq1AHJOYYxQMgLM3KY4xu8OsXHpCnINjDsV4XGnQzczJDU9e04Zmd8XqIQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxfmt/binding-linux-arm-gnueabihf@0.35.0': + resolution: {integrity: sha512-u+kv3JD6P3J38oOyUaiCqgY5TNESzBRZJ5lyZQ6c2czUW2v5SIN9E/KWWa9vxoc+P8AFXQFUVrdzGy1tK+nbPQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm-musleabihf@0.35.0': + resolution: {integrity: sha512-1NiZroCiV57I7Pf8kOH4XGR366kW5zir3VfSMBU2D0V14GpYjiYmPYFAoJboZvp8ACnZKUReWyMkNKSa5ad58A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm64-gnu@0.35.0': + resolution: {integrity: sha512-7Q0Xeg7ZnW2nxnZ4R7aF6DEbCFls4skgHZg+I63XitpNvJCbVIU8MFOTZlvZGRsY9+rPgWPQGeUpLHlyx0wvMA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@oxfmt/binding-linux-arm64-musl@0.35.0': + resolution: {integrity: sha512-5Okqi+uhYFxwKz8hcnUftNNwdm8BCkf6GSCbcz9xJxYMm87k1E4p7PEmAAbhLTk7cjSdDre6TDL0pDzNX+Y22Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@oxfmt/binding-linux-ppc64-gnu@0.35.0': + resolution: {integrity: sha512-9k66pbZQXM/lBJWys3Xbc5yhl4JexyfqkEf/tvtq8976VIJnLAAL3M127xHA3ifYSqxdVHfVGTg84eiBHCGcNw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + + '@oxfmt/binding-linux-riscv64-gnu@0.35.0': + resolution: {integrity: sha512-aUcY9ofKPtjO52idT6t0SAQvEF6ctjzUQa1lLp7GDsRpSBvuTrBQGeq0rYKz3gN8dMIQ7mtMdGD9tT4LhR8jAQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxfmt/binding-linux-riscv64-musl@0.35.0': + resolution: {integrity: sha512-C6yhY5Hvc2sGM+mCPek9ZLe5xRUOC/BvhAt2qIWFAeXMn4il04EYIjl3DsWiJr0xDMTJhvMOmD55xTRPlNp39w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxfmt/binding-linux-s390x-gnu@0.35.0': + resolution: {integrity: sha512-RG2hlvOMK4OMZpO3mt8MpxLQ0AAezlFqhn5mI/g5YrVbPFyoCv9a34AAvbSJS501ocOxlFIRcKEuw5hFvddf9g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + + '@oxfmt/binding-linux-x64-gnu@0.35.0': + resolution: {integrity: sha512-wzmh90Pwvqj9xOKHJjkQYBpydRkaXG77ZvDz+iFDRRQpnqIEqGm5gmim2s6vnZIkDGsvKCuTdtxm0GFmBjM1+w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@oxfmt/binding-linux-x64-musl@0.35.0': + resolution: {integrity: sha512-+HCqYCJPCUy5I+b2cf+gUVaApfgtoQT3HdnSg/l7NIcLHOhKstlYaGyrFZLmUpQt4WkFbpGKZZayG6zjRU0KFA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@oxfmt/binding-openharmony-arm64@0.35.0': + resolution: {integrity: sha512-kFYmWfR9YL78XyO5ws+1dsxNvZoD973qfVMNFOS4e9bcHXGF7DvGC2tY5UDFwyMCeB33t3sDIuGONKggnVNSJA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxfmt/binding-win32-arm64-msvc@0.35.0': + resolution: {integrity: sha512-uD/NGdM65eKNCDGyTGdO8e9n3IHX+wwuorBvEYrPJXhDXL9qz6gzddmXH8EN04ejUXUujlq4FsoSeCfbg0Y+Jg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxfmt/binding-win32-ia32-msvc@0.35.0': + resolution: {integrity: sha512-oSRD2k8J2uxYDEKR2nAE/YTY9PobOEnhZgCmspHu0+yBQ665yH8lFErQVSTE7fcGJmJp/cC6322/gc8VFuQf7g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxfmt/binding-win32-x64-msvc@0.35.0': + resolution: {integrity: sha512-WCDJjlS95NboR0ugI2BEwzt1tYvRDorDRM9Lvctls1SLyKYuNRCyrPwp1urUPFBnwgBNn9p2/gnmo7gFMySRoQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@oxlint/binding-android-arm-eabi@1.53.0': + resolution: {integrity: sha512-JC89/jAx4d2zhDIbK8MC4L659FN1WiMXMBkNg7b33KXSkYpUgcbf+0nz7+EPRg+VwWiZVfaoFkNHJ7RXYb5Neg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.53.0': + resolution: {integrity: sha512-CY+pZfi+uyeU7AwFrEnjsNT+VfxYmKLMuk7bVxArd8f+09hQbJb8f7C7EpvTfNqrCK1J8zZlaYI4LltmEctgbQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.53.0': + resolution: {integrity: sha512-0aqsC4HDQ94oI6kMz64iaOJ1f3bCVArxvaHJGOScBvFz6CcQedXi5b70Xg09CYjKNaHA56dW0QJfoZ/111kz1A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxlint/binding-darwin-x64@1.53.0': + resolution: {integrity: sha512-e+KvuaWtnisyWojO/t5qKDbp2dvVpg+1dl4MGnTb21QpY4+4+9Y1XmZPaztcA2XNvy4BIaXFW+9JH9tMpSBqUg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxlint/binding-freebsd-x64@1.53.0': + resolution: {integrity: sha512-hpU0ZHVeblFjmZDfgi9BxhhCpURh0KjoFy5V+Tvp9sg/fRcnMUEfaJrgz+jQfOX4jctlVWrAs1ANs91+5iV+zA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.53.0': + resolution: {integrity: sha512-ccKxOpw+X4xa2pO+qbTOpxQ2x1+Ag3ViRQMnWt3gHp1LcpNgS1xd6GYc3OvehmHtrXqEV3YGczZ0I1qpBB4/2A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.53.0': + resolution: {integrity: sha512-UBkBvmzSmlyH2ZObQMDKW/TuyTmUtP/XClPUyU2YLwj0qLopZTZxnDz4VG5d3wz1HQuZXO0o1QqsnQUW1v4a6Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.53.0': + resolution: {integrity: sha512-PQJJ1izoH9p61las6rZ0BWOznAhTDMmdUPL2IEBLuXFwhy2mSloYHvRkk39PSYJ1DyG+trqU5Z9ZbtHSGH6plg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@oxlint/binding-linux-arm64-musl@1.53.0': + resolution: {integrity: sha512-GXI1o4Thn/rtnRIL38BwrDMwVcUbIHKCsOixIWf/CkU3fCG3MXFzFTtDMt+34ik0Qk452d8kcpksL0w/hUkMZA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@oxlint/binding-linux-ppc64-gnu@1.53.0': + resolution: {integrity: sha512-Uahk7IVs2yBamCgeJ3XKpKT9Vh+de0pDKISFKnjEcI3c/w2CFHk1+W6Q6G3KI56HGwE9PWCp6ayhA9whXWkNIQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + + '@oxlint/binding-linux-riscv64-gnu@1.53.0': + resolution: {integrity: sha512-sWtcU9UkrKMWsGKdFy8R6jkm9Q0VVG1VCpxVuh0HzRQQi3ENI1Nh5CkpsdfUs2MKRcOoHKbXqTscunuXjhxoxQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxlint/binding-linux-riscv64-musl@1.53.0': + resolution: {integrity: sha512-aXew1+HDvCdExijX/8NBVC854zJwxhKP3l9AHFSHQNo4EanlHtzDMIlIvP3raUkL0vXtFCkTFYezzU5HjstB8A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxlint/binding-linux-s390x-gnu@1.53.0': + resolution: {integrity: sha512-rVpyBSqPGou9sITcsoXqUoGBUH74bxYLYOAGUqN599Zu6BQBlBU9hh3bJQ/20D1xrhhrsbiCpVPvXpLPM5nL1w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + + '@oxlint/binding-linux-x64-gnu@1.53.0': + resolution: {integrity: sha512-eOyeQ8qFQ2geXmlWJuXAOaek0hFhbMLlYsU457NMLKDRoC43Xf+eDPZ9Yk0n9jDaGJ5zBl/3Dy8wo41cnIXuLA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@oxlint/binding-linux-x64-musl@1.53.0': + resolution: {integrity: sha512-S6rBArW/zD1tob8M9PwKYrRmz+j1ss1+wjbRAJCWKd7TC3JB6noDiA95pIj9zOZVVp04MIzy5qymnYusrEyXzg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@oxlint/binding-openharmony-arm64@1.53.0': + resolution: {integrity: sha512-sd/A0Ny5sN0D/MJtlk7w2jGY4bJQou7gToa9WZF7Sj6HTyVzvlzKJWiOHfr4SulVk4ndiFQ8rKmF9rXP0EcF3A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.53.0': + resolution: {integrity: sha512-QC3q7b51Er/ZurEFcFzc7RpQ/YEoEBLJuCp3WoOzhSHHH/nkUKFy+igOxlj1z3LayhEZPDQQ7sXvv2PM2cdG3Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxlint/binding-win32-ia32-msvc@1.53.0': + resolution: {integrity: sha512-3OvLgOqwd705hWHV2i8ni80pilvg6BUgpC2+xtVu++e/q28LKVohGh5J5QYJOrRMfWmxK0M/AUu43vUw62LAKQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.53.0': + resolution: {integrity: sha512-xTiOkntexCdJytZ7ArIIgl3vGW5ujMM3sJNM7/+iqGAVJagCqjFFWn68HRWRLeyT66c95uR+CeFmQFI6mLQqDw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + '@polka/url@1.0.0-next.29': resolution: {integrity: sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==} @@ -1966,6 +2197,21 @@ packages: obug@2.1.1: resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} + oxfmt@0.35.0: + resolution: {integrity: sha512-QYeXWkP+aLt7utt5SLivNIk09glWx9QE235ODjgcEZ3sd1VMaUBSpLymh6ZRCA76gD2rMP4bXanUz/fx+nLM9Q==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + oxlint@1.53.0: + resolution: {integrity: sha512-TLW0PzGbpO1JxUnuy1pIqVPjQUGh4fNfxu5XJbdFIRFVaJ0UFzTjjk/hSFTMRxN6lZub53xL/IwJNEkrh7VtDg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + oxlint-tsgolint: '>=0.15.0' + peerDependenciesMeta: + oxlint-tsgolint: + optional: true + parse5-htmlparser2-tree-adapter@7.1.0: resolution: {integrity: sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==} @@ -2218,6 +2464,10 @@ packages: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} + tinypool@2.1.0: + resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==} + engines: {node: ^20.0.0 || >=22.0.0} + tinyrainbow@3.0.3: resolution: {integrity: sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==} engines: {node: '>=14.0.0'} @@ -2712,6 +2962,120 @@ snapshots: '@oozcitak/util@10.0.0': {} + '@oxfmt/binding-android-arm-eabi@0.35.0': + optional: true + + '@oxfmt/binding-android-arm64@0.35.0': + optional: true + + '@oxfmt/binding-darwin-arm64@0.35.0': + optional: true + + '@oxfmt/binding-darwin-x64@0.35.0': + optional: true + + '@oxfmt/binding-freebsd-x64@0.35.0': + optional: true + + '@oxfmt/binding-linux-arm-gnueabihf@0.35.0': + optional: true + + '@oxfmt/binding-linux-arm-musleabihf@0.35.0': + optional: true + + '@oxfmt/binding-linux-arm64-gnu@0.35.0': + optional: true + + '@oxfmt/binding-linux-arm64-musl@0.35.0': + optional: true + + '@oxfmt/binding-linux-ppc64-gnu@0.35.0': + optional: true + + '@oxfmt/binding-linux-riscv64-gnu@0.35.0': + optional: true + + '@oxfmt/binding-linux-riscv64-musl@0.35.0': + optional: true + + '@oxfmt/binding-linux-s390x-gnu@0.35.0': + optional: true + + '@oxfmt/binding-linux-x64-gnu@0.35.0': + optional: true + + '@oxfmt/binding-linux-x64-musl@0.35.0': + optional: true + + '@oxfmt/binding-openharmony-arm64@0.35.0': + optional: true + + '@oxfmt/binding-win32-arm64-msvc@0.35.0': + optional: true + + '@oxfmt/binding-win32-ia32-msvc@0.35.0': + optional: true + + '@oxfmt/binding-win32-x64-msvc@0.35.0': + optional: true + + '@oxlint/binding-android-arm-eabi@1.53.0': + optional: true + + '@oxlint/binding-android-arm64@1.53.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.53.0': + optional: true + + '@oxlint/binding-darwin-x64@1.53.0': + optional: true + + '@oxlint/binding-freebsd-x64@1.53.0': + optional: true + + '@oxlint/binding-linux-arm-gnueabihf@1.53.0': + optional: true + + '@oxlint/binding-linux-arm-musleabihf@1.53.0': + optional: true + + '@oxlint/binding-linux-arm64-gnu@1.53.0': + optional: true + + '@oxlint/binding-linux-arm64-musl@1.53.0': + optional: true + + '@oxlint/binding-linux-ppc64-gnu@1.53.0': + optional: true + + '@oxlint/binding-linux-riscv64-gnu@1.53.0': + optional: true + + '@oxlint/binding-linux-riscv64-musl@1.53.0': + optional: true + + '@oxlint/binding-linux-s390x-gnu@1.53.0': + optional: true + + '@oxlint/binding-linux-x64-gnu@1.53.0': + optional: true + + '@oxlint/binding-linux-x64-musl@1.53.0': + optional: true + + '@oxlint/binding-openharmony-arm64@1.53.0': + optional: true + + '@oxlint/binding-win32-arm64-msvc@1.53.0': + optional: true + + '@oxlint/binding-win32-ia32-msvc@1.53.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.53.0': + optional: true + '@polka/url@1.0.0-next.29': {} '@radix-ui/colors@3.0.0': {} @@ -4350,6 +4714,52 @@ snapshots: obug@2.1.1: {} + oxfmt@0.35.0: + dependencies: + tinypool: 2.1.0 + optionalDependencies: + '@oxfmt/binding-android-arm-eabi': 0.35.0 + '@oxfmt/binding-android-arm64': 0.35.0 + '@oxfmt/binding-darwin-arm64': 0.35.0 + '@oxfmt/binding-darwin-x64': 0.35.0 + '@oxfmt/binding-freebsd-x64': 0.35.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.35.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.35.0 + '@oxfmt/binding-linux-arm64-gnu': 0.35.0 + '@oxfmt/binding-linux-arm64-musl': 0.35.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.35.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.35.0 + '@oxfmt/binding-linux-riscv64-musl': 0.35.0 + '@oxfmt/binding-linux-s390x-gnu': 0.35.0 + '@oxfmt/binding-linux-x64-gnu': 0.35.0 + '@oxfmt/binding-linux-x64-musl': 0.35.0 + '@oxfmt/binding-openharmony-arm64': 0.35.0 + '@oxfmt/binding-win32-arm64-msvc': 0.35.0 + '@oxfmt/binding-win32-ia32-msvc': 0.35.0 + '@oxfmt/binding-win32-x64-msvc': 0.35.0 + + oxlint@1.53.0: + optionalDependencies: + '@oxlint/binding-android-arm-eabi': 1.53.0 + '@oxlint/binding-android-arm64': 1.53.0 + '@oxlint/binding-darwin-arm64': 1.53.0 + '@oxlint/binding-darwin-x64': 1.53.0 + '@oxlint/binding-freebsd-x64': 1.53.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.53.0 + '@oxlint/binding-linux-arm-musleabihf': 1.53.0 + '@oxlint/binding-linux-arm64-gnu': 1.53.0 + '@oxlint/binding-linux-arm64-musl': 1.53.0 + '@oxlint/binding-linux-ppc64-gnu': 1.53.0 + '@oxlint/binding-linux-riscv64-gnu': 1.53.0 + '@oxlint/binding-linux-riscv64-musl': 1.53.0 + '@oxlint/binding-linux-s390x-gnu': 1.53.0 + '@oxlint/binding-linux-x64-gnu': 1.53.0 + '@oxlint/binding-linux-x64-musl': 1.53.0 + '@oxlint/binding-openharmony-arm64': 1.53.0 + '@oxlint/binding-win32-arm64-msvc': 1.53.0 + '@oxlint/binding-win32-ia32-msvc': 1.53.0 + '@oxlint/binding-win32-x64-msvc': 1.53.0 + parse5-htmlparser2-tree-adapter@7.1.0: dependencies: domhandler: 5.0.3 @@ -4633,6 +5043,8 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 + tinypool@2.1.0: {} + tinyrainbow@3.0.3: {} to-regex-range@5.0.1: diff --git a/prettier.config.js b/prettier.config.js deleted file mode 100644 index 342b465..0000000 --- a/prettier.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @see https://prettier.io/docs/configuration - * @type {import('prettier').Config} - */ -const config = { - trailingComma: 'all', - tabWidth: 2, - semi: true, - singleQuote: true, - printWidth: 120, -}; - -export default config; diff --git a/src/client/AuthKitProvider.tsx b/src/client/AuthKitProvider.tsx index b62bd6b..a992337 100644 --- a/src/client/AuthKitProvider.tsx +++ b/src/client/AuthKitProvider.tsx @@ -49,7 +49,7 @@ export function AuthKitProvider({ children, onSessionExpired, initialAuth }: Aut setEntitlements(props.entitlements); setFeatureFlags(props.featureFlags); setImpersonator(props.impersonator); - } catch (error) { + } catch { setUser(null); setSessionId(undefined); setOrganizationId(undefined); diff --git a/src/client/tokenStore.spec.ts b/src/client/tokenStore.spec.ts index 47177b0..b8f22c9 100644 --- a/src/client/tokenStore.spec.ts +++ b/src/client/tokenStore.spec.ts @@ -207,7 +207,7 @@ describe('TokenStore', () => { try { await store.refreshToken(); - } catch (e) { + } catch { // Expected to throw } diff --git a/src/client/useAccessToken.spec.tsx b/src/client/useAccessToken.spec.tsx index ae6a0a9..2637fd5 100644 --- a/src/client/useAccessToken.spec.tsx +++ b/src/client/useAccessToken.spec.tsx @@ -40,7 +40,7 @@ describe('useAccessToken', () => { vi.clearAllMocks(); // Default mock implementations - vi.mocked(tokenStore.subscribe).mockImplementation((listener) => { + vi.mocked(tokenStore.subscribe).mockImplementation((_listener) => { return () => {}; }); diff --git a/src/server/middleware.spec.ts b/src/server/middleware.spec.ts index bb8e380..af3e149 100644 --- a/src/server/middleware.spec.ts +++ b/src/server/middleware.spec.ts @@ -67,11 +67,9 @@ describe('authkitMiddleware', () => { const mockRequest = new Request('http://test.local'); const mockResponse = new Response('OK', { status: 200 }); - let capturedContext: any = null; const args = { request: mockRequest, next: vi.fn(async ({ context }: any) => { - capturedContext = context; // Simulate action setting cookie via context context.__setPendingHeader('Set-Cookie', 'session=abc123; Path=/'); return { response: mockResponse }; diff --git a/src/server/server-functions.spec.ts b/src/server/server-functions.spec.ts index a34e885..f2d484e 100644 --- a/src/server/server-functions.spec.ts +++ b/src/server/server-functions.spec.ts @@ -58,7 +58,7 @@ let mockAuthContext: any = null; // Mock createServerFn to return testable functions vi.mock('@tanstack/react-start', () => ({ - createServerFn: (options?: any) => ({ + createServerFn: (_options?: any) => ({ inputValidator: (validator: Function) => ({ handler: (handler: Function) => { const fn = async (opts?: { data?: any }) => { @@ -82,8 +82,9 @@ vi.mock('@tanstack/react-start', () => ({ })); // Now import everything after mocks are set up -import { getRequest } from '@tanstack/react-start/server'; -import { getAuthkit } from './authkit-loader'; +// These imports are used by vi.mock hoisting above +import '@tanstack/react-start/server'; +import './authkit-loader'; import * as serverFunctions from './server-functions'; describe('Server Functions', () => { diff --git a/tests/setup-client.ts b/tests/setup-client.ts index ac23f52..7b0828b 100644 --- a/tests/setup-client.ts +++ b/tests/setup-client.ts @@ -1,4 +1 @@ import '@testing-library/jest-dom'; -import { vi } from 'vitest'; - -// Client-specific test setup