diff --git a/docs/api/cautious-journey.flaglabel.md b/docs/api/cautious-journey.flaglabel.md index e1febd9..776f07a 100644 --- a/docs/api/cautious-journey.flaglabel.md +++ b/docs/api/cautious-journey.flaglabel.md @@ -9,7 +9,7 @@ Individual labels: the equivalent of a checkbox. Signature: ```typescript -export interface FlagLabel extends BaseLabel, LabelSet +export interface FlagLabel extends BaseLabel, ChangeSet ``` -Extends: BaseLabel, LabelSet +Extends: BaseLabel, ChangeSet diff --git a/docs/api/cautious-journey.statechange.md b/docs/api/cautious-journey.statechange.md index 982bbd8..b524755 100644 --- a/docs/api/cautious-journey.statechange.md +++ b/docs/api/cautious-journey.statechange.md @@ -9,9 +9,9 @@ The transition between two state values. Signature: ```typescript -export interface StateChange extends LabelSet +export interface StateChange extends ChangeSet ``` -Extends: LabelSet +Extends: ChangeSet ## Properties diff --git a/docs/api/cautious-journey.statelabel.md b/docs/api/cautious-journey.statelabel.md index e5c6196..b91a9ff 100644 --- a/docs/api/cautious-journey.statelabel.md +++ b/docs/api/cautious-journey.statelabel.md @@ -9,9 +9,9 @@ Grouped labels: the equivalent of a radio group. Signature: ```typescript -export interface StateLabel extends BaseLabel, LabelSet +export interface StateLabel extends BaseLabel, ChangeSet ``` -Extends: BaseLabel, LabelSet +Extends: BaseLabel, ChangeSet ## Properties diff --git a/docs/getting-started.md b/docs/getting-started.md index 935496f..cd875ba 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -21,9 +21,9 @@ This guide explains how to start using `cautious-journey` to manage project and - [Commands](#commands) - [Sync Labels](#sync-labels) - [Sync Issues](#sync-issues) - - [Transitions](#transitions) - - [Flag Transitions](#flag-transitions) - - [State Transitions](#state-transitions) + - [Changes](#changes) + - [Flag Changes](#flag-changes) + - [State Changes](#state-changes) ## Setup @@ -83,12 +83,12 @@ TODO: what happens when you sync the project labels? TODO: what happens when you sync the issue labels? -## Transitions +## Changes -### Flag Transitions +### Flag Changes TODO: how are flag labels added and removed? -### State Transitions +### State Changes TODO: how are state labels added and removed? diff --git a/src/config/args.ts b/src/config/args.ts index ae7b7b6..d1b005a 100644 --- a/src/config/args.ts +++ b/src/config/args.ts @@ -15,6 +15,7 @@ interface Parser { export interface ParsedArgs { config: string; dryrun: boolean; + project?: Array; remote: string; } @@ -45,6 +46,12 @@ export function createParser(modeset: Modeback): Parser { demand: false, type: 'boolean', }, + project: { + alias: ['p'], + array: true, + demand: false, + type: 'string', + }, remote: { alias: ['r'], demand: true, diff --git a/src/labels.ts b/src/labels.ts index 74c29ee..a8a9a03 100644 --- a/src/labels.ts +++ b/src/labels.ts @@ -8,7 +8,7 @@ export interface LabelRef { /** * A set of labels to add and/or remove. */ -export interface LabelSet { +export interface ChangeSet { adds: Array; removes: Array; } @@ -34,14 +34,14 @@ export interface BaseLabel { /** * Individual labels: the equivalent of a checkbox. */ -export interface FlagLabel extends BaseLabel, LabelSet { +export interface FlagLabel extends BaseLabel, ChangeSet { /* empty */ } /** * The transition between two state values. */ -export interface StateChange extends LabelSet { +export interface StateChange extends ChangeSet { /** * Required labels for this state change to occur. */ @@ -61,7 +61,7 @@ export interface StateValue extends BaseLabel { /** * Grouped labels: the equivalent of a radio group. */ -export interface StateLabel extends BaseLabel, LabelSet { +export interface StateLabel extends BaseLabel, ChangeSet { /** * Values for this state. */ diff --git a/src/main.ts b/src/main.ts index 2c64207..c870c1f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { InvalidArgumentError, isNil } from '@apextoaster/js-utils'; +import { InvalidArgumentError, isNil, doesExist } from '@apextoaster/js-utils'; import { createSchema } from '@apextoaster/js-yaml-schema'; import { existsSync, readFileSync, realpathSync } from 'fs'; import { DEFAULT_SAFE_SCHEMA, safeLoad } from 'js-yaml'; @@ -57,6 +57,11 @@ export async function main(argv: Array): Promise { }, 'startup environment'); for (const project of config.projects) { + if (doesExist(args.project) && !args.project.includes(project.name)) { + logger.info({ project: project.name }, 'skipping project'); + continue; + } + const remote = new GithubRemote({ ...project.remote, dryrun: args.dryrun, diff --git a/src/remote/github.ts b/src/remote/github.ts index d759f42..2221abb 100644 --- a/src/remote/github.ts +++ b/src/remote/github.ts @@ -18,7 +18,7 @@ export class GithubRemote implements Remote { constructor(options: RemoteOptions) { this.options = options; - options.logger.debug({ options }, 'github remote'); + options.logger.debug(options, 'github remote'); } public async connect() {