Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,6 @@ Below you see how Release compares to other tools. Keep in mind that I'm only co
| Comments on relevant GitHub pull requests | ✅ | [✅](https://github.com/semantic-release/semantic-release/pull/2330#issuecomment-1015001540) | [✅](https://github.com/intuit/auto/pull/2175#issuecomment-1073389222) | ? |
| Reverts tags/commits if publishing fails | ✅ | ❌ | ? | ? |
| Supports monorepos | ❌ | ✅ | ✅ | ✅ |
| Support dry run | | ✅ | ✅ | [❌](https://github.com/changesets/changesets/issues/614) |
| Support dry run | | ✅ | ✅ | [❌](https://github.com/changesets/changesets/issues/614) |

> <sup>1</sup> - requires additional plugins.
18 changes: 15 additions & 3 deletions src/Command.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
import { log } from './logger'
import type { BuilderCallback } from 'yargs'
import type { Config } from './utils/getConfig'

export abstract class Command<Argv extends Record<string, any> = never> {
export interface DefaultArgv {
_: (number | string)[]
}

export abstract class Command<Argv extends Record<string, any> = {}> {
static readonly command: string
static readonly description: string
static readonly builder: BuilderCallback<{}, any> = () => {}

constructor(protected readonly config: Config) {}
protected log: typeof log

constructor(
protected readonly config: Config,
protected readonly argv: DefaultArgv & Argv,
) {
this.log = log
}

public run = async (argv: Argv): Promise<void> => {}
public run = async (): Promise<void> => {}
}
Loading