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)
|
||||
|
||||
## Constructors
|
||||
|
||||
| Constructor | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [(constructor)(options)](./cautious-journey.githubremote._constructor_.md) | | Constructs a new instance of the <code>GithubRemote</code> class |
|
||||
|
||||
## Methods
|
||||
|
||||
| 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)
|
||||
|
||||
## Constructors
|
||||
|
||||
| Constructor | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [(constructor)(options)](./cautious-journey.gitlabremote._constructor_.md) | | Constructs a new instance of the <code>GitlabRemote</code> class |
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
|
|
|
@ -5,25 +5,32 @@ import { RemoteOptions } from '../remote';
|
|||
* Config data for the app, loaded from CLI or DOM.
|
||||
*/
|
||||
export interface ConfigData {
|
||||
/**
|
||||
* Color palette for labels without their own.
|
||||
*/
|
||||
colors: Array<string>;
|
||||
projects: Array<{
|
||||
/**
|
||||
* Color palette for labels without their own.
|
||||
*/
|
||||
colors: Array<string>;
|
||||
|
||||
/**
|
||||
* Individual flag labels.
|
||||
*/
|
||||
flags: Array<FlagLabel>;
|
||||
/**
|
||||
* Individual flag labels.
|
||||
*/
|
||||
flags: Array<FlagLabel>;
|
||||
|
||||
/**
|
||||
* Remote APIs.
|
||||
*/
|
||||
remotes: Array<RemoteOptions>;
|
||||
/**
|
||||
* Project name or path.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Grouped state labels.
|
||||
*/
|
||||
states: Array<StateLabel>;
|
||||
/**
|
||||
* Remote APIs.
|
||||
*/
|
||||
remote: RemoteOptions;
|
||||
|
||||
/**
|
||||
* Grouped state labels.
|
||||
*/
|
||||
states: Array<StateLabel>;
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,9 +40,15 @@ export interface ConfigData {
|
|||
*/
|
||||
export function initConfig(): ConfigData {
|
||||
return {
|
||||
colors: [],
|
||||
flags: [],
|
||||
remotes: [],
|
||||
states: [],
|
||||
projects: [{
|
||||
colors: [],
|
||||
flags: [],
|
||||
name: '',
|
||||
remote: {
|
||||
data: {},
|
||||
type: '',
|
||||
},
|
||||
states: [],
|
||||
}],
|
||||
};
|
||||
}
|
||||
|
|
17
src/main.ts
17
src/main.ts
|
@ -1,5 +1,6 @@
|
|||
import { InvalidArgumentError } from '@apextoaster/js-utils';
|
||||
|
||||
import { ConfigData } from './config';
|
||||
import { Commands, createParser } from './config/args';
|
||||
import { GithubRemote } from './remote/github';
|
||||
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));
|
||||
|
||||
// load config
|
||||
const config = {
|
||||
colors: [],
|
||||
flags: [],
|
||||
remotes: [],
|
||||
states: [],
|
||||
const config: ConfigData = {
|
||||
projects: [{
|
||||
colors: [],
|
||||
flags: [],
|
||||
name: '',
|
||||
remote: {
|
||||
data: {},
|
||||
type: '',
|
||||
},
|
||||
states: [],
|
||||
}],
|
||||
};
|
||||
|
||||
/* eslint-disable-next-line no-console */
|
||||
|
|
Loading…
Reference in New Issue