elm-open-api-cli
elm-open-api-cli copied to clipboard
Split into package and CLI
This version is factored into logical commits(!).
Unlike the first version of this effort, this one does not use any tricks to make Elm think the local package is a real package; it just uses source-directories for that (and is careful about not having any Gen. modules in the example project, in order to avoid name collisions).
- Move the CLI-only files into ./cli
- Start with a copy of original elm.json in ./cli
- Move /codegen/Gen into /src, add to CLI source-directories
- Rewrite root elm.json to be for elm-open-api-codegen package
- Remove the one reference in package to the Cli module
- Move Cli -> OpenApi.BackendTask to preserve git history
- Move CLI generation to OpenApi.BackendTask module
- Readd Cli.elm
- Adjust elm-review config to reflect new project structure
- Add docstrings for package
- Split package.json into root and cli
- Update TestGenScript
- Add elm-open-api-codegen example project
- Fix CI
CAVEATS:
- A single Elm Review project is reviewing the package and the CLI code.
- This is not intended to be published directly, but rather followed up with a PR(s) to more thoughtfully consider the package's exposed API. I have left a number of TODO markers where it seems like an easy call that "this should not be exposed".
Sorry for the force-pushes!
The first was to fix a bug (I'd used a slightly outdated Cli.elm).
The second was to preserve git history for src/Cli.elm -- that git history is now in src/OpenApi/BackendTask.elm. Now cli/src/Cli.elm is all attributed to me, but the majority of its code, which is now in OpenApi.BackendTask, has its proper history. (It was opposite before.)
The third was to upgrade elm-pages rather than re-install vite to make the older elm-pages version work.
Force pushes are fine in branches, no worries :+1: