claudekit-cli 3.35.0-dev.17 → 3.35.0-dev.18
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/index.js +54 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -53065,7 +53065,7 @@ var package_default;
|
|
|
53065
53065
|
var init_package = __esm(() => {
|
|
53066
53066
|
package_default = {
|
|
53067
53067
|
name: "claudekit-cli",
|
|
53068
|
-
version: "3.35.0-dev.
|
|
53068
|
+
version: "3.35.0-dev.18",
|
|
53069
53069
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
53070
53070
|
type: "module",
|
|
53071
53071
|
repository: {
|
|
@@ -87239,16 +87239,7 @@ async function handlePostInstall(ctx) {
|
|
|
87239
87239
|
return ctx;
|
|
87240
87240
|
}
|
|
87241
87241
|
if (ctx.options.global) {
|
|
87242
|
-
|
|
87243
|
-
const claudeMdDest = join99(ctx.resolvedDir, "CLAUDE.md");
|
|
87244
|
-
if (await import_fs_extra30.pathExists(claudeMdSource)) {
|
|
87245
|
-
if (!await import_fs_extra30.pathExists(claudeMdDest)) {
|
|
87246
|
-
await import_fs_extra30.copy(claudeMdSource, claudeMdDest);
|
|
87247
|
-
logger.success("Copied CLAUDE.md to global directory");
|
|
87248
|
-
} else {
|
|
87249
|
-
logger.debug("CLAUDE.md already exists in global directory (preserved)");
|
|
87250
|
-
}
|
|
87251
|
-
}
|
|
87242
|
+
await handleGlobalClaudeMd(ctx);
|
|
87252
87243
|
}
|
|
87253
87244
|
let installSkills = ctx.options.installSkills;
|
|
87254
87245
|
if (!ctx.isNonInteractive && !installSkills) {
|
|
@@ -87308,6 +87299,49 @@ async function handlePostInstall(ctx) {
|
|
|
87308
87299
|
installSkills
|
|
87309
87300
|
};
|
|
87310
87301
|
}
|
|
87302
|
+
function normalizeLineEndings(content) {
|
|
87303
|
+
return content.replace(/\r\n/g, `
|
|
87304
|
+
`);
|
|
87305
|
+
}
|
|
87306
|
+
async function handleGlobalClaudeMd(ctx) {
|
|
87307
|
+
if (!ctx.extractDir || !ctx.resolvedDir)
|
|
87308
|
+
return;
|
|
87309
|
+
const claudeMdSource = join99(ctx.extractDir, "CLAUDE.md");
|
|
87310
|
+
const claudeMdDest = join99(ctx.resolvedDir, "CLAUDE.md");
|
|
87311
|
+
if (!await import_fs_extra30.pathExists(claudeMdSource))
|
|
87312
|
+
return;
|
|
87313
|
+
const destExists = await import_fs_extra30.pathExists(claudeMdDest);
|
|
87314
|
+
if (!destExists) {
|
|
87315
|
+
await import_fs_extra30.copy(claudeMdSource, claudeMdDest);
|
|
87316
|
+
logger.success("Copied CLAUDE.md to global directory");
|
|
87317
|
+
return;
|
|
87318
|
+
}
|
|
87319
|
+
if (ctx.options.fresh || ctx.options.forceOverwrite) {
|
|
87320
|
+
await import_fs_extra30.copy(claudeMdSource, claudeMdDest);
|
|
87321
|
+
logger.success("Updated CLAUDE.md in global directory");
|
|
87322
|
+
return;
|
|
87323
|
+
}
|
|
87324
|
+
const [srcContent, destContent] = await Promise.all([
|
|
87325
|
+
import_fs_extra30.readFile(claudeMdSource, "utf-8"),
|
|
87326
|
+
import_fs_extra30.readFile(claudeMdDest, "utf-8")
|
|
87327
|
+
]);
|
|
87328
|
+
if (normalizeLineEndings(srcContent) === normalizeLineEndings(destContent)) {
|
|
87329
|
+
logger.debug("CLAUDE.md already up to date");
|
|
87330
|
+
return;
|
|
87331
|
+
}
|
|
87332
|
+
if (!ctx.isNonInteractive) {
|
|
87333
|
+
const shouldOverwrite = await ctx.prompts.confirm(`CLAUDE.md has changed in the new version. Update it?
|
|
87334
|
+
(Your customizations will be replaced)`);
|
|
87335
|
+
if (!shouldOverwrite) {
|
|
87336
|
+
logger.info("CLAUDE.md preserved (user chose to keep existing)");
|
|
87337
|
+
return;
|
|
87338
|
+
}
|
|
87339
|
+
} else {
|
|
87340
|
+
logger.warning("Updating CLAUDE.md (content differs from new version)");
|
|
87341
|
+
}
|
|
87342
|
+
await import_fs_extra30.copy(claudeMdSource, claudeMdDest);
|
|
87343
|
+
logger.success("Updated CLAUDE.md (new version detected)");
|
|
87344
|
+
}
|
|
87311
87345
|
// src/commands/init/phases/selection-handler.ts
|
|
87312
87346
|
init_config_manager();
|
|
87313
87347
|
init_github_client();
|
|
@@ -87969,7 +88003,7 @@ async function handleSelection(ctx) {
|
|
|
87969
88003
|
};
|
|
87970
88004
|
}
|
|
87971
88005
|
// src/commands/init/phases/sync-handler.ts
|
|
87972
|
-
import { copyFile as copyFile7, mkdir as mkdir29, open as open4, readFile as
|
|
88006
|
+
import { copyFile as copyFile7, mkdir as mkdir29, open as open4, readFile as readFile48, rename as rename5, stat as stat17, unlink as unlink10, writeFile as writeFile28 } from "node:fs/promises";
|
|
87973
88007
|
import { dirname as dirname21, join as join102, resolve as resolve20 } from "node:path";
|
|
87974
88008
|
init_logger();
|
|
87975
88009
|
init_path_resolver();
|
|
@@ -88137,7 +88171,7 @@ async function executeSyncMerge(ctx) {
|
|
|
88137
88171
|
try {
|
|
88138
88172
|
const sourceMetadataPath = join102(upstreamDir, "metadata.json");
|
|
88139
88173
|
if (await import_fs_extra33.pathExists(sourceMetadataPath)) {
|
|
88140
|
-
const content = await
|
|
88174
|
+
const content = await readFile48(sourceMetadataPath, "utf-8");
|
|
88141
88175
|
const sourceMetadata = JSON.parse(content);
|
|
88142
88176
|
deletions = sourceMetadata.deletions || [];
|
|
88143
88177
|
}
|
|
@@ -88435,7 +88469,7 @@ async function renameFolders(dirsToRename, extractDir, options2) {
|
|
|
88435
88469
|
// src/services/transformers/folder-transform/path-replacer.ts
|
|
88436
88470
|
init_logger();
|
|
88437
88471
|
init_types3();
|
|
88438
|
-
import { readFile as
|
|
88472
|
+
import { readFile as readFile49, readdir as readdir32, writeFile as writeFile29 } from "node:fs/promises";
|
|
88439
88473
|
import { join as join104, relative as relative18 } from "node:path";
|
|
88440
88474
|
var TRANSFORMABLE_FILE_PATTERNS = [
|
|
88441
88475
|
".md",
|
|
@@ -88502,7 +88536,7 @@ async function transformFileContents(dir, compiledReplacements, options2) {
|
|
|
88502
88536
|
if (!shouldTransform)
|
|
88503
88537
|
continue;
|
|
88504
88538
|
try {
|
|
88505
|
-
const content = await
|
|
88539
|
+
const content = await readFile49(fullPath, "utf-8");
|
|
88506
88540
|
let newContent = content;
|
|
88507
88541
|
let changeCount = 0;
|
|
88508
88542
|
for (const { regex: regex2, replacement } of compiledReplacements) {
|
|
@@ -88624,7 +88658,7 @@ async function transformFolderPaths(extractDir, folders, options2 = {}) {
|
|
|
88624
88658
|
|
|
88625
88659
|
// src/services/transformers/global-path-transformer.ts
|
|
88626
88660
|
init_logger();
|
|
88627
|
-
import { readFile as
|
|
88661
|
+
import { readFile as readFile50, readdir as readdir33, writeFile as writeFile30 } from "node:fs/promises";
|
|
88628
88662
|
import { platform as platform13 } from "node:os";
|
|
88629
88663
|
import { extname as extname5, join as join105 } from "node:path";
|
|
88630
88664
|
var IS_WINDOWS3 = platform13() === "win32";
|
|
@@ -88744,7 +88778,7 @@ async function transformPathsForGlobalInstall(directory, options2 = {}) {
|
|
|
88744
88778
|
await processDirectory2(fullPath);
|
|
88745
88779
|
} else if (entry.isFile() && shouldTransformFile3(entry.name)) {
|
|
88746
88780
|
try {
|
|
88747
|
-
const content = await
|
|
88781
|
+
const content = await readFile50(fullPath, "utf-8");
|
|
88748
88782
|
const { transformed, changes } = transformContent(content);
|
|
88749
88783
|
if (changes > 0) {
|
|
88750
88784
|
await writeFile30(fullPath, transformed, "utf-8");
|
|
@@ -89006,7 +89040,7 @@ init_checksum_utils();
|
|
|
89006
89040
|
init_config_discovery();
|
|
89007
89041
|
var import_picocolors25 = __toESM(require_picocolors(), 1);
|
|
89008
89042
|
import { existsSync as existsSync50 } from "node:fs";
|
|
89009
|
-
import { readFile as
|
|
89043
|
+
import { readFile as readFile51, rm as rm12, unlink as unlink11 } from "node:fs/promises";
|
|
89010
89044
|
import { resolve as resolve21 } from "node:path";
|
|
89011
89045
|
|
|
89012
89046
|
// src/commands/portable/conflict-resolver.ts
|
|
@@ -89580,7 +89614,7 @@ async function migrateCommand(options2) {
|
|
|
89580
89614
|
for (const action of conflictActions) {
|
|
89581
89615
|
if (!action.diff && action.targetPath && existsSync50(action.targetPath)) {
|
|
89582
89616
|
try {
|
|
89583
|
-
const targetContent = await
|
|
89617
|
+
const targetContent = await readFile51(action.targetPath, "utf-8");
|
|
89584
89618
|
const sourceItem = agents2.find((a3) => a3.name === action.item) || commands.find((c2) => c2.name === action.item) || (configItem?.name === action.item ? configItem : null) || ruleItems.find((r2) => r2.name === action.item);
|
|
89585
89619
|
if (sourceItem) {
|
|
89586
89620
|
const providerConfig = providers[action.provider];
|
|
@@ -89774,7 +89808,7 @@ async function computeTargetStates(selectedProviders, global3) {
|
|
|
89774
89808
|
continue;
|
|
89775
89809
|
try {
|
|
89776
89810
|
if (existsSync50(entry.path)) {
|
|
89777
|
-
const content = await
|
|
89811
|
+
const content = await readFile51(entry.path, "utf-8");
|
|
89778
89812
|
states.set(entry.path, {
|
|
89779
89813
|
path: entry.path,
|
|
89780
89814
|
exists: true,
|