Explore your Smithy models with the CLI

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025

Комментарии • 5

  • @risavkarna
    @risavkarna 8 месяцев назад +1

    Awesome bespoke content! Do you plan on having one about code generation with Smithy? Looking forward to all other videos in this series.

    • @kubukoz_
      @kubukoz_  8 месяцев назад +1

      Like, about building a codegen? Not sure, but there will be some stuff that'd be useful for that as well (programmatic access to the model)

    • @risavkarna
      @risavkarna 8 месяцев назад

      @@kubukoz_ Programmatic access would be quite helpful to me personally. I am interested in customizing and creating code generators currently.

    • @kubukoz_
      @kubukoz_  8 месяцев назад +1

      For now I can only point you to the docs:
      smithy.io/2.0/guides/using-code-generation/index.html
      As for working with the model, I think the API is pretty self-descriptive in most areas. If you're not implementing a smithy-build plugin but want to load a model yourself, this can be a hurdle, and I can recommend looking at smithy-playground, smithy4s's, or the LSP's implementations:
      github.com/kubukoz/smithy-playground/blob/cb186f4b0b3b46ab0a47409d85537c92d4a8fe7f/modules/lsp/src/main/scala/playground/lsp/ModelLoader.scala
      github.com/disneystreaming/smithy4s/blob/d7afe2123095bc03389dc30c0a151bff78983ceb/modules/codegen/src/smithy4s/codegen/internals/ModelLoader.scala
      github.com/smithy-lang/smithy-language-server/blob/6ce7064a88be58df5fb7ebcf35e165f7fae1286f/src/main/java/software/amazon/smithy/lsp/SmithyInterface.java#L58
      that said, if you can "plug into" smithy cli / gradle plugin's own build system, that's probably the easiest way to get going.

    • @risavkarna
      @risavkarna 8 месяцев назад

      @@kubukoz_ Thanks. This is incredibly helpful as I am new to Smithy, its API and lib authoring itself. I will try both approaches from above. Overall I just need my CLI tools/options to work with Smithy IDL code as an input. ts-morph & AST libs from unifiedjs do most of the heavy lifting currently.