centy 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/create.d.ts +21 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +95 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/get.d.ts.map +1 -1
- package/dist/commands/get.js +1 -7
- package/dist/commands/get.js.map +1 -1
- package/dist/daemon/daemon-create-item.d.ts +6 -0
- package/dist/daemon/daemon-create-item.d.ts.map +1 -0
- package/dist/daemon/daemon-create-item.js +9 -0
- package/dist/daemon/daemon-create-item.js.map +1 -0
- package/dist/utils/parse-custom-fields.d.ts +5 -0
- package/dist/utils/parse-custom-fields.d.ts.map +1 -0
- package/dist/utils/parse-custom-fields.js +19 -0
- package/dist/utils/parse-custom-fields.js.map +1 -0
- package/dist/utils/to-plural.d.ts +5 -0
- package/dist/utils/to-plural.d.ts.map +1 -0
- package/dist/utils/to-plural.js +11 -0
- package/dist/utils/to-plural.js.map +1 -0
- package/oclif.manifest.json +125 -195
- package/package.json +1 -1
- package/dist/commands/create/doc.d.ts +0 -17
- package/dist/commands/create/doc.d.ts.map +0 -1
- package/dist/commands/create/doc.js +0 -69
- package/dist/commands/create/doc.js.map +0 -1
- package/dist/commands/create/issue.d.ts +0 -19
- package/dist/commands/create/issue.d.ts.map +0 -1
- package/dist/commands/create/issue.js +0 -71
- package/dist/commands/create/issue.js.map +0 -1
- package/dist/lib/create-issue/index.d.ts +0 -2
- package/dist/lib/create-issue/index.d.ts.map +0 -1
- package/dist/lib/create-issue/index.js +0 -2
- package/dist/lib/create-issue/index.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
/**
|
|
3
|
+
* Create a new item of any registered type via the generic CreateItem RPC
|
|
4
|
+
*/
|
|
5
|
+
export default class Create extends Command {
|
|
6
|
+
static args: {
|
|
7
|
+
type: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static flags: {
|
|
12
|
+
title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
body: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
status: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
priority: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'custom-field': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;AAYlD;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,OAAO;IAEzC,OAAgB,IAAI;;MAKnB;IAGD,OAAgB,WAAW,SAAkC;IAG7D,OAAgB,QAAQ,WAMvB;IAGD,OAAgB,KAAK;;;;;;;MA0BpB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyClC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// eslint-disable-next-line import/order
|
|
2
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
3
|
+
import { daemonCreateItem } from '../daemon/daemon-create-item.js';
|
|
4
|
+
import { projectFlag } from '../flags/project-flag.js';
|
|
5
|
+
import { ensureInitialized, NotInitializedError, } from '../utils/ensure-initialized.js';
|
|
6
|
+
import { parseCustomFields } from '../utils/parse-custom-fields.js';
|
|
7
|
+
import { resolveProjectPath } from '../utils/resolve-project-path.js';
|
|
8
|
+
import { toPlural } from '../utils/to-plural.js';
|
|
9
|
+
/**
|
|
10
|
+
* Create a new item of any registered type via the generic CreateItem RPC
|
|
11
|
+
*/
|
|
12
|
+
// eslint-disable-next-line custom/no-default-class-export, class-export/class-export
|
|
13
|
+
export default class Create extends Command {
|
|
14
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
15
|
+
static args = {
|
|
16
|
+
type: Args.string({
|
|
17
|
+
description: 'Item type (e.g., issue, doc, epic, or custom type)',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
22
|
+
static description = 'Create a new item of any type';
|
|
23
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
24
|
+
static examples = [
|
|
25
|
+
'<%= config.bin %> create issue --title "Bug in login" --priority 1',
|
|
26
|
+
'<%= config.bin %> create doc --title "Getting Started" --body "# Guide"',
|
|
27
|
+
'<%= config.bin %> create epic --title "Auth overhaul" --status open',
|
|
28
|
+
'<%= config.bin %> create bug --title "Crash on startup"',
|
|
29
|
+
'<%= config.bin %> create task --title "Review PR" --custom-field "assignee=alice"',
|
|
30
|
+
];
|
|
31
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
32
|
+
static flags = {
|
|
33
|
+
title: Flags.string({
|
|
34
|
+
char: 't',
|
|
35
|
+
description: 'Item title',
|
|
36
|
+
required: true,
|
|
37
|
+
}),
|
|
38
|
+
body: Flags.string({
|
|
39
|
+
char: 'b',
|
|
40
|
+
description: 'Item body / description (markdown)',
|
|
41
|
+
default: '',
|
|
42
|
+
}),
|
|
43
|
+
status: Flags.string({
|
|
44
|
+
char: 's',
|
|
45
|
+
description: 'Initial status (empty = use type default)',
|
|
46
|
+
default: '',
|
|
47
|
+
}),
|
|
48
|
+
priority: Flags.integer({
|
|
49
|
+
char: 'p',
|
|
50
|
+
description: 'Priority level (0 = use default)',
|
|
51
|
+
default: 0,
|
|
52
|
+
}),
|
|
53
|
+
'custom-field': Flags.string({
|
|
54
|
+
description: 'Custom field as key=value (repeatable)',
|
|
55
|
+
multiple: true,
|
|
56
|
+
}),
|
|
57
|
+
project: projectFlag,
|
|
58
|
+
};
|
|
59
|
+
async run() {
|
|
60
|
+
const { args, flags } = await this.parse(Create);
|
|
61
|
+
const itemType = toPlural(args.type);
|
|
62
|
+
const cwd = await resolveProjectPath(flags.project);
|
|
63
|
+
try {
|
|
64
|
+
await ensureInitialized(cwd);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (error instanceof NotInitializedError) {
|
|
68
|
+
this.error(error.message);
|
|
69
|
+
}
|
|
70
|
+
throw error instanceof Error ? error : new Error(String(error));
|
|
71
|
+
}
|
|
72
|
+
const customFields = parseCustomFields(flags['custom-field']);
|
|
73
|
+
const response = await daemonCreateItem({
|
|
74
|
+
projectPath: cwd,
|
|
75
|
+
itemType,
|
|
76
|
+
title: flags.title,
|
|
77
|
+
body: flags.body,
|
|
78
|
+
status: flags.status,
|
|
79
|
+
priority: flags.priority,
|
|
80
|
+
customFields,
|
|
81
|
+
});
|
|
82
|
+
if (!response.success) {
|
|
83
|
+
const errorMsg = response.error !== '' ? response.error : 'Failed to create item';
|
|
84
|
+
this.error(errorMsg);
|
|
85
|
+
}
|
|
86
|
+
const item = response.item;
|
|
87
|
+
const meta = item.metadata;
|
|
88
|
+
const displayId = meta !== undefined && meta.displayNumber > 0
|
|
89
|
+
? ` #${meta.displayNumber}`
|
|
90
|
+
: '';
|
|
91
|
+
this.log(`Created ${args.type}${displayId}: "${item.title}"`);
|
|
92
|
+
this.log(` ID: ${item.id}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","source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AAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,YAAY;SACb,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,MAAM,QAAQ,GACZ,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAA;YAClE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACtB,CAAC;QAED,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAK,CAAA;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC1B,MAAM,SAAS,GACb,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC;YAC1C,CAAC,CAAC,KAAK,IAAI,CAAC,aAAa,EAAE;YAC3B,CAAC,CAAC,EAAE,CAAA;QACR,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,IAAI,GAAG,SAAS,MAAM,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QAC7D,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;IAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/commands/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/commands/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;AAalD;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;IAEtC,OAAgB,IAAI;;;MASnB;IAGD,OAAgB,WAAW,SAAuC;IAGlE,OAAgB,QAAQ,WASvB;IAGD,OAAgB,KAAK;;;;MAWpB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4ClC"}
|
package/dist/commands/get.js
CHANGED
|
@@ -6,6 +6,7 @@ import { formatGenericItem } from '../lib/get-item/format-generic-item.js';
|
|
|
6
6
|
import { handleGlobalGet } from '../lib/get-item/handle-global-get.js';
|
|
7
7
|
import { ensureInitialized, NotInitializedError, } from '../utils/ensure-initialized.js';
|
|
8
8
|
import { resolveProjectPath } from '../utils/resolve-project-path.js';
|
|
9
|
+
import { toPlural } from '../utils/to-plural.js';
|
|
9
10
|
/**
|
|
10
11
|
* Get any item by type and identifier
|
|
11
12
|
*/
|
|
@@ -81,11 +82,4 @@ export default class Get extends Command {
|
|
|
81
82
|
formatGenericItem(response.item, this.log.bind(this));
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
function toPlural(type) {
|
|
85
|
-
if (type.endsWith('s'))
|
|
86
|
-
return type;
|
|
87
|
-
if (type.endsWith('y'))
|
|
88
|
-
return type.slice(0, -1) + 'ies';
|
|
89
|
-
return type + 's';
|
|
90
|
-
}
|
|
91
85
|
//# sourceMappingURL=get.js.map
|
package/dist/commands/get.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../src/commands/get.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["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,IAAI,CAAC,EAAE;SAChB,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC5B,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;YAChD,OAAM;QACR,CAAC;QAED,iBAAiB,CAAC,QAAQ,CAAC,IAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACxD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CreateItemRequest, CreateItemResponse } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a generic item via daemon
|
|
4
|
+
*/
|
|
5
|
+
export declare function daemonCreateItem(request: CreateItemRequest): Promise<CreateItemResponse>;
|
|
6
|
+
//# sourceMappingURL=daemon-create-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-create-item.d.ts","sourceRoot":"","sources":["../../src/daemon/daemon-create-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAGvE;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAG7B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getDaemonClient, callWithDeadline } from './load-proto.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a generic item via daemon
|
|
4
|
+
*/
|
|
5
|
+
export function daemonCreateItem(request) {
|
|
6
|
+
const client = getDaemonClient();
|
|
7
|
+
return callWithDeadline(client.createItem.bind(client), request);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=daemon-create-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-create-item.js","sourceRoot":"","sources":["../../src/daemon/daemon-create-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEnE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA0B;IAE1B,MAAM,MAAM,GAAG,eAAe,EAAE,CAAA;IAChC,OAAO,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAA;AAClE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-custom-fields.d.ts","sourceRoot":"","sources":["../../src/utils/parse-custom-fields.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYxB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse custom field key=value pairs into an object.
|
|
3
|
+
*/
|
|
4
|
+
export function parseCustomFields(fields) {
|
|
5
|
+
const result = {};
|
|
6
|
+
if (fields === undefined)
|
|
7
|
+
return result;
|
|
8
|
+
for (const field of fields) {
|
|
9
|
+
const eqIndex = field.indexOf('=');
|
|
10
|
+
if (eqIndex === -1)
|
|
11
|
+
continue;
|
|
12
|
+
const key = field.slice(0, eqIndex);
|
|
13
|
+
const value = field.slice(eqIndex + 1);
|
|
14
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
15
|
+
result[key] = value;
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=parse-custom-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-custom-fields.js","sourceRoot":"","sources":["../../src/utils/parse-custom-fields.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAA4B;IAE5B,MAAM,MAAM,GAA2B,EAAE,CAAA;IACzC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAA;IACvC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAClC,IAAI,OAAO,KAAK,CAAC,CAAC;YAAE,SAAQ;QAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAA;QACtC,4DAA4D;QAC5D,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;IACrB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-plural.d.ts","sourceRoot":"","sources":["../../src/utils/to-plural.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI7C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a singular item type name to its plural form.
|
|
3
|
+
*/
|
|
4
|
+
export function toPlural(type) {
|
|
5
|
+
if (type.endsWith('s'))
|
|
6
|
+
return type;
|
|
7
|
+
if (type.endsWith('y'))
|
|
8
|
+
return type.slice(0, -1) + 'ies';
|
|
9
|
+
return type + 's';
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=to-plural.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-plural.js","sourceRoot":"","sources":["../../src/utils/to-plural.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;IACxD,OAAO,IAAI,GAAG,GAAG,CAAA;AACnB,CAAC"}
|
package/oclif.manifest.json
CHANGED
|
@@ -155,6 +155,90 @@
|
|
|
155
155
|
"config.js"
|
|
156
156
|
]
|
|
157
157
|
},
|
|
158
|
+
"create": {
|
|
159
|
+
"aliases": [],
|
|
160
|
+
"args": {
|
|
161
|
+
"type": {
|
|
162
|
+
"description": "Item type (e.g., issue, doc, epic, or custom type)",
|
|
163
|
+
"name": "type",
|
|
164
|
+
"required": true
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"description": "Create a new item of any type",
|
|
168
|
+
"examples": [
|
|
169
|
+
"<%= config.bin %> create issue --title \"Bug in login\" --priority 1",
|
|
170
|
+
"<%= config.bin %> create doc --title \"Getting Started\" --body \"# Guide\"",
|
|
171
|
+
"<%= config.bin %> create epic --title \"Auth overhaul\" --status open",
|
|
172
|
+
"<%= config.bin %> create bug --title \"Crash on startup\"",
|
|
173
|
+
"<%= config.bin %> create task --title \"Review PR\" --custom-field \"assignee=alice\""
|
|
174
|
+
],
|
|
175
|
+
"flags": {
|
|
176
|
+
"title": {
|
|
177
|
+
"char": "t",
|
|
178
|
+
"description": "Item title",
|
|
179
|
+
"name": "title",
|
|
180
|
+
"required": true,
|
|
181
|
+
"hasDynamicHelp": false,
|
|
182
|
+
"multiple": false,
|
|
183
|
+
"type": "option"
|
|
184
|
+
},
|
|
185
|
+
"body": {
|
|
186
|
+
"char": "b",
|
|
187
|
+
"description": "Item body / description (markdown)",
|
|
188
|
+
"name": "body",
|
|
189
|
+
"default": "",
|
|
190
|
+
"hasDynamicHelp": false,
|
|
191
|
+
"multiple": false,
|
|
192
|
+
"type": "option"
|
|
193
|
+
},
|
|
194
|
+
"status": {
|
|
195
|
+
"char": "s",
|
|
196
|
+
"description": "Initial status (empty = use type default)",
|
|
197
|
+
"name": "status",
|
|
198
|
+
"default": "",
|
|
199
|
+
"hasDynamicHelp": false,
|
|
200
|
+
"multiple": false,
|
|
201
|
+
"type": "option"
|
|
202
|
+
},
|
|
203
|
+
"priority": {
|
|
204
|
+
"char": "p",
|
|
205
|
+
"description": "Priority level (0 = use default)",
|
|
206
|
+
"name": "priority",
|
|
207
|
+
"default": 0,
|
|
208
|
+
"hasDynamicHelp": false,
|
|
209
|
+
"multiple": false,
|
|
210
|
+
"type": "option"
|
|
211
|
+
},
|
|
212
|
+
"custom-field": {
|
|
213
|
+
"description": "Custom field as key=value (repeatable)",
|
|
214
|
+
"name": "custom-field",
|
|
215
|
+
"hasDynamicHelp": false,
|
|
216
|
+
"multiple": true,
|
|
217
|
+
"type": "option"
|
|
218
|
+
},
|
|
219
|
+
"project": {
|
|
220
|
+
"description": "Project name or path (defaults to current directory)",
|
|
221
|
+
"name": "project",
|
|
222
|
+
"hasDynamicHelp": false,
|
|
223
|
+
"multiple": false,
|
|
224
|
+
"type": "option"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"hasDynamicHelp": false,
|
|
228
|
+
"hiddenAliases": [],
|
|
229
|
+
"id": "create",
|
|
230
|
+
"pluginAlias": "centy",
|
|
231
|
+
"pluginName": "centy",
|
|
232
|
+
"pluginType": "core",
|
|
233
|
+
"strict": true,
|
|
234
|
+
"enableJsonFlag": false,
|
|
235
|
+
"isESM": true,
|
|
236
|
+
"relativePath": [
|
|
237
|
+
"dist",
|
|
238
|
+
"commands",
|
|
239
|
+
"create.js"
|
|
240
|
+
]
|
|
241
|
+
},
|
|
158
242
|
"get": {
|
|
159
243
|
"aliases": [],
|
|
160
244
|
"args": {
|
|
@@ -891,160 +975,6 @@
|
|
|
891
975
|
"status.js"
|
|
892
976
|
]
|
|
893
977
|
},
|
|
894
|
-
"create:doc": {
|
|
895
|
-
"aliases": [],
|
|
896
|
-
"args": {},
|
|
897
|
-
"description": "Create a new documentation file",
|
|
898
|
-
"examples": [
|
|
899
|
-
"<%= config.bin %> create doc --title \"Getting Started\"",
|
|
900
|
-
"<%= config.bin %> create doc -t \"API Reference\" -c \"# API\n\nDocumentation here\"",
|
|
901
|
-
"<%= config.bin %> create doc --title \"Guide\" --slug my-guide",
|
|
902
|
-
"<%= config.bin %> create doc --title \"Guide\" --project centy-daemon"
|
|
903
|
-
],
|
|
904
|
-
"flags": {
|
|
905
|
-
"title": {
|
|
906
|
-
"char": "t",
|
|
907
|
-
"description": "Doc title",
|
|
908
|
-
"name": "title",
|
|
909
|
-
"required": true,
|
|
910
|
-
"hasDynamicHelp": false,
|
|
911
|
-
"multiple": false,
|
|
912
|
-
"type": "option"
|
|
913
|
-
},
|
|
914
|
-
"content": {
|
|
915
|
-
"char": "c",
|
|
916
|
-
"description": "Doc content (markdown)",
|
|
917
|
-
"name": "content",
|
|
918
|
-
"default": "",
|
|
919
|
-
"hasDynamicHelp": false,
|
|
920
|
-
"multiple": false,
|
|
921
|
-
"type": "option"
|
|
922
|
-
},
|
|
923
|
-
"slug": {
|
|
924
|
-
"description": "Custom slug (auto-generated from title if not provided)",
|
|
925
|
-
"name": "slug",
|
|
926
|
-
"hasDynamicHelp": false,
|
|
927
|
-
"multiple": false,
|
|
928
|
-
"type": "option"
|
|
929
|
-
},
|
|
930
|
-
"template": {
|
|
931
|
-
"description": "Template name to use",
|
|
932
|
-
"name": "template",
|
|
933
|
-
"hasDynamicHelp": false,
|
|
934
|
-
"multiple": false,
|
|
935
|
-
"type": "option"
|
|
936
|
-
},
|
|
937
|
-
"project": {
|
|
938
|
-
"description": "Project name or path (defaults to current directory)",
|
|
939
|
-
"name": "project",
|
|
940
|
-
"hasDynamicHelp": false,
|
|
941
|
-
"multiple": false,
|
|
942
|
-
"type": "option"
|
|
943
|
-
}
|
|
944
|
-
},
|
|
945
|
-
"hasDynamicHelp": false,
|
|
946
|
-
"hiddenAliases": [],
|
|
947
|
-
"id": "create:doc",
|
|
948
|
-
"pluginAlias": "centy",
|
|
949
|
-
"pluginName": "centy",
|
|
950
|
-
"pluginType": "core",
|
|
951
|
-
"strict": true,
|
|
952
|
-
"enableJsonFlag": false,
|
|
953
|
-
"isESM": true,
|
|
954
|
-
"relativePath": [
|
|
955
|
-
"dist",
|
|
956
|
-
"commands",
|
|
957
|
-
"create",
|
|
958
|
-
"doc.js"
|
|
959
|
-
]
|
|
960
|
-
},
|
|
961
|
-
"create:issue": {
|
|
962
|
-
"aliases": [],
|
|
963
|
-
"args": {},
|
|
964
|
-
"description": "Create a new issue in the .centy folder",
|
|
965
|
-
"examples": [
|
|
966
|
-
"<%= config.bin %> create issue",
|
|
967
|
-
"<%= config.bin %> create issue --title \"Bug in login\" --priority high",
|
|
968
|
-
"<%= config.bin %> create issue -t \"Add feature\" -d \"Implement dark mode\"",
|
|
969
|
-
"<%= config.bin %> create issue -t \"Add feature\" --project centy-daemon",
|
|
970
|
-
"<%= config.bin %> create issue --title \"WIP feature\" --draft",
|
|
971
|
-
"<%= config.bin %> create issue --title \"Cross-org bug\" --org"
|
|
972
|
-
],
|
|
973
|
-
"flags": {
|
|
974
|
-
"title": {
|
|
975
|
-
"char": "t",
|
|
976
|
-
"description": "Issue title",
|
|
977
|
-
"name": "title",
|
|
978
|
-
"hasDynamicHelp": false,
|
|
979
|
-
"multiple": false,
|
|
980
|
-
"type": "option"
|
|
981
|
-
},
|
|
982
|
-
"description": {
|
|
983
|
-
"char": "d",
|
|
984
|
-
"description": "Issue description",
|
|
985
|
-
"name": "description",
|
|
986
|
-
"hasDynamicHelp": false,
|
|
987
|
-
"multiple": false,
|
|
988
|
-
"type": "option"
|
|
989
|
-
},
|
|
990
|
-
"priority": {
|
|
991
|
-
"char": "p",
|
|
992
|
-
"description": "Priority level (low/medium/high)",
|
|
993
|
-
"name": "priority",
|
|
994
|
-
"hasDynamicHelp": false,
|
|
995
|
-
"multiple": false,
|
|
996
|
-
"options": [
|
|
997
|
-
"low",
|
|
998
|
-
"medium",
|
|
999
|
-
"high"
|
|
1000
|
-
],
|
|
1001
|
-
"type": "option"
|
|
1002
|
-
},
|
|
1003
|
-
"status": {
|
|
1004
|
-
"char": "s",
|
|
1005
|
-
"description": "Initial status",
|
|
1006
|
-
"name": "status",
|
|
1007
|
-
"default": "open",
|
|
1008
|
-
"hasDynamicHelp": false,
|
|
1009
|
-
"multiple": false,
|
|
1010
|
-
"type": "option"
|
|
1011
|
-
},
|
|
1012
|
-
"draft": {
|
|
1013
|
-
"description": "Create as draft",
|
|
1014
|
-
"name": "draft",
|
|
1015
|
-
"allowNo": false,
|
|
1016
|
-
"type": "boolean"
|
|
1017
|
-
},
|
|
1018
|
-
"org": {
|
|
1019
|
-
"description": "Create as an org-wide issue",
|
|
1020
|
-
"name": "org",
|
|
1021
|
-
"allowNo": false,
|
|
1022
|
-
"type": "boolean"
|
|
1023
|
-
},
|
|
1024
|
-
"project": {
|
|
1025
|
-
"description": "Project name or path (defaults to current directory)",
|
|
1026
|
-
"name": "project",
|
|
1027
|
-
"hasDynamicHelp": false,
|
|
1028
|
-
"multiple": false,
|
|
1029
|
-
"type": "option"
|
|
1030
|
-
}
|
|
1031
|
-
},
|
|
1032
|
-
"hasDynamicHelp": false,
|
|
1033
|
-
"hiddenAliases": [],
|
|
1034
|
-
"id": "create:issue",
|
|
1035
|
-
"pluginAlias": "centy",
|
|
1036
|
-
"pluginName": "centy",
|
|
1037
|
-
"pluginType": "core",
|
|
1038
|
-
"strict": true,
|
|
1039
|
-
"enableJsonFlag": false,
|
|
1040
|
-
"isESM": true,
|
|
1041
|
-
"relativePath": [
|
|
1042
|
-
"dist",
|
|
1043
|
-
"commands",
|
|
1044
|
-
"create",
|
|
1045
|
-
"issue.js"
|
|
1046
|
-
]
|
|
1047
|
-
},
|
|
1048
978
|
"create:item-type": {
|
|
1049
979
|
"aliases": [],
|
|
1050
980
|
"args": {},
|
|
@@ -2259,46 +2189,6 @@
|
|
|
2259
2189
|
"issue.js"
|
|
2260
2190
|
]
|
|
2261
2191
|
},
|
|
2262
|
-
"register:project": {
|
|
2263
|
-
"aliases": [],
|
|
2264
|
-
"args": {
|
|
2265
|
-
"path": {
|
|
2266
|
-
"description": "Path to the project (defaults to current directory)",
|
|
2267
|
-
"name": "path",
|
|
2268
|
-
"required": false
|
|
2269
|
-
}
|
|
2270
|
-
},
|
|
2271
|
-
"description": "Register a project for tracking",
|
|
2272
|
-
"examples": [
|
|
2273
|
-
"<%= config.bin %> register project",
|
|
2274
|
-
"<%= config.bin %> register project /path/to/project",
|
|
2275
|
-
"<%= config.bin %> register project --no-init"
|
|
2276
|
-
],
|
|
2277
|
-
"flags": {
|
|
2278
|
-
"init": {
|
|
2279
|
-
"char": "i",
|
|
2280
|
-
"description": "Initialize .centy folder if not already initialized",
|
|
2281
|
-
"name": "init",
|
|
2282
|
-
"allowNo": true,
|
|
2283
|
-
"type": "boolean"
|
|
2284
|
-
}
|
|
2285
|
-
},
|
|
2286
|
-
"hasDynamicHelp": false,
|
|
2287
|
-
"hiddenAliases": [],
|
|
2288
|
-
"id": "register:project",
|
|
2289
|
-
"pluginAlias": "centy",
|
|
2290
|
-
"pluginName": "centy",
|
|
2291
|
-
"pluginType": "core",
|
|
2292
|
-
"strict": true,
|
|
2293
|
-
"enableJsonFlag": false,
|
|
2294
|
-
"isESM": true,
|
|
2295
|
-
"relativePath": [
|
|
2296
|
-
"dist",
|
|
2297
|
-
"commands",
|
|
2298
|
-
"register",
|
|
2299
|
-
"project.js"
|
|
2300
|
-
]
|
|
2301
|
-
},
|
|
2302
2192
|
"project:archive": {
|
|
2303
2193
|
"aliases": [],
|
|
2304
2194
|
"args": {
|
|
@@ -2497,6 +2387,46 @@
|
|
|
2497
2387
|
"title.js"
|
|
2498
2388
|
]
|
|
2499
2389
|
},
|
|
2390
|
+
"register:project": {
|
|
2391
|
+
"aliases": [],
|
|
2392
|
+
"args": {
|
|
2393
|
+
"path": {
|
|
2394
|
+
"description": "Path to the project (defaults to current directory)",
|
|
2395
|
+
"name": "path",
|
|
2396
|
+
"required": false
|
|
2397
|
+
}
|
|
2398
|
+
},
|
|
2399
|
+
"description": "Register a project for tracking",
|
|
2400
|
+
"examples": [
|
|
2401
|
+
"<%= config.bin %> register project",
|
|
2402
|
+
"<%= config.bin %> register project /path/to/project",
|
|
2403
|
+
"<%= config.bin %> register project --no-init"
|
|
2404
|
+
],
|
|
2405
|
+
"flags": {
|
|
2406
|
+
"init": {
|
|
2407
|
+
"char": "i",
|
|
2408
|
+
"description": "Initialize .centy folder if not already initialized",
|
|
2409
|
+
"name": "init",
|
|
2410
|
+
"allowNo": true,
|
|
2411
|
+
"type": "boolean"
|
|
2412
|
+
}
|
|
2413
|
+
},
|
|
2414
|
+
"hasDynamicHelp": false,
|
|
2415
|
+
"hiddenAliases": [],
|
|
2416
|
+
"id": "register:project",
|
|
2417
|
+
"pluginAlias": "centy",
|
|
2418
|
+
"pluginName": "centy",
|
|
2419
|
+
"pluginType": "core",
|
|
2420
|
+
"strict": true,
|
|
2421
|
+
"enableJsonFlag": false,
|
|
2422
|
+
"isESM": true,
|
|
2423
|
+
"relativePath": [
|
|
2424
|
+
"dist",
|
|
2425
|
+
"commands",
|
|
2426
|
+
"register",
|
|
2427
|
+
"project.js"
|
|
2428
|
+
]
|
|
2429
|
+
},
|
|
2500
2430
|
"sync:users": {
|
|
2501
2431
|
"aliases": [],
|
|
2502
2432
|
"args": {},
|
|
@@ -3035,5 +2965,5 @@
|
|
|
3035
2965
|
]
|
|
3036
2966
|
}
|
|
3037
2967
|
},
|
|
3038
|
-
"version": "0.
|
|
2968
|
+
"version": "0.7.0"
|
|
3039
2969
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
/**
|
|
3
|
-
* Create a new documentation file
|
|
4
|
-
*/
|
|
5
|
-
export default class CreateDoc extends Command {
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
|
-
static flags: {
|
|
9
|
-
title: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
content: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
slug: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
template: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
};
|
|
15
|
-
run(): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=doc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../../src/commands/create/doc.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAA;AAU5C;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAE5C,OAAgB,WAAW,SAAoC;IAG/D,OAAgB,QAAQ,WAKvB;IAGD,OAAgB,KAAK;;;;;;MAkBpB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA8BlC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/order
|
|
2
|
-
import { Command, Flags } from '@oclif/core';
|
|
3
|
-
import { daemonCreateDoc } from '../../daemon/daemon-create-doc.js';
|
|
4
|
-
import { projectFlag } from '../../flags/project-flag.js';
|
|
5
|
-
import { ensureInitialized, NotInitializedError, } from '../../utils/ensure-initialized.js';
|
|
6
|
-
import { resolveProjectPath } from '../../utils/resolve-project-path.js';
|
|
7
|
-
/**
|
|
8
|
-
* Create a new documentation file
|
|
9
|
-
*/
|
|
10
|
-
// eslint-disable-next-line custom/no-default-class-export, class-export/class-export
|
|
11
|
-
export default class CreateDoc extends Command {
|
|
12
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
13
|
-
static description = 'Create a new documentation file';
|
|
14
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
15
|
-
static examples = [
|
|
16
|
-
'<%= config.bin %> create doc --title "Getting Started"',
|
|
17
|
-
'<%= config.bin %> create doc -t "API Reference" -c "# API\n\nDocumentation here"',
|
|
18
|
-
'<%= config.bin %> create doc --title "Guide" --slug my-guide',
|
|
19
|
-
'<%= config.bin %> create doc --title "Guide" --project centy-daemon',
|
|
20
|
-
];
|
|
21
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
22
|
-
static flags = {
|
|
23
|
-
title: Flags.string({
|
|
24
|
-
char: 't',
|
|
25
|
-
description: 'Doc title',
|
|
26
|
-
required: true,
|
|
27
|
-
}),
|
|
28
|
-
content: Flags.string({
|
|
29
|
-
char: 'c',
|
|
30
|
-
description: 'Doc content (markdown)',
|
|
31
|
-
default: '',
|
|
32
|
-
}),
|
|
33
|
-
slug: Flags.string({
|
|
34
|
-
description: 'Custom slug (auto-generated from title if not provided)',
|
|
35
|
-
}),
|
|
36
|
-
template: Flags.string({
|
|
37
|
-
description: 'Template name to use',
|
|
38
|
-
}),
|
|
39
|
-
project: projectFlag,
|
|
40
|
-
};
|
|
41
|
-
async run() {
|
|
42
|
-
const { flags } = await this.parse(CreateDoc);
|
|
43
|
-
const cwd = await resolveProjectPath(flags.project);
|
|
44
|
-
try {
|
|
45
|
-
await ensureInitialized(cwd);
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
if (error instanceof NotInitializedError) {
|
|
49
|
-
this.error(error.message);
|
|
50
|
-
}
|
|
51
|
-
throw error instanceof Error ? error : new Error(String(error));
|
|
52
|
-
}
|
|
53
|
-
const response = await daemonCreateDoc({
|
|
54
|
-
projectPath: cwd,
|
|
55
|
-
title: flags.title,
|
|
56
|
-
content: flags.content,
|
|
57
|
-
slug: flags.slug !== undefined ? flags.slug : '',
|
|
58
|
-
template: flags.template !== undefined ? flags.template : '',
|
|
59
|
-
isOrgDoc: false,
|
|
60
|
-
});
|
|
61
|
-
if (!response.success) {
|
|
62
|
-
this.error(response.error);
|
|
63
|
-
}
|
|
64
|
-
this.log(`Created doc "${flags.title}"`);
|
|
65
|
-
this.log(` Slug: ${response.slug}`);
|
|
66
|
-
this.log(` File: ${response.createdFile}`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=doc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"doc.js","sourceRoot":"","sources":["../../../src/commands/create/doc.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAExE;;GAEG;AACH,qFAAqF;AACrF,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAC5C,gDAAgD;IAChD,MAAM,CAAU,WAAW,GAAG,iCAAiC,CAAA;IAE/D,gDAAgD;IAChD,MAAM,CAAU,QAAQ,GAAG;QACzB,wDAAwD;QACxD,kFAAkF;QAClF,8DAA8D;QAC9D,qEAAqE;KACtE,CAAA;IAED,gDAAgD;IAChD,MAAM,CAAU,KAAK,GAAG;QACtB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,KAAK,CAAC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C,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC5B,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,gBAAgB,KAAK,CAAC,KAAK,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,GAAG,CAAC,WAAW,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;QACpC,IAAI,CAAC,GAAG,CAAC,WAAW,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;IAC7C,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
/**
|
|
3
|
-
* Create a new issue in the .centy/issues folder
|
|
4
|
-
*/
|
|
5
|
-
export default class CreateIssue extends Command {
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
|
-
static flags: {
|
|
9
|
-
title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
priority: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
status: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
draft: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
-
org: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
-
};
|
|
17
|
-
run(): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=issue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../../../src/commands/create/issue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAA;AAM5C;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAE9C,OAAgB,WAAW,SAA4C;IAGvE,OAAgB,QAAQ,WAOvB;IAGD,OAAgB,KAAK;;;;;;;;MA4BpB;IAEY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoBlC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/order
|
|
2
|
-
import { Command, Flags } from '@oclif/core';
|
|
3
|
-
import { projectFlag } from '../../flags/project-flag.js';
|
|
4
|
-
import { createIssue } from '../../lib/create-issue/index.js';
|
|
5
|
-
import { resolveProjectPath } from '../../utils/resolve-project-path.js';
|
|
6
|
-
/**
|
|
7
|
-
* Create a new issue in the .centy/issues folder
|
|
8
|
-
*/
|
|
9
|
-
// eslint-disable-next-line custom/no-default-class-export, class-export/class-export
|
|
10
|
-
export default class CreateIssue extends Command {
|
|
11
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
12
|
-
static description = 'Create a new issue in the .centy folder';
|
|
13
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
14
|
-
static examples = [
|
|
15
|
-
'<%= config.bin %> create issue',
|
|
16
|
-
'<%= config.bin %> create issue --title "Bug in login" --priority high',
|
|
17
|
-
'<%= config.bin %> create issue -t "Add feature" -d "Implement dark mode"',
|
|
18
|
-
'<%= config.bin %> create issue -t "Add feature" --project centy-daemon',
|
|
19
|
-
'<%= config.bin %> create issue --title "WIP feature" --draft',
|
|
20
|
-
'<%= config.bin %> create issue --title "Cross-org bug" --org',
|
|
21
|
-
];
|
|
22
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
23
|
-
static flags = {
|
|
24
|
-
title: Flags.string({
|
|
25
|
-
char: 't',
|
|
26
|
-
description: 'Issue title',
|
|
27
|
-
}),
|
|
28
|
-
description: Flags.string({
|
|
29
|
-
char: 'd',
|
|
30
|
-
description: 'Issue description',
|
|
31
|
-
}),
|
|
32
|
-
priority: Flags.string({
|
|
33
|
-
char: 'p',
|
|
34
|
-
description: 'Priority level (low/medium/high)',
|
|
35
|
-
options: ['low', 'medium', 'high'],
|
|
36
|
-
}),
|
|
37
|
-
status: Flags.string({
|
|
38
|
-
char: 's',
|
|
39
|
-
description: 'Initial status',
|
|
40
|
-
default: 'open',
|
|
41
|
-
}),
|
|
42
|
-
draft: Flags.boolean({
|
|
43
|
-
description: 'Create as draft',
|
|
44
|
-
default: false,
|
|
45
|
-
}),
|
|
46
|
-
org: Flags.boolean({
|
|
47
|
-
description: 'Create as an org-wide issue',
|
|
48
|
-
default: false,
|
|
49
|
-
}),
|
|
50
|
-
project: projectFlag,
|
|
51
|
-
};
|
|
52
|
-
async run() {
|
|
53
|
-
const { flags } = await this.parse(CreateIssue);
|
|
54
|
-
const cwd = await resolveProjectPath(flags.project);
|
|
55
|
-
const result = await createIssue({
|
|
56
|
-
cwd,
|
|
57
|
-
title: flags.title,
|
|
58
|
-
description: flags.description,
|
|
59
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
60
|
-
priority: flags.priority,
|
|
61
|
-
status: flags.status,
|
|
62
|
-
draft: flags.draft,
|
|
63
|
-
org: flags.org,
|
|
64
|
-
});
|
|
65
|
-
if (!result.success) {
|
|
66
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
67
|
-
this.error(result.error ?? 'Failed to create issue');
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=issue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"issue.js","sourceRoot":"","sources":["../../../src/commands/create/issue.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MA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AW,CAAC,CAAA;QAC/C,MAAM,GAAG,GAAG,MAAM,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAEnD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC;YAC/B,GAAG;YACH,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,gDAAgD;YAChD,QAAQ,EAAE,KAAK,CAAC,QAAiD;YACjE,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,GAAG,EAAE,KAAK,CAAC,GAAG;SACf,CAAC,CAAA;QAEF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,gDAAgD;YAChD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,wBAAwB,CAAC,CAAA;QACtD,CAAC;IACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/create-issue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/create-issue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
|