Problem
The current typia generate command requires --input and --output directories:
npx typia generate --input src/templates --output src/generated --project tsconfig.json
For projects with templates spread across multiple submodules, this creates organizational challenges:
- Requires centralizing templates in a single directory hierarchy
- Or running multiple generate commands with different input/output pairs
Proposed Solution
Accept .ts files as positional arguments, as alternative to --input:
npx typia generate --output src/generated --project tsconfig.json src/**/*.typia.ts
This complements (not replaces) the existing --input directory mode.
Benefits
- Templates can live alongside app code in multiple submodules
- Shell glob patterns (
*.typia.ts) select exactly which files to transform
- Single command handles templates from anywhere in the project
Example
src/
├── users/
│ ├── user.ts
│ └── user.typia.ts ← template
├── orders/
│ ├── order.ts
│ └── order.typia.ts ← template
└── generated/ ← all output goes here
├── user.typia.ts
└── order.typia.ts
npx typia generate src/**/*.typia.ts --output src/generated --project tsconfig.json
CLI Interface
Usage: typia generate [options] [files...]
Arguments:
files input .ts files (alternative to --input)
Options:
--input [path] input directory
--output [directory] output directory
--project [project] tsconfig.json file location
Related
This differs from #1251 (glob patterns for directories) - it's about accepting file arguments directly.
Problem
The current
typia generatecommand requires--inputand--outputdirectories:For projects with templates spread across multiple submodules, this creates organizational challenges:
Proposed Solution
Accept
.tsfiles as positional arguments, as alternative to--input:This complements (not replaces) the existing
--inputdirectory mode.Benefits
*.typia.ts) select exactly which files to transformExample
CLI Interface
Related
This differs from #1251 (glob patterns for directories) - it's about accepting file arguments directly.