Skip to content

TypeScriptLibraryExporter documentation support #1

Open

Description

@astorks

Since we have access to the bukkit JavaDocs we should be able to generate documentation comments automatically. Need to research more.

Activity

  1. self-assigned this
    on Jan 23, 2020
  2. changed the title [-]TypeScriptApiExporter documentation support[/-] [+]TypeScriptLibraryExporter documentation support[/+] on Jan 23, 2020
  3. astorks commented on Jan 24, 2020

    @astorks
    OwnerAuthor
  4. astorks commented on Jan 25, 2020

    @astorks
    OwnerAuthor

    https://github.com/paul-hammant/paranamer

    Paranamer is now implemented to help with some parameter names. Although full documentation would be nice at least for the bukkit api.

    https://github.com/javaparser/javaparser

  5. jwulf commented on Feb 23, 2020

    @jwulf

    I have a Bukkit API ts declaration already. Partially auto-generated.

    https://github.com/Magikcraft/scriptcraft-types

    It’s on npm as well.

    I think it also contains the ScriptCraft API typings too, which you won’t want if you are not using ScriptCraft.

    I have a npm module loading require implementation as well, which is a patch on Walter’s require implementation. It’s in @Magikcraft/MagikCraft in the SMA/js folder.

  6. jwulf commented on Feb 23, 2020

    @jwulf

    I’ll dig out the generation code. It works by scraping the bukkit api docs and doing a ghetto transform to TS (Non-AST aware text tansform). Gets about 90% of the way there. The other 10%, plus crawling the site is manual, but we can probably fix that up.

  7. astorks commented on Feb 23, 2020

    @astorks
    OwnerAuthor

    I'm actually already generating a typescript library via java reflection. I'm just thinking about using the javadocs support to help comment the typescript code better.

    I'd definitely be interested in the generation code though as it may help with parsing the java docs.
    Thanks

  8. jwulf commented on Feb 24, 2020

    @jwulf
  9. astorks commented on Feb 24, 2020

    @astorks
    OwnerAuthor

    haha, all good. Thanks, I'm sure mine isn't too much better currently:

    https://github.com/astorks/ScriptableMC-Engine/blob/dev/ScriptableMC-Tools-TS/src/main/kotlin/com/pixlfox/scriptablemc/TypescriptLibraryExporter.kt

    Being able to pull reflection data directly from the jar is nice though, I just wish argument names where saved properly in the java bytecode instead of arg0, arg1.... That's why I'm looking into the javadocs as well as code comments.

    Anyway I'm thinking about cleaning it up and making it a standalone project so you could just set up a build script and pass the spigot api jar and any additional jars and it would generate a typescript project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions