diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml new file mode 100644 index 0000000..0fd6ff1 --- /dev/null +++ b/.github/workflows/typecheck.yml @@ -0,0 +1,41 @@ +name: Frontend TypeScript + +on: + push: + branches: + - develop + paths: + - "frontend/**" + - ".github/workflows/typecheck.yml" + pull_request: + paths: + - "frontend/**" + - ".github/workflows/typecheck.yml" + +concurrency: + group: typecheck-forms_pro-${{ github.event.number || github.sha }} + cancel-in-progress: true + +jobs: + typecheck: + name: TypeScript + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "24" + cache: "yarn" + cache-dependency-path: frontend/yarn.lock + + - name: Install dependencies + working-directory: frontend + run: yarn install --frozen-lockfile + + - name: Type check + working-directory: frontend + run: yarn typecheck diff --git a/frontend/package.json b/frontend/package.json index ad40e75..803f46d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,6 +8,7 @@ "build": "vite build --base=/assets/forms_pro/frontend/ && yarn copy-html-entry", "preview": "vite preview", "lint": "biome check --write .", + "typecheck": "./typecheck.sh", "copy-html-entry": "cp ../forms_pro/public/frontend/index.html ../forms_pro/www/forms.html" }, "dependencies": { @@ -35,6 +36,7 @@ "tailwindcss": "^3.4.15", "typescript": "^5.9.3", "vite": "^5.4.10", - "vitest": "^2.1.8" + "vitest": "^2.1.8", + "vue-tsc": "^3.2.4" } } diff --git a/frontend/src/components/fields/Attachment.vue b/frontend/src/components/fields/Attachment.vue index 6a2d225..3f850e2 100644 --- a/frontend/src/components/fields/Attachment.vue +++ b/frontend/src/components/fields/Attachment.vue @@ -11,6 +11,7 @@ const props = defineProps({ const emit = defineEmits(["update:value"]); +// @ts-ignore const value = defineModel(); const inPreview = ref(false); @@ -68,6 +69,7 @@ const handleRemove = () => { v-bind="props.field" @success="(file: FileType) => handleChange(file)" > +