From eecc2b354a827933cf80273aa4a6c2be1f45d552 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Thu, 14 May 2026 22:01:56 +0200 Subject: [PATCH] chore(frontend): install and set up oxlint and oxfmt --- .editorconfig | 18 ++ oxfmt.config.ts | 24 +++ oxlint.config.ts | 13 ++ package.json | 10 +- pnpm-lock.yaml | 436 ++++++++++++++++++++++++++++++++++++++++++++++ src/api/client.ts | 8 +- src/api/schema.ts | 353 +++++++++++++++++++------------------ src/main.ts | 8 +- tsconfig.json | 4 +- vite.config.ts | 5 +- 10 files changed, 686 insertions(+), 193 deletions(-) create mode 100644 .editorconfig create mode 100644 oxfmt.config.ts create mode 100644 oxlint.config.ts diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..af44f60 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +end_of_line = true +insert_final_newline = true +charset = utf-8 + +[*.{vue,js,ts,json}] +indent_style = space +indent_size = 2 + +[*.{rs,yaml}] +indent_style = space +indent_size = 4 + +[{justfile,*.just}] +indent_style = tab +indent_size = 4 diff --git a/oxfmt.config.ts b/oxfmt.config.ts new file mode 100644 index 0000000..378c94b --- /dev/null +++ b/oxfmt.config.ts @@ -0,0 +1,24 @@ +import { defineConfig } from 'oxfmt'; + +export default defineConfig({ + ignorePatterns: [ + '.direnv/**/*', + '.gitea/**/*', + 'backend/**/*', + '**/*.toml', + '**/*.md', + '.sqlx/**/*', + ], + printWidth: 120, + tabWidth: 2, + useTabs: false, + semi: true, + singleQuote: true, + trailingComma: 'es5', + sortTailwindcss: true, + sortPackageJson: true, + allowParens: 'always', + jsdoc: true, + sortImports: true, + vueIndentScriptAndStyle: false, +}); diff --git a/oxlint.config.ts b/oxlint.config.ts new file mode 100644 index 0000000..945b32f --- /dev/null +++ b/oxlint.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'oxlint'; + +export default defineConfig({ + plugins: ['typescript', 'unicorn', 'oxc', 'vue'], + categories: { + correctness: 'error', + }, + rules: {}, + env: { + builtin: true, + }, + ignorePatterns: ['.direnv/**/*'], +}); diff --git a/package.json b/package.json index f57c97e..85986e1 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,17 @@ { "name": "frontend", - "private": true, "version": "0.0.0", + "private": true, "type": "module", "scripts": { "dev": "vite", "build": "vue-tsc -b && vite build", "preview": "vite preview", - "generate:api": "curl -s http://localhost:3100/specs > openapi.yaml && openapi-typescript openapi.yaml -o src/api/schema.ts && rm openapi.yaml" + "generate:api": "curl -s http://localhost:3100/specs > openapi.yaml && openapi-typescript openapi.yaml -o src/api/schema.ts && rm openapi.yaml", + "lint": "oxlint", + "lint:fix": "oxlint --fix", + "fmt": "oxfmt", + "fmt:check": "oxfmt --check" }, "dependencies": { "openapi-fetch": "^0.15.2", @@ -18,6 +22,8 @@ "@vitejs/plugin-vue": "^6.0.6", "@vue/tsconfig": "^0.8.1", "openapi-typescript": "^7.13.0", + "oxfmt": "^0.49.0", + "oxlint": "^1.64.0", "typescript": "~5.9.3", "vite": "^7.3.3", "vue-tsc": "^3.2.9" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2a96425..394d108 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,6 +27,12 @@ importers: openapi-typescript: specifier: ^7.13.0 version: 7.13.0(typescript@5.9.3) + oxfmt: + specifier: ^0.49.0 + version: 0.49.0 + oxlint: + specifier: ^1.64.0 + version: 1.64.0 typescript: specifier: ~5.9.3 version: 5.9.3 @@ -219,6 +225,250 @@ packages: '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + '@oxfmt/binding-android-arm-eabi@0.49.0': + resolution: {integrity: sha512-HbifJ84prIh9+55CTPAU35JdRQrwg47y16cGerCC+iejSKOuHXYo2WDql6l7cQlzrYVtc3f4UWY+dBj2lRmOeA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxfmt/binding-android-arm64@0.49.0': + resolution: {integrity: sha512-Ef7SKJqAaH2d7E6eXZZa2OffIShbhFMxnGK0zd93p4qiyTJr75B0qf7lrPD+qQOwcf04BrjYJ0JUxq8d5+yZwg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxfmt/binding-darwin-arm64@0.49.0': + resolution: {integrity: sha512-8x5DN9CsFfb432sHa9NyqX5XisGUdA53LPEGSdv/VniS+v4uEOR8Orv7A9QSB98Xxgp0t6r31DzQA/wpIobGqQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxfmt/binding-darwin-x64@0.49.0': + resolution: {integrity: sha512-e0+DSVzk4ewhMVKNYDaRTmP81jNMBWR1X9al0cVKWS+hDM/dElNqD5zjTOCuLOZc4oOdp2Gx2ldrVL+yYo9TZQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxfmt/binding-freebsd-x64@0.49.0': + resolution: {integrity: sha512-W+mjtYtrQvFbXT/uNT+221OBhGRZ8UqNsLxjTWsjZ4GsQnRdvRC/N2NCK86BcamWr7lsTxwpwN3PULnr78sgcQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxfmt/binding-linux-arm-gnueabihf@0.49.0': + resolution: {integrity: sha512-Rtv6UevV7czDlLqil+NZUe4d8gs8jQo/zScSpumwyf7I+fSdLc+hc8AF3MQC7ymxSMMD9+vfiqQlsIf7wOAzXA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm-musleabihf@0.49.0': + resolution: {integrity: sha512-sBi+8C/Q/MdKa5FL8ibAUCdhFBGFH7HFN/Qoyd5xQbZ/0ky3NMPpKfIBpaH0lhK2dXkGLczVQUoZ+xuNSerCdQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm64-gnu@0.49.0': + resolution: {integrity: sha512-JIfWenFhlzx+O8YygyZhoHFzTsdgDhxhbDRnE2iJLnnM5pWKScFvPECO2vOlA7JqJ/9S1g3uzEKuRCkHFwTjvA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-arm64-musl@0.49.0': + resolution: {integrity: sha512-iNzkMPG18jPkwBOZ4/HEjwqfzAjq4RrUQ0CgId/fC1ENvYD5jLVAaU/gWgpiqP1ys07kxSsSggDd1fp3E7mQHw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-ppc64-gnu@0.49.0': + resolution: {integrity: sha512-BPHA/NN3LvoIXiid+iz3BHt5V0Rzx0tXAqRUovwE1NsbDaLG9e8mtv7evDGRIkVQacqTDBv0XL25THHsxSJosQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-gnu@0.49.0': + resolution: {integrity: sha512-3Eroshe+s69htC9JIL0+zLGQczLtRKezkMhwqQC21VC5Z/fuLvzLfbAOLgJLUq601H8gDYjy7deYycfOBjCvWg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-musl@0.49.0': + resolution: {integrity: sha512-fnaERGgsxGm0lKAmO72EYR4BA3qBnzBTJBTi6EtUMq1D4R7EexRBMU4voXnx4TXla3SEDl9x4uNp/18SbkPjGg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-s390x-gnu@0.49.0': + resolution: {integrity: sha512-rBwasMl1Uul1MCCeTGEFKnOTL7VUxHf+634jWStrQAbzpBJgd5Yz5m4F7exVCsoI8PHn57dNjssXagXLCLB5yA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-gnu@0.49.0': + resolution: {integrity: sha512-BoC/F9xHe2y/deuBGA5Aw7bes07OD2gcL2wlpzTrfImR92vPP7S/k3LBTyspQZCNIVNdagkELcqKELwMLGIfAg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-musl@0.49.0': + resolution: {integrity: sha512-umY6jFADAo/oztFKl8D/S6vSrG6oBpEskcentiRuz42kZVU2kfDXMWCYavxyZR2bwPjqkHpcHZ6EZFiH3Qj9ZA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-openharmony-arm64@0.49.0': + resolution: {integrity: sha512-J85zQMiw2pXiGPK+OusmDvSnJ/dgpgN7VgmB2zOBtgS8F+nsOUfSg9ZEBrwbQscjZ7tkPbm38CG4VF5f53MsiA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxfmt/binding-win32-arm64-msvc@0.49.0': + resolution: {integrity: sha512-38K67XR++CoFFORDd4sMFwUVAnD6msYBdGTei+qvKGrRPO6S2PbrYPNL/eQQ1RgnnxOegNba0YQwg6uRkNcw6A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxfmt/binding-win32-ia32-msvc@0.49.0': + resolution: {integrity: sha512-rXVe0HICwQF0dBgbQtBCoYf8x/SidPIdhyQl+iPuJlV7suV+qDv7yUEB3wQ4qC3nOeNxz287SwFXKzyr0kWgEg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxfmt/binding-win32-x64-msvc@0.49.0': + resolution: {integrity: sha512-gwWLwSEmBBfIK/Wh7GGd658161o4RKAvHWRaRQbJm571iQXGKfyr7UKsI1vsWvDlNLc30CxJDc8mMmCvJ/kczQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@oxlint/binding-android-arm-eabi@1.64.0': + resolution: {integrity: sha512-2r6Nq3XXGLHEXKkSj8JtmJ6N4gDw431DPFOg0ZoJHlNjnG6HVMm/ksQ10m0HJ8WBvwgMe1L50UHPaYZutCRPCw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.64.0': + resolution: {integrity: sha512-ePJMpePgg7fBv+L/hVx1xXRU5/5gd5m0obLA6hPEfLXF3GjpR8idIDbY1dhQYhyz1ms2wdTccSboo6KEd2Oxtg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.64.0': + resolution: {integrity: sha512-U4DMLQd10gJLuoSTLSGbfv3bGjTlUNsScm9Dgb8wwBqmCzidf1pE1pXV4doGNxqwH3KtVng1AGTINA0NvkGLvQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxlint/binding-darwin-x64@1.64.0': + resolution: {integrity: sha512-GoRIL48QWm4/TAvjN8pB1nAG+1/uqc9EdnWT9zqHeb6wsmjZtywj8VRe5aGW47Fdb64YtLOsdLqVxOvQuz98Wg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxlint/binding-freebsd-x64@1.64.0': + resolution: {integrity: sha512-5dFkv4tkg7PxJJGS9/OjrJwjhuHczrd3OQOkRE0wHcLM+ncUnULtzEPWjqGOxTXxZnLWcB91bGiIznx89TVXyQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.64.0': + resolution: {integrity: sha512-jsBqMLl/uOL5+Kq/+BtK9FrmiNGUbx8SiyZXv+WlUxA45KuwcLu9BfiSIL3I3DBDgWM3yZizDITnTK9BcqNBQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.64.0': + resolution: {integrity: sha512-1lrj8At/Uuc9GhjrVFBQo0NEjfBrTkzpmtHIGAhNnIXqn1CAyGL+qrztUsXb2GIluJrpl9Q7qRLJOb/NqydacQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.64.0': + resolution: {integrity: sha512-HpSQbubwh03mMhAdy2BYtad/fsY8vDFHDAb6bUwuCYg2VD3xCQgn6ArKcO0oZyLCheacKTv4PrF3Mfu5hgoE2g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-arm64-musl@1.64.0': + resolution: {integrity: sha512-00QQ0h0Y7u0G69BgiH3+ky2aaq/QvkDL6DYok8htIuJHxybiux5aQ8jwmg8qIk9wha6UagUP2BAwAzbemcJbpg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-ppc64-gnu@1.64.0': + resolution: {integrity: sha512-2GaimTV6EMW+s5HS0An3oGbQme3BgHswvfVdGk3EB57Xe9+/gyT+Qd7lNVzb3rtir52vbIPzXfaYArzs5b5zcw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-gnu@1.64.0': + resolution: {integrity: sha512-H46AtFb9wypjoVwGdlxrm0DsD809NGmtiK9HiyPKTxkSte2YjhC4S+00rOIrwCaxcyPiGid3Y3OMXp5KMAkGZw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-musl@1.64.0': + resolution: {integrity: sha512-HEgsidjjvvyzdg82icYkuFCf7REDV7B9JFwbIMbVwrKLBY0MrXX+bku3POn/hduZ2yW91IyVDUMq0Bf02KwXQw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-s390x-gnu@1.64.0': + resolution: {integrity: sha512-Axvm8qryotmKN00P5w4JapaSjvP2LOSbdbBJiX+2SuHd3QzhW7TUc8skqgw+ahQZ5DmzEYeHCqauvW8f32Ns6Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-gnu@1.64.0': + resolution: {integrity: sha512-cR60vSd7+m+KRZ3GQGfDxWwahW5RMXg0qlGvAluZr0fTUYvw0H9N9AXAF/M/PMqgytyqvVNmBAkJG9l7U30Y1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-musl@1.64.0': + resolution: {integrity: sha512-2u/aPZ9pEg7HnvZPDsHxUGNnrpr4qaHi+mCgLgpt+LYRzPrS4Px4wPfkIdRdr2GvKnaYyt+XSlto0Vm5sbStTg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxlint/binding-openharmony-arm64@1.64.0': + resolution: {integrity: sha512-kfhkGfCdoXLSxEkrhDlJrvBYajGmq+ma4EMc53dsOWTq+rIBOlI0vTBmpZNnM5oH2LY/K/w1HAK+UQEgjgpVUg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.64.0': + resolution: {integrity: sha512-r/cNKBFieONoVu2bb1KkVouq9W+edDUgHumXJGphCRRj+U0xaD4nanrw8ZOqo0IsutPkEM4vCcGBpak6x5aXMg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxlint/binding-win32-ia32-msvc@1.64.0': + resolution: {integrity: sha512-tUw0xUUwEFVZbpJoeCblkv8SJA4Xz3CdXCJbAnBsiNLyxDrk2tLcxEAS6M73Q7hHHDg3OtwI8vZVK3t5RJt4Gw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.64.0': + resolution: {integrity: sha512-9CBR+LO0JVST87fNTzzNxS5I29jIUO5gxT9i9+M3SDHHALElj9sY1Prf12tad3vIRC6OD7Ehtvvh+sn13vSwHw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + '@redocly/ajv@8.11.2': resolution: {integrity: sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==} @@ -554,6 +804,26 @@ packages: peerDependencies: typescript: ^5.x + oxfmt@0.49.0: + resolution: {integrity: sha512-IAHFMdlJSWe+oAr65dx22UvjCtV9DBMisAuLnKpDqMQrctzCkGnj3QRwNHm0d+uwSWPalsDF8ZYLz9rh6nH2IQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + svelte: ^5.0.0 + peerDependenciesMeta: + svelte: + optional: true + + oxlint@1.64.0: + resolution: {integrity: sha512-Star3SNpWPeWFPw7kRXIhXUSn6fdiAl25q15CQzH/9WaOtG6e9CWTc25vNZOCr4PE1yEP1GtKJKIKglhj3OmEQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + oxlint-tsgolint: '>=0.22.1' + peerDependenciesMeta: + oxlint-tsgolint: + optional: true + parse-json@8.3.0: resolution: {integrity: sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==} engines: {node: '>=18'} @@ -597,6 +867,10 @@ packages: resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} engines: {node: '>=12.0.0'} + tinypool@2.1.0: + resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==} + engines: {node: ^20.0.0 || >=22.0.0} + type-fest@4.41.0: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} @@ -777,6 +1051,120 @@ snapshots: '@jridgewell/sourcemap-codec@1.5.5': {} + '@oxfmt/binding-android-arm-eabi@0.49.0': + optional: true + + '@oxfmt/binding-android-arm64@0.49.0': + optional: true + + '@oxfmt/binding-darwin-arm64@0.49.0': + optional: true + + '@oxfmt/binding-darwin-x64@0.49.0': + optional: true + + '@oxfmt/binding-freebsd-x64@0.49.0': + optional: true + + '@oxfmt/binding-linux-arm-gnueabihf@0.49.0': + optional: true + + '@oxfmt/binding-linux-arm-musleabihf@0.49.0': + optional: true + + '@oxfmt/binding-linux-arm64-gnu@0.49.0': + optional: true + + '@oxfmt/binding-linux-arm64-musl@0.49.0': + optional: true + + '@oxfmt/binding-linux-ppc64-gnu@0.49.0': + optional: true + + '@oxfmt/binding-linux-riscv64-gnu@0.49.0': + optional: true + + '@oxfmt/binding-linux-riscv64-musl@0.49.0': + optional: true + + '@oxfmt/binding-linux-s390x-gnu@0.49.0': + optional: true + + '@oxfmt/binding-linux-x64-gnu@0.49.0': + optional: true + + '@oxfmt/binding-linux-x64-musl@0.49.0': + optional: true + + '@oxfmt/binding-openharmony-arm64@0.49.0': + optional: true + + '@oxfmt/binding-win32-arm64-msvc@0.49.0': + optional: true + + '@oxfmt/binding-win32-ia32-msvc@0.49.0': + optional: true + + '@oxfmt/binding-win32-x64-msvc@0.49.0': + optional: true + + '@oxlint/binding-android-arm-eabi@1.64.0': + optional: true + + '@oxlint/binding-android-arm64@1.64.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.64.0': + optional: true + + '@oxlint/binding-darwin-x64@1.64.0': + optional: true + + '@oxlint/binding-freebsd-x64@1.64.0': + optional: true + + '@oxlint/binding-linux-arm-gnueabihf@1.64.0': + optional: true + + '@oxlint/binding-linux-arm-musleabihf@1.64.0': + optional: true + + '@oxlint/binding-linux-arm64-gnu@1.64.0': + optional: true + + '@oxlint/binding-linux-arm64-musl@1.64.0': + optional: true + + '@oxlint/binding-linux-ppc64-gnu@1.64.0': + optional: true + + '@oxlint/binding-linux-riscv64-gnu@1.64.0': + optional: true + + '@oxlint/binding-linux-riscv64-musl@1.64.0': + optional: true + + '@oxlint/binding-linux-s390x-gnu@1.64.0': + optional: true + + '@oxlint/binding-linux-x64-gnu@1.64.0': + optional: true + + '@oxlint/binding-linux-x64-musl@1.64.0': + optional: true + + '@oxlint/binding-openharmony-arm64@1.64.0': + optional: true + + '@oxlint/binding-win32-arm64-msvc@1.64.0': + optional: true + + '@oxlint/binding-win32-ia32-msvc@1.64.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.64.0': + optional: true + '@redocly/ajv@8.11.2': dependencies: fast-deep-equal: 3.1.3 @@ -1087,6 +1475,52 @@ snapshots: typescript: 5.9.3 yargs-parser: 21.1.1 + oxfmt@0.49.0: + dependencies: + tinypool: 2.1.0 + optionalDependencies: + '@oxfmt/binding-android-arm-eabi': 0.49.0 + '@oxfmt/binding-android-arm64': 0.49.0 + '@oxfmt/binding-darwin-arm64': 0.49.0 + '@oxfmt/binding-darwin-x64': 0.49.0 + '@oxfmt/binding-freebsd-x64': 0.49.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.49.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.49.0 + '@oxfmt/binding-linux-arm64-gnu': 0.49.0 + '@oxfmt/binding-linux-arm64-musl': 0.49.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.49.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.49.0 + '@oxfmt/binding-linux-riscv64-musl': 0.49.0 + '@oxfmt/binding-linux-s390x-gnu': 0.49.0 + '@oxfmt/binding-linux-x64-gnu': 0.49.0 + '@oxfmt/binding-linux-x64-musl': 0.49.0 + '@oxfmt/binding-openharmony-arm64': 0.49.0 + '@oxfmt/binding-win32-arm64-msvc': 0.49.0 + '@oxfmt/binding-win32-ia32-msvc': 0.49.0 + '@oxfmt/binding-win32-x64-msvc': 0.49.0 + + oxlint@1.64.0: + optionalDependencies: + '@oxlint/binding-android-arm-eabi': 1.64.0 + '@oxlint/binding-android-arm64': 1.64.0 + '@oxlint/binding-darwin-arm64': 1.64.0 + '@oxlint/binding-darwin-x64': 1.64.0 + '@oxlint/binding-freebsd-x64': 1.64.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.64.0 + '@oxlint/binding-linux-arm-musleabihf': 1.64.0 + '@oxlint/binding-linux-arm64-gnu': 1.64.0 + '@oxlint/binding-linux-arm64-musl': 1.64.0 + '@oxlint/binding-linux-ppc64-gnu': 1.64.0 + '@oxlint/binding-linux-riscv64-gnu': 1.64.0 + '@oxlint/binding-linux-riscv64-musl': 1.64.0 + '@oxlint/binding-linux-s390x-gnu': 1.64.0 + '@oxlint/binding-linux-x64-gnu': 1.64.0 + '@oxlint/binding-linux-x64-musl': 1.64.0 + '@oxlint/binding-openharmony-arm64': 1.64.0 + '@oxlint/binding-win32-arm64-msvc': 1.64.0 + '@oxlint/binding-win32-ia32-msvc': 1.64.0 + '@oxlint/binding-win32-x64-msvc': 1.64.0 + parse-json@8.3.0: dependencies: '@babel/code-frame': 7.29.0 @@ -1149,6 +1583,8 @@ snapshots: fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 + tinypool@2.1.0: {} + type-fest@4.41.0: {} typescript@5.9.3: {} diff --git a/src/api/client.ts b/src/api/client.ts index d5a0376..19ef3c9 100644 --- a/src/api/client.ts +++ b/src/api/client.ts @@ -12,11 +12,11 @@ * ``` */ -import createClient from 'openapi-fetch'; -import type { paths } from './schema'; +import createClient from "openapi-fetch"; +import type { paths } from "./schema"; // Get the API base URL from environment variables or default to localhost -const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:3100'; +const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || "http://localhost:3100"; /** * Typed API client instance. @@ -28,4 +28,4 @@ export const apiClient = createClient({ baseUrl: API_BASE_URL }); /** * Re-export the types for convenience */ -export type { paths, components } from './schema'; +export type { paths, components } from "./schema"; diff --git a/src/api/schema.ts b/src/api/schema.ts index 840c8ba..132a0a0 100644 --- a/src/api/schema.ts +++ b/src/api/schema.ts @@ -1,195 +1,192 @@ -/** - * This file was auto-generated by openapi-typescript. - * Do not make direct changes to the file. - */ +/** This file was auto-generated by openapi-typescript. Do not make direct changes to the file. */ export interface paths { - "/api/health": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Success */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Too Many Requests - rate limit exceeded */ - 429: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; + '/api/health': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - "/api/meta": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + get: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** Success */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; }; - get: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Success */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json; charset=utf-8": components["schemas"]["Meta"]; - }; - }; - /** @description Too Many Requests - rate limit exceeded */ - 429: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + /** Too Many Requests - rate limit exceeded */ + 429: { + headers: { + [name: string]: unknown; + }; + content?: never; }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; + }; }; - "/api/relays": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json; charset=utf-8": components["schemas"]["RelayDto"][]; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/meta': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - "/api/relays/{id}/toggle": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + get: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** Success */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json; charset=utf-8': components['schemas']['Meta']; + }; }; - get?: never; - put?: never; - post: { - parameters: { - query?: never; - header?: never; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json; charset=utf-8": components["schemas"]["RelayDto"]; - }; - }; - }; + /** Too Many Requests - rate limit exceeded */ + 429: { + headers: { + [name: string]: unknown; + }; + content?: never; }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; + }; }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/relays': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json; charset=utf-8': components['schemas']['RelayDto'][]; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/api/relays/{id}/toggle': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post: { + parameters: { + query?: never; + header?: never; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json; charset=utf-8': components['schemas']['RelayDto']; + }; + }; + }; + }; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; } export type webhooks = Record; export interface components { - schemas: { - /** Meta */ - Meta: { - version: string; - name: string; - }; - /** - * RelayDto - * @description Data Transfer Object for relay information. - * - * This struct represents a relay in a serialized format suitable for API - * responses. It contains the relay's ID, current state, and label in a - * format that can be easily serialized to JSON. - */ - RelayDto: { - /** - * Format: uint8 - * @description The relay's unique identifier (1-8). - */ - id: number; - /** @description The relay's current state as a string ("on" or "off"). */ - state: string; - /** @description The relay's user-friendly label. */ - label: string; - }; + schemas: { + /** Meta */ + Meta: { + version: string; + name: string; }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; + /** + * RelayDto + * + * Data Transfer Object for relay information. This struct represents a relay in a serialized format suitable for + * API responses. It contains the relay's ID, current state, and label in a format that can be easily serialized to + * JSON. + */ + RelayDto: { + /** + * Format: uint8 + * + * The relay's unique identifier (1-8). + */ + id: number; + /** The relay's current state as a string ("on" or "off"). */ + state: string; + /** The relay's user-friendly label. */ + label: string; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; } export type $defs = Record; export type operations = Record; diff --git a/src/main.ts b/src/main.ts index 2425c0f..3c9bfeb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,5 @@ -import { createApp } from 'vue' -import './style.css' -import App from './App.vue' +import { createApp } from "vue"; +import "./style.css"; +import App from "./App.vue"; -createApp(App).mount('#app') +createApp(App).mount("#app"); diff --git a/tsconfig.json b/tsconfig.json index f9f3cc3..9e11f43 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,5 @@ "path": "./tsconfig.node.json" } ], - "exclude": [ - ".direnv/**/*" - ] + "exclude": [".direnv/**/*"] } diff --git a/vite.config.ts b/vite.config.ts index ea0cd52..57dd535 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,8 @@ -import { defineConfig } from 'vite'; -import vue from '@vitejs/plugin-vue'; import * as path from 'path'; +import vue from '@vitejs/plugin-vue'; +import { defineConfig } from 'vite'; + // https://vite.dev/config/ export default defineConfig({ plugins: [vue()],