@taprootio/trellis 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 +21 -0
- package/README.md +77 -0
- package/SPEC.md +405 -0
- package/docs/import.md +273 -0
- package/package.json +59 -0
- package/profiles/taproot-ai-backlog.json +28 -0
- package/profiles/yaml-frontmatter.json +23 -0
- package/scripts/backlog-readme.mjs +84 -0
- package/scripts/pr-title-lint.mjs +69 -0
- package/scripts/trellis-history.mjs +127 -0
- package/scripts/trellis-import.mjs +141 -0
- package/scripts/trellis-init.mjs +287 -0
- package/scripts/trellis-mcp.mjs +222 -0
- package/scripts/trellis.mjs +62 -0
- package/src/backlog.mjs +667 -0
- package/src/cli.mjs +33 -0
- package/src/history.mjs +204 -0
- package/src/import.mjs +583 -0
- package/src/init.mjs +644 -0
- package/src/mcp.mjs +449 -0
- package/src/pr-title.mjs +47 -0
- package/src/profiles.mjs +68 -0
- package/src/prompts.mjs +189 -0
- package/templates/.github/pull_request_template.md +31 -0
- package/templates/trellis/branch-protection.md +116 -0
- package/templates/trellis/playbooks/code-review.md +64 -0
- package/templates/trellis/playbooks/conventions.md +56 -0
- package/templates/trellis/playbooks/pr-draft.md +39 -0
- package/templates/trellis/playbooks/work-task.md +76 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Packaged Trellis CLI dispatcher.
|
|
3
|
+
//
|
|
4
|
+
// The subcommand wrappers keep their existing thin shape, while this file is the
|
|
5
|
+
// npm bin exposed by the `@taprootio/trellis` package. Run from an installed package, paths
|
|
6
|
+
// below are package-relative; target repos are still resolved by each subcommand
|
|
7
|
+
// from cwd / --target / --repo.
|
|
8
|
+
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
+
|
|
12
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const HELP = `trellis — file-based backlog toolkit
|
|
14
|
+
|
|
15
|
+
Usage:
|
|
16
|
+
trellis <command> [args]
|
|
17
|
+
|
|
18
|
+
Commands:
|
|
19
|
+
init scaffold Trellis into a repo
|
|
20
|
+
import import an existing backlog into a Trellis repo
|
|
21
|
+
generate validate and rewrite generated backlog artifacts
|
|
22
|
+
check validate and fail if generated artifacts are stale
|
|
23
|
+
history derive per-task history from git
|
|
24
|
+
mcp serve Trellis operations over MCP stdio
|
|
25
|
+
pr-title lint a PR title from PR_TITLE
|
|
26
|
+
|
|
27
|
+
Run "trellis <command> --help" for command-specific options.
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const COMMANDS = {
|
|
31
|
+
init: ["trellis-init.mjs"],
|
|
32
|
+
import: ["trellis-import.mjs"],
|
|
33
|
+
generate: ["backlog-readme.mjs"],
|
|
34
|
+
check: ["backlog-readme.mjs", "--check"],
|
|
35
|
+
history: ["trellis-history.mjs"],
|
|
36
|
+
mcp: ["trellis-mcp.mjs"],
|
|
37
|
+
"pr-title": ["pr-title-lint.mjs"],
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const [cmd, ...args] = process.argv.slice(2);
|
|
41
|
+
if (!cmd || cmd === "-h" || cmd === "--help" || cmd === "help") {
|
|
42
|
+
process.stdout.write(HELP);
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const spec = COMMANDS[cmd];
|
|
47
|
+
if (!spec) {
|
|
48
|
+
console.error(`Unknown command: ${cmd}\n`);
|
|
49
|
+
process.stdout.write(HELP);
|
|
50
|
+
process.exit(2);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const [script, ...prefixArgs] = spec;
|
|
54
|
+
const scriptPath = join(here, script);
|
|
55
|
+
process.argv = [process.argv[0], scriptPath, ...prefixArgs, ...args];
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
await import(pathToFileURL(scriptPath).href);
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.error(`error: failed to run ${cmd}: ${e && e.message ? e.message : String(e)}`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|