Skip to content

Commit 025fb7d

Browse files
unit(u5a): the guardedWrite tool on top of the writer's guard API
Second unit of the #1914 split plan recorded on #1991: src/core/tools/guardedWrite.ts and its spec, taken unchanged from 74f5eb2, plus the one knip.json line that declares core/tools/guardedWrite.ts as a src workspace entry. Builds on vps2f-1914-u5b for two measured reasons. The tool's only dependency on the previous unit is Task's cancellationGeneration field, which guardedWrite reads at six sites; a variant carrying the writer and the tool but not Task fails tsc with eight TS2339 errors for that property (built and measured as vps2f-1914-u5c, not kept). The unit also cannot precede the writer for the opposite reason: knip --production does not credit imports from files it reports as unused, so a writer-only unit has to declare the writer as an entry instead, which is the line the previous unit carries. Taking the entry line here rather than there is what makes both units pass knip in isolation, which matters because knip is a required status check on main. Local build for measurement. The unit's line counts, gate results, and the reason the entry line moves between the two units are reported with this unit's head rather than inferred.
1 parent 8a9d5b7 commit 025fb7d

3 files changed

Lines changed: 2000 additions & 6 deletions

File tree

‎knip.json‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@
1616
"playwright-ct": false,
1717
"workspaces": {
1818
"src": {
19-
"entry": [
20-
"extension.ts!",
21-
"extension/api.ts!",
22-
"workers/countTokens.ts!",
23-
"services/file-safety/safeWriteText.ts!"
24-
],
19+
"entry": ["extension.ts!", "extension/api.ts!", "workers/countTokens.ts!", "core/tools/guardedWrite.ts!"],
2520
"project": [
2621
"**/*.ts!",
2722
"!**/__tests__/**!",

0 commit comments

Comments
 (0)