@shortcut-cli/shortcut-cli 3.8.1 → 4.0.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.
Files changed (30) hide show
  1. package/README.md +121 -2
  2. package/build/bin/{short-api.js → short-api.cjs} +12 -10
  3. package/build/bin/short-create.cjs +58 -0
  4. package/build/bin/{short-doc.js → short-doc.cjs} +8 -9
  5. package/build/bin/{short-docs.js → short-docs.cjs} +18 -19
  6. package/build/bin/{short-epic.js → short-epic.cjs} +8 -9
  7. package/build/bin/short-epics.cjs +36 -0
  8. package/build/bin/{short-find.js → short-find.cjs} +1 -1
  9. package/build/bin/{short-install.js → short-install.cjs} +8 -9
  10. package/build/bin/short-iteration.cjs +184 -0
  11. package/build/bin/short-iterations.cjs +66 -0
  12. package/build/bin/{short-members.js → short-members.cjs} +6 -7
  13. package/build/bin/{short-projects.js → short-projects.cjs} +7 -8
  14. package/build/bin/{short-search.js → short-search.cjs} +20 -25
  15. package/build/bin/{short-story.js → short-story.cjs} +47 -46
  16. package/build/bin/{short-workflows.js → short-workflows.cjs} +5 -6
  17. package/build/bin/short-workspace.cjs +64 -0
  18. package/build/bin/short.cjs +10 -0
  19. package/build/lib/client.cjs +11 -0
  20. package/build/lib/{configure.js → configure.cjs} +3 -3
  21. package/build/lib/{spinner.js → spinner.cjs} +1 -1
  22. package/build/lib/{stories.js → stories.cjs} +73 -69
  23. package/build/{package.js → package.cjs} +1 -1
  24. package/package.json +67 -67
  25. package/build/bin/short-create.js +0 -56
  26. package/build/bin/short-epics.js +0 -37
  27. package/build/bin/short-workspace.js +0 -64
  28. package/build/bin/short.js +0 -11
  29. package/build/lib/client.js +0 -11
  30. /package/build/_virtual/{rolldown_runtime.js → rolldown_runtime.cjs} +0 -0
@@ -1,37 +0,0 @@
1
- #!/usr/bin/env node
2
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
3
- const require_lib_spinner = require('../lib/spinner.js');
4
- const require_lib_client = require('../lib/client.js');
5
- let commander = require("commander");
6
- commander = require_rolldown_runtime.__toESM(commander);
7
- let chalk = require("chalk");
8
- chalk = require_rolldown_runtime.__toESM(chalk);
9
-
10
- //#region src/bin/short-epics.ts
11
- const log = console.log;
12
- const spin = require_lib_spinner.default();
13
- const program = commander.default.description("Display epics available for stories").option("-a, --archived", "List only epics including archived", "").option("-c, --completed", "List only epics that have been completed", "").option("-d, --detailed", "List more details for each epic", "").option("-f, --format [template]", "Format each epic output by template", "").option("-M, --milestone [ID]", "List epics in milestone matching id", "").option("-t, --title [query]", "List epics with name/title containing query", "").option("-s, --started", "List epics that have been started", "").parse(process.argv);
14
- const main = async () => {
15
- spin.start();
16
- const epics = await require_lib_client.default.listEpics(null).then((r) => r.data);
17
- spin.stop(true);
18
- const textMatch = new RegExp(program.title, "i");
19
- epics.filter((epic) => {
20
- return !!`${epic.name} ${epic.name}`.match(textMatch) && !!(program.milestone ? epic.milestone_id == program.milestone : true);
21
- }).map(printItem);
22
- };
23
- const printItem = (epic) => {
24
- if (epic.archived && !program.archived) return;
25
- if (!epic.started && program.started) return;
26
- if (!epic.completed && program.completed) return;
27
- let defaultFormat = `#%id %t\nMilestone:\t%m\nState:\t\t%s\nDeadline:\t%dl\n`;
28
- defaultFormat += `Points:\t\t%p\nPoints Started: %ps\nPoints Done:\t%pd\nCompletion:\t%c\n`;
29
- if (epic.archived) defaultFormat += `Archived:\t%ar\n`;
30
- if (epic.started) defaultFormat += `Started:\t%st\n`;
31
- if (epic.completed) defaultFormat += `Completed:\t%co\n`;
32
- if (program.detailed) defaultFormat += `Description:\t%d\n`;
33
- log((program.format || defaultFormat).replace(/%id/, chalk.default.bold(`${epic.id}`)).replace(/%t/, chalk.default.blue(`${epic.name}`)).replace(/%m/, `${epic.milestone_id || "_"}`).replace(/%s/, `${epic.state}`).replace(/%dl/, `${epic.deadline || "_"}`).replace(/%d/, `${epic.description}`).replace(/%p/, `${epic.stats.num_points}`).replace(/%ps/, `${epic.stats.num_points_started}`).replace(/%pd/, `${epic.stats.num_points_done}`).replace(/%c/, `${Math.round(epic.stats.num_points_done / (epic.stats.num_points || 1) * 100)}%`).replace(/%a/, `${epic.archived}`).replace(/%st/, `${epic.started_at}`).replace(/%co/, `${epic.completed_at}`));
34
- };
35
- main();
36
-
37
- //#endregion
@@ -1,64 +0,0 @@
1
- #!/usr/bin/env node
2
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
3
- const require_lib_configure = require('../lib/configure.js');
4
- const require_lib_stories = require('../lib/stories.js');
5
- const require_bin_short_search = require('./short-search.js');
6
- let commander = require("commander");
7
- commander = require_rolldown_runtime.__toESM(commander);
8
-
9
- //#region src/bin/short-workspace.ts
10
- const config = require_lib_configure.default.loadConfig();
11
- const log = console.log;
12
- const program$1 = commander.default.description("List stories matching saved workspace query").option("-l, --list", "List saved workspaces").option("-q, --quiet", "Print only workspace story output, no loading dialog", "").option("-n, --name [name]", "Load named workspace", "").option("-u, --unset [name]", "Force unset saved workspace").parse(process.argv);
13
- const main = async () => {
14
- if (!config || !config.token) {
15
- log("Not installed yet.");
16
- log("Please run: short install");
17
- return;
18
- } else if (!config.workspaces) {
19
- log("No workspace saved.");
20
- log("Please run:");
21
- log(" short search [options] --save");
22
- log("to create your first one.");
23
- return;
24
- } else if (program$1.list) {
25
- log("Workspaces:");
26
- Object.keys(config.workspaces).map((w) => {
27
- log(" ", w + ":", toArgs(config.workspaces[w]));
28
- });
29
- return;
30
- } else if (program$1.unset) {
31
- if (require_lib_configure.default.removeWorkspace(program$1.unset)) log("Successfully removed %s workspace", program$1.unset);
32
- else log("Failed to remove %s workspace", program$1.unset);
33
- return;
34
- }
35
- const name = `${program$1.name || program$1.args[0] || "default"}`;
36
- const workspace = config.workspaces[name];
37
- if (!workspace) {
38
- log("No workspace saved with name", name);
39
- log("Please run:");
40
- log(" short search [options] --save", name);
41
- log("to create it.");
42
- return;
43
- }
44
- const found = require_bin_short_search.program.parse(process.argv);
45
- const additionalArgs = found.options.map((o) => o.name()).reduce((acc, val) => {
46
- acc[val] = found[val] || acc[val] || found[val];
47
- return acc;
48
- }, workspace);
49
- if (!program$1.quiet) {
50
- log("Loading %s workspace ...", name);
51
- log();
52
- }
53
- let stories = [];
54
- try {
55
- stories = await require_lib_stories.default.listStories(additionalArgs);
56
- } catch (e) {
57
- log("Error fetching stories:", e);
58
- }
59
- stories.map(require_lib_stories.default.printFormattedStory(additionalArgs));
60
- };
61
- main();
62
- const toArgs = (obj) => Object.keys(obj).map((k) => `--${k} '${obj[k]}'`).join(" ");
63
-
64
- //#endregion
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
3
- const require_package = require('../package.js');
4
- let commander = require("commander");
5
- commander = require_rolldown_runtime.__toESM(commander);
6
-
7
- //#region src/bin/short.ts
8
- process.on("unhandledRejection", console.log);
9
- commander.default.version(require_package.version).description(require_package.description).command("install [options]", "install and configure API access").command("search [options] [SEARCH OPERATORS]", "search stories with optional query").alias("s").command("find [options] [SEARCH OPERATORS]", "[DEPRECATED] search stories with optional query").command("story ID [options]", "view or manipulate stories").alias("st").command("create [options]", "create a story").alias("c").command("members [options]", "list members").alias("m").command("workflows [options]", "list workflows and their states").alias("wf").command("epics [options]", "list epics and their states").alias("e").command("epic [command] [options]", "create or view an epic").command("docs [options]", "list and search docs").alias("d").command("doc [command] [options]", "view, create, or update a doc").command("projects [options]", "list projects and their states").alias("p").command("workspace [NAME] [options]", "list stories matching saved workspace query", { isDefault: true }).alias("w").command("api <path> [options]", "make a request to the Shortcut API").parse(process.argv);
10
-
11
- //#endregion
@@ -1,11 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
3
- const require_lib_configure = require('./configure.js');
4
- let __shortcut_client = require("@shortcut/client");
5
-
6
- //#region src/lib/client.ts
7
- const client = new __shortcut_client.ShortcutClient(require_lib_configure.loadConfig().token);
8
- var client_default = client;
9
-
10
- //#endregion
11
- exports.default = client_default;