Skip to content

Conversation

@httpdss
Copy link
Owner

@httpdss httpdss commented Aug 25, 2025

Summary
This PR improves the UX of the generate command by making both positional arguments optional with sensible defaults. Users can now run struct generate with no additional arguments when a .struct.yaml is present in the current directory.

Motivation

  • Streamline the most common workflow: running generation from the current directory using a local .struct.yaml.
  • Reduce friction and boilerplate for quick iterations and demos.

Changes

  • CLI: Make positional args optional in GenerateCommand
    • structure_definition defaults to .struct.yaml
    • base_path defaults to .
    • Explicitly provided arguments continue to override these defaults.
  • Docs: Updated to reflect new defaults
    • docs/cli-reference.md
    • docs/usage.md
    • docs/quickstart.md

Usage

# With defaults (if .struct.yaml exists in the current directory)
struct generate

# From a specific YAML file into a target directory (unchanged)
struct generate file://my-config.yaml ./output

# Using a built-in structure definition into a directory (unchanged)
struct generate python-basic ./my-project

Backward compatibility

  • Existing commands remain valid; this is an additive improvement.
  • Explicit arguments still take precedence over defaults.

Testing

  • Full test suite executed locally: 112 tests passed.
  • No behavior changes to existing flows other than allowing omitted positional args with sensible defaults.

Docs

  • CLI reference updated to show optional positional args and defaults.
  • Usage and Quickstart updated with examples using struct generate without arguments.

Closes #113.

@codecov
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.19%. Comparing base (3464fbf) to head (d44939e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   68.06%   68.19%   +0.13%     
==========================================
  Files          20       20              
  Lines        1522     1522              
  Branches      269      269              
==========================================
+ Hits         1036     1038       +2     
+ Misses        410      409       -1     
+ Partials       76       75       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@httpdss httpdss changed the title generate: default structure_definition to .struct.yaml and base_path to . when omitted feat(generate): default structure_definition to .struct.yaml and base_path to . when omitted Aug 25, 2025
@httpdss httpdss changed the title feat(generate): default structure_definition to .struct.yaml and base_path to . when omitted feat(generate): default structure_definition and base_path when omitted Aug 25, 2025
@httpdss httpdss added enhancement New feature or request minor labels Aug 25, 2025
@httpdss httpdss merged commit 19bb0c5 into main Aug 25, 2025
5 checks passed
@httpdss httpdss deleted the feat/113-generate-defaults branch August 25, 2025 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generate: default structure_definition to .struct.yaml and base_path to . when omitted

2 participants