claudekit-cli 3.41.4-dev.10 → 3.41.4-dev.12
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 +28 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15300,6 +15300,9 @@ function truncateField(value, field, warnings) {
|
|
|
15300
15300
|
}
|
|
15301
15301
|
return value;
|
|
15302
15302
|
}
|
|
15303
|
+
function normalizeFrontmatterInput(content) {
|
|
15304
|
+
return content.replace(/^\uFEFF/, "");
|
|
15305
|
+
}
|
|
15303
15306
|
function parseFrontmatterFallback(content) {
|
|
15304
15307
|
const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
15305
15308
|
if (!fmMatch)
|
|
@@ -15327,8 +15330,9 @@ function parseFrontmatterFallback(content) {
|
|
|
15327
15330
|
return { frontmatter, body: body.trim(), warnings };
|
|
15328
15331
|
}
|
|
15329
15332
|
function parseFrontmatter(content) {
|
|
15333
|
+
const normalizedContent = normalizeFrontmatterInput(content);
|
|
15330
15334
|
try {
|
|
15331
|
-
const { data, content: body } = import_gray_matter3.default(
|
|
15335
|
+
const { data, content: body } = import_gray_matter3.default(normalizedContent, {
|
|
15332
15336
|
engines: { javascript: { parse: () => ({}) } }
|
|
15333
15337
|
});
|
|
15334
15338
|
const frontmatter = {};
|
|
@@ -15352,13 +15356,13 @@ function parseFrontmatter(content) {
|
|
|
15352
15356
|
}
|
|
15353
15357
|
return { frontmatter, body: body.trim(), warnings };
|
|
15354
15358
|
} catch (error) {
|
|
15355
|
-
const fallback = parseFrontmatterFallback(
|
|
15359
|
+
const fallback = parseFrontmatterFallback(normalizedContent);
|
|
15356
15360
|
if (fallback && Object.keys(fallback.frontmatter).length > 0) {
|
|
15357
15361
|
logger.verbose(`Failed to parse frontmatter: ${error instanceof Error ? error.message : "Unknown error"} (recovered via fallback)`);
|
|
15358
15362
|
return fallback;
|
|
15359
15363
|
}
|
|
15360
15364
|
logger.warning(`Failed to parse frontmatter: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
15361
|
-
return { frontmatter: {}, body:
|
|
15365
|
+
return { frontmatter: {}, body: normalizedContent.trim(), warnings: [] };
|
|
15362
15366
|
}
|
|
15363
15367
|
}
|
|
15364
15368
|
async function parseFrontmatterFile(filePath) {
|
|
@@ -44716,7 +44720,12 @@ var init_claudekit_constants = __esm(() => {
|
|
|
44716
44720
|
});
|
|
44717
44721
|
|
|
44718
44722
|
// src/shared/skip-directories.ts
|
|
44719
|
-
|
|
44723
|
+
function hasSkippedDirectorySegment(relativePath, skipDirs = SKIP_DIRS_ALL) {
|
|
44724
|
+
const segments = relativePath.replace(/\\/g, "/").split("/").filter(Boolean);
|
|
44725
|
+
const skipSet = skipDirs === SKIP_DIRS_ALL ? SKIP_DIRS_ALL_SET : new Set(skipDirs);
|
|
44726
|
+
return segments.some((segment) => skipSet.has(segment));
|
|
44727
|
+
}
|
|
44728
|
+
var BUILD_ARTIFACT_DIRS, CLAUDE_CODE_INTERNAL_DIRS, SKIP_DIRS_ALL, SKIP_DIRS_ALL_SET, SKIP_DIRS_CLAUDE_INTERNAL;
|
|
44720
44729
|
var init_skip_directories = __esm(() => {
|
|
44721
44730
|
BUILD_ARTIFACT_DIRS = [
|
|
44722
44731
|
"node_modules",
|
|
@@ -44744,6 +44753,7 @@ var init_skip_directories = __esm(() => {
|
|
|
44744
44753
|
...BUILD_ARTIFACT_DIRS,
|
|
44745
44754
|
...CLAUDE_CODE_INTERNAL_DIRS
|
|
44746
44755
|
];
|
|
44756
|
+
SKIP_DIRS_ALL_SET = new Set(SKIP_DIRS_ALL);
|
|
44747
44757
|
SKIP_DIRS_CLAUDE_INTERNAL = CLAUDE_CODE_INTERNAL_DIRS;
|
|
44748
44758
|
});
|
|
44749
44759
|
|
|
@@ -58815,7 +58825,7 @@ var package_default;
|
|
|
58815
58825
|
var init_package = __esm(() => {
|
|
58816
58826
|
package_default = {
|
|
58817
58827
|
name: "claudekit-cli",
|
|
58818
|
-
version: "3.41.4-dev.
|
|
58828
|
+
version: "3.41.4-dev.12",
|
|
58819
58829
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
58820
58830
|
type: "module",
|
|
58821
58831
|
repository: {
|
|
@@ -97120,6 +97130,7 @@ class ManifestWriter {
|
|
|
97120
97130
|
}
|
|
97121
97131
|
|
|
97122
97132
|
// src/domains/migration/legacy-migration.ts
|
|
97133
|
+
init_environment();
|
|
97123
97134
|
init_logger();
|
|
97124
97135
|
init_skip_directories();
|
|
97125
97136
|
var import_fs_extra18 = __toESM(require_lib(), 1);
|
|
@@ -97180,14 +97191,22 @@ class LegacyMigration {
|
|
|
97180
97191
|
}
|
|
97181
97192
|
static async classifyFiles(claudeDir3, manifest) {
|
|
97182
97193
|
const files = await LegacyMigration.scanFiles(claudeDir3);
|
|
97194
|
+
const relevantFiles = files.filter((file) => {
|
|
97195
|
+
const relativePath = relative17(claudeDir3, file);
|
|
97196
|
+
return !hasSkippedDirectorySegment(relativePath);
|
|
97197
|
+
});
|
|
97198
|
+
const skippedRuntimeArtifacts = files.length - relevantFiles.length;
|
|
97199
|
+
if (skippedRuntimeArtifacts > 0) {
|
|
97200
|
+
logger.debug(`Legacy migration ignored ${skippedRuntimeArtifacts} runtime artifact file(s) after scan`);
|
|
97201
|
+
}
|
|
97183
97202
|
const preview = {
|
|
97184
97203
|
ckPristine: [],
|
|
97185
97204
|
ckModified: [],
|
|
97186
97205
|
userCreated: [],
|
|
97187
|
-
totalFiles:
|
|
97206
|
+
totalFiles: relevantFiles.length
|
|
97188
97207
|
};
|
|
97189
97208
|
const filesInManifest = [];
|
|
97190
|
-
for (const file of
|
|
97209
|
+
for (const file of relevantFiles) {
|
|
97191
97210
|
const relativePath = relative17(claudeDir3, file).replace(/\\/g, "/");
|
|
97192
97211
|
const manifestEntry = ReleaseManifestLoader.findFile(manifest, relativePath);
|
|
97193
97212
|
if (!manifestEntry) {
|
|
@@ -97204,7 +97223,7 @@ class LegacyMigration {
|
|
|
97204
97223
|
const checksumResults = await mapWithLimit(filesInManifest, async ({ file, relativePath, manifestChecksum }) => {
|
|
97205
97224
|
const actualChecksum = await OwnershipChecker.calculateChecksum(file);
|
|
97206
97225
|
return { relativePath, actualChecksum, manifestChecksum };
|
|
97207
|
-
});
|
|
97226
|
+
}, getOptimalConcurrency());
|
|
97208
97227
|
for (const { relativePath, actualChecksum, manifestChecksum } of checksumResults) {
|
|
97209
97228
|
if (actualChecksum === manifestChecksum) {
|
|
97210
97229
|
preview.ckPristine.push(relativePath);
|
|
@@ -97260,7 +97279,7 @@ User-created files (sample):`);
|
|
|
97260
97279
|
const fullPath = join104(claudeDir3, relativePath);
|
|
97261
97280
|
const checksum = await OwnershipChecker.calculateChecksum(fullPath);
|
|
97262
97281
|
return { relativePath, checksum, ownership };
|
|
97263
|
-
});
|
|
97282
|
+
}, getOptimalConcurrency());
|
|
97264
97283
|
for (const { relativePath, checksum, ownership } of checksumResults) {
|
|
97265
97284
|
trackedFiles.push({
|
|
97266
97285
|
path: relativePath,
|