@@ -52,6 +52,15 @@ const repoProviderIcon = computed((): IconClass => {
5252 return PROVIDER_ICONS [provider ] ?? ' i-lucide:code'
5353})
5454
55+ const repositoryCommandLabel = computed (() => {
56+ if (! repoRef .value ) {
57+ return $t (' package.links.repo' )
58+ }
59+
60+ const provider = repoRef .value .provider ? ` (${repoRef .value .provider }) ` : ' '
61+ return ` ${$t (' package.links.repo' )}${provider }: ${repoRef .value .owner }/${repoRef .value .repo } `
62+ })
63+
5564useCommandPaletteContextCommands (
5665 computed (() => {
5766 const commands: CommandPaletteContextCommandInput [] = []
@@ -61,11 +70,15 @@ useCommandPaletteContextCommands(
6170 commands .push ({
6271 id: ' package-link-repo' ,
6372 group: ' links' ,
64- label: repoRef .value
65- ? ` ${repoRef .value .owner }/${repoRef .value .repo } `
66- : $t (' package.links.repo' ),
67- keywords: [... packageKeywords , $t (' package.links.repo' )],
73+ label: repositoryCommandLabel .value ,
74+ keywords: [
75+ ... packageKeywords ,
76+ $t (' package.links.repo' ),
77+ repoRef .value ?.provider ?? ' ' ,
78+ repoRef .value ? ` ${repoRef .value .owner }/${repoRef .value .repo } ` : ' ' ,
79+ ],
6880 iconClass: repoProviderIcon .value ,
81+ href: repositoryUrl .value ,
6982 external: true ,
7083 action : () => {
7184 window .open (repositoryUrl .value ! , ' _blank' , ' noopener,noreferrer' )
@@ -80,6 +93,7 @@ useCommandPaletteContextCommands(
8093 label: $t (' command_palette.package_links.stars' ),
8194 keywords: [... packageKeywords , $t (' command_palette.package_links.stars' )],
8295 iconClass: ' i-lucide:star' ,
96+ href: starsLink .value ,
8397 external: true ,
8498 action : () => {
8599 window .open (starsLink .value ! , ' _blank' , ' noopener,noreferrer' )
@@ -94,6 +108,7 @@ useCommandPaletteContextCommands(
94108 label: $t (' command_palette.package_links.forks' ),
95109 keywords: [... packageKeywords , $t (' command_palette.package_links.forks' )],
96110 iconClass: ' i-lucide:git-fork' ,
111+ href: forksLink .value ,
97112 external: true ,
98113 action : () => {
99114 window .open (forksLink .value ! , ' _blank' , ' noopener,noreferrer' )
@@ -108,6 +123,7 @@ useCommandPaletteContextCommands(
108123 label: $t (' package.links.homepage' ),
109124 keywords: [... packageKeywords , $t (' package.links.homepage' )],
110125 iconClass: ' i-lucide:link' ,
126+ href: homepageUrl .value ,
111127 external: true ,
112128 action : () => {
113129 window .open (homepageUrl .value ! , ' _blank' , ' noopener,noreferrer' )
@@ -122,6 +138,7 @@ useCommandPaletteContextCommands(
122138 label: $t (' package.links.issues' ),
123139 keywords: [... packageKeywords , $t (' package.links.issues' )],
124140 iconClass: ' i-lucide:circle-alert' ,
141+ href: displayVersion .value ! .bugs ! .url ! ,
125142 external: true ,
126143 action : () => {
127144 window .open (displayVersion .value ! .bugs ! .url ! , ' _blank' , ' noopener,noreferrer' )
@@ -135,6 +152,7 @@ useCommandPaletteContextCommands(
135152 label: ' npm' ,
136153 keywords: [... packageKeywords , $t (' common.view_on.npm' )],
137154 iconClass: ' i-simple-icons:npm' ,
155+ href: ` https://www.npmjs.com/package/${props .pkg .name } ` ,
138156 external: true ,
139157 action : () => {
140158 window .open (
@@ -152,6 +170,7 @@ useCommandPaletteContextCommands(
152170 label: $t (' package.links.jsr' ),
153171 keywords: [... packageKeywords , $t (' package.links.jsr' )],
154172 iconClass: ' i-simple-icons:jsr' ,
173+ href: props .jsrInfo .url ,
155174 external: true ,
156175 action : () => {
157176 window .open (props .jsrInfo ! .url ! , ' _blank' , ' noopener,noreferrer' )
@@ -166,6 +185,7 @@ useCommandPaletteContextCommands(
166185 label: $t (' package.links.fund' ),
167186 keywords: [... packageKeywords , $t (' package.links.fund' )],
168187 iconClass: ' i-lucide:heart' ,
188+ href: fundingUrl .value ,
169189 external: true ,
170190 action : () => {
171191 window .open (fundingUrl .value ! , ' _blank' , ' noopener,noreferrer' )
0 commit comments