Skip to content

Commit 12efcd2

Browse files
authored
Merge branch 'main' into exit_report
2 parents 46fa7f9 + 1be54c8 commit 12efcd2

File tree

12 files changed

+38
-24
lines changed

12 files changed

+38
-24
lines changed

src/cli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { pathToFileURL } from 'node:url'
66
import { messageWithCauses, stackWithCauses } from 'pony-cause'
77
import updateNotifier from 'tiny-updater'
88

9+
import { debugLog } from '@socketsecurity/registry/lib/debug'
910
import { logger } from '@socketsecurity/registry/lib/logger'
1011

1112
import { cmdAnalytics } from './commands/analytics/cmd-analytics'
@@ -107,9 +108,10 @@ void (async () => {
107108
} else {
108109
errorTitle = 'Unexpected error with no details'
109110
}
111+
logger.error('\n') // Any-spinner-newline
110112
logger.fail(failMsgWithBadge(errorTitle, errorMessage))
111113
if (errorBody) {
112-
logger.error(`\n${errorBody}`)
114+
debugLog(`${errorBody}`)
113115
}
114116
await captureException(e)
115117
}

src/commands/info/cmd-info.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ describe('socket info', async () => {
2323
Usage
2424
$ socket info <name>
2525
26+
Note: this command will be deprecated in favor of \`socket package score\` soon
27+
2628
Options
2729
--all Include all issues
2830
--dryRun Do input validation for a command and exit 0 when input is ok

src/commands/info/cmd-info.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ const config: CliCommandConfig = {
2424
Usage
2525
$ ${command} <name>
2626
27+
Note: this command will be deprecated in favor of \`socket package score\` soon
28+
2729
Options
2830
${getFlagListOutput(config.flags, 6)}
2931

src/commands/package/cmd-package-score.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('socket package score', async () => {
1818
const { code, stderr, stdout } = await invokeNpm(entryPath, cmd)
1919
expect(stdout).toMatchInlineSnapshot(
2020
`
21-
"Look up score for one package which reflects all of its transitive dependencies as well
21+
"[beta] Look up score for one package which reflects all of its transitive dependencies as well
2222
2323
Usage
2424
$ socket package score <<ecosystem> <name> | <purl>>

src/commands/package/cmd-package-score.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const { DRY_RUN_BAIL_TEXT } = constants
1616
const config: CliCommandConfig = {
1717
commandName: 'score',
1818
description:
19-
'Look up score for one package which reflects all of its transitive dependencies as well',
20-
hidden: true,
19+
'[beta] Look up score for one package which reflects all of its transitive dependencies as well',
20+
hidden: false,
2121
flags: {
2222
...commonFlags,
2323
...outputFlags

src/commands/package/cmd-package-shallow.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('socket package shallow', async () => {
1818
const { code, stderr, stdout } = await invokeNpm(entryPath, cmd)
1919
expect(stdout).toMatchInlineSnapshot(
2020
`
21-
"Look up info regarding one or more packages but not their transitives
21+
"[beta] Look up info regarding one or more packages but not their transitives
2222
2323
Usage
2424
$ socket package shallow <<ecosystem> <name> [<name> ...] | <purl> [<purl> ...]>

src/commands/package/cmd-package-shallow.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const { DRY_RUN_BAIL_TEXT } = constants
1515
const config: CliCommandConfig = {
1616
commandName: 'shallow',
1717
description:
18-
'Look up info regarding one or more packages but not their transitives',
19-
hidden: true,
18+
'[beta] Look up info regarding one or more packages but not their transitives',
19+
hidden: false,
2020
flags: {
2121
...commonFlags,
2222
...outputFlags

src/commands/package/cmd-package.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ describe('socket package', async () => {
2424
$ socket package <command>
2525
2626
Commands
27-
(none)
27+
score [beta] Look up score for one package which reflects all of its transitive dependencies as well
28+
shallow [beta] Look up info regarding one or more packages but not their transitives
2829
2930
Options
3031
--dryRun Do input validation for a command and exit 0 when input is ok

src/commands/package/cmd-package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const description = 'Commands relating to looking up published packages'
88

99
export const cmdPackage: CliSubcommand = {
1010
description,
11-
hidden: true, // [beta]
11+
hidden: false,
1212
async run(argv, importMeta, { parentName }) {
1313
await meowWithSubcommands(
1414
{

src/commands/scan/cmd-scan-create.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,24 +161,28 @@ async function run(
161161
})
162162

163163
const {
164+
branch: branchName = '',
164165
cwd: cwdOverride,
165166
defaultBranch,
166167
dryRun,
167168
json,
168169
markdown,
169170
pendingHead,
170171
readOnly,
172+
repo: repoName = '',
171173
report,
172174
tmp
173175
} = cli.flags as {
176+
branch: string
174177
cwd: string
178+
defaultBranch: boolean
175179
dryRun: boolean
176-
report: boolean
177180
json: boolean
178181
markdown: boolean
179-
defaultBranch: boolean
180182
pendingHead: boolean
181183
readOnly: boolean
184+
repo: string
185+
report: boolean
182186
tmp: boolean
183187
}
184188
const defaultOrgSlug = getConfigValue('defaultOrg')
@@ -189,10 +193,6 @@ async function run(
189193
cwdOverride && cwdOverride !== 'process.cwd()'
190194
? String(cwdOverride)
191195
: process.cwd()
192-
const { branch: branchName = '', repo: repoName = '' } = cli.flags as {
193-
branch: string
194-
repo: string
195-
}
196196

197197
// We're going to need an api token to suggest data because those suggestions
198198
// must come from data we already know. Don't error on missing api token yet.

0 commit comments

Comments
 (0)