@shortcut-cli/shortcut-cli 3.5.0 → 3.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/README.md +14 -0
- package/build/_virtual/rolldown_runtime.js +10 -6
- package/build/bin/short-api.js +7 -8
- package/build/bin/short-create.js +3 -2
- package/build/bin/short-epics.js +5 -4
- package/build/bin/short-install.js +6 -5
- package/build/bin/short-members.js +4 -2
- package/build/bin/short-projects.js +4 -2
- package/build/bin/short-search.js +2 -1
- package/build/bin/short-story.js +19 -13
- package/build/bin/short-workflows.js +4 -2
- package/build/bin/short-workspace.js +4 -5
- package/build/bin/short.js +2 -1
- package/build/lib/client.js +2 -3
- package/build/lib/configure.js +22 -8
- package/build/lib/spinner.js +1 -1
- package/build/lib/stories.js +11 -11
- package/build/package.js +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -52,6 +52,20 @@ You may also provide a Shortcut API token via environment variable `SHORTCUT_API
|
|
|
52
52
|
SHORTCUT_API_TOKEN=foobar short story 3300
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
To skip `short install` entirely, set the additional environment variables used for URL and mention-name substitutions:
|
|
56
|
+
|
|
57
|
+
- `SHORTCUT_URL_SLUG` – your workspace slug, e.g. `acme-co`
|
|
58
|
+
- `SHORTCUT_MENTION_NAME` – your personal mention name used in branches, e.g. `mike`
|
|
59
|
+
|
|
60
|
+
With these env vars in place you can run commands directly:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
SHORTCUT_API_TOKEN=foobar \
|
|
64
|
+
SHORTCUT_URL_SLUG=acme-co \
|
|
65
|
+
SHORTCUT_MENTION_NAME=mike \
|
|
66
|
+
short story 3300
|
|
67
|
+
```
|
|
68
|
+
|
|
55
69
|
```
|
|
56
70
|
Usage: short [options] [command]
|
|
57
71
|
|
|
@@ -6,12 +6,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
return to;
|
|
17
21
|
};
|
package/build/bin/short-api.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
2
|
const require_lib_spinner = require('../lib/spinner.js');
|
|
3
3
|
const require_lib_client = require('../lib/client.js');
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
let commander = require("commander");
|
|
5
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
6
|
+
let debug = require("debug");
|
|
7
|
+
debug = require_rolldown_runtime.__toESM(debug);
|
|
6
8
|
|
|
7
9
|
//#region src/bin/short-api.ts
|
|
8
10
|
const debug$1 = (0, debug.default)("short-api");
|
|
@@ -11,9 +13,7 @@ const logError = console.error;
|
|
|
11
13
|
const spin = require_lib_spinner.default();
|
|
12
14
|
const parseKeyVal = (input, separator = "=") => {
|
|
13
15
|
const parts = input.split(separator);
|
|
14
|
-
|
|
15
|
-
const value = parts.join(separator);
|
|
16
|
-
return [key, value];
|
|
16
|
+
return [parts.shift(), parts.join(separator)];
|
|
17
17
|
};
|
|
18
18
|
const collect = (val, memo) => {
|
|
19
19
|
memo.push(val);
|
|
@@ -52,12 +52,11 @@ const main = async () => {
|
|
|
52
52
|
method,
|
|
53
53
|
headers
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
if ([
|
|
56
56
|
"POST",
|
|
57
57
|
"PUT",
|
|
58
58
|
"PATCH"
|
|
59
|
-
]
|
|
60
|
-
if (bodyMethods.includes(method)) {
|
|
59
|
+
].includes(method)) {
|
|
61
60
|
requestOptions.body = params;
|
|
62
61
|
if (!headers["Content-Type"]) headers["Content-Type"] = "application/json";
|
|
63
62
|
} else requestOptions.query = params;
|
|
@@ -4,8 +4,9 @@ const require_lib_spinner = require('../lib/spinner.js');
|
|
|
4
4
|
const require_lib_configure = require('../lib/configure.js');
|
|
5
5
|
const require_lib_client = require('../lib/client.js');
|
|
6
6
|
const require_lib_stories = require('../lib/stories.js');
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
let commander = require("commander");
|
|
8
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
9
|
+
let child_process = require("child_process");
|
|
9
10
|
|
|
10
11
|
//#region src/bin/short-create.ts
|
|
11
12
|
const config = require_lib_configure.loadConfig();
|
package/build/bin/short-epics.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
3
|
const require_lib_spinner = require('../lib/spinner.js');
|
|
4
4
|
const require_lib_client = require('../lib/client.js');
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
let commander = require("commander");
|
|
6
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
7
|
+
let chalk = require("chalk");
|
|
8
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
7
9
|
|
|
8
10
|
//#region src/bin/short-epics.ts
|
|
9
11
|
const log = console.log;
|
|
@@ -28,8 +30,7 @@ const printItem = (epic) => {
|
|
|
28
30
|
if (epic.started) defaultFormat += `Started:\t%st\n`;
|
|
29
31
|
if (epic.completed) defaultFormat += `Completed:\t%co\n`;
|
|
30
32
|
if (program.detailed) defaultFormat += `Description:\t%d\n`;
|
|
31
|
-
|
|
32
|
-
log(format.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}`));
|
|
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}`));
|
|
33
34
|
};
|
|
34
35
|
main();
|
|
35
36
|
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
3
|
const require_lib_configure = require('../lib/configure.js');
|
|
4
4
|
const require_package = require('../package.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
let commander = require("commander");
|
|
6
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
7
|
+
let __shortcut_client = require("@shortcut/client");
|
|
8
|
+
let prompt = require("prompt");
|
|
9
|
+
prompt = require_rolldown_runtime.__toESM(prompt);
|
|
8
10
|
|
|
9
11
|
//#region src/bin/short-install.ts
|
|
10
12
|
const extant = require_lib_configure.loadCachedConfig();
|
|
@@ -31,8 +33,7 @@ const main = async () => {
|
|
|
31
33
|
if (err) return log(err);
|
|
32
34
|
const config = await enrichConfigWithMemberDetails(result);
|
|
33
35
|
log("Saving config...");
|
|
34
|
-
|
|
35
|
-
if (success) log("Saved config");
|
|
36
|
+
if (require_lib_configure.updateConfig(config)) log("Saved config");
|
|
36
37
|
else log("Error saving config");
|
|
37
38
|
});
|
|
38
39
|
} else if (extant.token) log("A configuration/token is already saved. To override, re-run with --force");
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
3
|
const require_lib_spinner = require('../lib/spinner.js');
|
|
4
4
|
const require_lib_client = require('../lib/client.js');
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
let commander = require("commander");
|
|
6
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
7
|
+
let chalk = require("chalk");
|
|
8
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
7
9
|
|
|
8
10
|
//#region src/bin/short-members.ts
|
|
9
11
|
const spin = require_lib_spinner.default("Loading... %s ");
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
3
|
const require_lib_spinner = require('../lib/spinner.js');
|
|
4
4
|
const require_lib_client = require('../lib/client.js');
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
let commander = require("commander");
|
|
6
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
7
|
+
let chalk = require("chalk");
|
|
8
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
7
9
|
|
|
8
10
|
//#region src/bin/short-projects.ts
|
|
9
11
|
const spin = require_lib_spinner.default();
|
|
@@ -3,7 +3,8 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
|
3
3
|
const require_lib_spinner = require('../lib/spinner.js');
|
|
4
4
|
const require_lib_configure = require('../lib/configure.js');
|
|
5
5
|
const require_lib_stories = require('../lib/stories.js');
|
|
6
|
-
|
|
6
|
+
let commander = require("commander");
|
|
7
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
7
8
|
|
|
8
9
|
//#region src/bin/short-search.ts
|
|
9
10
|
var _process$argv$;
|
package/build/bin/short-story.js
CHANGED
|
@@ -4,14 +4,21 @@ const require_lib_spinner = require('../lib/spinner.js');
|
|
|
4
4
|
const require_lib_configure = require('../lib/configure.js');
|
|
5
5
|
const require_lib_client = require('../lib/client.js');
|
|
6
6
|
const require_lib_stories = require('../lib/stories.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
let commander = require("commander");
|
|
8
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
9
|
+
let debug = require("debug");
|
|
10
|
+
debug = require_rolldown_runtime.__toESM(debug);
|
|
11
|
+
let path = require("path");
|
|
12
|
+
path = require_rolldown_runtime.__toESM(path);
|
|
13
|
+
let fs = require("fs");
|
|
14
|
+
fs = require_rolldown_runtime.__toESM(fs);
|
|
15
|
+
let os = require("os");
|
|
16
|
+
os = require_rolldown_runtime.__toESM(os);
|
|
17
|
+
let child_process = require("child_process");
|
|
18
|
+
let chalk = require("chalk");
|
|
19
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
20
|
+
let https = require("https");
|
|
21
|
+
https = require_rolldown_runtime.__toESM(https);
|
|
15
22
|
|
|
16
23
|
//#region src/bin/short-story.ts
|
|
17
24
|
const config = require_lib_configure.loadConfig();
|
|
@@ -19,7 +26,7 @@ const spin = require_lib_spinner.default();
|
|
|
19
26
|
const log = console.log;
|
|
20
27
|
const logError = console.error;
|
|
21
28
|
const debug$1 = (0, debug.default)("short");
|
|
22
|
-
const program = commander.default.usage("[options] <id>").description("Update and/or display story details").option("-a, --archived", "Update story as archived").option("-c, --comment [text]", "Add comment to story", "").option("-d, --description [text]", "Update description of story", "").option("-D, --download", "Download all attached files", "").option("--download-dir [path]", "Directory to download files to", ".").option("-e, --estimate [number]", "Update estimate of story", "").option("--epic [id|name]", "Set epic of story").option("-i, --iteration [id|name]", "Set iteration of story").option("-f, --format [template]", "Format the story output by template", "").option("--from-git", "Fetch story parsed by ID from current git branch").option("--git-branch", "Checkout git branch from story slug <mention-name>/ch<id>/<type>-<title>\n as required by the Git integration: https://bit.ly/2RKO1FF").option("--git-branch-short", "Checkout git branch from story slug <mention-name>/ch<id>/<title>").option("-I, --idonly", "Print only ID of story results", "").option("-l, --label [id|name]", "Stories with label id/name, by regex", "").option("--move-after [id]", "Move story to position below story ID").option("--move-before [id]", "Move story to position above story ID").option("--move-down [n]", "Move story position downward by n stories").option("--move-up [n]", "Move story position upward by n stories").option("-o, --owners [id|name]", "Update owners of story, comma-separated", "").option("-O, --open", "Open story in browser").option("--oe, --open-epic", "Open story's epic in browser").option("--oi, --open-iteration", "Open story's iteration in browser").option("--op, --open-project", "Open story's project in browser").option("-q, --quiet", "Print only story output, no loading dialog", "").option("-s, --state [id|name]", "Update workflow state of story", "").option("-t, --title [text]", "Update title/name of story", "").option("--task [text]", "Create new task on story").option("--task-complete [text]", "Toggle completion of task on story matching text").option("-y, --type [name]", "Update type of story", "").parse(process.argv);
|
|
29
|
+
const program = commander.default.usage("[options] <id>").description("Update and/or display story details").option("-a, --archived", "Update story as archived").option("-c, --comment [text]", "Add comment to story", "").option("-d, --description [text]", "Update description of story", "").option("-D, --download", "Download all attached files", "").option("--download-dir [path]", "Directory to download files to", ".").option("-e, --estimate [number]", "Update estimate of story", "").option("--epic [id|name]", "Set epic of story").option("-i, --iteration [id|name]", "Set iteration of story").option("-f, --format [template]", "Format the story output by template", "").option("--from-git", "Fetch story parsed by ID from current git branch").option("--git-branch", "Checkout git branch from story slug <mention-name>/ch<id>/<type>-<title>\n as required by the Git integration: https://bit.ly/2RKO1FF").option("--git-branch-short", "Checkout git branch from story slug <mention-name>/ch<id>/<title>").option("-I, --idonly", "Print only ID of story results", "").option("-l, --label [id|name]", "Stories with label id/name, by regex", "").option("--move-after [id]", "Move story to position below story ID").option("--move-before [id]", "Move story to position above story ID").option("--move-down [n]", "Move story position downward by n stories").option("--move-up [n]", "Move story position upward by n stories").option("-o, --owners [id|name]", "Update owners of story, comma-separated", "").option("-O, --open", "Open story in browser").option("--oe, --open-epic", "Open story's epic in browser").option("--oi, --open-iteration", "Open story's iteration in browser").option("--op, --open-project", "Open story's project in browser").option("-q, --quiet", "Print only story output, no loading dialog", "").option("-s, --state [id|name]", "Update workflow state of story", "").option("-t, --title [text]", "Update title/name of story", "").option("-T, --team [id|name]", "Update team/group of story", "").option("--task [text]", "Create new task on story").option("--task-complete [text]", "Toggle completion of task on story matching text").option("-y, --type [name]", "Update type of story", "").parse(process.argv);
|
|
23
30
|
const main = async () => {
|
|
24
31
|
const entities = await require_lib_stories.default.fetchEntities();
|
|
25
32
|
if (!(program.idonly || program.quiet)) spin.start();
|
|
@@ -42,6 +49,7 @@ const main = async () => {
|
|
|
42
49
|
if (program.epic) update.epic_id = (require_lib_stories.default.findEpic(entities, program.epic) || {}).id;
|
|
43
50
|
if (program.iteration) update.iteration_id = (require_lib_stories.default.findIteration(entities, program.iteration) || {}).id;
|
|
44
51
|
if (program.label) update.labels = require_lib_stories.default.findLabelNames(entities, program.label);
|
|
52
|
+
if (program.team) update.group_id = (require_lib_stories.default.findGroup(entities, program.team) || {}).id;
|
|
45
53
|
const hasPositionUpdate = program.moveAfter !== void 0 || program.moveBefore !== void 0 || program.moveDown !== void 0 || program.moveUp !== void 0;
|
|
46
54
|
const hasUpdate = Object.keys(update).length > 0 || hasPositionUpdate;
|
|
47
55
|
debug$1("constructed story update", update);
|
|
@@ -65,8 +73,7 @@ const main = async () => {
|
|
|
65
73
|
process.exit(2);
|
|
66
74
|
}
|
|
67
75
|
}
|
|
68
|
-
|
|
69
|
-
argIDs.concat(gitID).map(async (_id) => {
|
|
76
|
+
program.args.map((a) => (a.match(/\d+/) || [])[0]).concat(gitID).map(async (_id) => {
|
|
70
77
|
const id = parseInt(_id, 10);
|
|
71
78
|
let story;
|
|
72
79
|
try {
|
|
@@ -181,8 +188,7 @@ const main = async () => {
|
|
|
181
188
|
stopSpinner();
|
|
182
189
|
};
|
|
183
190
|
const openURL = (url) => {
|
|
184
|
-
|
|
185
|
-
(0, child_process.execSync)(`${open} '${url}'`);
|
|
191
|
+
(0, child_process.execSync)(`${os.default.platform() === "darwin" ? "open" : "xdg-open"} '${url}'`);
|
|
186
192
|
};
|
|
187
193
|
const stopSpinner = () => {
|
|
188
194
|
if (!(program.idonly || program.quiet)) spin.stop(true);
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
3
|
const require_lib_spinner = require('../lib/spinner.js');
|
|
4
4
|
const require_lib_client = require('../lib/client.js');
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
let commander = require("commander");
|
|
6
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
7
|
+
let chalk = require("chalk");
|
|
8
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
7
9
|
|
|
8
10
|
//#region src/bin/short-workflows.ts
|
|
9
11
|
const spin = require_lib_spinner.default();
|
|
@@ -3,7 +3,8 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
|
3
3
|
const require_lib_configure = require('../lib/configure.js');
|
|
4
4
|
const require_lib_stories = require('../lib/stories.js');
|
|
5
5
|
const require_bin_short_search = require('./short-search.js');
|
|
6
|
-
|
|
6
|
+
let commander = require("commander");
|
|
7
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
7
8
|
|
|
8
9
|
//#region src/bin/short-workspace.ts
|
|
9
10
|
const config = require_lib_configure.default.loadConfig();
|
|
@@ -27,8 +28,7 @@ const main = async () => {
|
|
|
27
28
|
});
|
|
28
29
|
return;
|
|
29
30
|
} else if (program$1.unset) {
|
|
30
|
-
|
|
31
|
-
if (success) log("Successfully removed %s workspace", program$1.unset);
|
|
31
|
+
if (require_lib_configure.default.removeWorkspace(program$1.unset)) log("Successfully removed %s workspace", program$1.unset);
|
|
32
32
|
else log("Failed to remove %s workspace", program$1.unset);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
@@ -42,8 +42,7 @@ const main = async () => {
|
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
const found = require_bin_short_search.program.parse(process.argv);
|
|
45
|
-
const
|
|
46
|
-
const additionalArgs = findOpts.reduce((acc, val) => {
|
|
45
|
+
const additionalArgs = found.options.map((o) => o.name()).reduce((acc, val) => {
|
|
47
46
|
acc[val] = found[val] || acc[val] || found[val];
|
|
48
47
|
return acc;
|
|
49
48
|
}, workspace);
|
package/build/bin/short.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
3
|
const require_package = require('../package.js');
|
|
4
|
-
|
|
4
|
+
let commander = require("commander");
|
|
5
|
+
commander = require_rolldown_runtime.__toESM(commander);
|
|
5
6
|
|
|
6
7
|
//#region src/bin/short.ts
|
|
7
8
|
process.on("unhandledRejection", console.log);
|
package/build/lib/client.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
3
|
const require_lib_configure = require('./configure.js');
|
|
4
|
-
|
|
4
|
+
let __shortcut_client = require("@shortcut/client");
|
|
5
5
|
|
|
6
6
|
//#region src/lib/client.ts
|
|
7
|
-
const
|
|
8
|
-
const client = new __shortcut_client.ShortcutClient(config.token);
|
|
7
|
+
const client = new __shortcut_client.ShortcutClient(require_lib_configure.loadConfig().token);
|
|
9
8
|
var client_default = client;
|
|
10
9
|
|
|
11
10
|
//#endregion
|
package/build/lib/configure.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
let path = require("path");
|
|
4
|
+
path = require_rolldown_runtime.__toESM(path);
|
|
5
|
+
let fs = require("fs");
|
|
6
|
+
fs = require_rolldown_runtime.__toESM(fs);
|
|
7
|
+
let os = require("os");
|
|
8
|
+
os = require_rolldown_runtime.__toESM(os);
|
|
6
9
|
|
|
7
10
|
//#region src/lib/configure.ts
|
|
8
11
|
function getConfigDir(suffix) {
|
|
@@ -19,13 +22,23 @@ let CONFIG_CACHE = null;
|
|
|
19
22
|
const loadConfig = () => {
|
|
20
23
|
const config = loadCachedConfig();
|
|
21
24
|
if (!config || config === {} || !config.token) {
|
|
22
|
-
console.error("Please run 'short install' to configure Shortcut API access.");
|
|
25
|
+
console.error("Please run 'short install' to configure Shortcut API access or set SHORTCUT_API_TOKEN.");
|
|
23
26
|
process.exit(11);
|
|
24
27
|
}
|
|
28
|
+
const envUrlSlug = process.env.SHORTCUT_URL_SLUG || process.env.CLUBHOUSE_URL_SLUG;
|
|
29
|
+
if (!config.urlSlug && envUrlSlug) config.urlSlug = envUrlSlug;
|
|
30
|
+
const envMentionName = process.env.SHORTCUT_MENTION_NAME || process.env.CLUBHOUSE_MENTION_NAME;
|
|
31
|
+
if (!config.mentionName && envMentionName) config.mentionName = envMentionName;
|
|
25
32
|
if (!config.urlSlug) {
|
|
26
|
-
console.
|
|
27
|
-
|
|
33
|
+
console.warn("shortcut-cli: URL slug not configured. Set SHORTCUT_URL_SLUG or run 'short install --refresh' for full functionality.");
|
|
34
|
+
config.urlSlug = "";
|
|
28
35
|
}
|
|
36
|
+
if (!config.mentionName) {
|
|
37
|
+
console.warn("shortcut-cli: Mention name not configured. Set SHORTCUT_MENTION_NAME or run 'short install --refresh' for full functionality.");
|
|
38
|
+
config.mentionName = "";
|
|
39
|
+
}
|
|
40
|
+
if (!config.workspaces) config.workspaces = {};
|
|
41
|
+
CONFIG_CACHE = { ...config };
|
|
29
42
|
return config;
|
|
30
43
|
};
|
|
31
44
|
/**
|
|
@@ -48,9 +61,10 @@ const loadCachedConfig = () => {
|
|
|
48
61
|
process.exit(10);
|
|
49
62
|
}
|
|
50
63
|
if (token) config = {
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
...config,
|
|
65
|
+
token
|
|
53
66
|
};
|
|
67
|
+
if (!config.workspaces) config.workspaces = {};
|
|
54
68
|
CONFIG_CACHE = { ...config };
|
|
55
69
|
return config;
|
|
56
70
|
};
|
package/build/lib/spinner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
|
-
|
|
3
|
+
let cli_spinner = require("cli-spinner");
|
|
4
4
|
|
|
5
5
|
//#region src/lib/spinner.ts
|
|
6
6
|
const spinner = (text = "") => {
|
package/build/lib/stories.js
CHANGED
|
@@ -2,9 +2,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
3
3
|
const require_lib_configure = require('./configure.js');
|
|
4
4
|
const require_lib_client = require('./client.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
let debug = require("debug");
|
|
6
|
+
debug = require_rolldown_runtime.__toESM(debug);
|
|
7
|
+
let child_process = require("child_process");
|
|
8
|
+
let chalk = require("chalk");
|
|
9
|
+
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
8
10
|
|
|
9
11
|
//#region src/lib/stories.ts
|
|
10
12
|
const debug$1 = (0, debug.default)("club");
|
|
@@ -103,7 +105,7 @@ const findEntity = (entities, id) => {
|
|
|
103
105
|
if (entities.get(id)) return entities.get(id);
|
|
104
106
|
if (isNumber(id) && Number(id.toString())) return entities.get(Number(id.toString()));
|
|
105
107
|
const match = new RegExp(`${id}`, "i");
|
|
106
|
-
return
|
|
108
|
+
return Array.from(entities.values()).filter((s) => !!s.name.match(match))[0];
|
|
107
109
|
};
|
|
108
110
|
const findProject = (entities, project) => findEntity(entities.projectsById, project);
|
|
109
111
|
const findGroup = (entities, group) => findEntity(entities.groupsById, group);
|
|
@@ -112,7 +114,7 @@ const findEpic = (entities, epicName) => findEntity(entities.epicsById, epicName
|
|
|
112
114
|
const findIteration = (entities, iterationName) => findEntity(entities.statesById, iterationName);
|
|
113
115
|
const findOwnerIds = (entities, owners) => {
|
|
114
116
|
const ownerMatch = new RegExp(owners.split(",").join("|"), "i");
|
|
115
|
-
return
|
|
117
|
+
return Array.from(entities.membersById.values()).filter((m) => !!`${m.id} ${m.profile.name} ${m.profile.mention_name}`.match(ownerMatch)).map((m) => m.id);
|
|
116
118
|
};
|
|
117
119
|
const findLabelNames = (entities, label) => {
|
|
118
120
|
const labelMatch = new RegExp(label.split(",").join("|"), "i");
|
|
@@ -139,10 +141,9 @@ const filterStories = (program, stories, entities) => {
|
|
|
139
141
|
if (!(s.epic_id + " " + (s.epic || {}).name).match(regexEpic)) return false;
|
|
140
142
|
if (!(s.iteration_id + " " + (s.iteration || {}).name).match(regexIteration)) return false;
|
|
141
143
|
if (program.owner) {
|
|
142
|
-
|
|
144
|
+
if (!(s.owners.filter((o) => {
|
|
143
145
|
return !!`${o.profile.name} ${o.profile.mention_name}`.match(regexOwner);
|
|
144
|
-
}).length > 0;
|
|
145
|
-
if (!owned) return false;
|
|
146
|
+
}).length > 0)) return false;
|
|
146
147
|
}
|
|
147
148
|
if (!s.name.match(regexText)) return false;
|
|
148
149
|
if (!s.story_type.match(regexType)) return false;
|
|
@@ -177,7 +178,7 @@ const sortStories = (program) => {
|
|
|
177
178
|
const printFormattedStory = (program) => {
|
|
178
179
|
return (story) => {
|
|
179
180
|
var _story$group;
|
|
180
|
-
const
|
|
181
|
+
const format = program.format || `#%id %t
|
|
181
182
|
\tType: %y/%e
|
|
182
183
|
\tTeam: %T
|
|
183
184
|
\tProject: %p
|
|
@@ -192,10 +193,9 @@ const printFormattedStory = (program) => {
|
|
|
192
193
|
\tUpdated: %updated
|
|
193
194
|
\tArchived: %a
|
|
194
195
|
`;
|
|
195
|
-
const format = program.format || defaultFormat;
|
|
196
196
|
const labels = story.labels.map((l) => `${l.name} (#${l.id})`);
|
|
197
197
|
const owners = story.owners.map((o) => `${o.profile.name} (${o.profile.mention_name})`);
|
|
198
|
-
const url =
|
|
198
|
+
const url = storyURL(story);
|
|
199
199
|
const project = story.project ? `${story.project.name} (#${story.project.id})` : "None";
|
|
200
200
|
log(format.replace(/%j/, JSON.stringify({
|
|
201
201
|
...story,
|
package/build/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shortcut-cli/shortcut-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "A community-driven command line tool for viewing, creating, and updating shortcut.com stories",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/shortcut-cli/shortcut-cli",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@shortcut/client": "^2.1
|
|
43
|
+
"@shortcut/client": "^2.3.1",
|
|
44
44
|
"chalk": "^2.2.0",
|
|
45
45
|
"cli-spinner": "^0.2.10",
|
|
46
46
|
"commander": "^2.12.0",
|
|
@@ -48,22 +48,22 @@
|
|
|
48
48
|
"prompt": "^1.3.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@eslint/js": "^9.
|
|
51
|
+
"@eslint/js": "^9.39.1",
|
|
52
52
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
53
53
|
"@types/chalk": "2.2.4",
|
|
54
54
|
"@types/cli-spinner": "0.2.3",
|
|
55
55
|
"@types/debug": "4.1.12",
|
|
56
|
-
"@types/node": "
|
|
56
|
+
"@types/node": "24.10.1",
|
|
57
57
|
"@types/node-fetch": "3.0.3",
|
|
58
58
|
"@types/prompt": "^1.1.9",
|
|
59
|
-
"eslint": "^9.
|
|
59
|
+
"eslint": "^9.39.1",
|
|
60
60
|
"eslint-plugin-import": "^2.32.0",
|
|
61
61
|
"glob": "^11.0.3",
|
|
62
|
-
"globals": "^16.
|
|
62
|
+
"globals": "^16.5.0",
|
|
63
63
|
"prettier": "3.6.2",
|
|
64
64
|
"source-map-support": "0.5.21",
|
|
65
65
|
"tsdown": "^0.12.9",
|
|
66
|
-
"typescript": "5.
|
|
67
|
-
"typescript-eslint": "^8.
|
|
66
|
+
"typescript": "5.9.3",
|
|
67
|
+
"typescript-eslint": "^8.47.0"
|
|
68
68
|
}
|
|
69
69
|
}
|