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

refactor: Fix TypeScript type correctness test #2134

Merged
merged 6 commits into from
May 16, 2024

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented May 16, 2024

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  [email protected] compile error: 
Module '"./ObjectStateMutations"' declares 'AttributeMap' locally, but it is not exported.
ERROR: 1:29    expect  [email protected] compile error: 
Module '"./ObjectStateMutations"' declares 'ObjectCache' locally, but it is not exported.
ERROR: 1:42    expect  [email protected] compile error: 
Module '"./ObjectStateMutations"' declares 'OpsMap' locally, but it is not exported.
ERROR: 1:50    expect  [email protected] compile error: 
Module '"./ObjectStateMutations"' declares 'State' locally, but it is not exported.
ERROR: 3:15    expect  [email protected] compile error: 
Module '"./ParseFile"' has no exported member 'FileSaveOptions'. Did you mean to use 'import FileSaveOptions from "./ParseFile"' instead?
ERROR: 3:32    expect  [email protected] compile error: 
Module '"./ParseFile"' has no exported member 'FileSource'. Did you mean to use 'import FileSource from "./ParseFile"' instead?
ERROR: 7:15    expect  [email protected] compile error: 
Module '"./ParseQuery"' has no exported member 'QueryJSON'. Did you mean to use 'import QueryJSON from "./ParseQuery"' instead?
ERROR: 9:15    expect  [email protected] compile error: 
Module '"./ParseUser"' has no exported member 'AuthData'. Did you mean to use 'import AuthData from "./ParseUser"' instead?
ERROR: 10:15   expect  [email protected] compile error: 
Module '"./Push"' declares 'PushData' locally, but it is not exported.
ERROR: 13:53   expect  [email protected] 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  [email protected] compile error: 
Cannot find name 'URL'.
ERROR: 280:50  expect  [email protected] 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  [email protected] 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  [email protected] compile error: 
Module '"./ObjectStateMutations"' declares 'AttributeMap' locally, but it is not exported.
ERROR: 5:29    expect  [email protected] 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

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

Copy link

parse-github-assistant bot commented May 16, 2024

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Closes: #123 in the PR description, so I can recognize it.

Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dplewis dplewis requested a review from a team May 16, 2024 19:06
@dplewis
Copy link
Member Author

dplewis commented May 16, 2024

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

@mtrezza mtrezza merged commit 3123819 into parse-community:alpha May 16, 2024
6 of 9 checks passed
@mtrezza mtrezza mentioned this pull request May 16, 2024
66 tasks
@dplewis dplewis deleted the test-types branch May 16, 2024 23:06
@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label May 17, 2024
@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Jun 24, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.2.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants