Skip to content

Commit b63c0d4

Browse files
committed
Rename --compute-fixes-only to --only-compute and fix tests
1 parent d4a14e6 commit b63c0d4

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

src/commands/fix/cmd-fix.mts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ Available styles:
8383
* preserve - Retain the existing version range style as-is
8484
`.trim(),
8585
},
86-
outputFile: {
87-
type: 'string',
88-
default: '',
89-
description: 'Path to store upgrades as a JSON file at this path.',
90-
},
91-
computeFixesOnly: {
86+
onlyCompute: {
9287
type: 'boolean',
9388
default: false,
9489
description:
9590
'Compute fixes only, do not apply them. Logs what upgrades would be applied. If combined with --output-file, the output file will contain the upgrades that would be applied.',
9691
},
92+
outputFile: {
93+
type: 'string',
94+
default: '',
95+
description: 'Path to store upgrades as a JSON file at this path.',
96+
},
9797
}
9898

9999
const hiddenFlags: MeowFlags = {
@@ -190,11 +190,11 @@ async function run(
190190

191191
const {
192192
autopilot,
193-
computeFixesOnly,
194193
json,
195194
limit,
196195
markdown,
197196
maxSatisfying,
197+
onlyCompute,
198198
outputFile,
199199
prCheck,
200200
rangeStyle,
@@ -212,7 +212,7 @@ async function run(
212212
rangeStyle: RangeStyle
213213
unknownFlags?: string[]
214214
outputFile: string
215-
computeFixesOnly: boolean
215+
onlyCompute: boolean
216216
}
217217

218218
const dryRun = !!cli.flags['dryRun']
@@ -281,7 +281,7 @@ async function run(
281281
rangeStyle,
282282
spinner,
283283
unknownFlags,
284-
computeFixesOnly,
284+
onlyCompute,
285285
outputFile,
286286
})
287287
}

src/commands/fix/cmd-fix.test.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ describe('socket fix', async () => {
7272
--json Output result as json
7373
--limit The number of fixes to attempt at a time (default 10)
7474
--markdown Output result as markdown
75+
--only-compute Compute fixes only, do not apply them. Logs what upgrades would be applied. If combined with --output-file, the output file will contain the upgrades that would be applied.
76+
--output-file Path to store upgrades as a JSON file at this path.
7577
--range-style Define how dependency version ranges are updated in package.json (default 'preserve').
7678
Available styles:
7779
* pin - Use the exact version (e.g. 1.2.3)

src/commands/fix/coana-fix.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ export async function coanaFix(
3939
): Promise<CResult<{ fixed: boolean }>> {
4040
const {
4141
autopilot,
42-
computeFixesOnly,
4342
cwd,
4443
ghsas,
4544
limit,
45+
onlyCompute,
4646
orgSlug,
4747
outputFile,
4848
spinner,
@@ -117,7 +117,7 @@ export async function coanaFix(
117117
? ['--range-style', fixConfig.rangeStyle]
118118
: []),
119119
...fixConfig.unknownFlags,
120-
...(computeFixesOnly ? ['--dry-run'] : []),
120+
...(onlyCompute ? ['--dry-run'] : []),
121121
...(outputFile ? ['--output-file', outputFile] : []),
122122
],
123123
fixConfig.orgSlug,

src/commands/fix/handle-fix.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type HandleFixConfig = Remap<
1818
orgSlug: string
1919
outputKind: OutputKind
2020
unknownFlags: string[]
21-
computeFixesOnly: boolean
21+
onlyCompute: boolean
2222
outputFile: string
2323
}
2424
>
@@ -89,11 +89,11 @@ export async function convertIdsToGhsas(ids: string[]): Promise<string[]> {
8989

9090
export async function handleFix({
9191
autopilot,
92-
computeFixesOnly,
9392
cwd,
9493
ghsas,
9594
limit,
9695
minSatisfying,
96+
onlyCompute,
9797
orgSlug,
9898
outputFile,
9999
outputKind,
@@ -115,7 +115,7 @@ export async function handleFix({
115115
rangeStyle,
116116
spinner,
117117
unknownFlags,
118-
computeFixesOnly,
118+
onlyCompute,
119119
outputFile,
120120
}),
121121
outputKind,

src/commands/fix/types.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export type FixConfig = {
1212
rangeStyle: RangeStyle
1313
spinner: Spinner | undefined
1414
unknownFlags: string[]
15-
computeFixesOnly: boolean
15+
onlyCompute: boolean
1616
outputFile: string
1717
}

0 commit comments

Comments
 (0)