@shortcut-cli/shortcut-cli 3.4.0 → 3.6.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 +25 -0
- package/build/_virtual/rolldown_runtime.js +25 -0
- package/build/bin/short-api.js +78 -0
- package/build/bin/short-create.js +52 -573
- package/build/bin/short-epics.js +31 -160
- package/build/bin/short-find.js +4 -588
- package/build/bin/short-install.js +37 -135
- package/build/bin/short-members.js +28 -134
- package/build/bin/short-projects.js +28 -136
- package/build/bin/short-search.js +46 -597
- package/build/bin/short-story.js +201 -737
- package/build/bin/short-workflows.js +27 -133
- package/build/bin/short-workspace.js +62 -648
- package/build/bin/short.js +7 -33
- package/build/lib/client.js +10 -103
- package/build/lib/configure.js +93 -126
- package/build/lib/spinner.js +14 -31
- package/build/lib/stories.js +295 -462
- package/build/package.js +18 -0
- package/package.json +15 -15
|
@@ -1,137 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
|
|
25
|
-
// src/bin/short-workflows.ts
|
|
26
|
-
var import_chalk = __toESM(require("chalk"));
|
|
27
|
-
var import_commander = __toESM(require("commander"));
|
|
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
|
+
const commander = require_rolldown_runtime.__toESM(require("commander"));
|
|
6
|
+
const chalk = require_rolldown_runtime.__toESM(require("chalk"));
|
|
28
7
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!config2 || config2 === {} || !config2.token) {
|
|
50
|
-
console.error("Please run 'short install' to configure Shortcut API access.");
|
|
51
|
-
process.exit(11);
|
|
52
|
-
}
|
|
53
|
-
if (!config2.urlSlug) {
|
|
54
|
-
console.error(
|
|
55
|
-
"Your config must be updated with data from Shortcut. Please run 'short install --refresh'."
|
|
56
|
-
);
|
|
57
|
-
process.exit(12);
|
|
58
|
-
}
|
|
59
|
-
return config2;
|
|
60
|
-
};
|
|
61
|
-
var loadCachedConfig = () => {
|
|
62
|
-
if (CONFIG_CACHE) {
|
|
63
|
-
return { ...CONFIG_CACHE };
|
|
64
|
-
}
|
|
65
|
-
let config2 = {};
|
|
66
|
-
const token = process.env.SHORTCUT_API_TOKEN || process.env.CLUBHOUSE_API_TOKEN;
|
|
67
|
-
legacyConfigDirs.forEach((dir) => {
|
|
68
|
-
if (import_fs.default.existsSync(dir)) {
|
|
69
|
-
createConfigDir();
|
|
70
|
-
import_fs.default.renameSync(dir, configDir);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
if (import_fs.default.existsSync(configFile)) {
|
|
74
|
-
try {
|
|
75
|
-
config2 = JSON.parse(import_fs.default.readFileSync(configFile, "utf8"));
|
|
76
|
-
} catch (e) {
|
|
77
|
-
console.error(e);
|
|
78
|
-
process.exit(10);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (token) {
|
|
82
|
-
config2 = { token, ...config2 };
|
|
83
|
-
}
|
|
84
|
-
CONFIG_CACHE = { ...config2 };
|
|
85
|
-
return config2;
|
|
86
|
-
};
|
|
87
|
-
var createConfigDir = () => {
|
|
88
|
-
const dir = import_path.default.dirname(configDir);
|
|
89
|
-
if (!import_fs.default.existsSync(dir)) {
|
|
90
|
-
import_fs.default.mkdirSync(dir);
|
|
91
|
-
}
|
|
92
|
-
if (!import_fs.default.existsSync(configDir)) {
|
|
93
|
-
import_fs.default.mkdirSync(configDir);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// src/lib/client.ts
|
|
98
|
-
var config = loadConfig();
|
|
99
|
-
var client = new import_client.ShortcutClient(config.token);
|
|
100
|
-
var client_default = client;
|
|
101
|
-
|
|
102
|
-
// src/lib/spinner.ts
|
|
103
|
-
var import_cli_spinner = require("cli-spinner");
|
|
104
|
-
var spinner = (text = "") => {
|
|
105
|
-
const spin2 = new import_cli_spinner.Spinner({
|
|
106
|
-
text: text ? text : "Loading... %s ",
|
|
107
|
-
stream: process.stderr
|
|
108
|
-
});
|
|
109
|
-
spin2.setSpinnerString(27);
|
|
110
|
-
return spin2;
|
|
111
|
-
};
|
|
112
|
-
var spinner_default = spinner;
|
|
113
|
-
|
|
114
|
-
// src/bin/short-workflows.ts
|
|
115
|
-
var spin = spinner_default();
|
|
116
|
-
var log = console.log;
|
|
117
|
-
var program = import_commander.default.description("Display workflows/states available for stories").option("-s, --search [query]", "List states containing query", "").parse(process.argv);
|
|
118
|
-
var main = async () => {
|
|
119
|
-
spin.start();
|
|
120
|
-
const wfs = await client_default.listWorkflows().then((r) => r.data);
|
|
121
|
-
spin.stop(true);
|
|
122
|
-
wfs.map(printWf);
|
|
123
|
-
};
|
|
124
|
-
var printWf = (wf) => {
|
|
125
|
-
log(import_chalk.default.bold(`#${wf.id}`) + ` ${wf.name}`);
|
|
126
|
-
log(" == States:");
|
|
127
|
-
wf.states.map(printWfState);
|
|
128
|
-
};
|
|
129
|
-
var printWfState = (state) => {
|
|
130
|
-
if (!state.name.match(new RegExp(program.search, "i"))) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
log(import_chalk.default.bold(` #${state.id}`) + ` ${state.name}`);
|
|
134
|
-
log(` Type: ${state.type}`);
|
|
135
|
-
log(` Stories: ${state.num_stories}`);
|
|
8
|
+
//#region src/bin/short-workflows.ts
|
|
9
|
+
const spin = require_lib_spinner.default();
|
|
10
|
+
const log = console.log;
|
|
11
|
+
const program = commander.default.description("Display workflows/states available for stories").option("-s, --search [query]", "List states containing query", "").parse(process.argv);
|
|
12
|
+
const main = async () => {
|
|
13
|
+
spin.start();
|
|
14
|
+
const wfs = await require_lib_client.default.listWorkflows().then((r) => r.data);
|
|
15
|
+
spin.stop(true);
|
|
16
|
+
wfs.map(printWf);
|
|
17
|
+
};
|
|
18
|
+
const printWf = (wf) => {
|
|
19
|
+
log(chalk.default.bold(`#${wf.id}`) + ` ${wf.name}`);
|
|
20
|
+
log(" == States:");
|
|
21
|
+
wf.states.map(printWfState);
|
|
22
|
+
};
|
|
23
|
+
const printWfState = (state) => {
|
|
24
|
+
if (!state.name.match(new RegExp(program.search, "i"))) return;
|
|
25
|
+
log(chalk.default.bold(` #${state.id}`) + ` ${state.name}`);
|
|
26
|
+
log(` Type: \t${state.type}`);
|
|
27
|
+
log(` Stories:\t${state.num_stories}`);
|
|
136
28
|
};
|
|
137
29
|
main();
|
|
30
|
+
|
|
31
|
+
//#endregion
|