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

fix and improve types #106

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

EdJoPaTo
Copy link
Contributor

This touched a lot of things again. I enabled some more tsconfig settings and removed some //@ts-nocheck. The only one left is the simplify_claims test one which seems especially fun to get rid of in the future. I also moved time related stuff into wikibase_time.ts.

@mshd When you have time to review this one it would be nice :)

@EdJoPaTo
Copy link
Contributor Author

I got a bunch of claim parsing typed which is nice. On the downside: I'm not sure how much I like the simplify methods as they are very dependent on the input and their options. Especially with types its simpler to pick the exact type you want and simplify exactly for your needs rather than simplifying with some options while loosing typings. I would consider publishing the parse_claim methods and deprecating the simplify claim related methods.

@EdJoPaTo
Copy link
Contributor Author

This is horrible to review… Maybe I should split this up into multiple Pull Requests which can be reviewed and accepted on their own.

I keep this one open and rebase it on top of the current main branch as a "progress" indication and provide Pull Requests for parts. Then I'll wait with more changes until they are merged to prevent a huge clogged up PR like this one. Does that sound good to you @maxlath ?

@maxlath
Copy link
Owner

maxlath commented Mar 17, 2023

yes, more atomic PRs would be welcome indeed 😅

Conflicts:
	package.json
	scripts/update_dist
	tests/cirrus_search.ts
	tests/general.ts
	tests/get_entities.ts
	tests/get_entities_from_sitelinks.ts
	tests/get_entity_revision.ts
	tests/get_many_entities.ts
	tests/get_reverse_claims.ts
	tests/get_revisions.ts
	tests/helpers.ts
	tests/parse.ts
	tests/search_entities.ts
	tests/simplify_claims.ts
	tests/simplify_entity.ts
	tests/simplify_forms.ts
	tests/simplify_qualifiers.ts
	tests/simplify_senses.ts
	tests/simplify_sitelinks.ts
	tests/simplify_sparql_results.ts
	tests/sitelinks_helpers.ts
	tsconfig.json
@maxlath
Copy link
Owner

maxlath commented Jun 10, 2023

@EdJoPaTo can we close this PR now that it was taken over in other PRs?

@EdJoPaTo
Copy link
Contributor Author

EdJoPaTo commented Jun 14, 2023

There are still some things left which are not added in their own PR… I scrolled over this PR and found these:

  • eslint → eslint-with-typescript (probably should be done when there are no other open PR to have less breaking changes
  • src/queries/get_reverse_claims.ts has improved types
  • claim DataType as an explicit list rather than derived from existing parsers
  • simpler types of src/utils/build_url.ts (see refactor: improve build_url #123)
  • ts-nocheck is removed on tests/simplify_sitelinks.ts
  • ts-nocheck is removed on tests/simplify_sparql_results.ts (see refactor: stricter eslint and ts config #129)

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