@@ -21,13 +21,6 @@ interface PURL {
2121 subpath ?: string
2222}
2323
24- export interface HandlePatchConfig {
25- cwd : string
26- outputKind : OutputKind
27- packages : string [ ]
28- spinner : typeof constants . spinner
29- }
30-
3124async function applyNPMPatches (
3225 patches : Array < { key : string ; purl : PURL ; patch : PatchRecord } > ,
3326 dryRun : boolean ,
@@ -280,26 +273,33 @@ async function readPackageJson(
280273 return null
281274}
282275
276+ export interface HandlePatchConfig {
277+ cwd : string
278+ dryRun : boolean
279+ outputKind : OutputKind
280+ packages : string [ ]
281+ spinner : typeof constants . spinner
282+ }
283+
283284export async function handlePatch ( {
284285 cwd,
286+ dryRun,
285287 outputKind,
286288 packages,
287289 spinner,
288290} : HandlePatchConfig ) : Promise < void > {
289- const dryRun = false // TODO: Add dryRun support via config
290-
291291 try {
292292 const dotSocketDirPath = path . join ( cwd , '.socket' )
293293 const manifestPath = path . join ( dotSocketDirPath , 'manifest.json' )
294294
295- // Read the manifest file
295+ // Read the manifest file.
296296 const manifestContent = await fs . readFile ( manifestPath , 'utf-8' )
297297 const manifestData = JSON . parse ( manifestContent )
298298
299- // Validate the schema
299+ // Validate the schema.
300300 const validated = PatchManifestSchema . parse ( manifestData )
301301
302- // Parse PURLs and group by ecosystem
302+ // Parse PURLs and group by ecosystem.
303303 const patchesByEcosystem : Record <
304304 string ,
305305 Array < { key : string ; purl : PURL ; patch : PatchRecord } >
0 commit comments