socketrpc-gen
Advanced tools
Comparing version
# Changelog | ||
## [1.3.0](https://github.com/nguyenvanduocit/socketrpc-gen/compare/v1.2.2...v1.3.0) (2025-06-25) | ||
### Features | ||
* display CLI version on startup and reformat arguments ([7bdff4c](https://github.com/nguyenvanduocit/socketrpc-gen/commit/7bdff4c656c329e86a262abc9651b67fe3693b63)) | ||
## [1.2.2](https://github.com/nguyenvanduocit/socketrpc-gen/compare/v1.2.1...v1.2.2) (2025-06-24) | ||
@@ -4,0 +11,0 @@ |
38
index.ts
@@ -848,11 +848,29 @@ #!/usr/bin/env bun | ||
program | ||
.name('socketrpc-gen') | ||
.description('Generate Socket.IO RPC code from interface definitions.') | ||
.version('1.0.0'); | ||
.name("socketrpc-gen") | ||
.description("Generate Socket.IO RPC code from interface definitions.") | ||
.version("1.0.0"); | ||
// Display the current version when the program starts | ||
console.log(`š socketrpc-gen v${program.version()}`); | ||
program | ||
.argument('<path>', 'Path to the input TypeScript file containing interface definitions') | ||
.option('-p, --package-name <name>', 'Package name for the generated RPC package', '@socket-rpc/rpc') | ||
.option('-t, --timeout <ms>', 'Default timeout for RPC calls in milliseconds', '5000') | ||
.option('-w, --watch', 'Watch for changes and regenerate automatically', false) | ||
.argument( | ||
"<path>", | ||
"Path to the input TypeScript file containing interface definitions" | ||
) | ||
.option( | ||
"-p, --package-name <name>", | ||
"Package name for the generated RPC package", | ||
"@socket-rpc/rpc" | ||
) | ||
.option( | ||
"-t, --timeout <ms>", | ||
"Default timeout for RPC calls in milliseconds", | ||
"5000" | ||
) | ||
.option( | ||
"-w, --watch", | ||
"Watch for changes and regenerate automatically", | ||
false | ||
) | ||
.action((filePath, options) => { | ||
@@ -863,3 +881,5 @@ const inputPath = path.resolve(process.cwd(), filePath); | ||
if (!fs.existsSync(inputPath) || !fs.statSync(inputPath).isFile()) { | ||
console.error(`ā Error: Input file not found or is not a file at ${inputPath}`); | ||
console.error( | ||
`ā Error: Input file not found or is not a file at ${inputPath}` | ||
); | ||
process.exit(1); | ||
@@ -875,3 +895,3 @@ } | ||
packageName: options.packageName, | ||
defaultTimeout: parseInt(options.timeout, 10) | ||
defaultTimeout: parseInt(options.timeout, 10), | ||
}; | ||
@@ -878,0 +898,0 @@ |
{ | ||
"name": "socketrpc-gen", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "Code generator for Socket.IO RPC packages using ts-morph", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
47683
1.08%818
2.38%