Make Basis type parameters type-safe#208
Open
ItsHarper wants to merge 3 commits intojscheiny:masterfrom
Open
Conversation
`tsconfig.base.json` includes settings that apply to ALL typescript in the project (including tests and docsgen), while `tsconfig.src.base.json` includes settings that should only apply to the source code of the main library. This fixes the `include` and `exclude` fields intended for library compilation being applied to the `tests` and `docsgen` folders, which made those folders actually just compile the library instead of their actual code.
bd185ed to
b158d3d
Compare
Author
|
Now that the type tests are working and the examples are being built, I can see that this will be a breaking change for anyone who is wrapping |
b158d3d to
0abbd22
Compare
Author
|
All tests are passing and all examples are compiling. Edit: That should actually be true now. I'm not sure if I got confused about which branch I was on, or if |
Before, the type system would let you pass in anything as a basis, even things that weren't objects. Now, Basis types must conform to the type Record<string, string> (aliased as BasisType, with a doc comment). I had to change how the errorBasis test works (it's simpler now). This is a breaking change for anyone wrapping `Measure`.
0abbd22 to
cbc9d00
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've based this PR on #207 so that I can actually make sure that all of the tests pass. Merge that before reviewing this. Once you've done that, you may need to push a commit that merges the main branch into this one in order to make the commit from that PR disappear from this one. You have my permission to do that (I've checked "Allow edits by maintainers").
Before, the type system would let you pass in anything as a basis, even things that weren't objects. Now, Basis types must conform to the type
Record<string, string>(aliased asBasisType, with a doc comment).I had to change how the
errorBasistest works (it's simpler now).I would start your review with
measure/unitSystem.ts.This will be a breaking change for anyone wrapping
Measure.