@quickback-dev/cli 0.10.2 → 0.10.5
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/commands/compile.d.ts +9 -1
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +56 -16
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/create.js +108 -55
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +22 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/cursor/quickback.mdc +61 -46
- package/dist/docs/content.js +18 -18
- package/dist/docs/content.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +34 -2
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +31 -2
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/api-client.test.js +58 -0
- package/dist/lib/api-client.test.js.map +1 -1
- package/dist/lib/config-sync.d.ts +55 -0
- package/dist/lib/config-sync.d.ts.map +1 -0
- package/dist/lib/config-sync.js +207 -0
- package/dist/lib/config-sync.js.map +1 -0
- package/dist/lib/config-sync.test.d.ts +2 -0
- package/dist/lib/config-sync.test.d.ts.map +1 -0
- package/dist/lib/config-sync.test.js +151 -0
- package/dist/lib/config-sync.test.js.map +1 -0
- package/dist/lib/file-loader.d.ts +39 -5
- package/dist/lib/file-loader.d.ts.map +1 -1
- package/dist/lib/file-loader.js +226 -63
- package/dist/lib/file-loader.js.map +1 -1
- package/dist/lib/file-loader.test.js +212 -1
- package/dist/lib/file-loader.test.js.map +1 -1
- package/dist/lib/prepare-output.d.ts +31 -0
- package/dist/lib/prepare-output.d.ts.map +1 -0
- package/dist/lib/prepare-output.js +95 -0
- package/dist/lib/prepare-output.js.map +1 -0
- package/dist/lib/prepare-output.test.d.ts +2 -0
- package/dist/lib/prepare-output.test.d.ts.map +1 -0
- package/dist/lib/prepare-output.test.js +105 -0
- package/dist/lib/prepare-output.test.js.map +1 -0
- package/dist/lib/sweep-stale.d.ts +25 -0
- package/dist/lib/sweep-stale.d.ts.map +1 -0
- package/dist/lib/sweep-stale.js +179 -0
- package/dist/lib/sweep-stale.js.map +1 -0
- package/dist/lib/sweep-stale.test.d.ts +2 -0
- package/dist/lib/sweep-stale.test.d.ts.map +1 -0
- package/dist/lib/sweep-stale.test.js +130 -0
- package/dist/lib/sweep-stale.test.js.map +1 -0
- package/dist/skill/SKILL.md +327 -103
- package/dist/skill/agents/quickback-specialist/AGENT.md +93 -81
- package/package.json +14 -14
- package/src/cursor/quickback.mdc +61 -46
- package/src/skill/SKILL.md +327 -103
- package/src/skill/agents/quickback-specialist/AGENT.md +93 -81
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface SweepOptions {
|
|
2
|
+
/**
|
|
3
|
+
* If set, copy the target dir into `<archiveDir>/<targetBasename>-<ISO>/`
|
|
4
|
+
* before deleting anything. No-op when no orphans are found.
|
|
5
|
+
*/
|
|
6
|
+
archiveDir?: string;
|
|
7
|
+
/** How many archives to retain. Defaults to 3. */
|
|
8
|
+
archiveKeep?: number;
|
|
9
|
+
/** Subtrees (relative to outputDir) to skip — e.g. SPA asset dirs that already get a hard wipe upstream. */
|
|
10
|
+
skipPrefixes?: Iterable<string>;
|
|
11
|
+
}
|
|
12
|
+
export interface SweepResult {
|
|
13
|
+
/** Files deleted because they were stale orphans. */
|
|
14
|
+
deleted: string[];
|
|
15
|
+
/** Files NOT deleted despite being missing from the manifest — they lacked the generated-header marker. */
|
|
16
|
+
preserved: string[];
|
|
17
|
+
/** Path to the archive created before deletion (undefined when nothing was deleted or archiveDir wasn't set). */
|
|
18
|
+
archivePath?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sweep stale generated files under `targetDir`. Paths in `manifest` are
|
|
22
|
+
* relative to `outputDir` (matching the wire shape the compiler returns).
|
|
23
|
+
*/
|
|
24
|
+
export declare function sweepStaleGeneratedFiles(outputDir: string, targetDir: string, manifest: Iterable<string>, options?: SweepOptions): Promise<SweepResult>;
|
|
25
|
+
//# sourceMappingURL=sweep-stale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweep-stale.d.ts","sourceRoot":"","sources":["../../src/lib/sweep-stale.ts"],"names":[],"mappings":"AAyCA,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4GAA4G;IAC5G,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2GAA2G;IAC3G,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,iHAAiH;IACjH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,EAC1B,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,CA8CtB"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stale-file sweep for generated output trees.
|
|
3
|
+
*
|
|
4
|
+
* `src/` is hermetic — every file there is emitted by the compiler and
|
|
5
|
+
* carries the "Generated by quickback.dev" header. When a feature is
|
|
6
|
+
* removed/renamed or a generator stops emitting a file, the orphaned file
|
|
7
|
+
* lingers under merge-only writes and can mask bugs (dead routes, ghost
|
|
8
|
+
* imports, mismatched types, stale schemas the user assumes are current).
|
|
9
|
+
*
|
|
10
|
+
* This helper walks a target dir, deletes any file whose path isn't in the
|
|
11
|
+
* compiler's manifest *and* carries the generated-header marker, then
|
|
12
|
+
* collapses the empty directories left behind. Files without the marker are
|
|
13
|
+
* preserved (defence against accidentally nuking hand-authored content that
|
|
14
|
+
* snuck into a generated tree).
|
|
15
|
+
*
|
|
16
|
+
* Before any deletes, it copies the target dir into a timestamped archive
|
|
17
|
+
* under `archiveDir` (when provided). The archive is uncompressed (just a
|
|
18
|
+
* recursive copy via Node's built-in fs.cp) so it's trivially inspectable
|
|
19
|
+
* and recoverable with `cp -r`. Old archives beyond `archiveKeep` are
|
|
20
|
+
* pruned. The archive is skipped entirely on no-op compiles where no
|
|
21
|
+
* orphans were found.
|
|
22
|
+
*/
|
|
23
|
+
import { promises as fs } from 'fs';
|
|
24
|
+
import { join, relative, sep } from 'path';
|
|
25
|
+
const GENERATED_MARKER = 'Generated by quickback.dev';
|
|
26
|
+
const HEADER_PROBE_BYTES = 512;
|
|
27
|
+
const DEFAULT_ARCHIVE_KEEP = 3;
|
|
28
|
+
/**
|
|
29
|
+
* OS / editor noise that every contributor accidentally drops into checked-out
|
|
30
|
+
* trees. These files are *never* compiler output and *never* user-authored
|
|
31
|
+
* content the user cares about — silently skip them rather than warning the
|
|
32
|
+
* user every compile that ".DS_Store has no Quickback header".
|
|
33
|
+
*/
|
|
34
|
+
const SILENT_IGNORE_BASENAMES = new Set([
|
|
35
|
+
'.DS_Store',
|
|
36
|
+
'Thumbs.db',
|
|
37
|
+
'.localized',
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* Sweep stale generated files under `targetDir`. Paths in `manifest` are
|
|
41
|
+
* relative to `outputDir` (matching the wire shape the compiler returns).
|
|
42
|
+
*/
|
|
43
|
+
export async function sweepStaleGeneratedFiles(outputDir, targetDir, manifest, options = {}) {
|
|
44
|
+
const result = { deleted: [], preserved: [] };
|
|
45
|
+
const fullTarget = join(outputDir, targetDir);
|
|
46
|
+
if (!(await pathExists(fullTarget)))
|
|
47
|
+
return result;
|
|
48
|
+
const manifestSet = new Set();
|
|
49
|
+
for (const p of manifest)
|
|
50
|
+
manifestSet.add(normalizePath(p));
|
|
51
|
+
const skipNormalized = [...(options.skipPrefixes ?? [])].map(normalizePath);
|
|
52
|
+
const isSkipped = (relPath) => skipNormalized.some((sp) => relPath === sp || relPath.startsWith(sp + '/'));
|
|
53
|
+
const onDisk = [];
|
|
54
|
+
await collectFiles(fullTarget, outputDir, onDisk);
|
|
55
|
+
// First pass: identify deletions without acting, so the archive captures
|
|
56
|
+
// the pre-delete state and runs only when there's something to lose.
|
|
57
|
+
const toDelete = [];
|
|
58
|
+
for (const relPath of onDisk) {
|
|
59
|
+
if (manifestSet.has(relPath))
|
|
60
|
+
continue;
|
|
61
|
+
if (isSkipped(relPath))
|
|
62
|
+
continue;
|
|
63
|
+
const base = relPath.slice(relPath.lastIndexOf('/') + 1);
|
|
64
|
+
if (SILENT_IGNORE_BASENAMES.has(base))
|
|
65
|
+
continue;
|
|
66
|
+
const fullPath = join(outputDir, relPath);
|
|
67
|
+
if (await fileHasMarker(fullPath, GENERATED_MARKER)) {
|
|
68
|
+
toDelete.push(relPath);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
result.preserved.push(relPath);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (toDelete.length === 0)
|
|
75
|
+
return result;
|
|
76
|
+
if (options.archiveDir) {
|
|
77
|
+
result.archivePath = await archiveDirectory(fullTarget, options.archiveDir, basename(targetDir));
|
|
78
|
+
await pruneArchives(options.archiveDir, basename(targetDir), options.archiveKeep ?? DEFAULT_ARCHIVE_KEEP);
|
|
79
|
+
}
|
|
80
|
+
for (const relPath of toDelete) {
|
|
81
|
+
await fs.unlink(join(outputDir, relPath));
|
|
82
|
+
result.deleted.push(relPath);
|
|
83
|
+
}
|
|
84
|
+
await removeEmptyDirs(fullTarget);
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
async function archiveDirectory(srcDir, archiveBase, prefix) {
|
|
88
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, '-').replace(/Z$/, '');
|
|
89
|
+
const dest = join(archiveBase, `${prefix}-${stamp}`);
|
|
90
|
+
await fs.mkdir(archiveBase, { recursive: true });
|
|
91
|
+
// fs.cp with recursive copies the tree, preserves dir structure, no deps.
|
|
92
|
+
await fs.cp(srcDir, dest, { recursive: true, force: true });
|
|
93
|
+
return dest;
|
|
94
|
+
}
|
|
95
|
+
async function pruneArchives(archiveBase, prefix, keep) {
|
|
96
|
+
if (!(await pathExists(archiveBase)))
|
|
97
|
+
return;
|
|
98
|
+
const entries = await fs.readdir(archiveBase);
|
|
99
|
+
const stamped = entries.filter((e) => e.startsWith(`${prefix}-`)).sort().reverse();
|
|
100
|
+
const stale = stamped.slice(keep);
|
|
101
|
+
for (const old of stale) {
|
|
102
|
+
await fs.rm(join(archiveBase, old), { recursive: true, force: true }).catch(() => { });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async function pathExists(p) {
|
|
106
|
+
try {
|
|
107
|
+
await fs.access(p);
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function collectFiles(dir, outputDir, into) {
|
|
115
|
+
let entries;
|
|
116
|
+
try {
|
|
117
|
+
entries = await fs.readdir(dir, { withFileTypes: true });
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
for (const entry of entries) {
|
|
123
|
+
const full = join(dir, entry.name);
|
|
124
|
+
if (entry.isDirectory()) {
|
|
125
|
+
await collectFiles(full, outputDir, into);
|
|
126
|
+
}
|
|
127
|
+
else if (entry.isFile()) {
|
|
128
|
+
into.push(normalizePath(relative(outputDir, full)));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function fileHasMarker(path, marker) {
|
|
133
|
+
let handle = null;
|
|
134
|
+
try {
|
|
135
|
+
handle = await fs.open(path, 'r');
|
|
136
|
+
const buf = Buffer.alloc(HEADER_PROBE_BYTES);
|
|
137
|
+
const { bytesRead } = await handle.read(buf, 0, HEADER_PROBE_BYTES, 0);
|
|
138
|
+
return buf.subarray(0, bytesRead).toString('utf8').includes(marker);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
if (handle)
|
|
145
|
+
await handle.close();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
async function removeEmptyDirs(dir) {
|
|
149
|
+
let entries;
|
|
150
|
+
try {
|
|
151
|
+
entries = await fs.readdir(dir, { withFileTypes: true });
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
for (const entry of entries) {
|
|
157
|
+
if (entry.isDirectory()) {
|
|
158
|
+
await removeEmptyDirs(join(dir, entry.name));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
const after = await fs.readdir(dir);
|
|
163
|
+
if (after.length === 0) {
|
|
164
|
+
await fs.rmdir(dir).catch(() => { });
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
/* ignore */
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function normalizePath(p) {
|
|
172
|
+
return sep === '/' ? p : p.split(sep).join('/');
|
|
173
|
+
}
|
|
174
|
+
function basename(p) {
|
|
175
|
+
const norm = normalizePath(p).replace(/\/+$/, '');
|
|
176
|
+
const idx = norm.lastIndexOf('/');
|
|
177
|
+
return idx >= 0 ? norm.slice(idx + 1) : norm;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=sweep-stale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweep-stale.js","sourceRoot":"","sources":["../../src/lib/sweep-stale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,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AAS,aAAa,CAAC,CAAS;IAC9B,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS;IACzB,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweep-stale.test.d.ts","sourceRoot":"","sources":["../../src/lib/sweep-stale.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { describe, expect, test, beforeEach, afterEach } from 'bun:test';
|
|
2
|
+
import { promises as fs } from 'fs';
|
|
3
|
+
import { join, sep } from 'path';
|
|
4
|
+
import { tmpdir } from 'os';
|
|
5
|
+
import { sweepStaleGeneratedFiles } from './sweep-stale.js';
|
|
6
|
+
const HEADER = '/**\n * Generated by quickback.dev\n */\n';
|
|
7
|
+
const PLAIN = '// hand-authored content\n';
|
|
8
|
+
let tmp;
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
tmp = await fs.mkdtemp(join(tmpdir(), 'sweep-stale-'));
|
|
11
|
+
});
|
|
12
|
+
afterEach(async () => {
|
|
13
|
+
await fs.rm(tmp, { recursive: true, force: true }).catch(() => { });
|
|
14
|
+
});
|
|
15
|
+
async function writeFile(rel, content) {
|
|
16
|
+
const full = join(tmp, ...rel.split('/'));
|
|
17
|
+
await fs.mkdir(join(full, '..'), { recursive: true });
|
|
18
|
+
await fs.writeFile(full, content);
|
|
19
|
+
}
|
|
20
|
+
async function fileExists(rel) {
|
|
21
|
+
try {
|
|
22
|
+
await fs.access(join(tmp, ...rel.split('/')));
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
describe('sweepStaleGeneratedFiles', () => {
|
|
30
|
+
// User story: As a developer who renames a feature, I want stale generator
|
|
31
|
+
// output from the old name to disappear so my project tree reflects only
|
|
32
|
+
// what the current config produces — no ghost routes/types lingering.
|
|
33
|
+
test('deletes generated files not in the manifest', async () => {
|
|
34
|
+
await writeFile('src/features/old/schema.ts', HEADER);
|
|
35
|
+
await writeFile('src/features/new/schema.ts', HEADER);
|
|
36
|
+
const result = await sweepStaleGeneratedFiles(tmp, 'src', ['src/features/new/schema.ts']);
|
|
37
|
+
expect(result.deleted.sort()).toEqual(['src/features/old/schema.ts']);
|
|
38
|
+
expect(await fileExists('src/features/old/schema.ts')).toBe(false);
|
|
39
|
+
expect(await fileExists('src/features/new/schema.ts')).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
// User story: As a developer who pasted a personal note into src/, I want
|
|
42
|
+
// the sweep to leave my hand-authored file alone — the header check is the
|
|
43
|
+
// line between "compiler owns this" and "the user owns this".
|
|
44
|
+
test('preserves files without the generated-header marker', async () => {
|
|
45
|
+
await writeFile('src/features/new/notes.md', PLAIN);
|
|
46
|
+
await writeFile('src/features/new/schema.ts', HEADER);
|
|
47
|
+
const result = await sweepStaleGeneratedFiles(tmp, 'src', ['src/features/new/schema.ts']);
|
|
48
|
+
expect(result.deleted).toEqual([]);
|
|
49
|
+
expect(result.preserved).toEqual(['src/features/new/notes.md']);
|
|
50
|
+
expect(await fileExists('src/features/new/notes.md')).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
// User story: As a developer running quickback compile back-to-back with no
|
|
53
|
+
// changes, I want the sweep to be a fast no-op — no spurious archive dirs
|
|
54
|
+
// littering the repo every time I recompile.
|
|
55
|
+
test('does not archive when nothing is stale', async () => {
|
|
56
|
+
await writeFile('src/features/new/schema.ts', HEADER);
|
|
57
|
+
const archiveDir = join(tmp, 'quickback', '.archives');
|
|
58
|
+
const result = await sweepStaleGeneratedFiles(tmp, 'src', ['src/features/new/schema.ts'], {
|
|
59
|
+
archiveDir,
|
|
60
|
+
});
|
|
61
|
+
expect(result.deleted).toEqual([]);
|
|
62
|
+
expect(result.archivePath).toBeUndefined();
|
|
63
|
+
expect(await fileExists('quickback/.archives')).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
// User story: As a developer about to lose 30 generator-emitted files in a
|
|
66
|
+
// sweep, I want a snapshot of src/ saved automatically so I can recover if
|
|
67
|
+
// the compiler stopped emitting something I was depending on.
|
|
68
|
+
test('archives src/ before deleting when orphans are present', async () => {
|
|
69
|
+
await writeFile('src/features/old/schema.ts', HEADER);
|
|
70
|
+
await writeFile('src/features/new/schema.ts', HEADER);
|
|
71
|
+
const archiveDir = join(tmp, 'quickback', '.archives');
|
|
72
|
+
const result = await sweepStaleGeneratedFiles(tmp, 'src', ['src/features/new/schema.ts'], {
|
|
73
|
+
archiveDir,
|
|
74
|
+
});
|
|
75
|
+
expect(result.deleted).toEqual(['src/features/old/schema.ts']);
|
|
76
|
+
expect(result.archivePath).toBeDefined();
|
|
77
|
+
// Archive should contain a copy of the pre-sweep tree.
|
|
78
|
+
const archived = await fs.readdir(result.archivePath, { recursive: true });
|
|
79
|
+
const flat = archived.map((p) => (sep === '/' ? p : p.split(sep).join('/')));
|
|
80
|
+
expect(flat).toContain('features/old/schema.ts');
|
|
81
|
+
expect(flat).toContain('features/new/schema.ts');
|
|
82
|
+
});
|
|
83
|
+
// User story: As a developer who refactors aggressively over a week, I want
|
|
84
|
+
// older snapshots pruned automatically so the .archives folder doesn't
|
|
85
|
+
// balloon — last 3 generations is enough to walk back from a regret.
|
|
86
|
+
test('prunes old archives, keeping most recent N', async () => {
|
|
87
|
+
const archiveDir = join(tmp, 'archives');
|
|
88
|
+
await fs.mkdir(archiveDir, { recursive: true });
|
|
89
|
+
// Pre-seed 5 fake archives with sortable names.
|
|
90
|
+
for (const stamp of ['src-0001', 'src-0002', 'src-0003', 'src-0004']) {
|
|
91
|
+
await fs.mkdir(join(archiveDir, stamp));
|
|
92
|
+
}
|
|
93
|
+
await writeFile('src/features/old/schema.ts', HEADER);
|
|
94
|
+
await writeFile('src/features/new/schema.ts', HEADER);
|
|
95
|
+
await sweepStaleGeneratedFiles(tmp, 'src', ['src/features/new/schema.ts'], {
|
|
96
|
+
archiveDir,
|
|
97
|
+
archiveKeep: 3,
|
|
98
|
+
});
|
|
99
|
+
const remaining = (await fs.readdir(archiveDir)).filter((d) => d.startsWith('src-'));
|
|
100
|
+
expect(remaining.length).toBe(3);
|
|
101
|
+
// Newest survives — pruning is alphabetical-descending.
|
|
102
|
+
expect(remaining).toContain('src-0004');
|
|
103
|
+
expect(remaining).not.toContain('src-0001');
|
|
104
|
+
});
|
|
105
|
+
// User story: As a developer with SPA bundles in src/apps/cms/assets/, I want
|
|
106
|
+
// the sweep to leave that subtree alone — the upstream code wipes it
|
|
107
|
+
// wholesale before each write, so the per-file header probe would be
|
|
108
|
+
// wasted work.
|
|
109
|
+
test('respects skipPrefixes (SPA asset dirs)', async () => {
|
|
110
|
+
await writeFile('src/apps/cms/assets/main-abc123.js', HEADER);
|
|
111
|
+
await writeFile('src/apps/cms/assets/main-def456.js', HEADER);
|
|
112
|
+
const result = await sweepStaleGeneratedFiles(tmp, 'src', ['src/apps/cms/assets/main-def456.js'], {
|
|
113
|
+
skipPrefixes: ['src/apps/cms/assets'],
|
|
114
|
+
});
|
|
115
|
+
expect(result.deleted).toEqual([]);
|
|
116
|
+
expect(await fileExists('src/apps/cms/assets/main-abc123.js')).toBe(true);
|
|
117
|
+
});
|
|
118
|
+
// User story: As a developer with a now-empty src/features/old/ after a
|
|
119
|
+
// sweep, I don't want the bare directory hanging around — the file tree
|
|
120
|
+
// should match the manifest, including its shape.
|
|
121
|
+
test('removes empty directories left after deletion', async () => {
|
|
122
|
+
await writeFile('src/features/old/schema.ts', HEADER);
|
|
123
|
+
await writeFile('src/features/old/routes.ts', HEADER);
|
|
124
|
+
await writeFile('src/features/new/schema.ts', HEADER);
|
|
125
|
+
await sweepStaleGeneratedFiles(tmp, 'src', ['src/features/new/schema.ts']);
|
|
126
|
+
expect(await fileExists('src/features/old')).toBe(false);
|
|
127
|
+
expect(await fileExists('src/features/new')).toBe(true);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=sweep-stale.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweep-stale.test.js","sourceRoot":"","sources":["../../src/lib/sweep-stale.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,MAAM,MAAM,GAAG,2CAA2C,CAAC;AAC3D,MAAM,KAAK,GAAG,4BAA4B,CAAC;AAE3C,IAAI,GAAW,CAAC;AAEhB,UAAU,CAAC,KAAK,IAAI,EAAE;IACpB,GAAG,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,KAAK,IAAI,EAAE;IACnB,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,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