11import meow from 'meow'
22import colors from 'yoctocolors-cjs'
33
4+ import constants from '@socketsecurity/registry/lib/constants'
45import { Spinner } from '@socketsecurity/registry/lib/spinner'
56
67import { commonFlags , outputFlags , validationFlags } from '../flags'
@@ -14,11 +15,17 @@ import { formatSeverityCount, getSeverityCount } from '../utils/format-issues'
1415import { getFlagListOutput } from '../utils/formatting'
1516import { objectSome } from '../utils/objects'
1617import { getPublicToken , setupSdk } from '../utils/sdk'
18+ import {
19+ getSocketDevAlertUrl ,
20+ getSocketDevPackageOverviewUrl
21+ } from '../utils/socket-url'
1722
1823import type { SocketIssue } from '../utils/format-issues'
1924import type { CliSubcommand } from '../utils/meow-with-subcommands'
2025import type { SocketSdkReturnType } from '@socketsecurity/sdk'
2126
27+ const { NPM } = constants
28+
2229export const info : CliSubcommand = {
2330 description : 'Look up info regarding a package' ,
2431 async run ( argv , importMeta , { parentName } ) {
@@ -208,7 +215,7 @@ function formatPackageDataOutput(
208215 }
209216
210217 const format = new ColorOrMarkdown ( ! ! outputMarkdown )
211- const url = `https://socket.dev/npm/package/ ${ pkgName } /overview/ ${ pkgVersion } `
218+ const url = getSocketDevPackageOverviewUrl ( NPM , pkgName , pkgVersion )
212219
213220 console . log ( '\n' )
214221 if ( pkgVersion === 'latest' ) {
@@ -267,7 +274,7 @@ function formatPackageIssuesDetails(
267274 for ( const issue of Object . keys ( uniqueIssues ) ) {
268275 const issueWithLink = format . hyperlink (
269276 `${ uniqueIssues [ issue ] ?. label } ` ,
270- `https://socket.dev/npm/ issue/ ${ issue } ` ,
277+ getSocketDevAlertUrl ( issue ) ,
271278 { fallbackToUrl : true }
272279 )
273280 if ( uniqueIssues [ issue ] ?. count === 1 ) {
0 commit comments