oh-my-customcode 0.18.3 → 0.18.4
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/dist/cli/index.js +75 -1
- package/dist/index.js +75 -1
- package/package.json +2 -2
- package/templates/deprecated-files.json +10 -0
package/dist/cli/index.js
CHANGED
|
@@ -15194,7 +15194,9 @@ function createUpdateResult() {
|
|
|
15194
15194
|
backedUpPaths: [],
|
|
15195
15195
|
previousVersion: "",
|
|
15196
15196
|
newVersion: "",
|
|
15197
|
-
warnings: []
|
|
15197
|
+
warnings: [],
|
|
15198
|
+
syncedRootFiles: [],
|
|
15199
|
+
removedDeprecatedFiles: []
|
|
15198
15200
|
};
|
|
15199
15201
|
}
|
|
15200
15202
|
async function handleBackupIfRequested(targetDir, backup, result) {
|
|
@@ -15359,6 +15361,14 @@ async function update(options) {
|
|
|
15359
15361
|
const customizations = resolveCustomizations(manifestCustomizations, configPreserveFiles, options.targetDir);
|
|
15360
15362
|
const components = options.components || getAllUpdateComponents();
|
|
15361
15363
|
await updateAllComponents(options.targetDir, components, updateCheck, customizations, options, result, config);
|
|
15364
|
+
if (!options.components || options.components.length === 0) {
|
|
15365
|
+
const synced = await syncRootLevelFiles(options.targetDir, options);
|
|
15366
|
+
result.syncedRootFiles = synced;
|
|
15367
|
+
}
|
|
15368
|
+
if (!options.components || options.components.length === 0) {
|
|
15369
|
+
const removed = await removeDeprecatedFiles(options.targetDir, options);
|
|
15370
|
+
result.removedDeprecatedFiles = removed;
|
|
15371
|
+
}
|
|
15362
15372
|
if (!options.components || options.components.length === 0) {
|
|
15363
15373
|
await updateEntryDoc(options.targetDir, config, options);
|
|
15364
15374
|
}
|
|
@@ -15453,6 +15463,70 @@ async function updateComponent(targetDir, component, customizations, options, co
|
|
|
15453
15463
|
});
|
|
15454
15464
|
return preservedFiles;
|
|
15455
15465
|
}
|
|
15466
|
+
var ROOT_LEVEL_FILES = ["statusline.sh", "install-hooks.sh", "uninstall-hooks.sh"];
|
|
15467
|
+
async function syncRootLevelFiles(targetDir, options) {
|
|
15468
|
+
if (options.dryRun) {
|
|
15469
|
+
return ROOT_LEVEL_FILES;
|
|
15470
|
+
}
|
|
15471
|
+
const fs3 = await import("node:fs/promises");
|
|
15472
|
+
const layout = getProviderLayout();
|
|
15473
|
+
const synced = [];
|
|
15474
|
+
for (const fileName of ROOT_LEVEL_FILES) {
|
|
15475
|
+
const srcPath = resolveTemplatePath(join8(layout.rootDir, fileName));
|
|
15476
|
+
if (!await fileExists(srcPath)) {
|
|
15477
|
+
continue;
|
|
15478
|
+
}
|
|
15479
|
+
const destPath = join8(targetDir, layout.rootDir, fileName);
|
|
15480
|
+
await ensureDirectory(join8(destPath, ".."));
|
|
15481
|
+
await fs3.copyFile(srcPath, destPath);
|
|
15482
|
+
if (fileName.endsWith(".sh")) {
|
|
15483
|
+
await fs3.chmod(destPath, 493);
|
|
15484
|
+
}
|
|
15485
|
+
synced.push(fileName);
|
|
15486
|
+
}
|
|
15487
|
+
if (synced.length > 0) {
|
|
15488
|
+
debug("update.root_files_synced", { files: synced.join(", ") });
|
|
15489
|
+
}
|
|
15490
|
+
return synced;
|
|
15491
|
+
}
|
|
15492
|
+
async function removeDeprecatedFiles(targetDir, options) {
|
|
15493
|
+
const manifestPath = resolveTemplatePath("deprecated-files.json");
|
|
15494
|
+
if (!await fileExists(manifestPath)) {
|
|
15495
|
+
return [];
|
|
15496
|
+
}
|
|
15497
|
+
const manifest = await readJsonFile(manifestPath);
|
|
15498
|
+
if (!manifest.files || manifest.files.length === 0) {
|
|
15499
|
+
return [];
|
|
15500
|
+
}
|
|
15501
|
+
if (options.dryRun) {
|
|
15502
|
+
return manifest.files.map((f) => f.path);
|
|
15503
|
+
}
|
|
15504
|
+
const fs3 = await import("node:fs/promises");
|
|
15505
|
+
const removed = [];
|
|
15506
|
+
for (const entry of manifest.files) {
|
|
15507
|
+
const validation = validatePreserveFilePath(entry.path, targetDir);
|
|
15508
|
+
if (!validation.valid) {
|
|
15509
|
+
warn("update.deprecated_file_invalid_path", {
|
|
15510
|
+
path: entry.path,
|
|
15511
|
+
reason: validation.reason ?? "Invalid path"
|
|
15512
|
+
});
|
|
15513
|
+
continue;
|
|
15514
|
+
}
|
|
15515
|
+
const fullPath = join8(targetDir, entry.path);
|
|
15516
|
+
if (await fileExists(fullPath)) {
|
|
15517
|
+
await fs3.unlink(fullPath);
|
|
15518
|
+
removed.push(entry.path);
|
|
15519
|
+
info("update.deprecated_file_removed", {
|
|
15520
|
+
path: entry.path,
|
|
15521
|
+
reason: entry.reason
|
|
15522
|
+
});
|
|
15523
|
+
}
|
|
15524
|
+
}
|
|
15525
|
+
if (removed.length > 0) {
|
|
15526
|
+
debug("update.deprecated_files_cleaned", { count: String(removed.length) });
|
|
15527
|
+
}
|
|
15528
|
+
return removed;
|
|
15529
|
+
}
|
|
15456
15530
|
function getComponentPath2(component) {
|
|
15457
15531
|
const layout = getProviderLayout();
|
|
15458
15532
|
if (component === "guides") {
|
package/dist/index.js
CHANGED
|
@@ -1210,7 +1210,9 @@ function createUpdateResult() {
|
|
|
1210
1210
|
backedUpPaths: [],
|
|
1211
1211
|
previousVersion: "",
|
|
1212
1212
|
newVersion: "",
|
|
1213
|
-
warnings: []
|
|
1213
|
+
warnings: [],
|
|
1214
|
+
syncedRootFiles: [],
|
|
1215
|
+
removedDeprecatedFiles: []
|
|
1214
1216
|
};
|
|
1215
1217
|
}
|
|
1216
1218
|
async function handleBackupIfRequested(targetDir, backup, result) {
|
|
@@ -1375,6 +1377,14 @@ async function update(options) {
|
|
|
1375
1377
|
const customizations = resolveCustomizations(manifestCustomizations, configPreserveFiles, options.targetDir);
|
|
1376
1378
|
const components = options.components || getAllUpdateComponents();
|
|
1377
1379
|
await updateAllComponents(options.targetDir, components, updateCheck, customizations, options, result, config);
|
|
1380
|
+
if (!options.components || options.components.length === 0) {
|
|
1381
|
+
const synced = await syncRootLevelFiles(options.targetDir, options);
|
|
1382
|
+
result.syncedRootFiles = synced;
|
|
1383
|
+
}
|
|
1384
|
+
if (!options.components || options.components.length === 0) {
|
|
1385
|
+
const removed = await removeDeprecatedFiles(options.targetDir, options);
|
|
1386
|
+
result.removedDeprecatedFiles = removed;
|
|
1387
|
+
}
|
|
1378
1388
|
if (!options.components || options.components.length === 0) {
|
|
1379
1389
|
await updateEntryDoc(options.targetDir, config, options);
|
|
1380
1390
|
}
|
|
@@ -1490,6 +1500,70 @@ async function updateComponent(targetDir, component, customizations, options, co
|
|
|
1490
1500
|
});
|
|
1491
1501
|
return preservedFiles;
|
|
1492
1502
|
}
|
|
1503
|
+
var ROOT_LEVEL_FILES = ["statusline.sh", "install-hooks.sh", "uninstall-hooks.sh"];
|
|
1504
|
+
async function syncRootLevelFiles(targetDir, options) {
|
|
1505
|
+
if (options.dryRun) {
|
|
1506
|
+
return ROOT_LEVEL_FILES;
|
|
1507
|
+
}
|
|
1508
|
+
const fs = await import("node:fs/promises");
|
|
1509
|
+
const layout = getProviderLayout();
|
|
1510
|
+
const synced = [];
|
|
1511
|
+
for (const fileName of ROOT_LEVEL_FILES) {
|
|
1512
|
+
const srcPath = resolveTemplatePath(join4(layout.rootDir, fileName));
|
|
1513
|
+
if (!await fileExists(srcPath)) {
|
|
1514
|
+
continue;
|
|
1515
|
+
}
|
|
1516
|
+
const destPath = join4(targetDir, layout.rootDir, fileName);
|
|
1517
|
+
await ensureDirectory(join4(destPath, ".."));
|
|
1518
|
+
await fs.copyFile(srcPath, destPath);
|
|
1519
|
+
if (fileName.endsWith(".sh")) {
|
|
1520
|
+
await fs.chmod(destPath, 493);
|
|
1521
|
+
}
|
|
1522
|
+
synced.push(fileName);
|
|
1523
|
+
}
|
|
1524
|
+
if (synced.length > 0) {
|
|
1525
|
+
debug("update.root_files_synced", { files: synced.join(", ") });
|
|
1526
|
+
}
|
|
1527
|
+
return synced;
|
|
1528
|
+
}
|
|
1529
|
+
async function removeDeprecatedFiles(targetDir, options) {
|
|
1530
|
+
const manifestPath = resolveTemplatePath("deprecated-files.json");
|
|
1531
|
+
if (!await fileExists(manifestPath)) {
|
|
1532
|
+
return [];
|
|
1533
|
+
}
|
|
1534
|
+
const manifest = await readJsonFile(manifestPath);
|
|
1535
|
+
if (!manifest.files || manifest.files.length === 0) {
|
|
1536
|
+
return [];
|
|
1537
|
+
}
|
|
1538
|
+
if (options.dryRun) {
|
|
1539
|
+
return manifest.files.map((f) => f.path);
|
|
1540
|
+
}
|
|
1541
|
+
const fs = await import("node:fs/promises");
|
|
1542
|
+
const removed = [];
|
|
1543
|
+
for (const entry of manifest.files) {
|
|
1544
|
+
const validation = validatePreserveFilePath(entry.path, targetDir);
|
|
1545
|
+
if (!validation.valid) {
|
|
1546
|
+
warn("update.deprecated_file_invalid_path", {
|
|
1547
|
+
path: entry.path,
|
|
1548
|
+
reason: validation.reason ?? "Invalid path"
|
|
1549
|
+
});
|
|
1550
|
+
continue;
|
|
1551
|
+
}
|
|
1552
|
+
const fullPath = join4(targetDir, entry.path);
|
|
1553
|
+
if (await fileExists(fullPath)) {
|
|
1554
|
+
await fs.unlink(fullPath);
|
|
1555
|
+
removed.push(entry.path);
|
|
1556
|
+
info("update.deprecated_file_removed", {
|
|
1557
|
+
path: entry.path,
|
|
1558
|
+
reason: entry.reason
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
if (removed.length > 0) {
|
|
1563
|
+
debug("update.deprecated_files_cleaned", { count: String(removed.length) });
|
|
1564
|
+
}
|
|
1565
|
+
return removed;
|
|
1566
|
+
}
|
|
1493
1567
|
function getComponentPath2(component) {
|
|
1494
1568
|
const layout = getProviderLayout();
|
|
1495
1569
|
if (component === "guides") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-customcode",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"description": "Batteries-included agent harness for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"js-yaml": "^4.1.0",
|
|
55
55
|
"nodemailer": "^8.0.1",
|
|
56
56
|
"typescript": "^5.7.3",
|
|
57
|
-
"vitepress": "^1.6.
|
|
57
|
+
"vitepress": "^1.6.4"
|
|
58
58
|
},
|
|
59
59
|
"keywords": [
|
|
60
60
|
"claude",
|