@danalexilewis/taskgraph 0.2.2 → 0.2.3
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 +2 -12
- package/dist/cli/setup.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,29 +19,19 @@ TaskGraph is a small CLI (`tg`) + Dolt-backed schema for managing **plans, tasks
|
|
|
19
19
|
pnpm add -D @danalexilewis/taskgraph
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
3. **
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
"scripts": {
|
|
26
|
-
"tg": "tg"
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Then use `pnpm tg` (or `npm run tg`) for all commands; the script runs the binary from `node_modules/.bin`.
|
|
22
|
+
3. **Run the CLI** with `pnpm tg` (pnpm runs the binary from `node_modules/.bin`; no script in `package.json` needed). Or use `npx tg` with npm.
|
|
31
23
|
4. **Initialize** from your repo root (creates `.taskgraph/` and Dolt DB):
|
|
32
24
|
|
|
33
25
|
```bash
|
|
34
26
|
pnpm tg init
|
|
35
27
|
```
|
|
36
28
|
|
|
37
|
-
5. **Scaffold** (optional; domain docs, skill guides, Cursor rules):
|
|
29
|
+
5. **Scaffold** (optional; domain docs, skill guides, Cursor rules). If `docs/` or `.cursor/` (including `.cursor/rules/`) already exist, setup adds template files alongside your existing ones and skips files that already exist:
|
|
38
30
|
|
|
39
31
|
```bash
|
|
40
32
|
pnpm tg setup
|
|
41
33
|
```
|
|
42
34
|
|
|
43
|
-
Without the script, the shell can't find `tg`; `npx tg init` also works if you prefer not to add the script.
|
|
44
|
-
|
|
45
35
|
## Conventions (domain + skill guides)
|
|
46
36
|
|
|
47
37
|
Tasks can optionally declare:
|
package/dist/cli/setup.js
CHANGED
|
@@ -39,6 +39,10 @@ const path = __importStar(require("path"));
|
|
|
39
39
|
const neverthrow_1 = require("neverthrow");
|
|
40
40
|
const errors_1 = require("../domain/errors");
|
|
41
41
|
function copyTree(srcDir, destDir, repoRoot, options, result) {
|
|
42
|
+
if (!fs.existsSync(srcDir))
|
|
43
|
+
return;
|
|
44
|
+
// Ensure destination exists so we merge contents side-by-side with existing files
|
|
45
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
42
46
|
const entries = fs.readdirSync(srcDir, { withFileTypes: true });
|
|
43
47
|
for (const entry of entries) {
|
|
44
48
|
const srcPath = path.join(srcDir, entry.name);
|
|
@@ -86,10 +90,12 @@ function setupCommand(program) {
|
|
|
86
90
|
}
|
|
87
91
|
if (options.docs) {
|
|
88
92
|
const docsSrc = path.join(templateRoot, "docs");
|
|
93
|
+
// Merges into existing docs/ and docs/skills/; adds template files that don't exist
|
|
89
94
|
copyTree(docsSrc, path.join(repoRoot, "docs"), repoRoot, options, result);
|
|
90
95
|
}
|
|
91
96
|
if (options.cursor) {
|
|
92
97
|
const cursorSrc = path.join(templateRoot, ".cursor");
|
|
98
|
+
// Merges into existing .cursor/ and .cursor/rules/; adds template files that don't exist
|
|
93
99
|
copyTree(cursorSrc, path.join(repoRoot, ".cursor"), repoRoot, options, result);
|
|
94
100
|
const agentMdSrc = path.join(templateRoot, "AGENT.md");
|
|
95
101
|
const agentMdDest = path.join(repoRoot, "AGENT.md");
|