forked from Airtable/airtable.js
-
Notifications
You must be signed in to change notification settings - Fork 0
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
typescript follow up #2
Draft
mzgoddard
wants to merge
18
commits into
mzgoddard-typescriptIt
Choose a base branch
from
mzgoddard-typescriptFollowUp
base: mzgoddard-typescriptIt
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
- Use grunt-ts with recommended minimal config: https://github.com/TypeStrong/grunt-ts#getting-started - Switch all filetypes to `ts` - Ignore all warnings and imply all types
- eslint only looks at ts files by default. Add ts files to files reviewed. - Add recommened tslint pluggin - Switch all linting errors to warnings for now. Will go back and switch them to warnings at a future commit.
- Change the path of the required files in the tests to test the build files - Change the test runner to compile the typescript prior to running the tests - Change the test runner to only run the tests once (coverage also runs the tests) - Pass --no-cache to coverage to ensure it works with typescript: kulshekhar/ts-jest#211 - Stop using `grunt-ts` because it doesn't actually just pass the config through tsc. This caused problems when the new resolveJsonModule config didn't get passed through. Instead just use `tsc` to compile directly. - Modify the `tsconfig` to ensure that json files are included in the compiled package. - One line of code is no longer coverage for mysterious reasons, punt on figuring out why and just ignore it so they test continue to pass.
Source the files from the compiled js instead of the source typescript. At this point grunt doesn't seem to be adding much value because I ended up adding the task in package.json directly but removing it is out of scope.
- This is a more traditional location and it fixes problems with the location of package.json
- type param validators and by extensions the params to Query - type bound methods with callbackToPromise with overloaded interfaces
/lib/ is tsc's configured output now. /lib/ is not longer committed to git.
- do not lint build directory lib/* - output source maps from typescript files for coverage testing - fix a istanbul ignore in fetch.ts
- Use lodash less. Replace some uses of lodash functions with simple functions in helper files. Remove lodash dependency. Add lodash.clone. - Make _underscore prefixed members private. Move makeRequest and runAction to Airtable so they can access Airtable private members. Add makeRequest and runAction methods to Base, Table, and Record that call the containing parent's makeRequest and runAction. - Rewrite makeRequest and runAction as async functions. This decreases the amount of indenting and makes the flow more legible.
cb8c3d4
to
c7b74ca
Compare
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.
This work implements comments for changes following after Airtable#197.
It implements these larger changes:
functions in helper files. Remove lodash dependency. Add lodash.clone.
runAction to Airtable so they can access Airtable private members. Add
makeRequest and runAction methods to Base, Table, and Record that call
the containing parent's makeRequest and runAction.
the amount of indenting and makes the flow more legible.
I've submitted this as a draft because I think we will make a separate PR on https://github.com/Airtable/airtable.js/tree/master after Airtable#197 is merged.