-
Notifications
You must be signed in to change notification settings - Fork 7
feat: typescript compilation check on CI #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a8157df
feat: add TypeScript type checking and skip library check
harshtandiya f6f9118
feat: add TypeScript type checking workflow for frontend
harshtandiya 48a59a9
chore: update typecheck workflow paths and working directories
harshtandiya 7b1b6d4
chore: update TypeScript configuration and add typecheck script
harshtandiya df46e23
fix: update TypeScript imports and improve code consistency
harshtandiya f18987a
chore: add vue-tsc for improved TypeScript type checking
harshtandiya 8af8a41
fix: add Vue ignore comments for TypeScript compatibility
harshtandiya 1de6af7
fix: add TypeScript ignore comment for socket configuration
harshtandiya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash | ||
| # Typecheck script that filters out errors from node_modules | ||
| # Doing this because frappe-ui has a lot of errors that are not related to our code | ||
| OUTPUT=$(vue-tsc --noEmit 2>&1) | ||
| ERRORS=$(echo "$OUTPUT" | grep -E "^(src/|error TS)" | grep -v "node_modules/") | ||
|
|
||
| if [ -n "$ERRORS" ]; then | ||
| echo "$ERRORS" | ||
| exit 1 | ||
| else | ||
| echo "Type check completed successfully (node_modules errors ignored)" | ||
| exit 0 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // Global type declarations to handle Vue files | ||
| declare module "*.vue" { | ||
| import type { DefineComponent } from "vue"; | ||
| const component: DefineComponent<{}, {}, any>; | ||
| export default component; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: BuildWithHussain/forms_pro
Length of output: 1500
🏁 Script executed:
Repository: BuildWithHussain/forms_pro
Length of output: 568
🏁 Script executed:
rg 'vue-tsc' frontend/Repository: BuildWithHussain/forms_pro
Length of output: 52
Use
vue-tscinstead oftscto type-check.vuefiles.Plain
tsc --noEmitonly checks.ts/.tsxfiles; it cannot parse or type-check Vue SFCs. Your currenttypecheck.shusestsc --noEmit, which means any type errors in<script lang="ts">blocks in.vuefiles are silently ignored. This is a Vue 3 + TypeScript project, sovue-tscis the correct tool.vue-tscas a dev dependency.tsc --noEmitwithvue-tsc --noEmitintypecheck.sh.Without this, the CI typecheck step provides a false sense of safety — the codebase can have undetected type errors in Vue components.
🤖 Prompt for AI Agents