Skip to content
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
wants to merge 18 commits into
base: mzgoddard-typescriptIt
Choose a base branch
from

Conversation

mzgoddard
Copy link

This work implements comments for changes following after Airtable#197.

It implements these larger changes:

  • 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.

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.

rmeritz and others added 18 commits August 10, 2020 15:13
- 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.
@mzgoddard mzgoddard requested a review from rwaldron August 29, 2020 01:42
@rwaldron rwaldron force-pushed the mzgoddard-typescriptIt branch from cb8c3d4 to c7b74ca Compare September 1, 2020 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants