team-toon-tack 1.0.9 → 1.0.11
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/{bin/cli.ts → dist/bin/cli.js} +30 -48
- package/dist/cli-6rkvcjaj.js +4923 -0
- package/dist/cli-pyanjjwn.js +21 -0
- package/{scripts/done-job.ts → dist/scripts/done-job.js} +82 -127
- package/dist/scripts/init.js +313 -0
- package/{scripts/sync.ts → dist/scripts/sync.js} +52 -90
- package/dist/scripts/utils.js +14793 -0
- package/dist/scripts/work-on.js +142 -0
- package/package.json +8 -11
- package/scripts/init.ts +0 -375
- package/scripts/utils.ts +0 -236
- package/scripts/work-on.ts +0 -161
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type Command = typeof COMMANDS[number];
|
|
12
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
__require,
|
|
4
|
+
__toESM
|
|
5
|
+
} from "../cli-pyanjjwn.js";
|
|
6
|
+
|
|
7
|
+
// bin/cli.ts
|
|
8
|
+
import { resolve } from "node:path";
|
|
9
|
+
var VERSION = "1.0.11";
|
|
10
|
+
var COMMANDS = ["init", "sync", "work-on", "done", "help", "version"];
|
|
13
11
|
function printHelp() {
|
|
14
12
|
console.log(`
|
|
15
13
|
team-toon-tack (ttt) - Linear task sync & management CLI
|
|
@@ -46,72 +44,57 @@ ENVIRONMENT:
|
|
|
46
44
|
More info: https://github.com/wayne930242/team-toon-tack
|
|
47
45
|
`);
|
|
48
46
|
}
|
|
49
|
-
|
|
50
47
|
function printVersion() {
|
|
51
48
|
console.log(`team-toon-tack v${VERSION}`);
|
|
52
49
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
for (let i = 0; i < args.length; i++) {
|
|
50
|
+
function parseGlobalArgs(args) {
|
|
51
|
+
let dir = process.env.TOON_DIR || resolve(process.cwd(), ".ttt");
|
|
52
|
+
const commandArgs = [];
|
|
53
|
+
for (let i = 0;i < args.length; i++) {
|
|
59
54
|
const arg = args[i];
|
|
60
|
-
if (arg ===
|
|
61
|
-
dir = resolve(args[++i] ||
|
|
55
|
+
if (arg === "-d" || arg === "--dir") {
|
|
56
|
+
dir = resolve(args[++i] || ".");
|
|
62
57
|
} else {
|
|
63
58
|
commandArgs.push(arg);
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
|
-
|
|
67
61
|
return { dir, commandArgs };
|
|
68
62
|
}
|
|
69
|
-
|
|
70
63
|
async function main() {
|
|
71
64
|
const args = process.argv.slice(2);
|
|
72
|
-
|
|
73
|
-
if (args.length === 0 || args[0] === 'help' || args[0] === '-h' || args[0] === '--help') {
|
|
65
|
+
if (args.length === 0 || args[0] === "help" || args[0] === "-h" || args[0] === "--help") {
|
|
74
66
|
printHelp();
|
|
75
67
|
process.exit(0);
|
|
76
68
|
}
|
|
77
|
-
|
|
78
|
-
if (args[0] === 'version' || args[0] === '-v' || args[0] === '--version') {
|
|
69
|
+
if (args[0] === "version" || args[0] === "-v" || args[0] === "--version") {
|
|
79
70
|
printVersion();
|
|
80
71
|
process.exit(0);
|
|
81
72
|
}
|
|
82
|
-
|
|
83
|
-
const command = args[0] as Command;
|
|
73
|
+
const command = args[0];
|
|
84
74
|
const restArgs = args.slice(1);
|
|
85
75
|
const { dir, commandArgs } = parseGlobalArgs(restArgs);
|
|
86
|
-
|
|
87
|
-
// Set TOON_DIR for scripts to use
|
|
88
76
|
process.env.TOON_DIR = dir;
|
|
89
|
-
|
|
90
77
|
if (!COMMANDS.includes(command)) {
|
|
91
78
|
console.error(`Unknown command: ${command}`);
|
|
92
79
|
console.error(`Run 'ttt help' for usage.`);
|
|
93
80
|
process.exit(1);
|
|
94
81
|
}
|
|
95
|
-
|
|
96
|
-
// Import and run the appropriate script
|
|
97
|
-
const scriptDir = new URL('../scripts/', import.meta.url).pathname;
|
|
98
|
-
|
|
99
82
|
try {
|
|
100
83
|
switch (command) {
|
|
101
|
-
case
|
|
102
|
-
process.argv = [
|
|
103
|
-
await import(
|
|
84
|
+
case "init":
|
|
85
|
+
process.argv = ["node", "init.js", ...commandArgs];
|
|
86
|
+
await import("../scripts/init.js");
|
|
104
87
|
break;
|
|
105
|
-
case
|
|
106
|
-
await import(
|
|
88
|
+
case "sync":
|
|
89
|
+
await import("../scripts/sync.js");
|
|
107
90
|
break;
|
|
108
|
-
case
|
|
109
|
-
process.argv = [
|
|
110
|
-
await import(
|
|
91
|
+
case "work-on":
|
|
92
|
+
process.argv = ["node", "work-on.js", ...commandArgs];
|
|
93
|
+
await import("../scripts/work-on.js");
|
|
111
94
|
break;
|
|
112
|
-
case
|
|
113
|
-
process.argv = [
|
|
114
|
-
await import(
|
|
95
|
+
case "done":
|
|
96
|
+
process.argv = ["node", "done-job.js", ...commandArgs];
|
|
97
|
+
await import("../scripts/done-job.js");
|
|
115
98
|
break;
|
|
116
99
|
}
|
|
117
100
|
} catch (error) {
|
|
@@ -121,5 +104,4 @@ async function main() {
|
|
|
121
104
|
process.exit(1);
|
|
122
105
|
}
|
|
123
106
|
}
|
|
124
|
-
|
|
125
107
|
main();
|