@ankurhalder/codebase-snapshot 4.0.0 → 4.0.2
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/bin.js +463 -289
- package/dist/{chunk-FM4OOQPF.js → chunk-CY3XU5TS.js} +301 -127
- package/dist/cli.cjs +427 -253
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +9 -6
- package/dist/index.cjs +299 -125
- package/dist/index.d.cts +14 -9
- package/dist/index.d.ts +14 -9
- package/dist/index.js +1 -1
- package/dist/{types-BdpT_4b8.d.cts → types-LSfwsKE-.d.cts} +1 -0
- package/dist/{types-BdpT_4b8.d.ts → types-LSfwsKE-.d.ts} +1 -0
- package/docs/cli.md +5 -3
- package/docs/troubleshooting.md +1 -1
- package/package.json +1 -1
package/dist/cli.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OutputFormat } from './types-
|
|
1
|
+
import { O as OutputFormat } from './types-LSfwsKE-.cjs';
|
|
2
2
|
|
|
3
3
|
type Command = "generate" | "validate" | "report" | "init" | "explain" | "diff" | "describe" | "skill";
|
|
4
4
|
/** A user-input problem: printed without a stack trace, exits 2. */
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OutputFormat } from './types-
|
|
1
|
+
import { O as OutputFormat } from './types-LSfwsKE-.js';
|
|
2
2
|
|
|
3
3
|
type Command = "generate" | "validate" | "report" | "init" | "explain" | "diff" | "describe" | "skill";
|
|
4
4
|
/** A user-input problem: printed without a stack trace, exits 2. */
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseByteSize, GENERATOR_VERSION, ARTIFACT_NAMES, getPreset, unknownPresetMessage, MIN_MAX_PART_BYTES, loadConfigFileDetailed, resolveConfig, validateSnapshot, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, GENERATOR_NAME, runInit, PromptCancelled, SCHEMA_VERSION, PRESETS, renderExplainText } from './chunk-
|
|
1
|
+
import { parseByteSize, GENERATOR_VERSION, ARTIFACT_NAMES, getPreset, unknownPresetMessage, MIN_MAX_PART_BYTES, loadConfigFileDetailed, resolveConfig, validateSnapshot, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, GENERATOR_NAME, runInit, PromptCancelled, SCHEMA_VERSION, PRESETS, renderExplainText } from './chunk-CY3XU5TS.js';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path2 from 'path';
|
|
4
4
|
import { parseArgs } from 'util';
|
|
@@ -483,8 +483,8 @@ function buildAgentContract() {
|
|
|
483
483
|
"snapshot.config.mjs",
|
|
484
484
|
"snapshot.config.cjs",
|
|
485
485
|
"snapshot.config.json",
|
|
486
|
-
".snapshotrc",
|
|
487
486
|
".snapshotrc.json",
|
|
487
|
+
".snapshotrc",
|
|
488
488
|
'package.json \u2192 "snapshot" key'
|
|
489
489
|
],
|
|
490
490
|
settings: [
|
|
@@ -1295,8 +1295,7 @@ ${USAGE}
|
|
|
1295
1295
|
warn(`\u274C ${manifestPath} is not a snapshot manifest: ${shapeError}`);
|
|
1296
1296
|
return 1;
|
|
1297
1297
|
}
|
|
1298
|
-
|
|
1299
|
-
emit(invocation.format, { manifest, validation }, () => {
|
|
1298
|
+
emit(invocation.format, { manifest, validation: null }, () => {
|
|
1300
1299
|
info(`
|
|
1301
1300
|
\u{1F4CA} Codebase Snapshot Report (${resolved.cwd})`);
|
|
1302
1301
|
info(` - Generated at: ${manifest.generatedAt}`);
|
|
@@ -1308,14 +1307,14 @@ ${USAGE}
|
|
|
1308
1307
|
` - Total size: ${(manifest.counts.totalSizeBytes / (1024 * 1024)).toFixed(2)} MB`
|
|
1309
1308
|
);
|
|
1310
1309
|
info(` - Total parts: ${manifest.counts.partsCount}`);
|
|
1311
|
-
info(
|
|
1310
|
+
info(" - Integrity: not checked (run `codebase-snapshot validate`)");
|
|
1312
1311
|
info(` - Warnings: ${manifest.warnings?.length ?? 0}`);
|
|
1313
1312
|
info("\n Layers:");
|
|
1314
1313
|
for (const [layer, count] of Object.entries(manifest.layers)) {
|
|
1315
1314
|
info(` - ${layer.padEnd(16)}: ${count} files`);
|
|
1316
1315
|
}
|
|
1317
1316
|
});
|
|
1318
|
-
return
|
|
1317
|
+
return 0;
|
|
1319
1318
|
}
|
|
1320
1319
|
if (invocation.command === "explain") {
|
|
1321
1320
|
const result = explainPath(resolved, invocation.args[0]);
|
|
@@ -1434,6 +1433,8 @@ async function runWatchLoop(invocation, resolved) {
|
|
|
1434
1433
|
(segment) => segment === outName || segment === tmpName || segment.startsWith(`${outName}.backup-`) || VCS_SEGMENTS.has(segment)
|
|
1435
1434
|
);
|
|
1436
1435
|
let running = false;
|
|
1436
|
+
let quietUntil = 0;
|
|
1437
|
+
const QUIET_MS = 1500;
|
|
1437
1438
|
const regenerate = async () => {
|
|
1438
1439
|
if (running) return;
|
|
1439
1440
|
running = true;
|
|
@@ -1471,6 +1472,7 @@ async function runWatchLoop(invocation, resolved) {
|
|
|
1471
1472
|
} catch (err) {
|
|
1472
1473
|
warn(`\u274C ${err.message}`);
|
|
1473
1474
|
} finally {
|
|
1475
|
+
quietUntil = performance.now() + QUIET_MS;
|
|
1474
1476
|
running = false;
|
|
1475
1477
|
}
|
|
1476
1478
|
};
|
|
@@ -1478,6 +1480,7 @@ async function runWatchLoop(invocation, resolved) {
|
|
|
1478
1480
|
void regenerate();
|
|
1479
1481
|
let timer = null;
|
|
1480
1482
|
const watcher = fs.watch(resolved.cwd, { recursive: true }, (_event, filename) => {
|
|
1483
|
+
if (performance.now() < quietUntil) return;
|
|
1481
1484
|
if (filename) {
|
|
1482
1485
|
const changed = path2.resolve(resolved.cwd, filename.toString());
|
|
1483
1486
|
if (isGenerated(changed)) return;
|