File tree Expand file tree Collapse file tree 3 files changed +19
-10
lines changed Expand file tree Collapse file tree 3 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -209,8 +209,8 @@ export interface Package {
209
209
210
210
typescript : boolean ;
211
211
212
- svCmd ?: string ;
213
- main_url ?: string ;
212
+ svCmdAlias ?: string ;
213
+ svCmdOptions ?: string ;
214
214
}
215
215
216
216
/**
Original file line number Diff line number Diff line change @@ -8,11 +8,10 @@ const arrToPackages = (arr: string[]) => {
8
8
. map ( ( name ) => {
9
9
const pkg = registry . find ( ( pkg ) => pkg . name === name ) ?? null ;
10
10
if ( pkg ) {
11
- pkg . main_url = pkg . homepage ;
12
11
const cmd = PACKAGES_META . SV_ADD_CMD [ pkg . name ] ;
13
12
if ( cmd ) {
14
- pkg . svCmd = `npx sv add ${ cmd . alias } ${ cmd . options ? `= ${ cmd . options } ` : '' } ` ;
15
- pkg . main_url = `/docs/cli/ ${ cmd . alias } ` ;
13
+ pkg . svCmdAlias = cmd . alias ;
14
+ pkg . svCmdOptions = cmd . options ;
16
15
}
17
16
}
18
17
Original file line number Diff line number Diff line change 24
24
</h3 >
25
25
{/ snippet }
26
26
27
- {#if pkg .main_url }
27
+ {#if pkg .homepage }
28
28
<a
29
- href ={pkg .main_url }
29
+ href ={pkg .homepage }
30
30
target =" _blank"
31
31
rel =" noreferrer"
32
32
aria-label =" View project homepage"
45
45
46
46
<p class ="description" >{pkg .description }</p >
47
47
48
- {#if pkg .svCmd }
48
+ {#if pkg .svCmdAlias }
49
49
<span class =" sv-cmd" >
50
- {pkg .svCmd }
50
+ npx sv add {pkg .svCmdAlias }{pkg .svCmdOptions ? ` =${pkg .svCmdOptions } ` : ' ' }
51
+ <a
52
+ href ={` /docs/cli/${pkg .svCmdAlias } ` }
53
+ target =" _blank"
54
+ rel =" noreferrer"
55
+ aria-label =" View Svelte CLI docs"
56
+ data-icon =" external-link"
57
+ ></a >
51
58
</span >
52
59
{/if }
53
60
<p class =" stats" >
221
228
}
222
229
223
230
.sv-cmd {
224
- display : inline-block ;
231
+ display : inline-flex ;
232
+ gap : 0.4rem ;
233
+ align-items : center ;
234
+ justify-content : space-between ;
225
235
font : var (--sk-font-ui-small );
226
236
color : var (--sk-fg-3 );
227
237
background : var (--sk-bg-3 );
You can’t perform that action at this time.
0 commit comments