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

TypeScript migration #309

Merged
merged 32 commits into from
Oct 18, 2023
Merged

TypeScript migration #309

merged 32 commits into from
Oct 18, 2023

Commits on Jul 31, 2023

  1. other(ts): copy parser types from bookbrainz-utils

    Since we also need them here, they will be deleted from there later.
    kellnerd committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    7679731 View commit details
    Browse the repository at this point in the history
  2. chore(deps): update @metabrainz/bookshelf to v1.4.0

    This version includes type definitions.
    kellnerd committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    9381eee View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2023

  1. refactor(types): introduce separate types for lazy-loaded properties

    Also use consistent names for inserted and fetched models:
    * ModelT
    * ModelWithIdT
    * LazyLoadedModelT
    kellnerd committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    9812991 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    242916d View commit details
    Browse the repository at this point in the history
  3. fix(types): make id and default flag of aliases optional

    An alias only needs an id during updates if it is not a new one.
    As long as one item of an alias set is marked as default, the others do
    not need this attribute.
    kellnerd committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    2d42980 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2023

  1. Configuration menu
    Copy the full SHA
    cc35dcb View commit details
    Browse the repository at this point in the history
  2. other(ts): export a type for the ORM

    Currently all its properties except for `bookshelf` have an inferred
    type of `any`, but that's a start at least.
    The situation will improve as soon as the Bookshelf models have types.
    kellnerd committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    6b9235a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3134f41 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fdcf333 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a2307f5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a93bc48 View commit details
    Browse the repository at this point in the history
  7. other(ts): create a return type for getEntitySetMetadataByType

    Consequent usage of this type seems to also have revealed a bug...
    kellnerd committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    df6ddcb View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2023

  1. Configuration menu
    Copy the full SHA
    53805a0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    959cc8e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    289a68e View commit details
    Browse the repository at this point in the history
  4. other(ts): convert utils to TypeScript

    Replace deprecated usage of `String.substr`.
    kellnerd committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    aa539c2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2f861f8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    436984d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a335e30 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a553d13 View commit details
    Browse the repository at this point in the history
  9. other(ts): add minimal type definitions to all bookshelf models

    - Batch-rename all JS modules: `rename .js .ts src/models/{*,*/*}.js`
    - Import and add Bookshelf type to each model using global search and replace
    - Adapt helper function in edition.ts
    - Update test to refer to the generated JS files in the lib/ directory
    
    Tests are passing but the bookshelf models still cause type errors
    caused by their non-standard inheritance.
    kellnerd committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    e3c529f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0335676 View commit details
    Browse the repository at this point in the history
  11. refactor(models): replace Model.forge() with new Model()

    https://bookshelfjs.org/api.html#Model-static-forge
    > A simple helper function to instantiate a new Model without needing new.
    
    Using the constructor syntax avoids a few type errors with chained calls.
    kellnerd committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    b699ab0 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2023

  1. chore: use consistent type import syntax

    Co-authored-by: Monkey Do <[email protected]>
    kellnerd and MonkeyDo committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    ee7e062 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f9b5d4f View commit details
    Browse the repository at this point in the history
  3. refactor(util): make date number parsing better readable

    Co-authored-by: Monkey Do <[email protected]>
    kellnerd and MonkeyDo committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    5a519ec View commit details
    Browse the repository at this point in the history
  4. fix(ts): call instance method instead of class method

    Co-authored-by: Monkey Do <[email protected]>
    kellnerd and MonkeyDo committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    10f9b55 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7843a11 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2023

  1. Configuration menu
    Copy the full SHA
    dfc71e4 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. fix(import): avoid conflicting usage of entityType by using QueuedEntity

    Type was copied from bookbrainz-utils, where it has been removed.
    kellnerd committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    1e155ab View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cdf0dcc View commit details
    Browse the repository at this point in the history
  3. fix(import): properly extract id from knex query result

    Finally the first test import of a random OpenLibrary author succeeded!
    kellnerd committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    d0c9658 View commit details
    Browse the repository at this point in the history