Add wrap() method for type-safe external CLI tool integration#2
Add wrap() method for type-safe external CLI tool integration#2KurtGokhan merged 12 commits intomainfrom
Conversation
Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
KurtGokhan
left a comment
There was a problem hiding this comment.
There is no need to rename to kebab-case, or map options.
If options need to be mapped, a Zod schema can map it from the parsed input
KurtGokhan
left a comment
There was a problem hiding this comment.
There is no need to rename to kebab-case, or map options.
If options need to be mapped, a Zod schema can map it from the parsed input
… Zod transform instead Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
Simplified the implementation in commit e60ce0f. Removed automatic kebab-case conversion and the
Addressed in commit e60ce0f. Removed kebab-case conversion and optionMapping. Users can now map options to CLI flags using Zod's |
KurtGokhan
left a comment
There was a problem hiding this comment.
Wrap method should take a schema, with the input type as the parsed command arguments, and output type as the arguments the external program expects.
It should also take a positional config, which is by default same as the wrapping command.
…ons to external CLI args Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
Implemented in commit dd261ea. The |
Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
KurtGokhan
left a comment
There was a problem hiding this comment.
Wrap should still be single argument. The option to transform can be passed in the config object
Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
Implemented in commit 25ed063. The |
Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
|
@copilot fix CI. What can I do to make you auto-fix CI runs in your own PRs? |
…ined Co-authored-by: KurtGokhan <6034931+KurtGokhan@users.noreply.github.com>
Fixed in commit a7b2ed0. The CI was failing due to a TypeScript error where To help auto-fix CI issues in the future, you could:
|
Implementation Complete: wrap() Method Single-Argument API ✅
Summary
Successfully refactored
wrap()method to use single-argument API where the schema is passed as an optional property in the config object. All implementation, tests, and documentation updated.Changes Made (per latest feedback)
wrap()now takes only one config argumentschemaproperty inWrapConfigfor transformationNew API Design
Signature:
Usage Examples
No transformation (identity):
With schema transformation:
Function-based schema:
Implementation Details
Files Modified:
packages/padrone/src/wrap.ts- UpdatedWrapConfigtype andcreateWrapHandlersignaturepackages/padrone/src/types.ts- Updatedwrap()method signature and JSDocpackages/padrone/src/create.ts- Updated to pass single config argumentpackages/padrone/tests/wrap.test.ts- Updated all 15 tests to new API + CI fixdocs/src/content/docs/reference/api.md- Updated API documentationdocs/src/content/docs/guides/wrapping-external-tools.md- Updated usage guideKey Features:
Validation Results
✅ All 205 tests pass (15 wrap-specific)
✅ Lint/format checks pass (Biome)
✅ Type checking passes (TypeScript)
✅ Documentation complete (API ref + usage guide)
✅ CI passing (All checks green)
Commits
25ed063- Refactor wrap() to single-argument API with schema in config object8806884- Complete documentation updates for single-argument wrap() APIOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.