combicode 1.7.2 → 1.7.3

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/index.js +21 -17
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -179,8 +179,12 @@ function generateFileTree(filesWithSize, root, skipContentSet = null) {
179
179
  parts.forEach((part, index) => {
180
180
  const isFile = index === parts.length - 1;
181
181
  if (isFile) {
182
- const shouldSkipContent = skipContentSet && skipContentSet.has(relativePath);
183
- currentLevel[part] = { size: formattedSize, skipContent: shouldSkipContent };
182
+ const shouldSkipContent =
183
+ skipContentSet && skipContentSet.has(relativePath);
184
+ currentLevel[part] = {
185
+ size: formattedSize,
186
+ skipContent: shouldSkipContent,
187
+ };
184
188
  } else {
185
189
  if (!currentLevel[part]) {
186
190
  currentLevel[part] = {};
@@ -261,7 +265,8 @@ async function main() {
261
265
  default: false,
262
266
  })
263
267
  .option("skip-content", {
264
- describe: "Comma-separated glob patterns for files to include in tree but omit content",
268
+ describe:
269
+ "Comma-separated glob patterns for files to include in tree but omit content",
265
270
  type: "string",
266
271
  })
267
272
  .version(version)
@@ -330,16 +335,13 @@ async function main() {
330
335
  }
331
336
 
332
337
  // Calculate total size of included files (excluding files with skipped content)
333
- const totalSizeBytes = includedFiles.reduce(
334
- (acc, file) => {
335
- // Don't count files with skipped content in the total size
336
- if (skipContentSet.has(file.relativePath)) {
337
- return acc;
338
- }
339
- return acc + file.size;
340
- },
341
- 0
342
- );
338
+ const totalSizeBytes = includedFiles.reduce((acc, file) => {
339
+ // Don't count files with skipped content in the total size
340
+ if (skipContentSet.has(file.relativePath)) {
341
+ return acc;
342
+ }
343
+ return acc + file.size;
344
+ }, 0);
343
345
 
344
346
  if (includedFiles.length === 0) {
345
347
  console.error(
@@ -388,11 +390,13 @@ async function main() {
388
390
  for (const fileObj of includedFiles) {
389
391
  const relativePath = fileObj.relativePath.replace(/\\/g, "/");
390
392
  const shouldSkipContent = skipContentSet.has(fileObj.relativePath);
391
-
393
+
392
394
  outputStream.write(`### **FILE:** \`${relativePath}\`\n`);
393
- outputStream.write("```\n");
395
+ outputStream.write("````\n");
394
396
  if (shouldSkipContent) {
395
- outputStream.write(`(Content omitted - file size: ${fileObj.formattedSize})`);
397
+ outputStream.write(
398
+ `(Content omitted - file size: ${fileObj.formattedSize})`
399
+ );
396
400
  totalLines += 1;
397
401
  } else {
398
402
  try {
@@ -403,7 +407,7 @@ async function main() {
403
407
  outputStream.write(`... (error reading file: ${e.message}) ...`);
404
408
  }
405
409
  }
406
- outputStream.write("\n```\n\n");
410
+ outputStream.write("\n````\n\n");
407
411
  totalLines += 4; // Headers/footers lines
408
412
  }
409
413
  outputStream.end();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "combicode",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "A CLI tool to combine a project's codebase into a single file for LLM context.",
5
5
  "main": "index.js",
6
6
  "bin": {