fix: add cli

This commit is contained in:
2025-01-31 02:02:07 +08:00
parent ca5f4984a4
commit 733b697ee2
11 changed files with 818 additions and 54 deletions

19
scripts/cli.ts Normal file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env node
import { Command } from 'commander';
import { rewriteAllObservableSubscribeToLastValueFrom } from './code-transform';
const program = new Command();
program
.version('1.0.0')
.description('A CLI tool to help develop oidc-client-rx');
program
.command('rewrite <pattern>')
.description('Rewrite files matching the given glob pattern')
.action(async (pattern: string) => {
await rewriteAllObservableSubscribeToLastValueFrom(pattern);
});
program.parse(process.argv);