-
Couldn't load subscription status.
- Fork 986
Typescript-ifying turf-great-circle #2733
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
base: master
Are you sure you want to change the base?
Typescript-ifying turf-great-circle #2733
Conversation
|
This is my first (draft) PR to TurfJS in preparation for other enhancement requests to turf-great-circle. |
|
Fantastic. Thanks @thomas-hervey. Will take a look at this shortly. |
|
@thomas-hervey it would be great if we could take the opportunity to do away with the whole lib/arc.* section and import as a third party module. There is https://www.npmjs.com/package/arc (which it looks like we've copy pasted into Turf at some point) but that doesn't have types. Are you possibly in a position to submit types to DefinitelyTyped for the arc JS lib, so we can import it nicely into Turf as part of your PR? If not - and don't feel obliged - I'll give it a whirl and let you know when it's ready to integrate. |
|
@smallsaucepan apologies for my delayed response. Yes I'll happily try to submit types to DefinitelyTyped for the arc JS lib and let you know if I run into any issues. |
|
Hi @thomas-hervey. How did you go getting arc.js types added to DT? |
|
Hi @smallsaucepan, I apologize again for the delay. I ran into some issues with DT and got sidetracked by my dissertation work. I should have reached out to you. I'd still like to submit a PR and should be ble to once I finish school in mid-June. However, feel free to give it a go first if you'd like. |
|
No stress at all @thomas-hervey . Let us know when you're under way 👍 |
|
@smallsaucepan fortunately, I completed my dissertation work, and I can soon refocus my attention on this. I'll keep you posted. |
- Resolved conflicts in packages/turf-great-circle/package.json - Resolved conflicts in packages/turf-great-circle/test.ts - Updated dependencies to latest versions from master - Fixed monorepolint dependency version requirements
- Add arc@^0.2.0 (WIP bump) as dependency to replace embedded lib/arc.js - Update import from './lib/arc.js' to 'arc' package - Fix TypeScript type compatibility issues: - Handle null properties with fallback to empty object - Add proper type assertion for return value - All tests pass (9/9) with new TypeScript arc.js integration - Maintains 100% backward compatibility while adding full TypeScript support
|
@smallsaucepan, apologies for the delay. I'm happy to say that I've returned my attention here, and fortunately, the changes were not a heavy a lift. Instead of submitting to DefinitivelyTyped, I opted to convert arc.js to TypeScript (see this PR awaiting review). However, I tested the integration locally and all tests and builds were passing. The latest commits to this PR updated the branch with master and preemptively replaced the reference of lib/arc.js to a Thanks! |
|
@smallsaucepan following up on my previous comment, this PR is now ready for re-review. @springmeyer has released arc v0.2.0, which this PR is set up to use. Please take your time to review my changes. Automated testing: All current /packages turf-great-circles tests passed. At the root all tests passed except for two suites, which appear to be failing on Manual testing: I created a simple application with Leaflet where I visually inspected the results of several examples including: SF --> NY, short distances, an antimeridian crossing, a polar route, an equatorial route, start & end same location. For each of those examples I modified the start and end location as well as the parameters (ex. number of points). I tested this simple application locally using my Turfjs PR. Thanks! |
|
@smallsaucepan pinging you in case you missed a notification about my previous comment. This PR is ready for your re-review, but no time pressure on my end. Thanks for all of your feedback thus far! |
This change is intended to typescript-ify the
turf-great-circlesmodule following the typescript-ifying discussion #2538.Summary of changes:
/index.jsinto/index.ts/test.tsto cover differentstartandendinput types/lib/arc.d.tsincluding class GreatCircleTemplate requirements: