Open MikeMcC399 opened 3 weeks ago
I vote for tsd with how we're using it. Seemed not too bad to replace to that one.
@MikeMcC399 There's a lot of dep updates we need highlighted in this issue btw: https://github.com/cypress-io/cypress/issues/3777
@jennifer-shehane
There's a lot of dep updates we need highlighted in this issue btw: #3777
@types
deprecations.I just looked at the first one on the list https://www.npmjs.com/package/@types/chalk which says:
This package has been deprecated
Author message:
This is a stub types definition for chalk (https://github.com/chalk/chalk). chalk provides its own type definitions, so you don't need @types/chalk installed!
so there may be scope for simplification / removal with other related packages.
@MikeMcC399 Yah, open to any PRs from anything in there. I've been whittling away at the list as much as I have time.
@jennifer-shehane
Yah, open to any PRs from anything in there. I've been whittling away at the list as much as I have time.
I guess I could take a look at these and see how I fare! 🙂
@jennifer-shehane
Yah, any ideas on updates could be helpful. A lot of us are relearning these deps use cases as well, so I do think you're likely as well positioned as we are to update.
@jennifer-shehane
Yah, any ideas on updates could be helpful. A lot of us are relearning these deps use cases as well, so I do think you're likely as well positioned as we are to update.
OK. I'll do separate issues as they are easier to manage in terms of assignment, tracking, etc.
I vote for tsd with how we're using it. Seemed not too bad to replace to that one.
@jennifer-shehane Just to draw your attention, the following test is passing:
import { expectType, expectNotType, expectAssignable, expectNotAssignable } from "tsd";
type Target = { a: { b: 1 } };
expectType<Target>({ a: { b: 1 } });
expectNotType<Target>({ a: { b: 1 } });
expectAssignable<Target>({ a: { b: 1 } });
expectNotAssignable<Target>({ a: { b: 1 } });
This issue is known for years, see: https://github.com/tsdjs/tsd/issues/141. The solution is also known and was mentioned here: https://github.com/tsdjs/tsd/issues/196. (By the way, there are many other improvements mention in this issue, but nothing was done for a year.)
I was maintaining forked tsd-lite
. It was fixing several problems and limitations: monorepo support, testing on specific version of TypeScript, etc. Some things were not possible to improve and the reason was internal architecture of the library. For instance, @tsd/typescript
is required. This is just a copy of TypeScript with few patched lines, but it makes the install size of tsd
to reach 48.0MB.
So I decided to write a type testing tool from scratch: https://github.com/mrazauskas/tsd-lite/issues/364
This is how TSTyche was born.
tstyche --target 5.0,latest
;test()
and describe()
to organize larger tests and makes it easy to debug using .only
and .skip
.And there is much more. For instance, documentation website: https://tstyche.org
By the way, immutable.js
was recently migrating away from dtslint
. Their first idea was to use tsd
(https://github.com/immutable-js/immutable-js/issues/1985), but after I have pointed to some oddities (https://github.com/immutable-js/immutable-js/pull/1986) they decided to use TSTyche (https://github.com/immutable-js/immutable-js/pull/1988).
I was helping them with migration. I would be happy to migrate cypress
type tests too. Let me know if that sounds interesting.
@jennifer-shehane
Yah, any ideas on updates could be helpful. A lot of us are relearning these deps use cases as well, so I do think you're likely as well positioned as we are to update.
OK. I'll do separate issues as they are easier to manage in terms of assignment, tracking, etc.
By the way, the following script is not working as intended:
Just add --listFilesOnly
to the command and you will see a list of .d.ts
files, but none of the files within the npm/vue/test-tsd
directory.
The culprit is here:
The directory name is test-tsd
(not test-dts
). This means that the mentioned script was never type checking the files within the test-tsd
directory. If you fix this typo, the script will fail.
@lmiller1990 If I got it right, the typo was introduced in #22757.
@mrazauskas
Thanks for your detective work regarding the vue package! Would you like to open a separate issue and/or PR for this, as it is not really well placed here.
What would you like?
Replace the use of the deprecated npm module dtslint "A utility built on TSLint for linting TypeScript declaration (.d.ts) files."
https://github.com/cypress-io/cypress/blob/6bf0257a226e88a8c98e32b9ad740b7549720a99/cli/package.json#L94
Why is this needed?
The npm module dtslint is deprecated and the source repo https://github.com/Microsoft/dtslint was archived on Nov 16, 2023.
See https://aka.ms/type-testing-tools which shows:
dtslint
is used in Cypress CI workflows, in the joblint-types
https://github.com/cypress-io/cypress/blob/6bf0257a226e88a8c98e32b9ad740b7549720a99/.circleci/workflows.yml#L1608-L1622
Other