@@ -21,13 +21,6 @@ interface PURL {
21
21
subpath ?: string
22
22
}
23
23
24
- export interface HandlePatchConfig {
25
- cwd : string
26
- outputKind : OutputKind
27
- packages : string [ ]
28
- spinner : typeof constants . spinner
29
- }
30
-
31
24
async function applyNPMPatches (
32
25
patches : Array < { key : string ; purl : PURL ; patch : PatchRecord } > ,
33
26
dryRun : boolean ,
@@ -280,26 +273,33 @@ async function readPackageJson(
280
273
return null
281
274
}
282
275
276
+ export interface HandlePatchConfig {
277
+ cwd : string
278
+ dryRun : boolean
279
+ outputKind : OutputKind
280
+ packages : string [ ]
281
+ spinner : typeof constants . spinner
282
+ }
283
+
283
284
export async function handlePatch ( {
284
285
cwd,
286
+ dryRun,
285
287
outputKind,
286
288
packages,
287
289
spinner,
288
290
} : HandlePatchConfig ) : Promise < void > {
289
- const dryRun = false // TODO: Add dryRun support via config
290
-
291
291
try {
292
292
const dotSocketDirPath = path . join ( cwd , '.socket' )
293
293
const manifestPath = path . join ( dotSocketDirPath , 'manifest.json' )
294
294
295
- // Read the manifest file
295
+ // Read the manifest file.
296
296
const manifestContent = await fs . readFile ( manifestPath , 'utf-8' )
297
297
const manifestData = JSON . parse ( manifestContent )
298
298
299
- // Validate the schema
299
+ // Validate the schema.
300
300
const validated = PatchManifestSchema . parse ( manifestData )
301
301
302
- // Parse PURLs and group by ecosystem
302
+ // Parse PURLs and group by ecosystem.
303
303
const patchesByEcosystem : Record <
304
304
string ,
305
305
Array < { key : string ; purl : PURL ; patch : PatchRecord } >
0 commit comments