feat: support multiple projects in one config
This commit is contained in:
parent
c2d54aa195
commit
0edbdea7d1
|
@ -0,0 +1,20 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [cautious-journey](./cautious-journey.md) > [GithubRemote](./cautious-journey.githubremote.md) > [(constructor)](./cautious-journey.githubremote._constructor_.md)
|
||||||
|
|
||||||
|
## GithubRemote.(constructor)
|
||||||
|
|
||||||
|
Constructs a new instance of the `GithubRemote` class
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
constructor(options: RemoteOptions);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| options | [RemoteOptions](./cautious-journey.remoteoptions.md) | |
|
||||||
|
|
|
@ -13,6 +13,12 @@ export declare class GithubRemote implements Remote
|
||||||
```
|
```
|
||||||
<b>Implements:</b> [Remote](./cautious-journey.remote.md)
|
<b>Implements:</b> [Remote](./cautious-journey.remote.md)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
| Constructor | Modifiers | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| [(constructor)(options)](./cautious-journey.githubremote._constructor_.md) | | Constructs a new instance of the <code>GithubRemote</code> class |
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Method | Modifiers | Description |
|
| Method | Modifiers | Description |
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [cautious-journey](./cautious-journey.md) > [GitlabRemote](./cautious-journey.gitlabremote.md) > [(constructor)](./cautious-journey.gitlabremote._constructor_.md)
|
||||||
|
|
||||||
|
## GitlabRemote.(constructor)
|
||||||
|
|
||||||
|
Constructs a new instance of the `GitlabRemote` class
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
constructor(options: RemoteOptions);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| options | [RemoteOptions](./cautious-journey.remoteoptions.md) | |
|
||||||
|
|
|
@ -13,6 +13,12 @@ export declare class GitlabRemote implements Remote
|
||||||
```
|
```
|
||||||
<b>Implements:</b> [Remote](./cautious-journey.remote.md)
|
<b>Implements:</b> [Remote](./cautious-journey.remote.md)
|
||||||
|
|
||||||
|
## Constructors
|
||||||
|
|
||||||
|
| Constructor | Modifiers | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| [(constructor)(options)](./cautious-journey.gitlabremote._constructor_.md) | | Constructs a new instance of the <code>GitlabRemote</code> class |
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
| Method | Modifiers | Description |
|
| Method | Modifiers | Description |
|
||||||
|
|
|
@ -5,25 +5,32 @@ import { RemoteOptions } from '../remote';
|
||||||
* Config data for the app, loaded from CLI or DOM.
|
* Config data for the app, loaded from CLI or DOM.
|
||||||
*/
|
*/
|
||||||
export interface ConfigData {
|
export interface ConfigData {
|
||||||
/**
|
projects: Array<{
|
||||||
* Color palette for labels without their own.
|
/**
|
||||||
*/
|
* Color palette for labels without their own.
|
||||||
colors: Array<string>;
|
*/
|
||||||
|
colors: Array<string>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Individual flag labels.
|
* Individual flag labels.
|
||||||
*/
|
*/
|
||||||
flags: Array<FlagLabel>;
|
flags: Array<FlagLabel>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remote APIs.
|
* Project name or path.
|
||||||
*/
|
*/
|
||||||
remotes: Array<RemoteOptions>;
|
name: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grouped state labels.
|
* Remote APIs.
|
||||||
*/
|
*/
|
||||||
states: Array<StateLabel>;
|
remote: RemoteOptions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Grouped state labels.
|
||||||
|
*/
|
||||||
|
states: Array<StateLabel>;
|
||||||
|
}>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,9 +40,15 @@ export interface ConfigData {
|
||||||
*/
|
*/
|
||||||
export function initConfig(): ConfigData {
|
export function initConfig(): ConfigData {
|
||||||
return {
|
return {
|
||||||
colors: [],
|
projects: [{
|
||||||
flags: [],
|
colors: [],
|
||||||
remotes: [],
|
flags: [],
|
||||||
states: [],
|
name: '',
|
||||||
|
remote: {
|
||||||
|
data: {},
|
||||||
|
type: '',
|
||||||
|
},
|
||||||
|
states: [],
|
||||||
|
}],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
17
src/main.ts
17
src/main.ts
|
@ -1,5 +1,6 @@
|
||||||
import { InvalidArgumentError } from '@apextoaster/js-utils';
|
import { InvalidArgumentError } from '@apextoaster/js-utils';
|
||||||
|
|
||||||
|
import { ConfigData } from './config';
|
||||||
import { Commands, createParser } from './config/args';
|
import { Commands, createParser } from './config/args';
|
||||||
import { GithubRemote } from './remote/github';
|
import { GithubRemote } from './remote/github';
|
||||||
import { syncIssues, syncLabels, SyncOptions } from './sync';
|
import { syncIssues, syncLabels, SyncOptions } from './sync';
|
||||||
|
@ -21,11 +22,17 @@ export async function main(argv: Array<string>): Promise<number> {
|
||||||
const args = parser.parse(argv.slice(SLICE_ARGS));
|
const args = parser.parse(argv.slice(SLICE_ARGS));
|
||||||
|
|
||||||
// load config
|
// load config
|
||||||
const config = {
|
const config: ConfigData = {
|
||||||
colors: [],
|
projects: [{
|
||||||
flags: [],
|
colors: [],
|
||||||
remotes: [],
|
flags: [],
|
||||||
states: [],
|
name: '',
|
||||||
|
remote: {
|
||||||
|
data: {},
|
||||||
|
type: '',
|
||||||
|
},
|
||||||
|
states: [],
|
||||||
|
}],
|
||||||
};
|
};
|
||||||
|
|
||||||
/* eslint-disable-next-line no-console */
|
/* eslint-disable-next-line no-console */
|
||||||
|
|
Loading…
Reference in New Issue