its-magic 0.1.2-27 → 0.1.2-28
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/installer.ps1
CHANGED
|
@@ -111,7 +111,7 @@ function Choose-Mode {
|
|
|
111
111
|
function Classify-File($RelPath) {
|
|
112
112
|
$normalized = $RelPath -replace '\\','/'
|
|
113
113
|
|
|
114
|
-
$mixedFiles = @('.cursor/scratchpad.md')
|
|
114
|
+
$mixedFiles = @('.cursor/scratchpad.md', 'README.md')
|
|
115
115
|
if ($mixedFiles -contains $normalized) { return 'mixed' }
|
|
116
116
|
|
|
117
117
|
$frameworkPrefixes = @(
|
|
@@ -174,6 +174,15 @@ function Write-InstalledVersion($TargetRoot, $Ver) {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
function Sync-RootReadmeToItsMagic($TargetRoot) {
|
|
178
|
+
$rootReadme = Join-Path $TargetRoot "README.md"
|
|
179
|
+
if (-not (Test-Path $rootReadme -PathType Leaf)) { return $false }
|
|
180
|
+
$itsMagicReadme = Join-Path $TargetRoot "its_magic\README.md"
|
|
181
|
+
Ensure-Parent $itsMagicReadme
|
|
182
|
+
Copy-Item -Path $rootReadme -Destination $itsMagicReadme -Force
|
|
183
|
+
return $true
|
|
184
|
+
}
|
|
185
|
+
|
|
177
186
|
function Read-RunbookKeyValue($RunbookPath, $Key) {
|
|
178
187
|
if (-not (Test-Path $RunbookPath -PathType Leaf)) { return "" }
|
|
179
188
|
$needle = "${Key}:"
|
|
@@ -617,6 +626,7 @@ if ($mode -eq "upgrade") {
|
|
|
617
626
|
}
|
|
618
627
|
|
|
619
628
|
Write-InstalledVersion $targetRoot $appVersion
|
|
629
|
+
Sync-RootReadmeToItsMagic $targetRoot | Out-Null
|
|
620
630
|
$runbookBootstrap = Invoke-RunbookBootstrap -TargetRoot $targetRoot
|
|
621
631
|
foreach ($note in $runbookBootstrap.notes) { Write-Host $note }
|
|
622
632
|
if (-not $runbookBootstrap.ok) { exit 1 }
|
|
@@ -694,6 +704,7 @@ foreach ($rel in $files) {
|
|
|
694
704
|
}
|
|
695
705
|
|
|
696
706
|
Write-InstalledVersion $targetRoot $appVersion
|
|
707
|
+
Sync-RootReadmeToItsMagic $targetRoot | Out-Null
|
|
697
708
|
$runbookBootstrap = Invoke-RunbookBootstrap -TargetRoot $targetRoot
|
|
698
709
|
foreach ($note in $runbookBootstrap.notes) { Write-Host $note }
|
|
699
710
|
if (-not $runbookBootstrap.ok) { exit 1 }
|
package/installer.py
CHANGED
|
@@ -119,7 +119,7 @@ USER_DATA_PREFIXES = (
|
|
|
119
119
|
"docs/product/", "docs/engineering/", "docs/user-guides/",
|
|
120
120
|
"sprints/", "handoffs/", "decisions/",
|
|
121
121
|
)
|
|
122
|
-
MIXED_FILES = {".cursor/scratchpad.md"}
|
|
122
|
+
MIXED_FILES = {".cursor/scratchpad.md", "README.md"}
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
def classify_file(rel_path):
|
|
@@ -159,6 +159,16 @@ def write_installed_version(target_root, ver):
|
|
|
159
159
|
os.remove(legacy)
|
|
160
160
|
|
|
161
161
|
|
|
162
|
+
def sync_root_readme_to_its_magic(target_root):
|
|
163
|
+
root_readme = os.path.join(target_root, "README.md")
|
|
164
|
+
if not os.path.isfile(root_readme):
|
|
165
|
+
return False
|
|
166
|
+
its_magic_readme = os.path.join(target_root, "its_magic", "README.md")
|
|
167
|
+
ensure_parent(its_magic_readme)
|
|
168
|
+
shutil.copy2(root_readme, its_magic_readme)
|
|
169
|
+
return True
|
|
170
|
+
|
|
171
|
+
|
|
162
172
|
def read_runbook_key(runbook_path, key):
|
|
163
173
|
if not os.path.isfile(runbook_path):
|
|
164
174
|
return ""
|
|
@@ -550,6 +560,7 @@ def main():
|
|
|
550
560
|
continue
|
|
551
561
|
|
|
552
562
|
write_installed_version(target_root, version)
|
|
563
|
+
sync_root_readme_to_its_magic(target_root)
|
|
553
564
|
runbook_ok, runbook_notes = bootstrap_runbook_commands(target_root)
|
|
554
565
|
for note in runbook_notes:
|
|
555
566
|
print(note)
|
|
@@ -620,6 +631,7 @@ def main():
|
|
|
620
631
|
shutil.copy2(src, dst)
|
|
621
632
|
|
|
622
633
|
write_installed_version(target_root, version)
|
|
634
|
+
sync_root_readme_to_its_magic(target_root)
|
|
623
635
|
runbook_ok, runbook_notes = bootstrap_runbook_commands(target_root)
|
|
624
636
|
for note in runbook_notes:
|
|
625
637
|
print(note)
|
package/installer.sh
CHANGED
|
@@ -133,7 +133,7 @@ choose_mode() {
|
|
|
133
133
|
classify_file() {
|
|
134
134
|
rel="$1"
|
|
135
135
|
case "$rel" in
|
|
136
|
-
.cursor/scratchpad.md) echo "mixed" ;;
|
|
136
|
+
.cursor/scratchpad.md|README.md) echo "mixed" ;;
|
|
137
137
|
.cursor/commands/*|.cursor/rules/*|.cursor/agents/*|.cursor/skills/*) echo "framework" ;;
|
|
138
138
|
.cursor/hooks/*|.cursor/hooks.json|.cursor/scratchpad.local.example.md) echo "framework" ;;
|
|
139
139
|
.github/workflows/*|scripts/validate-and-push*|docs/engineering/context/*|its_magic/*) echo "framework" ;;
|
|
@@ -166,6 +166,15 @@ write_installed_version() {
|
|
|
166
166
|
[ -f "$legacy" ] && rm -f "$legacy"
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
sync_root_readme_to_its_magic() {
|
|
170
|
+
target_root="$1"
|
|
171
|
+
[ -f "$target_root/README.md" ] || return 1
|
|
172
|
+
dst="$target_root/its_magic/README.md"
|
|
173
|
+
ensure_parent "$dst"
|
|
174
|
+
cp -p "$target_root/README.md" "$dst"
|
|
175
|
+
return 0
|
|
176
|
+
}
|
|
177
|
+
|
|
169
178
|
read_runbook_key() {
|
|
170
179
|
runbook_path="$1"
|
|
171
180
|
key="$2"
|
|
@@ -505,6 +514,7 @@ if [ "$MODE" = "upgrade" ]; then
|
|
|
505
514
|
done
|
|
506
515
|
|
|
507
516
|
write_installed_version "$TARGET_ROOT" "$APP_VERSION"
|
|
517
|
+
sync_root_readme_to_its_magic "$TARGET_ROOT" || true
|
|
508
518
|
bootstrap_runbook_commands "$TARGET_ROOT"
|
|
509
519
|
[ -n "$BOOTSTRAP_NOTES" ] && printf "%s" "$BOOTSTRAP_NOTES"
|
|
510
520
|
[ "$BOOTSTRAP_OK" = "true" ] || exit 1
|
|
@@ -572,6 +582,7 @@ for rel in $FILES; do
|
|
|
572
582
|
done
|
|
573
583
|
|
|
574
584
|
write_installed_version "$TARGET_ROOT" "$APP_VERSION"
|
|
585
|
+
sync_root_readme_to_its_magic "$TARGET_ROOT" || true
|
|
575
586
|
bootstrap_runbook_commands "$TARGET_ROOT"
|
|
576
587
|
[ -n "$BOOTSTRAP_NOTES" ] && printf "%s" "$BOOTSTRAP_NOTES"
|
|
577
588
|
[ "$BOOTSTRAP_OK" = "true" ] || exit 1
|
package/package.json
CHANGED