Create TS definitions from PHP driver YAML files

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • 8
    • Iteration X-Ray, Iteration Ylem, Iteration Zenith, Iteration A (Apr 21 - May 5), Iteration B (May 5 - May 16)
    • None
    • Developer Tools

      We fork the PHP driver repository to be able to iterate quickly on its YAML definitions.
      We write a command line tool for parsing these YAML definitions and emitting TS definitions based on them, and place it in the devtools-shared monorepo as a new @mongodb-js/mql-typescript package. This command line tool will generate TS files that will then be placed into the actual package contents as part of its build scripts.

      We adjust the YAML definitions with annotations as needed. When this work is complete, we will merge back the changes into the PHP driver, going through the normal PR review process. Examples of improvements we’d likely need to make is extending the YAML definitions to understand matching types (e.g. $gt: [ ‘$foo’, 42 ] only being allowed if $foo evaluated to a numeric value).

      The generated definitions should include documentation comments, including the description and (if available) link included in the current YAML definitions.

      A prototype of this work is available at https://github.com/mongodb-js/poc-php-mql-ts.

            Assignee:
            Nikola Irinchev
            Reporter:
            Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: