Skip to content

Conversation

@adamdicarlo0
Copy link
Contributor

@adamdicarlo0 adamdicarlo0 commented Jun 23, 2025

Sorry... it's a huge PR! But most of the diff is

  • New elm-codegen Gen modules (so, so many)
  • Moving files

It includes some new scripts, which must be used to test things locally until the new package is published.

After cloning, this series of commands should (in theory) just work:

scripts/link-local-package   # `npm run link-local-package` also works
npm test
scripts/unlink-local-package # `npm run unlink-local-package` also works

Slightly tangential changes:

  • Always use tools installed via shell.nix, rather than installing duplicates via npm, to remove the need to keep them in sync (I probably wouldn't have tried it if I'd realized how much work CI would be, lol)
  • Use shell.nix in CI, as well (this requires quite a bit of boilerplate to make caching work, without using something like devbox directly)
    • NB: For cache misses it takes around 35 seconds in CI to "build" the dev shell, so this will at time slow down CI runs
  • Rework basically all the scripts, like test, review, format because the project structure has changed so much

cc @miniBill

"elm-community/json-extra": "4.3.0",
"elm/url": "1.0.0",
"dillonkearns/elm-pages": "10.1.0",
"dillonkearns/elm-pages": "10.2.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and similar upgrades were necessary for the example-using-api project to be able to compile.

@adamdicarlo0
Copy link
Contributor Author

adamdicarlo0 commented Jun 23, 2025

TODO:

  • Finish adding function/type docs for elm-open-api-codegen
  • Wiring up elm-review to also run in elm-open-api-codegen in CI

@adamdicarlo0 adamdicarlo0 force-pushed the move-codegen-api-to-separate-package branch from 78c0ac4 to e80b96a Compare June 24, 2025 23:57
pkgs.elmPackages.elm-review
pkgs.nodejs-18_x
pkgs.nodejs_20
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgraded this to match the node version used in CI.

Now CI is using the Nix shell, so this dictates the Node version everywhere.

]
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: This file moved to the elm-open-api-codegen/ folder

@@ -0,0 +1,906 @@
module OpenApi.BackendTask exposing (withConfig)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code comes from the old Cli module.


Cli.Validate.Invalid _ ->
False
regexToCheckIfJson mediaType
Copy link
Contributor Author

@adamdicarlo0 adamdicarlo0 Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed these functions to not need the Cli module, since this is now in an Elm package.

"elm-explorations/test": "2.2.0",
"miniBill/elm-unicode": "1.1.1"
},
"direct": {},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test suite has moved into the package (elm-open-api-codegen) subfolder

},
"defaultStatus": ["⏳", "S"]
}
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this run-pty config is for npm run review:watch

"wolfadex/elm-ansi": "3.0.0",
"wolfadex/elm-open-api": "2.0.0"
"elmcraft/core-extra": "2.2.0",
"wolfadex/elm-open-api-codegen": "1.0.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is not published yet, so this elm.json file cannot work as-is. The TEMP HACK blocks in the CI workflow work around this (with the same method I used to work around it locally).

@adamdicarlo0
Copy link
Contributor Author

Superceded by #214

@adamdicarlo0 adamdicarlo0 deleted the move-codegen-api-to-separate-package branch July 29, 2025 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant