@fernado03/zoo-flow 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/bin/zoo-flow.js +24 -7
  2. package/package.json +1 -1
package/bin/zoo-flow.js CHANGED
@@ -106,21 +106,31 @@ function migrateRootContextDocs(projectRoot) {
106
106
  const rootContext = path.join(projectRoot, "CONTEXT.md");
107
107
  const targetContext = path.join(targetFlowDir, "CONTEXT.md");
108
108
  if (pathExists(rootContext) && !pathExists(targetContext)) {
109
- fs.copyFileSync(rootContext, targetContext);
109
+ fs.renameSync(rootContext, targetContext);
110
110
  moved.push("CONTEXT.md");
111
111
  }
112
112
 
113
113
  const rootAdr = path.join(projectRoot, "docs", "adr");
114
114
  const targetAdr = path.join(targetFlowDir, "docs", "adr");
115
- if (pathExists(rootAdr)) {
115
+ if (pathExists(rootAdr) && !pathExists(targetAdr)) {
116
116
  fs.mkdirSync(targetAdr, { recursive: true });
117
117
  copyRecursive(rootAdr, targetAdr);
118
+ removeRecursive(rootAdr);
118
119
  moved.push("docs/adr/");
119
120
  }
120
121
 
121
122
  return moved;
122
123
  }
123
124
 
125
+ function copyZooFlowIfMissing(projectRoot) {
126
+ const target = path.join(projectRoot, ".zoo-flow");
127
+ if (pathExists(target)) return false;
128
+ const source = path.join(templateRoot, ".zoo-flow");
129
+ if (!pathExists(source)) return false;
130
+ copyRecursive(source, target);
131
+ return true;
132
+ }
133
+
124
134
  function makeTimestamp() {
125
135
  return new Date().toISOString().replace(/[:.]/g, "-");
126
136
  }
@@ -307,16 +317,23 @@ Run again with --force to back up and overwrite:
307
317
  copyRecursive(sourceRoo, targetRoo);
308
318
 
309
319
  const didAddGitignore = appendZooFlowToGitignore(projectRoot);
320
+ const didAddZooFlow = copyZooFlowIfMissing(projectRoot);
321
+
322
+ const copiedLines = [" - .roomodes", " - .roo/"];
323
+ if (didAddZooFlow) {
324
+ copiedLines.push(" - .zoo-flow/CONTEXT.md");
325
+ copiedLines.push(" - .zoo-flow/docs/adr/0001-record-architecture-decisions.md");
326
+ }
327
+ if (didAddGitignore) {
328
+ copiedLines.push(" - appended .zoo-flow/ to .gitignore");
329
+ }
310
330
 
311
331
  console.log(`
312
332
  Zoo Flow installed.
313
333
 
314
334
  Copied:
315
- - .roomodes
316
- - .roo/
317
- - .zoo-flow/CONTEXT.md
318
- - .zoo-flow/docs/adr/0001-record-architecture-decisions.md
319
- ${didAddGitignore ? " - appended .zoo-flow/ to .gitignore\n" : ""}
335
+ ${copiedLines.join("\n")}
336
+ ${didBackup ? `\nBackup:\n ${backupDir}\n` : ""}
320
337
  ${didBackup ? `Backup:\n ${backupDir}\n` : ""}Next:
321
338
  1. Reload VS Code
322
339
  2. Open Zoo Code
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fernado03/zoo-flow",
3
3
  "description": "Workflow control plane for Zoo Code.",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "zoo-flow": "bin/zoo-flow.js"