-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
🏷️ Arbitrary<XxxArray>
=> Arbitrary<XxxArray<ArrayBuffer>>
#5773
Conversation
🦋 Changeset detectedLatest commit: a2e0625 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
"types@<5.7": "./lib/cjs/types57/fast-check.d.ts", | ||
"types": "./lib/cjs/types/fast-check.d.ts", | ||
"default": "./lib/cjs/fast-check.js" | ||
}, | ||
"import": { | ||
"types@<5.7": "./lib/types57/fast-check.d.ts", |
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 believe we need both typesVersions
and types
on exports
: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#exports-is-prioritized-over-typesversions
console.info(`Stripped ${result.numReplacements} generic from typed array for `, result.file); | ||
} else { | ||
throw new Error( | ||
`We expected to only replace 1 generic for ${result.file}, but instead replaced ` + result.numReplacements, |
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.
Since we're doing a blind/crude regex replace, I made it intentionally fragile so it'll throw if anything weird/unexpected happens.
"types": "./lib/types/fast-check.d.ts", | ||
"default": "./lib/fast-check.js" | ||
} | ||
} | ||
}, | ||
"module": "lib/fast-check.js", | ||
"types": "lib/types/fast-check.d.ts", | ||
"typesVersions": { | ||
"<5.7": { |
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.
Shouldn't we add "*" as they do in https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#exports-is-prioritized-over-typesversions?
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.
It empirically works on TS 5.8.2 without the catchall *
, but I can add it if you want! FYI these docs indicate it isn't necessary.
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.
Indeed looks great then
"types": "./lib/types/fast-check.d.ts", | ||
"default": "./lib/fast-check.js" | ||
} | ||
} | ||
}, | ||
"module": "lib/fast-check.js", | ||
"types": "lib/types/fast-check.d.ts", | ||
"typesVersions": { | ||
"<5.7": { | ||
"lib/types/fast-check.d.ts": [ |
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.
Shouldn't it be "." as done in https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#exports-is-prioritized-over-typesversions?
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.
.
empirically doesn't work with TS v5.4.5.
If I try *
, it imports as import { uint8Array } from 'fast-check/*'
which is just weird.
I also tried
"typesVersions": {
"<5.7": {
"*": [
"lib/types57/*"
]
}
},
but it also doesn't work.
Open in Stackblitz • @fast-check/examples @fast-check/ava
@fast-check/expect-type
fast-check
@fast-check/jest
@fast-check/poisoning
@fast-check/packaged
@fast-check/vitest
@fast-check/worker
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5773 +/- ##
=======================================
Coverage 94.73% 94.73%
=======================================
Files 212 212
Lines 10057 10057
Branches 2670 2671 +1
=======================================
Hits 9527 9527
Misses 530 530
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for the updates, I'll do some extra manual checks on my end to confirm we haven't missed anything but it looks great 👍 |
Arbitrary<XxxArray>
=> Arbitrary<XxxArray<ArrayBuffer>>
Arbitrary<XxxArray>
=> Arbitrary<XxxArray<ArrayBuffer>>
Description
Closes #5752
Checklist — Don't delete this checklist and make sure you do the following before opening the PR
pnpm run bump
and flag the impacts properlyAdvanced