safeword 0.78.2 → 0.78.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.
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/codex-plugin/hooks.json +5 -5
- package/codex-plugin/skills/bdd/references/SCENARIOS.md +3 -0
- package/codex-plugin/skills/bdd/references/TDD.md +11 -5
- package/codex-plugin/skills/closeout/SKILL.md +24 -16
- package/codex-plugin/skills/finish-review/SKILL.md +4 -3
- package/codex-plugin/skills/lint/SKILL.md +1 -1
- package/codex-plugin/skills/review-spec/SKILL.md +5 -1
- package/codex-plugin/skills/self-review/SKILL.md +2 -2
- package/codex-plugin/skills/ticket-system/SKILL.md +3 -0
- package/dist/{architecture-N5ZC4CDU.js → architecture-RQ377ZER.js} +6 -6
- package/dist/{architecture-document-UBA5UT4J.js → architecture-document-KS3CLSYN.js} +6 -6
- package/dist/{architecture-monorepo-E4JUYJGV.js → architecture-monorepo-NJWWU65G.js} +4 -4
- package/dist/{boundary-HLJILY7R.js → boundary-OPTC2RVJ.js} +6 -6
- package/dist/{chunk-NOTBZCKG.js → chunk-2XR7J5WL.js} +93 -42
- package/dist/chunk-2XR7J5WL.js.map +1 -0
- package/dist/{chunk-4CZS4YJV.js → chunk-3OKZ3X4O.js} +3 -3
- package/dist/{chunk-J7UDLLTK.js → chunk-76XHADUG.js} +39 -25
- package/dist/chunk-76XHADUG.js.map +1 -0
- package/dist/{chunk-4CKCRZDO.js → chunk-7ULZND56.js} +2 -2
- package/dist/{chunk-34NCOTP5.js → chunk-7XELS325.js} +2 -2
- package/dist/{chunk-USPVNZ63.js → chunk-BZWO3BVD.js} +11 -7
- package/dist/chunk-BZWO3BVD.js.map +1 -0
- package/dist/{chunk-GZ36UZJG.js → chunk-CFME47IY.js} +6 -6
- package/dist/{chunk-SME5SU3O.js → chunk-CNBZ3S5U.js} +255 -45
- package/dist/chunk-CNBZ3S5U.js.map +1 -0
- package/dist/{chunk-AV5LTEME.js → chunk-CRGPYC35.js} +8 -6
- package/dist/{chunk-AV5LTEME.js.map → chunk-CRGPYC35.js.map} +1 -1
- package/dist/{chunk-BQTC6YGN.js → chunk-D5ENZR6N.js} +2 -2
- package/dist/{chunk-V63TSN3C.js → chunk-FOYGZ4MK.js} +31 -10
- package/dist/chunk-FOYGZ4MK.js.map +1 -0
- package/dist/{chunk-ZRV7TOCX.js → chunk-G5AFQXXW.js} +2 -2
- package/dist/{chunk-S2T356DA.js → chunk-HF3DXZEA.js} +7 -10
- package/dist/chunk-HF3DXZEA.js.map +1 -0
- package/dist/{chunk-NSZGI7HK.js → chunk-HNCUIXDY.js} +9 -9
- package/dist/{chunk-NSZGI7HK.js.map → chunk-HNCUIXDY.js.map} +1 -1
- package/dist/{chunk-KXHVFCDT.js → chunk-IDRLACDS.js} +145 -19
- package/dist/chunk-IDRLACDS.js.map +1 -0
- package/dist/{chunk-BSOUMHMQ.js → chunk-IPTM5VE7.js} +101 -1094
- package/dist/chunk-IPTM5VE7.js.map +1 -0
- package/dist/chunk-JBOLNV2L.js +21 -0
- package/dist/chunk-JBOLNV2L.js.map +1 -0
- package/dist/chunk-JSR3HXFT.js +1231 -0
- package/dist/chunk-JSR3HXFT.js.map +1 -0
- package/dist/{chunk-I4KBHRZW.js → chunk-LH2FAQTI.js} +4 -4
- package/dist/{chunk-WVDRXD67.js → chunk-MLBZFB5A.js} +1 -1
- package/dist/chunk-MLBZFB5A.js.map +1 -0
- package/dist/{chunk-KFVEPQ7X.js → chunk-MVFHTUQ3.js} +2 -2
- package/dist/{chunk-BAVDDAN3.js → chunk-MZKTOX6X.js} +7 -7
- package/dist/{chunk-TJ627SKI.js → chunk-O3GZ77F7.js} +15 -1
- package/dist/chunk-O3GZ77F7.js.map +1 -0
- package/dist/{chunk-Q5KLE6ZF.js → chunk-OKPRQGFG.js} +2 -2
- package/dist/{chunk-QUDIOBHP.js → chunk-PD7ZXRHV.js} +139 -18
- package/dist/chunk-PD7ZXRHV.js.map +1 -0
- package/dist/chunk-QAHJSG53.js +30 -0
- package/dist/chunk-QAHJSG53.js.map +1 -0
- package/dist/{chunk-QTG2EXFT.js → chunk-QLOUSTQE.js} +2 -2
- package/dist/{chunk-QTG2EXFT.js.map → chunk-QLOUSTQE.js.map} +1 -1
- package/dist/{chunk-3SOJBMM6.js → chunk-R6BSRNU4.js} +6 -6
- package/dist/{chunk-3SOJBMM6.js.map → chunk-R6BSRNU4.js.map} +1 -1
- package/dist/{chunk-664YNAMR.js → chunk-RTFPKJJV.js} +5 -5
- package/dist/{chunk-GKR44BCH.js → chunk-RVDXBHUG.js} +2 -2
- package/dist/chunk-THLEVFEX.js +22 -0
- package/dist/chunk-THLEVFEX.js.map +1 -0
- package/dist/{chunk-A7Z27COA.js → chunk-VFWAZLEF.js} +3 -3
- package/dist/{chunk-3EJNDIAO.js → chunk-VZ5B2SIO.js} +2 -2
- package/dist/chunk-WAMQTZAH.js +19 -0
- package/dist/chunk-WAMQTZAH.js.map +1 -0
- package/dist/{chunk-FDHJ63FZ.js → chunk-WVA4Q6BX.js} +1 -1
- package/dist/{chunk-FDHJ63FZ.js.map → chunk-WVA4Q6BX.js.map} +1 -1
- package/dist/{cleanup-X556LNWM.js → cleanup-ELVHZPRC.js} +9 -9
- package/dist/{cleanup-command-RV2Q7G72.js → cleanup-command-5BY4FWAT.js} +12 -12
- package/dist/cli.js +143 -108
- package/dist/cli.js.map +1 -1
- package/dist/{clients-HP23HRN2.js → clients-WRPBRO6V.js} +2 -2
- package/dist/{codex-bootstrap-MGY2D6HU.js → codex-bootstrap-GYG7N4XU.js} +77 -34
- package/dist/codex-bootstrap-GYG7N4XU.js.map +1 -0
- package/dist/{codex-hook-IPX3PDXX.js → codex-hook-7ILIPLYM.js} +56 -48
- package/dist/codex-hook-7ILIPLYM.js.map +1 -0
- package/dist/{codify-J5ZLJ3HK.js → codify-HSDVRZFI.js} +11 -8
- package/dist/codify-HSDVRZFI.js.map +1 -0
- package/dist/{commands-L4AINARC.js → commands-X4KBCMHS.js} +115 -60
- package/dist/commands-X4KBCMHS.js.map +1 -0
- package/dist/{config-LUSJAK6B.js → config-TXJRCN3W.js} +2 -2
- package/dist/{configured-paths-SPQ5XWOM.js → configured-paths-4CRHLBIF.js} +4 -4
- package/dist/contract-B7NDKO5B.js +8 -0
- package/dist/{coordinator-SA75UB3C.js → coordinator-ZMD3467F.js} +231 -144
- package/dist/coordinator-ZMD3467F.js.map +1 -0
- package/dist/corpus-PUBXCCSN.js +15 -0
- package/dist/{doctor-DSC36R4U.js → doctor-RPXETRSJ.js} +18 -18
- package/dist/{feature-directories-VOHVV26X.js → feature-directories-ASNDEM7J.js} +6 -6
- package/dist/{finalization-7SMLMVLV.js → finalization-BGPOEBAL.js} +2 -2
- package/dist/{gh-cli-ZMO7D2KE.js → gh-cli-OTX7PORT.js} +2 -2
- package/dist/{github-rest-KGKS4V2H.js → github-rest-JCW32377.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/{job-CDADLJDF.js → job-NXXG4U5K.js} +20 -21
- package/dist/job-NXXG4U5K.js.map +1 -0
- package/dist/{learning-sync-6BTHM6ZC.js → learning-sync-2WIAOTW3.js} +4 -4
- package/dist/{legacy-global-guidance-2JL4Y5EB.js → legacy-global-guidance-WTDI53H7.js} +5 -5
- package/dist/{lint-gherkin-COSHVS6Z.js → lint-gherkin-LS3CHW3J.js} +7 -7
- package/dist/{operations-XVRQSLJG.js → operations-OZKEQCS4.js} +12 -12
- package/dist/{output-3LB2OEHN.js → output-ZYTEW6SC.js} +2 -2
- package/dist/{packet-5WT5M3OS.js → packet-7S6CZJQR.js} +2 -2
- package/dist/presets/typescript/index.js +2 -2
- package/dist/{profile-UMKQ5JVO.js → profile-SDFSBKH5.js} +7 -7
- package/dist/{prompt-GWYDFMLO.js → prompt-LYPODDC3.js} +2 -2
- package/dist/remove-P5JQNS5P.js +23 -0
- package/dist/{retro-IFSVU5KS.js → retro-EQK2Z2Z6.js} +8 -8
- package/dist/{retro-draft-spool-4S3TCHWL.js → retro-draft-spool-MDPBVM6J.js} +2 -2
- package/dist/{retro-extract-OSBFAXLU.js → retro-extract-CZMDD4WB.js} +2 -2
- package/dist/{review-pr-6S2352CK.js → review-pr-CWRD446M.js} +2 -2
- package/dist/{review-pr-publication-CGHCRRUI.js → review-pr-publication-AIX2U3VM.js} +2 -2
- package/dist/{run-5JESKXUR.js → run-T45X6Z6C.js} +4 -4
- package/dist/{self-report-VPHBPPSJ.js → self-report-V7PHKTS6.js} +2 -2
- package/dist/status-F5TFEIZ6.js +21 -0
- package/dist/{status-EX4L3ELO.js → status-S24PDFXB.js} +18 -18
- package/dist/{sync-config-O7J7IDGE.js → sync-config-EUVBPUUG.js} +5 -5
- package/dist/{sync-tracker-U2GYOFUO.js → sync-tracker-5FSIIAMS.js} +6 -6
- package/dist/{test-execution-6LIPMBIH.js → test-execution-HASVO6EL.js} +8 -7
- package/dist/{test-execution-6LIPMBIH.js.map → test-execution-HASVO6EL.js.map} +1 -1
- package/dist/{test-plan-VASHZXJ7.js → test-plan-EM3PVGIX.js} +7 -6
- package/dist/{test-plan-VASHZXJ7.js.map → test-plan-EM3PVGIX.js.map} +1 -1
- package/dist/{ticket-new-3YXDIWPC.js → ticket-new-H6ZNIRS4.js} +11 -11
- package/dist/ticket-new-H6ZNIRS4.js.map +1 -0
- package/dist/{ticket-sync-LLUBXZ2R.js → ticket-sync-7QRH6PVT.js} +5 -5
- package/dist/{tracker-map-HR4MBYG5.js → tracker-map-7AGCTWBZ.js} +2 -2
- package/dist/{tracker-sync-YDICZN66.js → tracker-sync-MLVYGFQJ.js} +2 -2
- package/package.json +1 -1
- package/templates/SAFEWORD.md +2 -2
- package/templates/commands/lint.md +1 -1
- package/templates/scripts/closeout-cleanup.ts +127 -31
- package/templates/skills/bdd/SCENARIOS.md +3 -0
- package/templates/skills/bdd/TDD.md +11 -5
- package/templates/skills/closeout/SKILL.md +25 -17
- package/templates/skills/finish-review/SKILL.md +4 -3
- package/templates/skills/lint/SKILL.md +1 -1
- package/templates/skills/review-spec/SKILL.md +5 -1
- package/templates/skills/self-review/SKILL.md +2 -2
- package/templates/skills/ticket-system/SKILL.md +3 -0
- package/dist/chunk-6S7CTKGC.js +0 -128
- package/dist/chunk-6S7CTKGC.js.map +0 -1
- package/dist/chunk-BSOUMHMQ.js.map +0 -1
- package/dist/chunk-J7UDLLTK.js.map +0 -1
- package/dist/chunk-KXHVFCDT.js.map +0 -1
- package/dist/chunk-NOTBZCKG.js.map +0 -1
- package/dist/chunk-QUDIOBHP.js.map +0 -1
- package/dist/chunk-S2T356DA.js.map +0 -1
- package/dist/chunk-SME5SU3O.js.map +0 -1
- package/dist/chunk-TJ627SKI.js.map +0 -1
- package/dist/chunk-USPVNZ63.js.map +0 -1
- package/dist/chunk-V63TSN3C.js.map +0 -1
- package/dist/chunk-WRUXO3WA.js +0 -48
- package/dist/chunk-WRUXO3WA.js.map +0 -1
- package/dist/chunk-WVDRXD67.js.map +0 -1
- package/dist/codex-bootstrap-MGY2D6HU.js.map +0 -1
- package/dist/codex-hook-IPX3PDXX.js.map +0 -1
- package/dist/codify-J5ZLJ3HK.js.map +0 -1
- package/dist/commands-L4AINARC.js.map +0 -1
- package/dist/contract-KEZY6YC3.js +0 -8
- package/dist/coordinator-SA75UB3C.js.map +0 -1
- package/dist/corpus-PPOBTF4J.js +0 -15
- package/dist/job-CDADLJDF.js.map +0 -1
- package/dist/remove-E6HGNHOU.js +0 -22
- package/dist/status-7VIGNTUI.js +0 -21
- package/dist/ticket-new-3YXDIWPC.js.map +0 -1
- /package/dist/{architecture-N5ZC4CDU.js.map → architecture-RQ377ZER.js.map} +0 -0
- /package/dist/{architecture-document-UBA5UT4J.js.map → architecture-document-KS3CLSYN.js.map} +0 -0
- /package/dist/{architecture-monorepo-E4JUYJGV.js.map → architecture-monorepo-NJWWU65G.js.map} +0 -0
- /package/dist/{boundary-HLJILY7R.js.map → boundary-OPTC2RVJ.js.map} +0 -0
- /package/dist/{chunk-4CZS4YJV.js.map → chunk-3OKZ3X4O.js.map} +0 -0
- /package/dist/{chunk-4CKCRZDO.js.map → chunk-7ULZND56.js.map} +0 -0
- /package/dist/{chunk-34NCOTP5.js.map → chunk-7XELS325.js.map} +0 -0
- /package/dist/{chunk-GZ36UZJG.js.map → chunk-CFME47IY.js.map} +0 -0
- /package/dist/{chunk-BQTC6YGN.js.map → chunk-D5ENZR6N.js.map} +0 -0
- /package/dist/{chunk-ZRV7TOCX.js.map → chunk-G5AFQXXW.js.map} +0 -0
- /package/dist/{chunk-I4KBHRZW.js.map → chunk-LH2FAQTI.js.map} +0 -0
- /package/dist/{chunk-KFVEPQ7X.js.map → chunk-MVFHTUQ3.js.map} +0 -0
- /package/dist/{chunk-BAVDDAN3.js.map → chunk-MZKTOX6X.js.map} +0 -0
- /package/dist/{chunk-Q5KLE6ZF.js.map → chunk-OKPRQGFG.js.map} +0 -0
- /package/dist/{chunk-664YNAMR.js.map → chunk-RTFPKJJV.js.map} +0 -0
- /package/dist/{chunk-GKR44BCH.js.map → chunk-RVDXBHUG.js.map} +0 -0
- /package/dist/{chunk-A7Z27COA.js.map → chunk-VFWAZLEF.js.map} +0 -0
- /package/dist/{chunk-3EJNDIAO.js.map → chunk-VZ5B2SIO.js.map} +0 -0
- /package/dist/{cleanup-X556LNWM.js.map → cleanup-ELVHZPRC.js.map} +0 -0
- /package/dist/{cleanup-command-RV2Q7G72.js.map → cleanup-command-5BY4FWAT.js.map} +0 -0
- /package/dist/{clients-HP23HRN2.js.map → clients-WRPBRO6V.js.map} +0 -0
- /package/dist/{config-LUSJAK6B.js.map → config-TXJRCN3W.js.map} +0 -0
- /package/dist/{configured-paths-SPQ5XWOM.js.map → configured-paths-4CRHLBIF.js.map} +0 -0
- /package/dist/{contract-KEZY6YC3.js.map → contract-B7NDKO5B.js.map} +0 -0
- /package/dist/{corpus-PPOBTF4J.js.map → corpus-PUBXCCSN.js.map} +0 -0
- /package/dist/{doctor-DSC36R4U.js.map → doctor-RPXETRSJ.js.map} +0 -0
- /package/dist/{feature-directories-VOHVV26X.js.map → feature-directories-ASNDEM7J.js.map} +0 -0
- /package/dist/{finalization-7SMLMVLV.js.map → finalization-BGPOEBAL.js.map} +0 -0
- /package/dist/{gh-cli-ZMO7D2KE.js.map → gh-cli-OTX7PORT.js.map} +0 -0
- /package/dist/{github-rest-KGKS4V2H.js.map → github-rest-JCW32377.js.map} +0 -0
- /package/dist/{learning-sync-6BTHM6ZC.js.map → learning-sync-2WIAOTW3.js.map} +0 -0
- /package/dist/{legacy-global-guidance-2JL4Y5EB.js.map → legacy-global-guidance-WTDI53H7.js.map} +0 -0
- /package/dist/{lint-gherkin-COSHVS6Z.js.map → lint-gherkin-LS3CHW3J.js.map} +0 -0
- /package/dist/{operations-XVRQSLJG.js.map → operations-OZKEQCS4.js.map} +0 -0
- /package/dist/{output-3LB2OEHN.js.map → output-ZYTEW6SC.js.map} +0 -0
- /package/dist/{packet-5WT5M3OS.js.map → packet-7S6CZJQR.js.map} +0 -0
- /package/dist/{profile-UMKQ5JVO.js.map → profile-SDFSBKH5.js.map} +0 -0
- /package/dist/{prompt-GWYDFMLO.js.map → prompt-LYPODDC3.js.map} +0 -0
- /package/dist/{remove-E6HGNHOU.js.map → remove-P5JQNS5P.js.map} +0 -0
- /package/dist/{retro-IFSVU5KS.js.map → retro-EQK2Z2Z6.js.map} +0 -0
- /package/dist/{retro-draft-spool-4S3TCHWL.js.map → retro-draft-spool-MDPBVM6J.js.map} +0 -0
- /package/dist/{retro-extract-OSBFAXLU.js.map → retro-extract-CZMDD4WB.js.map} +0 -0
- /package/dist/{review-pr-6S2352CK.js.map → review-pr-CWRD446M.js.map} +0 -0
- /package/dist/{review-pr-publication-CGHCRRUI.js.map → review-pr-publication-AIX2U3VM.js.map} +0 -0
- /package/dist/{run-5JESKXUR.js.map → run-T45X6Z6C.js.map} +0 -0
- /package/dist/{self-report-VPHBPPSJ.js.map → self-report-V7PHKTS6.js.map} +0 -0
- /package/dist/{status-7VIGNTUI.js.map → status-F5TFEIZ6.js.map} +0 -0
- /package/dist/{status-EX4L3ELO.js.map → status-S24PDFXB.js.map} +0 -0
- /package/dist/{sync-config-O7J7IDGE.js.map → sync-config-EUVBPUUG.js.map} +0 -0
- /package/dist/{sync-tracker-U2GYOFUO.js.map → sync-tracker-5FSIIAMS.js.map} +0 -0
- /package/dist/{ticket-sync-LLUBXZ2R.js.map → ticket-sync-7QRH6PVT.js.map} +0 -0
- /package/dist/{tracker-map-HR4MBYG5.js.map → tracker-map-7AGCTWBZ.js.map} +0 -0
- /package/dist/{tracker-sync-YDICZN66.js.map → tracker-sync-MLVYGFQJ.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WORKSPACE_ROOTS,
|
|
3
3
|
getWorkspacePackageNames
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OKPRQGFG.js";
|
|
5
5
|
import {
|
|
6
6
|
parse,
|
|
7
7
|
setupPythonTooling
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JSR3HXFT.js";
|
|
9
9
|
import {
|
|
10
10
|
SAFEWORD_PRIMARY_LINT_SCRIPT,
|
|
11
11
|
detect
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
NAMESPACE_ROOT_LEGACY,
|
|
15
15
|
readConfiguredPath,
|
|
16
16
|
resolveNamespaceRoot
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RVDXBHUG.js";
|
|
18
18
|
import {
|
|
19
19
|
ensureDirectory,
|
|
20
20
|
exists,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
removeIfEmpty,
|
|
29
29
|
writeFile,
|
|
30
30
|
writeJson
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-HF3DXZEA.js";
|
|
32
32
|
|
|
33
33
|
// src/reconcile.ts
|
|
34
|
-
import { lstatSync, readlinkSync, unlinkSync } from "fs";
|
|
34
|
+
import { lstatSync, readdirSync, readlinkSync, unlinkSync } from "fs";
|
|
35
35
|
import nodePath from "path";
|
|
36
36
|
var HUSKY_DIR = ".husky";
|
|
37
37
|
var CHMOD_PATHS = [".safeword/hooks", ".safeword/hooks/cursor", ".safeword/scripts"];
|
|
@@ -108,10 +108,7 @@ function passesTextPatchContentGuard(cwd, filePath, definition) {
|
|
|
108
108
|
return content !== void 0 && definition.applyWhenContentIncludes.every((required) => content.includes(required));
|
|
109
109
|
}
|
|
110
110
|
function planTextUnpatches(patches, ctx) {
|
|
111
|
-
const hasLegacyPreamble = (content, definition) =>
|
|
112
|
-
const firstLine = content.split("\n", 1)[0] ?? "";
|
|
113
|
-
return containsTextPatchContent(content, definition) || firstLine.includes(definition.marker);
|
|
114
|
-
};
|
|
111
|
+
const hasLegacyPreamble = (content, definition) => containsTextPatchContent(content, definition);
|
|
115
112
|
const actions = [];
|
|
116
113
|
for (const [filePath, entry] of Object.entries(patches)) {
|
|
117
114
|
if (shouldSkipForNonGit(filePath, ctx.isGitRepo)) continue;
|
|
@@ -161,15 +158,19 @@ function planManagedFileWrites(files, ctx) {
|
|
|
161
158
|
return exists(nodePath.join(c.cwd, filePath));
|
|
162
159
|
});
|
|
163
160
|
}
|
|
164
|
-
function planExistingDirectoriesRemoval(directories, cwd) {
|
|
161
|
+
function planExistingDirectoriesRemoval(directories, cwd, scheduledRemovals = /* @__PURE__ */ new Set()) {
|
|
165
162
|
const actions = [];
|
|
166
163
|
const removed = [];
|
|
167
164
|
for (const dir of directories) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
165
|
+
const fullPath = nodePath.join(cwd, dir);
|
|
166
|
+
if (!exists(fullPath)) continue;
|
|
171
167
|
actions.push({ type: "rmdir", path: dir });
|
|
172
|
-
removed
|
|
168
|
+
const plannedBeforeThisDirectory = /* @__PURE__ */ new Set([...scheduledRemovals, ...removed]);
|
|
169
|
+
const entries = readdirSync(fullPath);
|
|
170
|
+
const willBeEmpty = entries.every(
|
|
171
|
+
(entry) => plannedBeforeThisDirectory.has(nodePath.posix.join(dir, entry))
|
|
172
|
+
);
|
|
173
|
+
if (willBeEmpty) removed.push(dir);
|
|
173
174
|
}
|
|
174
175
|
return { actions, removed };
|
|
175
176
|
}
|
|
@@ -179,16 +180,24 @@ function matchesUnmodifiedScaffold(definition, ctx, installed) {
|
|
|
179
180
|
const normalize = definition.normalizeForUnmodifiedComparison;
|
|
180
181
|
return normalize === void 0 ? installed === expected : normalize(installed) === normalize(expected);
|
|
181
182
|
}
|
|
182
|
-
function
|
|
183
|
+
function matchesManagedScaffold(definition, ctx, installed) {
|
|
184
|
+
if (installed === void 0) return false;
|
|
185
|
+
if (definition.removeIfUnmodified !== void 0) {
|
|
186
|
+
return matchesUnmodifiedScaffold(definition, ctx, installed);
|
|
187
|
+
}
|
|
188
|
+
const expected = resolveFileContent(definition, ctx);
|
|
189
|
+
return expected !== void 0 && installed === expected;
|
|
190
|
+
}
|
|
191
|
+
function planConditionalManagedRemoval(managedFiles, ctx, includeAllUnmodified = false) {
|
|
183
192
|
const actions = [];
|
|
184
193
|
const removed = [];
|
|
185
194
|
for (const [filePath, definition] of Object.entries(managedFiles)) {
|
|
186
|
-
if (definition.removeIfUnmodified === void 0) continue;
|
|
195
|
+
if (!includeAllUnmodified && definition.removeIfUnmodified === void 0) continue;
|
|
187
196
|
if (isConfigOverridden(definition, ctx.cwd)) continue;
|
|
188
197
|
const fullPath = nodePath.join(ctx.cwd, filePath);
|
|
189
198
|
if (!exists(fullPath)) continue;
|
|
190
199
|
const installed = readFileSafe(fullPath);
|
|
191
|
-
if (
|
|
200
|
+
if (matchesManagedScaffold(definition, ctx, installed)) {
|
|
192
201
|
actions.push({ type: "rm", path: filePath });
|
|
193
202
|
removed.push(filePath);
|
|
194
203
|
}
|
|
@@ -249,7 +258,8 @@ function getClaudeParentDirectoryForCleanup(filePath) {
|
|
|
249
258
|
function resolveTextPatch(definition, ctx) {
|
|
250
259
|
return {
|
|
251
260
|
...definition,
|
|
252
|
-
content: typeof definition.content === "function" ? definition.content(ctx) : definition.content
|
|
261
|
+
content: typeof definition.content === "function" ? definition.content(ctx) : definition.content,
|
|
262
|
+
replacementAfterUnpatch: typeof definition.replacementAfterUnpatch === "function" ? definition.replacementAfterUnpatch(ctx) : definition.replacementAfterUnpatch
|
|
253
263
|
};
|
|
254
264
|
}
|
|
255
265
|
function withResolvedNamespaceRoot(schema, ctx) {
|
|
@@ -265,6 +275,7 @@ function withResolvedNamespaceRoot(schema, ctx) {
|
|
|
265
275
|
};
|
|
266
276
|
return {
|
|
267
277
|
...schema,
|
|
278
|
+
sharedDirs: schema.sharedDirs.map((path) => translate(path)),
|
|
268
279
|
preservedDirs: schema.preservedDirs.map((path) => translate(path)),
|
|
269
280
|
managedFiles: Object.fromEntries(
|
|
270
281
|
Object.entries(schema.managedFiles).map(([path, definition]) => [translate(path), definition]).filter(([translatedPath]) => translatedPath !== ".gitignore")
|
|
@@ -421,7 +432,11 @@ function computeUpgradePlan(schema, ctx) {
|
|
|
421
432
|
const deprecatedFiles = planExistingFilesRemoval(schema.deprecatedFiles, ctx.cwd);
|
|
422
433
|
actions.push(...deprecatedFiles.actions);
|
|
423
434
|
wouldRemove.push(...deprecatedFiles.removed);
|
|
424
|
-
const deprecatedDirectories = planExistingDirectoriesRemoval(
|
|
435
|
+
const deprecatedDirectories = planExistingDirectoriesRemoval(
|
|
436
|
+
schema.deprecatedDirs,
|
|
437
|
+
ctx.cwd,
|
|
438
|
+
new Set(wouldRemove)
|
|
439
|
+
);
|
|
425
440
|
actions.push(...deprecatedDirectories.actions);
|
|
426
441
|
wouldRemove.push(...deprecatedDirectories.removed);
|
|
427
442
|
actions.push({ type: "chmod", paths: CHMOD_PATHS });
|
|
@@ -468,7 +483,11 @@ function computeUninstallPlan(schema, ctx, full) {
|
|
|
468
483
|
const parentDirectory = getClaudeParentDirectoryForCleanup(filePath);
|
|
469
484
|
if (parentDirectory) directoriesToCleanup.add(parentDirectory);
|
|
470
485
|
}
|
|
471
|
-
const cleanupDirectories = planExistingDirectoriesRemoval(
|
|
486
|
+
const cleanupDirectories = planExistingDirectoriesRemoval(
|
|
487
|
+
[...directoriesToCleanup],
|
|
488
|
+
ctx.cwd,
|
|
489
|
+
new Set(wouldRemove)
|
|
490
|
+
);
|
|
472
491
|
actions.push(...cleanupDirectories.actions);
|
|
473
492
|
wouldRemove.push(...cleanupDirectories.removed);
|
|
474
493
|
for (const [filePath, definition] of Object.entries(schema.jsonMerges)) {
|
|
@@ -480,15 +499,22 @@ function computeUninstallPlan(schema, ctx, full) {
|
|
|
480
499
|
);
|
|
481
500
|
const dynamicChanges = planDynamicFileChanges(actions, ctx);
|
|
482
501
|
wouldRemove.push(...dynamicChanges.removed);
|
|
483
|
-
const preserved = planExistingDirectoriesRemoval(
|
|
502
|
+
const preserved = planExistingDirectoriesRemoval(
|
|
503
|
+
schema.preservedDirs.toReversed(),
|
|
504
|
+
ctx.cwd,
|
|
505
|
+
new Set(wouldRemove)
|
|
506
|
+
);
|
|
484
507
|
actions.push(...preserved.actions);
|
|
485
508
|
wouldRemove.push(...preserved.removed);
|
|
486
|
-
const owned = planExistingDirectoriesRemoval(
|
|
509
|
+
const owned = planExistingDirectoriesRemoval(
|
|
510
|
+
schema.ownedDirs.toReversed(),
|
|
511
|
+
ctx.cwd,
|
|
512
|
+
new Set(wouldRemove)
|
|
513
|
+
);
|
|
487
514
|
actions.push(...owned.actions);
|
|
488
515
|
wouldRemove.push(...owned.removed);
|
|
489
516
|
if (full) {
|
|
490
|
-
const
|
|
491
|
-
const managed = planExistingFilesRemoval(removable, ctx.cwd);
|
|
517
|
+
const managed = planConditionalManagedRemoval(schema.managedFiles, ctx, true);
|
|
492
518
|
actions.push(...managed.actions);
|
|
493
519
|
wouldRemove.push(...managed.removed);
|
|
494
520
|
} else {
|
|
@@ -496,7 +522,12 @@ function computeUninstallPlan(schema, ctx, full) {
|
|
|
496
522
|
actions.push(...conditional.actions);
|
|
497
523
|
wouldRemove.push(...conditional.removed);
|
|
498
524
|
}
|
|
499
|
-
|
|
525
|
+
let packagesToRemove = [];
|
|
526
|
+
if (full) {
|
|
527
|
+
packagesToRemove = computePackagesToRemove(schema, ctx.projectType, ctx.developmentDeps);
|
|
528
|
+
} else if (Object.hasOwn(ctx.developmentDeps, "safeword")) {
|
|
529
|
+
packagesToRemove = ["safeword"];
|
|
530
|
+
}
|
|
500
531
|
return {
|
|
501
532
|
actions,
|
|
502
533
|
wouldCreate: dynamicChanges.created,
|
|
@@ -791,6 +822,9 @@ function executeJsonUnmerge(cwd, path, definition, ctx) {
|
|
|
791
822
|
function rerenderBlockLines(definition) {
|
|
792
823
|
return definition.content.split("\n").filter((line) => line !== "" && !line.includes(definition.marker));
|
|
793
824
|
}
|
|
825
|
+
function isOwnedRerenderLine(line, expectedLine, definition) {
|
|
826
|
+
return line === expectedLine || expectedLine !== void 0 && definition.rerenderOwnedLinePattern?.test(line) === true;
|
|
827
|
+
}
|
|
794
828
|
function stripRerenderBlock(content, definition) {
|
|
795
829
|
const lines = content.split("\n");
|
|
796
830
|
const startIndex = lines.findIndex((line) => line.includes(definition.marker));
|
|
@@ -798,7 +832,10 @@ function stripRerenderBlock(content, definition) {
|
|
|
798
832
|
const blockLines = rerenderBlockLines(definition);
|
|
799
833
|
let endIndex = startIndex;
|
|
800
834
|
let expected = 0;
|
|
801
|
-
while (endIndex + 1 < lines.length
|
|
835
|
+
while (endIndex + 1 < lines.length) {
|
|
836
|
+
const nextLine = lines[endIndex + 1] ?? "";
|
|
837
|
+
const expectedLine = blockLines[expected];
|
|
838
|
+
if (!isOwnedRerenderLine(nextLine, expectedLine, definition)) break;
|
|
802
839
|
endIndex += 1;
|
|
803
840
|
expected += 1;
|
|
804
841
|
}
|
|
@@ -806,6 +843,15 @@ function stripRerenderBlock(content, definition) {
|
|
|
806
843
|
lines.splice(blockStart, endIndex - blockStart + 1);
|
|
807
844
|
return lines.join("\n").replaceAll(/\n{3,}/g, "\n\n");
|
|
808
845
|
}
|
|
846
|
+
function stripRerenderBlocks(content, definition) {
|
|
847
|
+
let stripped = content;
|
|
848
|
+
while (stripped.includes(definition.marker)) {
|
|
849
|
+
const next = stripRerenderBlock(stripped, definition);
|
|
850
|
+
if (next === stripped) break;
|
|
851
|
+
stripped = next;
|
|
852
|
+
}
|
|
853
|
+
return stripped;
|
|
854
|
+
}
|
|
809
855
|
function executeTextPatch(cwd, path, definition) {
|
|
810
856
|
if (definition.rerender && definition.operation !== "append") {
|
|
811
857
|
throw new Error(`rerender text patch ${path} must use operation: 'append'`);
|
|
@@ -820,11 +866,13 @@ function computePatchedContent(original, definition) {
|
|
|
820
866
|
if (content.includes(definition.marker)) {
|
|
821
867
|
return healAlreadyPatchedContent(content, definition);
|
|
822
868
|
}
|
|
823
|
-
|
|
869
|
+
if (definition.operation === "prepend") return definition.content + content;
|
|
870
|
+
const separator = content !== "" && !content.endsWith("\n") && !definition.content.startsWith("\n") ? "\n" : "";
|
|
871
|
+
return content + separator + definition.content;
|
|
824
872
|
}
|
|
825
873
|
function healAlreadyPatchedContent(content, definition) {
|
|
826
874
|
if (definition.rerender && !content.includes(definition.content)) {
|
|
827
|
-
return
|
|
875
|
+
return stripRerenderBlocks(content, definition) + definition.content;
|
|
828
876
|
}
|
|
829
877
|
let healed = content;
|
|
830
878
|
if (healed.includes("\n\n---#")) {
|
|
@@ -834,8 +882,8 @@ function healAlreadyPatchedContent(content, definition) {
|
|
|
834
882
|
}
|
|
835
883
|
function computeUnpatchedContent(content, definition) {
|
|
836
884
|
let unpatched = removeExactTextPatchContent(content, definition);
|
|
837
|
-
if (
|
|
838
|
-
unpatched =
|
|
885
|
+
if (definition.rerender && unpatched.includes(definition.marker)) {
|
|
886
|
+
unpatched = stripRerenderBlocks(unpatched, definition);
|
|
839
887
|
}
|
|
840
888
|
if (unpatched === content && content.startsWith(definition.marker)) {
|
|
841
889
|
const separatorIndex = content.indexOf("\n---");
|
|
@@ -848,7 +896,10 @@ function computeUnpatchedContent(content, definition) {
|
|
|
848
896
|
unpatched = content.split("\n").slice(1).join("\n").replace(/^\n+/, "");
|
|
849
897
|
unpatched = stripLeadingSafewordSeparator(unpatched);
|
|
850
898
|
}
|
|
851
|
-
return unpatched;
|
|
899
|
+
return appendReplacementAfterUnpatch(content, unpatched, definition.replacementAfterUnpatch);
|
|
900
|
+
}
|
|
901
|
+
function appendReplacementAfterUnpatch(original, unpatched, replacement) {
|
|
902
|
+
return unpatched === original || replacement === void 0 ? unpatched : unpatched + replacement;
|
|
852
903
|
}
|
|
853
904
|
function executeTextUnpatch(cwd, path, definition) {
|
|
854
905
|
const fullPath = nodePath.join(cwd, path);
|
|
@@ -881,7 +932,7 @@ function shouldRemoveTextPatchTarget(content, definition) {
|
|
|
881
932
|
import {
|
|
882
933
|
existsSync,
|
|
883
934
|
lstatSync as lstatSync2,
|
|
884
|
-
readdirSync,
|
|
935
|
+
readdirSync as readdirSync2,
|
|
885
936
|
readFileSync,
|
|
886
937
|
realpathSync,
|
|
887
938
|
writeFileSync
|
|
@@ -1008,7 +1059,7 @@ function expandMemberPattern(cwd, pattern) {
|
|
|
1008
1059
|
const fullPath = nodePath2.join(cwd, baseDirectory);
|
|
1009
1060
|
if (!existsSync(fullPath)) return [];
|
|
1010
1061
|
try {
|
|
1011
|
-
const entries =
|
|
1062
|
+
const entries = readdirSync2(fullPath, { withFileTypes: true });
|
|
1012
1063
|
return entries.filter((entry) => {
|
|
1013
1064
|
if (!entry.isDirectory()) return false;
|
|
1014
1065
|
const cargoPath = nodePath2.join(fullPath, entry.name, "Cargo.toml");
|
|
@@ -1125,7 +1176,7 @@ var pythonPack = {
|
|
|
1125
1176
|
name: "Python",
|
|
1126
1177
|
extensions: [".py", ".pyi"],
|
|
1127
1178
|
detect(cwd) {
|
|
1128
|
-
return existsInTree(cwd, "pyproject.toml") || existsInTree(cwd, "requirements.txt");
|
|
1179
|
+
return existsInTree(cwd, "pyproject.toml") || existsInTree(cwd, "requirements.txt") || existsInTree(cwd, "Pipfile") || existsInTree(cwd, "setup.py") || existsInTree(cwd, "setup.cfg");
|
|
1129
1180
|
},
|
|
1130
1181
|
setup(_cwd, _ctx) {
|
|
1131
1182
|
return setupPythonTooling();
|
|
@@ -1146,7 +1197,7 @@ var rustPack = {
|
|
|
1146
1197
|
};
|
|
1147
1198
|
|
|
1148
1199
|
// src/packs/sql/index.ts
|
|
1149
|
-
import { existsSync as existsSync2, readdirSync as
|
|
1200
|
+
import { existsSync as existsSync2, readdirSync as readdirSync3 } from "fs";
|
|
1150
1201
|
import nodePath4 from "path";
|
|
1151
1202
|
var TIER1_MARKERS = [
|
|
1152
1203
|
"dbt_project.yml",
|
|
@@ -1164,13 +1215,13 @@ var TIER2_DIRECTORIES = ["prisma/migrations", "drizzle", "db/migrations"];
|
|
|
1164
1215
|
function directoryHasSqlFiles(directory) {
|
|
1165
1216
|
if (!existsSync2(directory)) return false;
|
|
1166
1217
|
try {
|
|
1167
|
-
const entries =
|
|
1218
|
+
const entries = readdirSync3(directory, { withFileTypes: true });
|
|
1168
1219
|
if (entries.some((entry) => entry.isFile() && entry.name.endsWith(".sql"))) return true;
|
|
1169
1220
|
for (const entry of entries) {
|
|
1170
1221
|
if (!entry.isDirectory()) {
|
|
1171
1222
|
continue;
|
|
1172
1223
|
}
|
|
1173
|
-
const subEntries =
|
|
1224
|
+
const subEntries = readdirSync3(nodePath4.join(directory, entry.name));
|
|
1174
1225
|
if (subEntries.some((f) => f.endsWith(".sql"))) return true;
|
|
1175
1226
|
}
|
|
1176
1227
|
return false;
|
|
@@ -1305,7 +1356,7 @@ function detectHookManagerWorld(cwd, allDependencies) {
|
|
|
1305
1356
|
}
|
|
1306
1357
|
|
|
1307
1358
|
// src/utils/project-detector.ts
|
|
1308
|
-
import { existsSync as existsSync3, readdirSync as
|
|
1359
|
+
import { existsSync as existsSync3, readdirSync as readdirSync4, readFileSync as readFileSync2 } from "fs";
|
|
1309
1360
|
import nodePath8 from "path";
|
|
1310
1361
|
|
|
1311
1362
|
// src/utils/cucumber-template-revisions.ts
|
|
@@ -1381,7 +1432,7 @@ function hasShellScripts(cwd, maxDepth = 4) {
|
|
|
1381
1432
|
function scan(dir, depth) {
|
|
1382
1433
|
if (depth > maxDepth) return false;
|
|
1383
1434
|
try {
|
|
1384
|
-
const entries =
|
|
1435
|
+
const entries = readdirSync4(dir, { withFileTypes: true });
|
|
1385
1436
|
for (const entry of entries) {
|
|
1386
1437
|
if (entry.isFile() && entry.name.endsWith(".sh")) {
|
|
1387
1438
|
return true;
|
|
@@ -1508,7 +1559,7 @@ function isJsSourceFile(name, depth) {
|
|
|
1508
1559
|
function scanForJsSource(directory, depth, maxDepth) {
|
|
1509
1560
|
let entries;
|
|
1510
1561
|
try {
|
|
1511
|
-
entries =
|
|
1562
|
+
entries = readdirSync4(directory, { withFileTypes: true });
|
|
1512
1563
|
} catch {
|
|
1513
1564
|
return false;
|
|
1514
1565
|
}
|
|
@@ -1559,7 +1610,7 @@ function findCucumberEvidenceInPackage(cwd, packagePath) {
|
|
|
1559
1610
|
function findCucumberEvidenceUnderRoot(cwd, root) {
|
|
1560
1611
|
let entries;
|
|
1561
1612
|
try {
|
|
1562
|
-
entries =
|
|
1613
|
+
entries = readdirSync4(nodePath8.join(cwd, root), { withFileTypes: true });
|
|
1563
1614
|
} catch {
|
|
1564
1615
|
return void 0;
|
|
1565
1616
|
}
|
|
@@ -1646,4 +1697,4 @@ export {
|
|
|
1646
1697
|
LEFTHOOK_CONFIGS,
|
|
1647
1698
|
createProjectContext
|
|
1648
1699
|
};
|
|
1649
|
-
//# sourceMappingURL=chunk-
|
|
1700
|
+
//# sourceMappingURL=chunk-2XR7J5WL.js.map
|