daddykotex / smithy4s-code-generation

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

Add smithy4s-protocol to classpath deps #22

Closed kubukoz closed 9 months ago

kubukoz commented 9 months ago

It enables using things like smithy4s.meta#adt and other smithy4s codegen customizations.

In addition, adding a monospace class for the dependency strings.

bundlemon[bot] commented 9 months ago

BundleMon

Files updated (1) Status | Path | Size | Limits :------------: | ------------ | :------------: | :------------: :white_check_mark: | assets/index-(hash).js
| 861.29KB (+589B +0.07%) | +10%
Unchanged files (1) Status | Path | Size | Limits :------------: | ------------ | :------------: | :------------: :white_check_mark: | index.html
| 318B | -

Total files change +591B +0.07%

Final result: :white_check_mark:

View report in BundleMon website ➡️


Current branch size history | Target branch size history

kubukoz commented 9 months ago

BTW I'm having trouble running these locally now.

The dev workflow works fine, but doesn't have dependencies baked in. I saw the backendDependencies module, but I can't do reStart with it, and its Docker image either 404-ed on index.html or was missing the frontend changes I made.

daddykotex commented 9 months ago

BTW I'm having trouble running these locally now.

The dev workflow works fine, but doesn't have dependencies baked in. I saw the backendDependencies module, but I can't do reStart with it, and its Docker image either 404-ed on index.html or was missing the frontend changes I made.

Sorry for this, I messed up implementing this... Last 3 commits is me trying to set it back so that the workflow dev is back in a usable state.

Will merge this as I think it's a nice to have, and I'll try to improve the dev workflow.

daddykotex commented 9 months ago

When implementing the smithy classpath feature, I wanted to keep two images, one with deps, and one without. This is because I want to use the one w/o deps, to build from, and add my custom deps to. And it works superwell.

But I also want one with default deps in this repository that is deployed on fly.io.

At first I tried, to produce two images from the same module but did not succeed, then I tried to have a second project backendDependencies that was a plain copy of the first one, except from a few settings, but I was not able to implement it. Lastly, I made a project on it's own, but it's awkward to run locally because it's just meant to produce a docker image from the result of the first image.

would you know how to do "a plain copy of a sbt module, like backend, except from a few settings"?

kubukoz commented 9 months ago

question, why do you even need two images?

The way I see it, the problem with non-curated deps could be solved by having just a list of coordinates in the actual app. This can be passed when launching the container, like any other variable. No need to rebuild. Is there something I'm missing?

would you know how to do "a plain copy of a sbt module, like backend, except from a few settings"?

I usually did that with a project matrix, I don't know if sbt by itself has anything like that built-in.

daddykotex commented 9 months ago

I did not want to have to do artifact resolution at runtime, it meant:

  1. include coursier
  2. potentially deal with private repositories (requiring auth)
  3. in tight deployments, you don't always have access to the repositories at runtime

so the idea was to force resolution of anything the app at and/or before deployment

kubukoz commented 9 months ago

Makes sense. Perhaps it could be done as separate docker layers on top of a base one 🤔