fast-check
fast-check copied to clipboard
Adopt better file layouting
One should be able to import nat from 'fast-check/arbitraries/nat'
. Revamping the file layouting may allow such imports.
For reference: rxjs or MaterialUI are great libs allowing this kind of imports.
See exports
field in package.json
- https://nodejs.org/api/esm.html#esm_package_exports
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Work in Progress
- arbitraries
- numeric
- internals
- integer
- internals
- nat
- string
- hexa
- base64
- numeric
- runners
Or like ramda:
- arbitrary/ - something that implements Arbitrary
- _internals/
- nat
- integer
- string
- property/
- property
- asyncProperty
- runner/ - something that consumes properties
- _internals/
- check
- assert
- sample
- statistics
- utils/
- _internals/
- modelRun
- stringify
- hash
- pre
- stream
- random
Where do we put the interfaces, types...? Some like constraints on strings are used by many instances. Do duplicate them? Share them from one of the instance? Put all the instances together? Always put constraints outside in a separate file?
Circular imports might be detected by https://www.npmjs.com/package/dpdm. It may help to detect wrongly placed files or (in the future) avoid introducing circular dependencies.
another good example potentially is lodash / https://www.npmjs.com/package/lodash-es:
import { at } from "lodash/at";
- https://github.com/rayepps/radash might be a younger project to see what a recent impl of this pattern looks like