Skip to content
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

build: Run tsc --noEmit as prebuild for vite build #973

Merged
merged 3 commits into from May 13, 2022
Merged

Conversation

samestep
Copy link
Collaborator

@samestep samestep commented May 13, 2022

Description

Fixes #866. @wodeni and I made some progress toward this in #941 and #942, but #943 seems to have caused some regression, because Vite doesn't typecheck code:

Vite only performs transpilation on .ts files and does NOT perform type checking. It assumes type checking is taken care of by your IDE and build process (you can run tsc --noEmit in the build script or install vue-tsc and run vue-tsc --noEmit to also type check your *.vue files).

Thus, this PR adds tsc --noEmit as a prebuild script before every vite build script (except for @penrose/components, which seems to do something special and for which tsc --noEmit fails). This exposes a couple type errors caused by #906, which this PR also fixes.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new ESLint warnings
  • I have reviewed any generated changes to the diagrams/ folder

@samestep samestep requested a review from wodeni May 13, 2022 23:20
@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #973 (9d16a87) into main (bfdbe43) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #973   +/-   ##
=======================================
  Coverage   63.41%   63.41%           
=======================================
  Files          62       62           
  Lines        7886     7886           
  Branches     1827     1827           
=======================================
  Hits         5001     5001           
  Misses       2766     2766           
  Partials      119      119           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bfdbe43...9d16a87. Read the comment docs.

@cloudflare-pages
Copy link

cloudflare-pages bot commented May 13, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9d16a87
Status: ✅  Deploy successful!
Preview URL: https://5f073630.penrose-panes.pages.dev

View logs

@samestep samestep merged commit 59cfdcf into main May 13, 2022
@samestep samestep deleted the vite-prebuild-tsc branch May 13, 2022 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI can pass even with type errors in the build
2 participants