yarlo-cli 0.1.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/LICENSE +133 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +48 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +30 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +94 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/agent/setup.d.ts +3 -0
- package/dist/commands/agent/setup.d.ts.map +1 -0
- package/dist/commands/agent/setup.js +151 -0
- package/dist/commands/agent/setup.js.map +1 -0
- package/dist/commands/config.d.ts +15 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +41 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/done.d.ts +17 -0
- package/dist/commands/done.d.ts.map +1 -0
- package/dist/commands/done.js +46 -0
- package/dist/commands/done.js.map +1 -0
- package/dist/commands/edit.d.ts +17 -0
- package/dist/commands/edit.d.ts.map +1 -0
- package/dist/commands/edit.js +58 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +39 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +24 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +113 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/install.d.ts +9 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +51 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/list.d.ts +30 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +94 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/plugins.d.ts +15 -0
- package/dist/commands/plugins.d.ts.map +1 -0
- package/dist/commands/plugins.js +42 -0
- package/dist/commands/plugins.js.map +1 -0
- package/dist/commands/show.d.ts +17 -0
- package/dist/commands/show.d.ts.map +1 -0
- package/dist/commands/show.js +45 -0
- package/dist/commands/show.js.map +1 -0
- package/dist/commands/status.d.ts +17 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +47 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/uninstall.d.ts +9 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +46 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/core/config.d.ts +24 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +110 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/fields.d.ts +8 -0
- package/dist/core/fields.d.ts.map +1 -0
- package/dist/core/fields.js +82 -0
- package/dist/core/fields.js.map +1 -0
- package/dist/core/naming.d.ts +12 -0
- package/dist/core/naming.d.ts.map +1 -0
- package/dist/core/naming.js +61 -0
- package/dist/core/naming.js.map +1 -0
- package/dist/core/plugin-loader.d.ts +9 -0
- package/dist/core/plugin-loader.d.ts.map +1 -0
- package/dist/core/plugin-loader.js +38 -0
- package/dist/core/plugin-loader.js.map +1 -0
- package/dist/core/task.d.ts +7 -0
- package/dist/core/task.d.ts.map +1 -0
- package/dist/core/task.js +160 -0
- package/dist/core/task.js.map +1 -0
- package/dist/utils/output.d.ts +3 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +8 -0
- package/dist/utils/output.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
export declare const description = "Edit a task in your editor";
|
|
3
|
+
export declare const args: zod.ZodTuple<[zod.ZodString], null>;
|
|
4
|
+
export declare const options: zod.ZodObject<{
|
|
5
|
+
editor: zod.ZodOptional<zod.ZodString>;
|
|
6
|
+
}, "strip", zod.ZodTypeAny, {
|
|
7
|
+
editor?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
editor?: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
type Props = {
|
|
12
|
+
args: zod.infer<typeof args>;
|
|
13
|
+
options: zod.infer<typeof options>;
|
|
14
|
+
};
|
|
15
|
+
export default function Edit({ args: [id], options: opts }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../source/commands/edit.tsx"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,KAAK,CAAC;AAMtB,eAAO,MAAM,WAAW,+BAA+B,CAAC;AAExD,eAAO,MAAM,IAAI,qCAEf,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;EAKlB,CAAC;AAEH,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC7B,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,2CAyChE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Text } from "ink";
|
|
4
|
+
import zod from "zod";
|
|
5
|
+
import { argument, option } from "pastel";
|
|
6
|
+
import { spawn } from "node:child_process";
|
|
7
|
+
import { loadConfig } from "../core/config.js";
|
|
8
|
+
import { getTask } from "../core/task.js";
|
|
9
|
+
export const description = "Edit a task in your editor";
|
|
10
|
+
export const args = zod.tuple([
|
|
11
|
+
zod.string().describe(argument({ name: "id", description: "Task ID or prefix" })),
|
|
12
|
+
]);
|
|
13
|
+
export const options = zod.object({
|
|
14
|
+
editor: zod
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe(option({ description: "Editor to use (defaults to $EDITOR)", alias: "e" })),
|
|
18
|
+
});
|
|
19
|
+
export default function Edit({ args: [id], options: opts }) {
|
|
20
|
+
const [status, setStatus] = React.useState("loading");
|
|
21
|
+
const [filePath, setFilePath] = React.useState("");
|
|
22
|
+
const [error, setError] = React.useState("");
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
(async () => {
|
|
25
|
+
try {
|
|
26
|
+
const { config, configDir } = await loadConfig();
|
|
27
|
+
const task = await getTask(config, configDir, id);
|
|
28
|
+
setFilePath(task.file_path);
|
|
29
|
+
const editor = opts.editor ?? process.env.EDITOR ?? "vi";
|
|
30
|
+
setStatus("editing");
|
|
31
|
+
const child = spawn(editor, [task.file_path], {
|
|
32
|
+
stdio: "inherit",
|
|
33
|
+
});
|
|
34
|
+
child.on("close", (code) => {
|
|
35
|
+
if (code === 0) {
|
|
36
|
+
setStatus("done");
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
setError(`Editor exited with code ${code}`);
|
|
40
|
+
setStatus("error");
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
46
|
+
setStatus("error");
|
|
47
|
+
}
|
|
48
|
+
})();
|
|
49
|
+
}, []);
|
|
50
|
+
if (status === "error")
|
|
51
|
+
return _jsx(Text, { color: "red", children: error });
|
|
52
|
+
if (status === "loading")
|
|
53
|
+
return _jsx(Text, { children: "Loading task..." });
|
|
54
|
+
if (status === "editing")
|
|
55
|
+
return _jsxs(Text, { children: ["Editing ", filePath, "..."] });
|
|
56
|
+
return (_jsxs(Text, { color: "green", children: ["Saved: ", filePath] }));
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../source/commands/edit.tsx"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K,YAAE,KAAK,GAAQ,CAAC;IAChE,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,KAAC,IAAI,kCAAuB,CAAC;IAC9D,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAC,IAAI,2BAAU,QAAQ,WAAW,CAAC;IAEpE,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAS,QAAQ,IAAQ,CAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/commands/index.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,qCAAqC,CAAC;AAE9D,MAAM,CAAC,OAAO,UAAU,KAAK,4CA2D5B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Text, Box } from "ink";
|
|
4
|
+
import { loadConfig } from "../core/config.js";
|
|
5
|
+
import { listTasks } from "../core/task.js";
|
|
6
|
+
import { isJsonMode, jsonOutput } from "../utils/output.js";
|
|
7
|
+
export const description = "Yet Another Repo Local Organizer";
|
|
8
|
+
export default function Index() {
|
|
9
|
+
const [info, setInfo] = React.useState(null);
|
|
10
|
+
const [error, setError] = React.useState(null);
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
(async () => {
|
|
13
|
+
try {
|
|
14
|
+
const { config, configDir } = await loadConfig();
|
|
15
|
+
const tasks = await listTasks(config, configDir);
|
|
16
|
+
const byStatus = {};
|
|
17
|
+
for (const task of tasks) {
|
|
18
|
+
const status = String(task.fields.status ?? "unknown");
|
|
19
|
+
byStatus[status] = (byStatus[status] ?? 0) + 1;
|
|
20
|
+
}
|
|
21
|
+
if (isJsonMode()) {
|
|
22
|
+
jsonOutput({ total: tasks.length, byStatus });
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
setInfo({ total: tasks.length, byStatus });
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
setError("No yarlo project found. Run `yarlo init` to get started.");
|
|
29
|
+
}
|
|
30
|
+
})();
|
|
31
|
+
}, []);
|
|
32
|
+
if (error) {
|
|
33
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "yarlo - Yet Another Repo Local Organizer" }), _jsx(Text, { color: "yellow", children: error })] }));
|
|
34
|
+
}
|
|
35
|
+
if (!info)
|
|
36
|
+
return _jsx(Text, { children: "Loading..." });
|
|
37
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "yarlo - Yet Another Repo Local Organizer" }), _jsxs(Text, { children: ["Tasks: ", _jsx(Text, { bold: true, children: info.total })] }), Object.entries(info.byStatus).map(([status, count]) => (_jsxs(Text, { children: [" ", status, ": ", _jsx(Text, { bold: true, children: count })] }, status)))] }));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/commands/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,CAAC,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAE9D,MAAM,CAAC,OAAO,UAAU,KAAK;IAC3B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAG5B,IAAI,CAAC,CAAC;IAChB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAA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GAAQ,IAC/B,CACP,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,IAAI;QAAE,OAAO,KAAC,IAAI,6BAAkB,CAAC;IAE1C,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC,aAChC,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,yDAEhB,EACP,MAAC,IAAI,0BACI,KAAC,IAAI,IAAC,IAAI,kBAAE,IAAI,CAAC,KAAK,GAAQ,IAChC,EACN,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CACtD,MAAC,IAAI,eACF,IAAI,EACJ,MAAM,QAAG,KAAC,IAAI,IAAC,IAAI,kBAAE,KAAK,GAAQ,KAF1B,MAAM,CAGV,CACR,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
export declare const description = "Initialize a new yarlo project";
|
|
3
|
+
export declare const options: zod.ZodObject<{
|
|
4
|
+
yes: zod.ZodDefault<zod.ZodBoolean>;
|
|
5
|
+
"tasks-dir": zod.ZodOptional<zod.ZodString>;
|
|
6
|
+
"attachments-dir": zod.ZodOptional<zod.ZodString>;
|
|
7
|
+
naming: zod.ZodOptional<zod.ZodString>;
|
|
8
|
+
}, "strip", zod.ZodTypeAny, {
|
|
9
|
+
yes: boolean;
|
|
10
|
+
"tasks-dir"?: string | undefined;
|
|
11
|
+
"attachments-dir"?: string | undefined;
|
|
12
|
+
naming?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
yes?: boolean | undefined;
|
|
15
|
+
"tasks-dir"?: string | undefined;
|
|
16
|
+
"attachments-dir"?: string | undefined;
|
|
17
|
+
naming?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
type Props = {
|
|
20
|
+
options: zod.infer<typeof options>;
|
|
21
|
+
};
|
|
22
|
+
export default function Init({ options: opts }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../source/commands/init.tsx"],"names":[],"mappings":"AAGA,OAAO,GAAG,MAAM,KAAK,CAAC;AAMtB,eAAO,MAAM,WAAW,mCAAmC,CAAC;AAE5D,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;EAiBlB,CAAC;AAEH,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CACpC,CAAC;AAkBF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,kDAiJpD"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Text, Box } from "ink";
|
|
4
|
+
import { TextInput, Select, ConfirmInput } from "@inkjs/ui";
|
|
5
|
+
import zod from "zod";
|
|
6
|
+
import { option } from "pastel";
|
|
7
|
+
import { initProject, findConfigDir, getYarloVersion } from "../core/config.js";
|
|
8
|
+
import { DEFAULT_CONFIG } from "yarlo-types";
|
|
9
|
+
export const description = "Initialize a new yarlo project";
|
|
10
|
+
export const options = zod.object({
|
|
11
|
+
yes: zod
|
|
12
|
+
.boolean()
|
|
13
|
+
.describe(option({ description: "Skip prompts, use defaults", alias: "y" }))
|
|
14
|
+
.default(false),
|
|
15
|
+
"tasks-dir": zod
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe(option({ description: "Tasks directory name" })),
|
|
19
|
+
"attachments-dir": zod
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe(option({ description: "Attachments directory name" })),
|
|
23
|
+
naming: zod
|
|
24
|
+
.string()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe(option({ description: "Naming strategy: slug, uuid, incremental, ordered-slug" })),
|
|
27
|
+
});
|
|
28
|
+
const NAMING_OPTIONS = [
|
|
29
|
+
{ label: "slug (fix-login-bug)", value: "slug" },
|
|
30
|
+
{ label: "uuid (a1b2c3d4)", value: "uuid" },
|
|
31
|
+
{ label: "incremental (001, 002, ...)", value: "incremental" },
|
|
32
|
+
{ label: "ordered-slug (001-fix-login-bug)", value: "ordered-slug" },
|
|
33
|
+
];
|
|
34
|
+
export default function Init({ options: opts }) {
|
|
35
|
+
const [step, setStep] = React.useState("check");
|
|
36
|
+
const [config, setConfig] = React.useState({
|
|
37
|
+
...DEFAULT_CONFIG,
|
|
38
|
+
yarlo_version: getYarloVersion(),
|
|
39
|
+
...(opts["tasks-dir"] ? { tasks_dir: opts["tasks-dir"] } : {}),
|
|
40
|
+
...(opts["attachments-dir"] ? { attachments_dir: opts["attachments-dir"] } : {}),
|
|
41
|
+
...(opts.naming ? { naming: opts.naming } : {}),
|
|
42
|
+
});
|
|
43
|
+
const [error, setError] = React.useState("");
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
(async () => {
|
|
46
|
+
const existing = await findConfigDir();
|
|
47
|
+
if (existing) {
|
|
48
|
+
setError(`Already initialized at ${existing}`);
|
|
49
|
+
setStep("error");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (opts.yes) {
|
|
53
|
+
try {
|
|
54
|
+
await initProject(process.cwd(), config);
|
|
55
|
+
setStep("done");
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
59
|
+
setStep("error");
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
setStep("tasks_dir");
|
|
64
|
+
})();
|
|
65
|
+
}, []);
|
|
66
|
+
if (step === "error") {
|
|
67
|
+
return _jsx(Text, { color: "red", children: error });
|
|
68
|
+
}
|
|
69
|
+
if (step === "check") {
|
|
70
|
+
return _jsx(Text, { children: "Checking..." });
|
|
71
|
+
}
|
|
72
|
+
if (step === "tasks_dir") {
|
|
73
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Tasks directory (relative to .yarlo/):" }), _jsx(TextInput, { placeholder: "tasks", onSubmit: (value) => {
|
|
74
|
+
setConfig((c) => ({ ...c, tasks_dir: value || "tasks" }));
|
|
75
|
+
setStep("attachments_dir");
|
|
76
|
+
} })] }));
|
|
77
|
+
}
|
|
78
|
+
if (step === "attachments_dir") {
|
|
79
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Attachments directory (relative to .yarlo/):" }), _jsx(TextInput, { placeholder: "attachments", onSubmit: (value) => {
|
|
80
|
+
setConfig((c) => ({
|
|
81
|
+
...c,
|
|
82
|
+
attachments_dir: value || "attachments",
|
|
83
|
+
}));
|
|
84
|
+
setStep("naming");
|
|
85
|
+
} })] }));
|
|
86
|
+
}
|
|
87
|
+
if (step === "naming") {
|
|
88
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Task naming strategy:" }), _jsx(Select, { options: NAMING_OPTIONS, onChange: (value) => {
|
|
89
|
+
setConfig((c) => ({ ...c, naming: value }));
|
|
90
|
+
setStep("confirm");
|
|
91
|
+
} })] }));
|
|
92
|
+
}
|
|
93
|
+
if (step === "confirm") {
|
|
94
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { bold: true, children: "Configuration:" }), _jsxs(Text, { children: [" ", "Tasks dir: ", _jsxs(Text, { color: "cyan", children: [".yarlo/", config.tasks_dir] })] }), _jsxs(Text, { children: [" ", "Attachments dir:", " ", _jsxs(Text, { color: "cyan", children: [".yarlo/", config.attachments_dir] })] }), _jsxs(Text, { children: [" ", "Naming: ", _jsx(Text, { color: "cyan", children: config.naming })] }), _jsx(Text, { bold: true, children: "Initialize?" }), _jsx(ConfirmInput, { onConfirm: async () => {
|
|
95
|
+
try {
|
|
96
|
+
await initProject(process.cwd(), config);
|
|
97
|
+
setStep("done");
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
101
|
+
setStep("error");
|
|
102
|
+
}
|
|
103
|
+
}, onCancel: () => {
|
|
104
|
+
setError("Cancelled");
|
|
105
|
+
setStep("error");
|
|
106
|
+
} })] }));
|
|
107
|
+
}
|
|
108
|
+
if (step === "done") {
|
|
109
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Text, { color: "green", bold: true, children: "Initialized yarlo project!" }), _jsxs(Text, { children: ["Config: ", _jsx(Text, { color: "cyan", children: ".yarlo/config.yml" })] }), _jsxs(Text, { children: ["Tasks: ", _jsxs(Text, { color: "cyan", children: [".yarlo/", config.tasks_dir, "/"] })] }), _jsx(Text, { dimColor: true, children: "Run `yarlo add` to create your first task." })] }));
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../source/commands/init.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,CAAC,MAAM,WAAW,GAA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AC,CAAC,MAAM,CAAC,GAAG,CAAC,CACjD,CAAC;4BACF,OAAO,CAAC,OAAO,CAAC,CAAC;wBACnB,CAAC;oBACH,CAAC,EACD,QAAQ,EAAE,GAAG,EAAE;wBACb,QAAQ,CAAC,WAAW,CAAC,CAAC;wBACtB,OAAO,CAAC,OAAO,CAAC,CAAC;oBACnB,CAAC,GACD,IACE,CACP,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC,aAChC,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,iDAEjB,EACP,MAAC,IAAI,2BACK,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kCAAyB,IAC9C,EACP,MAAC,IAAI,0BACI,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,wBAAS,MAAM,CAAC,SAAS,SAAS,IACtD,EACP,KAAC,IAAI,IAAC,QAAQ,iEAAkD,IAC5D,CACP,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
export declare const description = "Install a yarlo plugin";
|
|
3
|
+
export declare const args: zod.ZodTuple<[zod.ZodString], null>;
|
|
4
|
+
type Props = {
|
|
5
|
+
args: zod.infer<typeof args>;
|
|
6
|
+
};
|
|
7
|
+
export default function Install({ args: [pluginName] }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../source/commands/install.tsx"],"names":[],"mappings":"AAGA,OAAO,GAAG,MAAM,KAAK,CAAC;AAItB,eAAO,MAAM,WAAW,2BAA2B,CAAC;AAEpD,eAAO,MAAM,IAAI,qCAEf,CAAC;AAEH,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,2CAgD5D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Text } from "ink";
|
|
4
|
+
import { execSync } from "node:child_process";
|
|
5
|
+
import zod from "zod";
|
|
6
|
+
import { argument } from "pastel";
|
|
7
|
+
import { loadConfig, saveConfig } from "../core/config.js";
|
|
8
|
+
export const description = "Install a yarlo plugin";
|
|
9
|
+
export const args = zod.tuple([
|
|
10
|
+
zod.string().describe(argument({ name: "plugin", description: "Plugin name (e.g., board)" })),
|
|
11
|
+
]);
|
|
12
|
+
export default function Install({ args: [pluginName] }) {
|
|
13
|
+
const [status, setStatus] = React.useState("installing");
|
|
14
|
+
const [error, setError] = React.useState("");
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
(async () => {
|
|
17
|
+
try {
|
|
18
|
+
const { config, configDir } = await loadConfig();
|
|
19
|
+
const packageName = pluginName.startsWith("yarlo-plugin-")
|
|
20
|
+
? pluginName
|
|
21
|
+
: `yarlo-plugin-${pluginName}`;
|
|
22
|
+
const shortName = packageName.replace("yarlo-plugin-", "");
|
|
23
|
+
if (config.plugins.includes(shortName)) {
|
|
24
|
+
setError(`Plugin "${shortName}" is already installed`);
|
|
25
|
+
setStatus("error");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Install the npm package
|
|
29
|
+
execSync(`pnpm add ${packageName}`, {
|
|
30
|
+
cwd: process.cwd(),
|
|
31
|
+
stdio: "pipe",
|
|
32
|
+
});
|
|
33
|
+
// Add to config
|
|
34
|
+
config.plugins.push(shortName);
|
|
35
|
+
await saveConfig(config, configDir);
|
|
36
|
+
setStatus("done");
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
40
|
+
setStatus("error");
|
|
41
|
+
}
|
|
42
|
+
})();
|
|
43
|
+
}, []);
|
|
44
|
+
if (status === "error")
|
|
45
|
+
return _jsx(Text, { color: "red", children: error });
|
|
46
|
+
if (status === "installing") {
|
|
47
|
+
return _jsxs(Text, { children: ["Installing yarlo-plugin-", pluginName, "..."] });
|
|
48
|
+
}
|
|
49
|
+
return (_jsxs(Text, { color: "green", bold: true, children: ["Installed plugin: ", pluginName] }));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../source/commands/install.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAO,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAEpD,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC;IAC5B,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC,CAAC;CAC9F,CAAC,CAAC;AAMH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAS;IAC3D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAA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C;YACrB,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,YAAE,KAAK,GAAQ,CAAC;IAChE,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;QAC5B,OAAO,MAAC,IAAI,2CAA0B,UAAU,WAAW,CAAC;IAC9D,CAAC;IAED,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,yCACH,UAAU,IACxB,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
export declare const description = "List tasks";
|
|
3
|
+
export declare const options: zod.ZodObject<{
|
|
4
|
+
status: zod.ZodOptional<zod.ZodString>;
|
|
5
|
+
priority: zod.ZodOptional<zod.ZodString>;
|
|
6
|
+
label: zod.ZodOptional<zod.ZodString>;
|
|
7
|
+
assignee: zod.ZodOptional<zod.ZodString>;
|
|
8
|
+
search: zod.ZodOptional<zod.ZodString>;
|
|
9
|
+
json: zod.ZodDefault<zod.ZodBoolean>;
|
|
10
|
+
}, "strip", zod.ZodTypeAny, {
|
|
11
|
+
json: boolean;
|
|
12
|
+
search?: string | undefined;
|
|
13
|
+
status?: string | undefined;
|
|
14
|
+
priority?: string | undefined;
|
|
15
|
+
assignee?: string | undefined;
|
|
16
|
+
label?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
search?: string | undefined;
|
|
19
|
+
status?: string | undefined;
|
|
20
|
+
priority?: string | undefined;
|
|
21
|
+
assignee?: string | undefined;
|
|
22
|
+
label?: string | undefined;
|
|
23
|
+
json?: boolean | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
type Props = {
|
|
26
|
+
options: zod.infer<typeof options>;
|
|
27
|
+
};
|
|
28
|
+
export default function List({ options: opts }: Props): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../source/commands/list.tsx"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,KAAK,CAAC;AAOtB,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;EAyBlB,CAAC;AAEH,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CACpC,CAAC;AAiBF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,2CAoEpD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Text, Box } from "ink";
|
|
4
|
+
import zod from "zod";
|
|
5
|
+
import { option } from "pastel";
|
|
6
|
+
import { loadConfig } from "../core/config.js";
|
|
7
|
+
import { listTasks } from "../core/task.js";
|
|
8
|
+
import { isJsonMode, jsonOutput } from "../utils/output.js";
|
|
9
|
+
export const description = "List tasks";
|
|
10
|
+
export const options = zod.object({
|
|
11
|
+
status: zod
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe(option({ description: "Filter by status", alias: "s" })),
|
|
15
|
+
priority: zod
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe(option({ description: "Filter by priority", alias: "p" })),
|
|
19
|
+
label: zod
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe(option({ description: "Filter by label", alias: "l" })),
|
|
23
|
+
assignee: zod
|
|
24
|
+
.string()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe(option({ description: "Filter by assignee", alias: "a" })),
|
|
27
|
+
search: zod
|
|
28
|
+
.string()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe(option({ description: "Search in title/content", alias: "q" })),
|
|
31
|
+
json: zod
|
|
32
|
+
.boolean()
|
|
33
|
+
.describe(option({ description: "Output as JSON" }))
|
|
34
|
+
.default(false),
|
|
35
|
+
});
|
|
36
|
+
const STATUS_COLORS = {
|
|
37
|
+
backlog: "gray",
|
|
38
|
+
todo: "white",
|
|
39
|
+
in_progress: "yellow",
|
|
40
|
+
done: "green",
|
|
41
|
+
cancelled: "red",
|
|
42
|
+
};
|
|
43
|
+
const PRIORITY_SYMBOLS = {
|
|
44
|
+
urgent: "!!!",
|
|
45
|
+
high: "!!",
|
|
46
|
+
medium: "!",
|
|
47
|
+
low: ".",
|
|
48
|
+
};
|
|
49
|
+
export default function List({ options: opts }) {
|
|
50
|
+
const [tasks, setTasks] = React.useState(null);
|
|
51
|
+
const [error, setError] = React.useState(null);
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
(async () => {
|
|
54
|
+
try {
|
|
55
|
+
const { config, configDir } = await loadConfig();
|
|
56
|
+
const filter = {};
|
|
57
|
+
if (opts.status)
|
|
58
|
+
filter.status = opts.status;
|
|
59
|
+
if (opts.priority)
|
|
60
|
+
filter.priority = opts.priority;
|
|
61
|
+
if (opts.label)
|
|
62
|
+
filter.label = opts.label;
|
|
63
|
+
if (opts.assignee)
|
|
64
|
+
filter.assignee = opts.assignee;
|
|
65
|
+
if (opts.search)
|
|
66
|
+
filter.search = opts.search;
|
|
67
|
+
const result = await listTasks(config, configDir, filter);
|
|
68
|
+
if (isJsonMode() || opts.json) {
|
|
69
|
+
jsonOutput(result);
|
|
70
|
+
process.exit(0);
|
|
71
|
+
}
|
|
72
|
+
setTasks(result);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
}, []);
|
|
79
|
+
if (error)
|
|
80
|
+
return _jsx(Text, { color: "red", children: error });
|
|
81
|
+
if (!tasks)
|
|
82
|
+
return _jsx(Text, { children: "Loading..." });
|
|
83
|
+
if (tasks.length === 0) {
|
|
84
|
+
return _jsx(Text, { dimColor: true, children: "No tasks found. Run `yarlo add` to create one." });
|
|
85
|
+
}
|
|
86
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { gap: 2, marginBottom: 1, children: [_jsx(Text, { bold: true, children: _jsx(Text, { color: "cyan", children: "ID" }) }), _jsx(Text, { bold: true, children: "Status" }), _jsx(Text, { bold: true, children: "Pri" }), _jsx(Text, { bold: true, children: "Title" })] }), tasks.map((task) => {
|
|
87
|
+
const status = String(task.fields.status ?? "");
|
|
88
|
+
const priority = String(task.fields.priority ?? "");
|
|
89
|
+
const color = STATUS_COLORS[status] ?? "white";
|
|
90
|
+
const priSymbol = PRIORITY_SYMBOLS[priority] ?? " ";
|
|
91
|
+
return (_jsxs(Box, { gap: 2, children: [_jsx(Text, { color: "cyan", children: task.id.slice(0, 20).padEnd(20) }), _jsx(Text, { color: color, children: status.padEnd(12) }), _jsx(Text, { color: priority === "urgent" ? "red" : priority === "high" ? "yellow" : "white", children: priSymbol.padEnd(4) }), _jsx(Text, { children: task.title })] }, task.id));
|
|
92
|
+
}), _jsxs(Text, { dimColor: true, children: ["\n", tasks.length, " task", tasks.length !== 1 ? "s" : ""] })] }));
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../source/commands/list.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/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AAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;gBACpD,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC;gBAC/C,MAAM,SAAS,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC;gBAEpD,OAAO,CACL,MAAC,GAAG,IAAe,GAAG,EAAE,CAAC,aACvB,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,GAAQ,EAC3D,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,YAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,GAAQ,EAC9C,KAAC,IAAI,IAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,YAClF,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,GACf,EACP,KAAC,IAAI,cAAE,IAAI,CAAC,KAAK,GAAQ,KANjB,IAAI,CAAC,EAAE,CAOX,CACP,CAAC;YACJ,CAAC,CAAC,EACF,MAAC,IAAI,IAAC,QAAQ,mBACX,IAAI,EACJ,KAAK,CAAC,MAAM,WAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAC5C,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
export declare const description = "List installed plugins";
|
|
3
|
+
export declare const options: zod.ZodObject<{
|
|
4
|
+
json: zod.ZodDefault<zod.ZodBoolean>;
|
|
5
|
+
}, "strip", zod.ZodTypeAny, {
|
|
6
|
+
json: boolean;
|
|
7
|
+
}, {
|
|
8
|
+
json?: boolean | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
type Props = {
|
|
11
|
+
options: zod.infer<typeof options>;
|
|
12
|
+
};
|
|
13
|
+
export default function Plugins({ options: opts }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../source/commands/plugins.tsx"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,KAAK,CAAC;AAKtB,eAAO,MAAM,WAAW,2BAA2B,CAAC;AAEpD,eAAO,MAAM,OAAO;;;;;;EAKlB,CAAC;AAEH,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,2CA4CvD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Text, Box } from "ink";
|
|
4
|
+
import zod from "zod";
|
|
5
|
+
import { option } from "pastel";
|
|
6
|
+
import { loadConfig } from "../core/config.js";
|
|
7
|
+
import { isJsonMode, jsonOutput } from "../utils/output.js";
|
|
8
|
+
export const description = "List installed plugins";
|
|
9
|
+
export const options = zod.object({
|
|
10
|
+
json: zod
|
|
11
|
+
.boolean()
|
|
12
|
+
.describe(option({ description: "Output as JSON" }))
|
|
13
|
+
.default(false),
|
|
14
|
+
});
|
|
15
|
+
export default function Plugins({ options: opts }) {
|
|
16
|
+
const [plugins, setPlugins] = React.useState(null);
|
|
17
|
+
const [error, setError] = React.useState(null);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
(async () => {
|
|
20
|
+
try {
|
|
21
|
+
const { config } = await loadConfig();
|
|
22
|
+
if (isJsonMode() || opts.json) {
|
|
23
|
+
jsonOutput({ plugins: config.plugins });
|
|
24
|
+
process.exit(0);
|
|
25
|
+
}
|
|
26
|
+
setPlugins(config.plugins);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
30
|
+
}
|
|
31
|
+
})();
|
|
32
|
+
}, []);
|
|
33
|
+
if (error)
|
|
34
|
+
return _jsx(Text, { color: "red", children: error });
|
|
35
|
+
if (!plugins)
|
|
36
|
+
return _jsx(Text, { children: "Loading..." });
|
|
37
|
+
if (plugins.length === 0) {
|
|
38
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { dimColor: true, children: "No plugins installed." }), _jsxs(Text, { dimColor: true, children: ["Run `yarlo install ", "<plugin>", "` to add one."] })] }));
|
|
39
|
+
}
|
|
40
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, children: "Installed plugins:" }), plugins.map((name) => (_jsxs(Text, { children: [" ", _jsxs(Text, { color: "cyan", children: ["yarlo-plugin-", name] })] }, name)))] }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../source/commands/plugins.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,CAAC,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAEpD,MAAM,CAAC,MAAM,OAAO,GAA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I,6BAAkB,CAAC;IAE7C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,IAAC,QAAQ,4CAA6B,EAC3C,MAAC,IAAI,IAAC,QAAQ,0CAAqB,UAAU,qBAAqB,IAC9D,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,IAAC,IAAI,yCAA0B,EACnC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACrB,MAAC,IAAI,eACF,IAAI,EACL,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,8BAAe,IAAI,IAAQ,KAFpC,IAAI,CAGR,CACR,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
export declare const description = "Show task details";
|
|
3
|
+
export declare const args: zod.ZodTuple<[zod.ZodString], null>;
|
|
4
|
+
export declare const options: zod.ZodObject<{
|
|
5
|
+
json: zod.ZodDefault<zod.ZodBoolean>;
|
|
6
|
+
}, "strip", zod.ZodTypeAny, {
|
|
7
|
+
json: boolean;
|
|
8
|
+
}, {
|
|
9
|
+
json?: boolean | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
type Props = {
|
|
12
|
+
args: zod.infer<typeof args>;
|
|
13
|
+
options: zod.infer<typeof options>;
|
|
14
|
+
};
|
|
15
|
+
export default function Show({ args: [id], options: opts }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=show.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../source/commands/show.tsx"],"names":[],"mappings":"AAEA,OAAO,GAAG,MAAM,KAAK,CAAC;AAOtB,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAE/C,eAAO,MAAM,IAAI,qCAEf,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;EAKlB,CAAC;AAEH,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC7B,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,2CAyDhE"}
|