Skip to content

fix: add required dependencies automatically after generating - #71

Merged
dotkas merged 5 commits into
developfrom
dotkas/dependency-report
Jul 24, 2026
Merged

fix: add required dependencies automatically after generating#71
dotkas merged 5 commits into
developfrom
dotkas/dependency-report

Conversation

@dotkas

@dotkas dotkas commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 24, 2026 11:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds post-generation dependency reporting (and optional installation) to make generated Rust output easier to compile by automatically surfacing the exact crates/features the emitters reference.

Changes:

  • Add a new dependency scanner (deps module) that infers required crates/features by scanning the generated source.
  • Extend the CLI to print a Cargo.toml snippet + cargo add commands after writing, and add --install-deps to run cargo add automatically.
  • Update README/docs/examples to reflect the new dependency output and CLI flag.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Updates example output to show the new dependency note after generation.
examples/bookstore/README.md Updates all example runs to include the new dependency note (server/models/client).
docs/configuration.md Documents the new dependency reporting/installation behavior.
docs/cli.md Documents the new --install-deps flag in the generated CLI reference.
crates/oapi-codegen/src/main.rs Computes required deps from generated code; optionally runs cargo add based on TTY/flag.
crates/oapi-codegen/src/lib.rs Exposes the new deps module from the library crate.
crates/oapi-codegen/src/deps.rs Implements dependency detection + formatting as TOML snippet and cargo add args; includes unit tests.
crates/oapi-codegen/src/console.rs Adds dependency reporting, prompting, and install status/failure output.
crates/oapi-codegen/src/cli.rs Adds the --install-deps flag to the Clap CLI.

Comment thread crates/oapi-codegen/src/console.rs
Comment thread docs/configuration.md Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Comment thread crates/oapi-codegen/src/deps.rs Outdated
Comment thread crates/oapi-codegen/src/cli.rs Outdated
Comment thread crates/oapi-codegen/src/main.rs Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.

Comment thread crates/oapi-codegen/src/deps.rs Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 12:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.

Comment thread crates/oapi-codegen/src/deps.rs Outdated
Comment thread crates/oapi-codegen/src/cli.rs Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 12:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.

Comment thread crates/oapi-codegen/src/deps.rs
Copilot AI review requested due to automatic review settings July 24, 2026 12:46
@dotkas
dotkas force-pushed the dotkas/dependency-report branch from 2ca4a2b to bd4a45f Compare July 24, 2026 12:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.

Comment thread crates/oapi-codegen/src/main.rs
Copilot AI review requested due to automatic review settings July 24, 2026 14:57
@dotkas
dotkas force-pushed the dotkas/dependency-report branch from bd4a45f to 4962075 Compare July 24, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.

Comment thread crates/oapi-codegen/src/main.rs
Comment thread examples/dependency-report/README.md Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 15:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

@dotkas
dotkas merged commit 2733b31 into develop Jul 24, 2026
7 checks passed
@dotkas
dotkas deleted the dotkas/dependency-report branch July 24, 2026 15:19
@alchemax-housekeeper

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.0.0-dev.14 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@alchemax-housekeeper

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants