daddykotex / smithy4s-code-generation

Preview Smithy4s code generation
https://morning-bird-7081.fly.dev/
MIT License
7 stars 1 forks source link

Load custom Smithy classpath #17

Closed daddykotex closed 7 months ago

daddykotex commented 7 months ago

Fixes https://github.com/daddykotex/smithy4s-code-generation/issues/15

The app configuration now reads from a JSON file to configure the classpath for the code generation. I've decided to do it at build time / deployment time as opposed to runtime (via an embedded coursier) for a few reason:

The file is expected to look like that:

{
  "entries": {
    "com.disneystreaming.alloy:alloy-core:0.2.8": "/path/to/Coursier/v1/https/repo1.maven.org/maven2/com/disneystreaming/alloy/alloy-core/0.2.8/alloy-core-0.2.8.jar",
    "software.amazon.smithy:smithy-aws-iam-traits:1.41.1": "/path/to/Coursier/v1/https/repo1.maven.org/maven2/software/amazon/smithy/smithy-aws-iam-traits/1.41.1/smithy-aws-iam-traits-1.41.1.jar"
  }
}

If this file is available, then the UI is customized a little bit to show checkboxes for all the dependencies available. The permalink also takes it into account.

URL looks like:

http://localhost:5173/#code=CQNwpgTgzglg9gOwFwAIBEAmNAobCCGAtmFAA74DGYKMCpArgC64AC+ANu3AJ4DE99GABMAYnAiF8zKIwi0A5igCSAEVwyI9Co3oRqABUhREKAN7YUKFnoCOgvUIs0hqVU+tg7MB04LFUAMqyCtgAvkA;dependencies=com.disneystreaming.alloy:alloy-core:0.2.8

Screenshot 2023-12-08 at 10 40 26

bundlemon[bot] commented 7 months ago

BundleMon

Files updated (1) Status | Path | Size | Limits :------------: | ------------ | :------------: | :------------: :white_check_mark: | assets/index-(hash).js
| 861.27KB (+564B +0.06%) | +10%
Unchanged files (1) Status | Path | Size | Limits :------------: | ------------ | :------------: | :------------: :white_check_mark: | index.html
| 319B | -

Total files change +567B +0.06%

Final result: :white_check_mark:

View report in BundleMon website ➡️


Current branch size history | Target branch size history

daddykotex commented 7 months ago

Currently, the format allows only one jar to be supplied for a given dependency, this is probably not good enough in some case. Some deps probably have transitive dependencies that we would need to resolve as well.