@@ -20,78 +20,76 @@ import type { RangeStyle } from '../../utils/semver.mts'
2020
2121const { DRY_RUN_NOT_SAVING } = constants
2222
23- const flags : CliCommandConfig [ 'flags' ] = {
24- ...commonFlags ,
25- autoMerge : {
26- type : 'boolean' ,
27- default : false ,
28- description : `Enable auto-merge for pull requests that Socket opens.\n See ${ terminalLink (
29- 'GitHub documentation' ,
30- 'https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository' ,
31- ) } for managing auto-merge for pull requests in your repository.`,
32- } ,
33- autopilot : {
34- type : 'boolean' ,
35- default : false ,
36- description : `Shorthand for --autoMerge --test` ,
37- } ,
38- ghsa : {
39- type : 'string' ,
40- default : [ ] ,
41- description : `Provide a list of ${ terminalLink (
42- 'GHSA IDs' ,
43- 'https://docs.github.com/en/code-security/security-advisories/working-with-global-security-advisories-from-the-github-advisory-database/about-the-github-advisory-database#about-ghsa-ids' ,
44- ) } to compute fixes for, as either a comma separated value or as multiple flags.\n Use '--ghsa auto' to automatically lookup GHSA IDs and compute fixes for them.`,
45- isMultiple : true ,
46- } ,
47- limit : {
48- type : 'number' ,
49- default : Infinity ,
50- description : 'The number of fixes to attempt at a time' ,
51- } ,
52- purl : {
53- type : 'string' ,
54- default : [ ] ,
55- description : `Provide a list of ${ terminalLink (
56- 'PURLs' ,
57- 'https://github.com/package-url/purl-spec?tab=readme-ov-file#purl' ,
58- ) } to compute fixes for, as either a comma separated value or as multiple flags,\n instead of querying the Socket API`,
59- isMultiple : true ,
60- shortFlag : 'p' ,
61- } ,
62- rangeStyle : {
63- type : 'string' ,
64- default : 'preserve' ,
65- description : `
66- Define how updated dependency versions should be written in package.json.
67- Available styles:
68- * caret - Use ^ range for compatible updates (e.g. ^1.2.3)
69- * gt - Use > to allow any newer version (e.g. >1.2.3)
70- * gte - Use >= to allow any newer version (e.g. >=1.2.3)
71- * lt - Use < to allow only lower versions (e.g. <1.2.3)
72- * lte - Use <= to allow only lower versions (e.g. <=1.2.3)
73- * pin - Use the exact version (e.g. 1.2.3)
74- * preserve - Retain the existing version range style as-is
75- * tilde - Use ~ range for patch/minor updates (e.g. ~1.2.3)
76- ` . trim ( ) ,
77- } ,
78- test : {
79- type : 'boolean' ,
80- default : false ,
81- description : 'Verify the fix by running unit tests' ,
82- } ,
83- testScript : {
84- type : 'string' ,
85- default : 'test' ,
86- description : 'The test script to run for each fix attempt' ,
87- } ,
88- }
89-
9023const config : CliCommandConfig = {
9124 commandName : 'fix' ,
9225 description : 'Update dependencies with "fixable" Socket alerts' ,
9326 hidden : false ,
94- flags,
27+ flags : {
28+ ...commonFlags ,
29+ autoMerge : {
30+ type : 'boolean' ,
31+ default : false ,
32+ description : `Enable auto-merge for pull requests that Socket opens.\n See ${ terminalLink (
33+ 'GitHub documentation' ,
34+ 'https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository' ,
35+ ) } for managing auto-merge for pull requests in your repository.`,
36+ } ,
37+ autopilot : {
38+ type : 'boolean' ,
39+ default : false ,
40+ description : `Shorthand for --autoMerge --test` ,
41+ } ,
42+ ghsa : {
43+ type : 'string' ,
44+ default : [ ] ,
45+ description : `Provide a list of ${ terminalLink (
46+ 'GHSA IDs' ,
47+ 'https://docs.github.com/en/code-security/security-advisories/working-with-global-security-advisories-from-the-github-advisory-database/about-the-github-advisory-database#about-ghsa-ids' ,
48+ ) } to compute fixes for, as either a comma separated value or as multiple flags.\n Use '--ghsa auto' to automatically lookup GHSA IDs and compute fixes for them.`,
49+ isMultiple : true ,
50+ } ,
51+ limit : {
52+ type : 'number' ,
53+ default : Infinity ,
54+ description : 'The number of fixes to attempt at a time' ,
55+ } ,
56+ purl : {
57+ type : 'string' ,
58+ default : [ ] ,
59+ description : `Provide a list of ${ terminalLink (
60+ 'PURLs' ,
61+ 'https://github.com/package-url/purl-spec?tab=readme-ov-file#purl' ,
62+ ) } to compute fixes for, as either a comma separated value or as multiple flags,\n instead of querying the Socket API`,
63+ isMultiple : true ,
64+ shortFlag : 'p' ,
65+ } ,
66+ rangeStyle : {
67+ type : 'string' ,
68+ default : 'preserve' ,
69+ description : `
70+ Define how updated dependency versions should be written in package.json.
71+ Available styles:
72+ * caret - Use ^ range for compatible updates (e.g. ^1.2.3)
73+ * gt - Use > to allow any newer version (e.g. >1.2.3)
74+ * gte - Use >= to allow any newer version (e.g. >=1.2.3)
75+ * lt - Use < to allow only lower versions (e.g. <1.2.3)
76+ * lte - Use <= to allow only lower versions (e.g. <=1.2.3)
77+ * pin - Use the exact version (e.g. 1.2.3)
78+ * preserve - Retain the existing version range style as-is
79+ * tilde - Use ~ range for patch/minor updates (e.g. ~1.2.3)
80+ ` . trim ( ) ,
81+ } ,
82+ test : {
83+ type : 'boolean' ,
84+ default : false ,
85+ description : 'Verify the fix by running unit tests' ,
86+ } ,
87+ testScript : {
88+ type : 'string' ,
89+ default : 'test' ,
90+ description : 'The test script to run for each fix attempt' ,
91+ } ,
92+ } ,
9593 help : ( command , config ) => `
9694 Usage
9795 $ ${ command } [options] [CWD=.]
0 commit comments