parse-community / Parse-SDK-JS

The JavaScript SDK for Parse Platform
https://parseplatform.org
Apache License 2.0
1.32k stars 596 forks source link

refactor: Fix TypeScript type correctness test #2134

Closed dplewis closed 3 months ago

dplewis commented 3 months ago

Pull Request

Issue

npm run test:types

Error: /home/runner/work/Parse-SDK-JS/Parse-SDK-JS/types/CoreManager.d.ts:1:15
ERROR: 1:15    expect  TypeScript@5.2 compile error: 
Module '"./ObjectStateMutations"' declares 'AttributeMap' locally, but it is not exported.
ERROR: 1:29    expect  TypeScript@5.2 compile error: 
Module '"./ObjectStateMutations"' declares 'ObjectCache' locally, but it is not exported.
ERROR: 1:42    expect  TypeScript@5.2 compile error: 
Module '"./ObjectStateMutations"' declares 'OpsMap' locally, but it is not exported.
ERROR: 1:50    expect  TypeScript@5.2 compile error: 
Module '"./ObjectStateMutations"' declares 'State' locally, but it is not exported.
ERROR: 3:15    expect  TypeScript@5.2 compile error: 
Module '"./ParseFile"' has no exported member 'FileSaveOptions'. Did you mean to use 'import FileSaveOptions from "./ParseFile"' instead?
ERROR: 3:32    expect  TypeScript@5.2 compile error: 
Module '"./ParseFile"' has no exported member 'FileSource'. Did you mean to use 'import FileSource from "./ParseFile"' instead?
ERROR: 7:15    expect  TypeScript@5.2 compile error: 
Module '"./ParseQuery"' has no exported member 'QueryJSON'. Did you mean to use 'import QueryJSON from "./ParseQuery"' instead?
ERROR: 9:15    expect  TypeScript@5.2 compile error: 
Module '"./ParseUser"' has no exported member 'AuthData'. Did you mean to use 'import AuthData from "./ParseUser"' instead?
ERROR: 10:15   expect  TypeScript@5.2 compile error: 
Module '"./Push"' declares 'PushData' locally, but it is not exported.
ERROR: 13:53   expect  TypeScript@5.2 compile error: 
Cannot find module './ParseHooks' or its corresponding type declarations.
ERROR: 279:[59](https://github.com/parse-community/Parse-SDK-JS/actions/runs/9116080664/job/25063872022#step:5:60)  expect  TypeScript@5.2 compile error: 
Cannot find name 'URL'.
ERROR: 280:50  expect  TypeScript@5.2 compile error: 
Cannot find name 'URL'.

/home/runner/work/Parse-SDK-JS/Parse-SDK-JS/types/ParseInstallation.d.ts:2:15
ERROR: 2:15    expect  TypeScript@5.2 compile error: 
Module '"./ObjectStateMutations"' declares 'AttributeMap' locally, but it is not exported.

/home/runner/work/Parse-SDK-JS/Parse-SDK-JS/types/ParseObject.d.ts:5:15
ERROR: 5:15    expect  TypeScript@5.2 compile error: 
Module '"./ObjectStateMutations"' declares 'AttributeMap' locally, but it is not exported.
ERROR: 5:29    expect  TypeScript@5.2 compile error: 
Module '"./ObjectStateMutations"' declares 'OpsMap' locally, but it is not exported.

Approach

Convert the following to TypeScript

ObjectStateMutation
ParseFile
ParseHooks
ParseQuery
ParseRole
ParseUser
Push.js
TaskQueue

Added dom to libs in tsconfig for Cannot find name 'URL'. error Fixed linting issues, for some reason the declaration files d.ts have parsing issues

Tasks

parse-github-assistant[bot] commented 3 months ago

Thanks for opening this pull request!

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (b50790a) to head (ba75946). Report is 42 commits behind head on alpha.

:exclamation: Current head ba75946 differs from pull request most recent head da3f5d0

Please upload reports for the commit da3f5d0 to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## alpha #2134 +/- ## ========================================== Coverage 100.00% 100.00% ========================================== Files 61 64 +3 Lines 6186 6325 +139 Branches 1499 1514 +15 ========================================== + Hits 6186 6325 +139 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dplewis commented 3 months ago

@mtrezza This is ready for review, I'll fix the linting type issue in another PR.

parseplatformorg commented 3 months ago

🎉 This change has been released in version 5.2.0-alpha.1

parseplatformorg commented 1 month ago

🎉 This change has been released in version 5.2.0-beta.1

parseplatformorg commented 1 month ago

🎉 This change has been released in version 5.2.0