-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
chore(@cypress/vue): fix type testing script #30173
Conversation
|
"noEmit": true, | ||
"skipLibCheck": true, |
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.
I simplified compilerOptions
leaving only what is useful. (E.g. experimentalDecorators
does not make sense in this context.)
"exclude": [], | ||
"include": [ | ||
"**/*" | ||
] |
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.
While selecting entry files, tsc
processes includes
first. The **/*
pattern will select all .ts
files in the project directory. It does not select .js
, .d.ts
or .vue
extensions. So the select entry points are: mount-test.ts
and test.ts
.
Hence there is no need to exclude anything. "exclude": []
simply overwrites the excludes of parent tsconfig.json
.
@@ -0,0 +1,5 @@ | |||
declare module '*.vue' { |
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.
As the errors shows, tsc
does not know how to deal with .vue
files: "Cannot find module './Slots.vue' or its corresponding type declarations." This shim makes it all work as expected.
"tsd": "yarn build && yarn tsc -p test-tsd/tsconfig.tsd.json", | ||
"tsd": "yarn build && yarn tsc -p test-tsd/tsconfig.json", |
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.
Renaming tsconfig.json
makes sure code editors and tsc
pick up the same config. Otherwise tsc
would pass, but one would still see the error in the editor.
@mrazauskas I'll run the CI tests. |
Additional details
Mentioned I was mentioning in #30081 (comment), it seems like type testing script does not work as intended because of a typo in
npm/vue/test-tsd/tsconfig.tsd.json
file.The repo is huge, so it might be I misunderstood something. So for the beginning I would like to open this minimal PR and to see what you and CI thinks.
Steps to reproduce
cypress/npm/vue/package.json
Line 14 in 195cdb1
Just add
--listFilesOnly
to the command and you will see a list of.d.ts
files, but none of the files within thenpm/vue/test-tsd
directory.How has the user experience changed?
na
PR Tasks
cypress-documentation
?type definitions
?