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

chore(gatsby): Convert db/nodes to TS #25199

Merged
merged 2 commits into from
Jun 23, 2020
Merged

chore(gatsby): Convert db/nodes to TS #25199

merged 2 commits into from
Jun 23, 2020

Conversation

pvdz
Copy link
Contributor

@pvdz pvdz commented Jun 22, 2020

Converts src/db/nodes to TS.

Note: first commit renames the file, second commit contains the changes. Github will consider it an added/removed file as a whole (because git does).

Also refactors src/utils/source-nodes since it now realizes the real typing of the getNode function and that it may return undefined. Had to change the loop logic a little to account for that.

Did not change the weird export mechanic that's going on here because that requires bigger refactors in other parts of the code. But this is basically a re-export that other consumers should import directly;

module.exports = {
  ...nodesDb,
  runQuery: runFastFiltersAndSort,
}

@pvdz pvdz requested a review from a team as a code owner June 22, 2020 14:05
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 22, 2020
@pvdz pvdz changed the title Ts db nodes chore(gatsby): Convert db/nodes to TS Jun 22, 2020
@pvdz pvdz added topic: TypeScript migration and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 22, 2020
@pvdz
Copy link
Contributor Author

pvdz commented Jun 22, 2020

image
:trollface:

@pvdz pvdz marked this pull request as draft June 22, 2020 20:30
@pvdz pvdz marked this pull request as ready for review June 23, 2020 08:02
@pvdz pvdz merged commit c63c2e9 into master Jun 23, 2020
@delete-merged-branch delete-merged-branch bot deleted the ts-db-nodes branch June 23, 2020 10:25
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