git0 0.3.17 → 0.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/docs/README.md +20 -0
  2. package/docs/app/(home)/docs-home.css +235 -0
  3. package/docs/app/(home)/layout.tsx +12 -0
  4. package/docs/app/(home)/page.tsx +27 -0
  5. package/docs/app/docs/[[...slug]]/page.tsx +84 -0
  6. package/docs/app/docs/api/docs-search/route.ts +11 -0
  7. package/docs/app/docs/layout.tsx +16 -0
  8. package/docs/app/docs/llms-full.txt/route.ts +15 -0
  9. package/docs/app/docs/llms.mdx/docs/[[...slug]]/route.ts +24 -0
  10. package/docs/app/globals.css +814 -0
  11. package/docs/app/layout.config.tsx +32 -0
  12. package/docs/app/layout.tsx +22 -0
  13. package/docs/app/provider.tsx +20 -0
  14. package/docs/cli.json +11 -0
  15. package/docs/components/DocsHomepage/code-example.tsx +123 -0
  16. package/docs/components/DocsHomepage/features-grid.tsx +92 -0
  17. package/docs/components/DocsHomepage/footer.tsx +58 -0
  18. package/docs/components/DocsHomepage/hero-section.tsx +114 -0
  19. package/docs/components/DocsHomepage/project-types.tsx +114 -0
  20. package/docs/components/fumadocs/ai/ask-ai-dropdown.tsx +299 -0
  21. package/docs/components/fumadocs/ai/llm-copy-button.tsx +61 -0
  22. package/docs/components/fumadocs/api/api-page.client.tsx +7 -0
  23. package/docs/components/fumadocs/api/api-page.tsx +7 -0
  24. package/docs/components/fumadocs/layout/breadcrumb.tsx +36 -0
  25. package/docs/components/fumadocs/layout/search.tsx +55 -0
  26. package/docs/components/fumadocs/layout/theme-dropdown.tsx +3 -0
  27. package/docs/components/fumadocs/layout/theme-provider.tsx +15 -0
  28. package/docs/components/fumadocs/layout/theme-toggle.tsx +40 -0
  29. package/docs/components/ui/badge.tsx +50 -0
  30. package/docs/components/ui/button.tsx +66 -0
  31. package/docs/components/ui/collapsible.tsx +44 -0
  32. package/docs/components/ui/slider.tsx +36 -0
  33. package/docs/components/ui/tooltip.tsx +63 -0
  34. package/docs/components/ui/video-modal.tsx +238 -0
  35. package/docs/content/docs/fm.mdx +11 -0
  36. package/docs/content/docs/git0.mdx +104 -0
  37. package/docs/content/docs/github-api.mdx +764 -0
  38. package/docs/content/docs/index.mdx +98 -0
  39. package/docs/content/docs/meta.json +15 -0
  40. package/docs/content/docs/modules.mdx +10 -0
  41. package/docs/lib/fumadocs/customize-docs.ts +47 -0
  42. package/docs/lib/fumadocs/generate-api-docs.ts +73 -0
  43. package/docs/lib/fumadocs/source.tsx +50 -0
  44. package/docs/lib/utils.ts +10 -0
  45. package/docs/mdx-components.tsx +21 -0
  46. package/docs/next-env.d.ts +7 -0
  47. package/docs/next.config.ts +35 -0
  48. package/docs/package.json +61 -0
  49. package/docs/postcss.config.mjs +5 -0
  50. package/docs/public/apple-touch-icon.png +0 -0
  51. package/docs/public/favicon-192.png +0 -0
  52. package/docs/public/favicon-512.png +0 -0
  53. package/docs/public/favicon.ico +0 -0
  54. package/docs/public/manifest.webmanifest +14 -0
  55. package/docs/source.config.ts +29 -0
  56. package/docs/tsconfig.json +50 -0
  57. package/docs/vite.config.ts +2 -0
  58. package/docs/wrangler.jsonc +13 -0
  59. package/package.json +1 -1
@@ -0,0 +1,764 @@
1
+ ---
2
+ title: github-api
3
+ description: GitHub API helpers for searching repositories and downloading source and releases.
4
+ ---
5
+
6
+ ## default
7
+
8
+ Defined in: [src/github-api.js:17](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L17)
9
+
10
+ GitHub API client for downloading repositories, searching, and managing releases
11
+ GithubAPI
12
+
13
+ ### Example
14
+
15
+ ```ts
16
+ const github = new GithubAPI();
17
+ const repos = await github.searchRepositories('nodejs');
18
+ await github.downloadRepo('user/repo', './my-downloads');
19
+ ```
20
+
21
+ ### Constructors
22
+
23
+ #### Constructor
24
+
25
+ ```ts
26
+ new default(options?: object): default;
27
+ ```
28
+
29
+ Defined in: [src/github-api.js:36](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L36)
30
+
31
+ Creates a new GithubAPI instance
32
+
33
+ ##### Parameters
34
+
35
+ <table>
36
+ <thead>
37
+ <tr>
38
+ <th>Parameter</th>
39
+ <th>Type</th>
40
+ <th>Description</th>
41
+ </tr>
42
+ </thead>
43
+ <tbody>
44
+ <tr>
45
+ <td>
46
+
47
+ `options?`
48
+
49
+ </td>
50
+ <td>
51
+
52
+ \{ `baseURL?`: `string`; `debug?`: `boolean`; `token?`: `string`; \}
53
+
54
+ </td>
55
+ <td>
56
+
57
+ Configuration options
58
+
59
+ </td>
60
+ </tr>
61
+ <tr>
62
+ <td>
63
+
64
+ `options.baseURL?`
65
+
66
+ </td>
67
+ <td>
68
+
69
+ `string`
70
+
71
+ </td>
72
+ <td>
73
+
74
+ GitHub API base URL
75
+
76
+ </td>
77
+ </tr>
78
+ <tr>
79
+ <td>
80
+
81
+ `options.debug?`
82
+
83
+ </td>
84
+ <td>
85
+
86
+ `boolean`
87
+
88
+ </td>
89
+ <td>
90
+
91
+ Enable debug logging
92
+
93
+ </td>
94
+ </tr>
95
+ <tr>
96
+ <td>
97
+
98
+ `options.token?`
99
+
100
+ </td>
101
+ <td>
102
+
103
+ `string`
104
+
105
+ </td>
106
+ <td>
107
+
108
+ GitHub personal access token (defaults to GITHUB_TOKEN env var)
109
+
110
+ </td>
111
+ </tr>
112
+ </tbody>
113
+ </table>
114
+
115
+ ##### Returns
116
+
117
+ [`default`](#default)
118
+
119
+ ##### Example
120
+
121
+ ```ts
122
+ // Use default settings with environment token
123
+
124
+ // Use custom token
125
+ const github = new GithubAPI({ token: 'ghp_xxxxxxxxxxxx' });
126
+
127
+ // Enable debug mode
128
+ const github = new GithubAPI({ debug: true });
129
+ ```
130
+
131
+ ### Properties
132
+
133
+ #### baseURL
134
+
135
+ ```ts
136
+ baseURL: string;
137
+ ```
138
+
139
+ Defined in: [src/github-api.js:39](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L39)
140
+
141
+ #### callGithub()
142
+
143
+ ```ts
144
+ callGithub: (path: any, options?: object) => Promise<{
145
+ [key: string]: unknown;
146
+ }>;
147
+ ```
148
+
149
+ Defined in: [src/github-api.js:41](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L41)
150
+
151
+ ##### Parameters
152
+
153
+ <table>
154
+ <thead>
155
+ <tr>
156
+ <th>Parameter</th>
157
+ <th>Type</th>
158
+ </tr>
159
+ </thead>
160
+ <tbody>
161
+ <tr>
162
+ <td>
163
+
164
+ `path`
165
+
166
+ </td>
167
+ <td>
168
+
169
+ `any`
170
+
171
+ </td>
172
+ </tr>
173
+ <tr>
174
+ <td>
175
+
176
+ `options?`
177
+
178
+ </td>
179
+ <td>
180
+
181
+ \{ \}
182
+
183
+ </td>
184
+ </tr>
185
+ </tbody>
186
+ </table>
187
+
188
+ ##### Returns
189
+
190
+ `Promise`&lt;\{
191
+ [`key`: `string`]: `unknown`;
192
+ \}&gt;
193
+
194
+ #### debug
195
+
196
+ ```ts
197
+ debug: boolean;
198
+ ```
199
+
200
+ Defined in: [src/github-api.js:38](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L38)
201
+
202
+ #### token
203
+
204
+ ```ts
205
+ token: string;
206
+ ```
207
+
208
+ Defined in: [src/github-api.js:37](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L37)
209
+
210
+ #### DEFAULT\_RESULTS\_PER\_PAGE
211
+
212
+ ```ts
213
+ static DEFAULT_RESULTS_PER_PAGE: number = 10;
214
+ ```
215
+
216
+ Defined in: [src/github-api.js:19](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L19)
217
+
218
+ ##### Constant
219
+
220
+ Number of results to return per page for repository searches
221
+
222
+ ### Methods
223
+
224
+ #### downloadPackage()
225
+
226
+ ```ts
227
+ downloadPackage(packageURL: any, downloadPath: string): Promise<string>;
228
+ ```
229
+
230
+ Defined in: [src/github-api.js:189](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L189)
231
+
232
+ Downloads a release asset from GitHub and provides installation instructions
233
+
234
+ ##### Parameters
235
+
236
+ <table>
237
+ <thead>
238
+ <tr>
239
+ <th>Parameter</th>
240
+ <th>Type</th>
241
+ <th>Description</th>
242
+ </tr>
243
+ </thead>
244
+ <tbody>
245
+ <tr>
246
+ <td>
247
+
248
+ `packageURL`
249
+
250
+ </td>
251
+ <td>
252
+
253
+ `any`
254
+
255
+ </td>
256
+ <td>
257
+
258
+ Download URL for the asset
259
+
260
+ </td>
261
+ </tr>
262
+ <tr>
263
+ <td>
264
+
265
+ `downloadPath`
266
+
267
+ </td>
268
+ <td>
269
+
270
+ `string`
271
+
272
+ </td>
273
+ <td>
274
+
275
+ Directory to download the asset to
276
+
277
+ </td>
278
+ </tr>
279
+ </tbody>
280
+ </table>
281
+
282
+ ##### Returns
283
+
284
+ `Promise`&lt;`string`&gt;
285
+
286
+ Path to the downloaded file
287
+
288
+ ##### Throws
289
+
290
+ When download fails
291
+
292
+ ##### Example
293
+
294
+ ```ts
295
+ const asset = 'https://github.com/user/repo/releases/download/v1.0.0/myapp-v1.0.0-linux-x64'
296
+ const downloadPath = await github.downloadPackage(asset, './downloads/myapp');
297
+ ```
298
+
299
+ #### downloadRepo()
300
+
301
+ ```ts
302
+ downloadRepo(repo: string, targetDir?: string): Promise<string>;
303
+ ```
304
+
305
+ Defined in: [src/github-api.js:70](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L70)
306
+
307
+ Downloads a GitHub repository as a tarball and extracts it to a local directory
308
+
309
+ ##### Parameters
310
+
311
+ <table>
312
+ <thead>
313
+ <tr>
314
+ <th>Parameter</th>
315
+ <th>Type</th>
316
+ <th>Default value</th>
317
+ <th>Description</th>
318
+ </tr>
319
+ </thead>
320
+ <tbody>
321
+ <tr>
322
+ <td>
323
+
324
+ `repo`
325
+
326
+ </td>
327
+ <td>
328
+
329
+ `string`
330
+
331
+ </td>
332
+ <td>
333
+
334
+ `undefined`
335
+
336
+ </td>
337
+ <td>
338
+
339
+ Repository URL or owner/name format
340
+
341
+ </td>
342
+ </tr>
343
+ <tr>
344
+ <td>
345
+
346
+ `targetDir?`
347
+
348
+ </td>
349
+ <td>
350
+
351
+ `string`
352
+
353
+ </td>
354
+ <td>
355
+
356
+ `null`
357
+
358
+ </td>
359
+ <td>
360
+
361
+ Target directory name (defaults to repo name)
362
+
363
+ </td>
364
+ </tr>
365
+ </tbody>
366
+ </table>
367
+
368
+ ##### Returns
369
+
370
+ `Promise`&lt;`string`&gt;
371
+
372
+ Path to the extracted repository directory
373
+
374
+ ##### Throws
375
+
376
+ When repository download fails
377
+
378
+ ##### Example
379
+
380
+ ```ts
381
+ // Download repository to current directory
382
+ const repoPath = await github.downloadRepo('https://github.com/user/repo');
383
+
384
+ // Download to specific directory
385
+ const repoPath = await github.downloadRepo('user/repo', 'my-custom-dir');
386
+ ```
387
+
388
+ #### getCompatibleReleases()
389
+
390
+ ```ts
391
+ getCompatibleReleases(owner: string, repo: string): Promise<any[]>;
392
+ ```
393
+
394
+ Defined in: [src/github-api.js:310](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L310)
395
+
396
+ Gets releases compatible with the current platform
397
+
398
+ ##### Parameters
399
+
400
+ <table>
401
+ <thead>
402
+ <tr>
403
+ <th>Parameter</th>
404
+ <th>Type</th>
405
+ <th>Description</th>
406
+ </tr>
407
+ </thead>
408
+ <tbody>
409
+ <tr>
410
+ <td>
411
+
412
+ `owner`
413
+
414
+ </td>
415
+ <td>
416
+
417
+ `string`
418
+
419
+ </td>
420
+ <td>
421
+
422
+ Repository owner
423
+
424
+ </td>
425
+ </tr>
426
+ <tr>
427
+ <td>
428
+
429
+ `repo`
430
+
431
+ </td>
432
+ <td>
433
+
434
+ `string`
435
+
436
+ </td>
437
+ <td>
438
+
439
+ Repository name
440
+
441
+ </td>
442
+ </tr>
443
+ </tbody>
444
+ </table>
445
+
446
+ ##### Returns
447
+
448
+ `Promise`&lt;`any`[]&gt;
449
+
450
+ Array of compatible releases
451
+
452
+ ##### Example
453
+
454
+ ```ts
455
+ const compatible = await github.getCompatibleReleases('user', 'repo');
456
+ console.log(`Found ${compatible.length} compatible releases`);
457
+ ```
458
+
459
+ #### getCurrentPlatform()
460
+
461
+ ```ts
462
+ getCurrentPlatform(): any;
463
+ ```
464
+
465
+ Defined in: [src/github-api.js:262](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L262)
466
+
467
+ Detects the current operating system and architecture
468
+
469
+ ##### Returns
470
+
471
+ `any`
472
+
473
+ Platform information object
474
+
475
+ ##### Example
476
+
477
+ ```ts
478
+ const platform = github.getCurrentPlatform();
479
+ console.log(`Running on ${platform.os} ${platform.arch}`);
480
+ ```
481
+
482
+ #### getReleases()
483
+
484
+ ```ts
485
+ getReleases(owner: string, repo: string): Promise<any[]>;
486
+ ```
487
+
488
+ Defined in: [src/github-api.js:296](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L296)
489
+
490
+ Gets repository releases with platform categorization
491
+
492
+ ##### Parameters
493
+
494
+ <table>
495
+ <thead>
496
+ <tr>
497
+ <th>Parameter</th>
498
+ <th>Type</th>
499
+ <th>Description</th>
500
+ </tr>
501
+ </thead>
502
+ <tbody>
503
+ <tr>
504
+ <td>
505
+
506
+ `owner`
507
+
508
+ </td>
509
+ <td>
510
+
511
+ `string`
512
+
513
+ </td>
514
+ <td>
515
+
516
+ Repository owner
517
+
518
+ </td>
519
+ </tr>
520
+ <tr>
521
+ <td>
522
+
523
+ `repo`
524
+
525
+ </td>
526
+ <td>
527
+
528
+ `string`
529
+
530
+ </td>
531
+ <td>
532
+
533
+ Repository name
534
+
535
+ </td>
536
+ </tr>
537
+ </tbody>
538
+ </table>
539
+
540
+ ##### Returns
541
+
542
+ `Promise`&lt;`any`[]&gt;
543
+
544
+ Array of categorized releases
545
+
546
+ ##### Example
547
+
548
+ ```ts
549
+ const releases = await github.getReleases('microsoft', 'vscode');
550
+ console.log(`Found ${releases.length} releases`);
551
+ ```
552
+
553
+ #### parseURL()
554
+
555
+ ```ts
556
+ parseURL(query: string): any;
557
+ ```
558
+
559
+ Defined in: [src/github-api.js:241](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L241)
560
+
561
+ Parses a GitHub URL or shorthand repository reference
562
+
563
+ ##### Parameters
564
+
565
+ <table>
566
+ <thead>
567
+ <tr>
568
+ <th>Parameter</th>
569
+ <th>Type</th>
570
+ <th>Description</th>
571
+ </tr>
572
+ </thead>
573
+ <tbody>
574
+ <tr>
575
+ <td>
576
+
577
+ `query`
578
+
579
+ </td>
580
+ <td>
581
+
582
+ `string`
583
+
584
+ </td>
585
+ <td>
586
+
587
+ GitHub URL or owner/repo format
588
+
589
+ </td>
590
+ </tr>
591
+ </tbody>
592
+ </table>
593
+
594
+ ##### Returns
595
+
596
+ `any`
597
+
598
+ Parsed git URL object or false if invalid
599
+
600
+ ##### Example
601
+
602
+ ```ts
603
+ // Parse full URL
604
+ const parsed = github.parseURL('https://github.com/user/repo');
605
+
606
+ // Parse shorthand
607
+ const parsed = github.parseURL('user/repo');
608
+
609
+ if (parsed) {
610
+ console.log(`Owner: ${parsed.owner}, Name: ${parsed.name}`);
611
+ }
612
+ ```
613
+
614
+ #### searchRepositories()
615
+
616
+ ```ts
617
+ searchRepositories(query: string, options?: object): Promise<any[]>;
618
+ ```
619
+
620
+ Defined in: [src/github-api.js:131](https://github.com/vtempest/git0/blob/59ed406649e41b4d7072fd6657f693b571f0088e/src/github-api.js#L131)
621
+
622
+ Searches for GitHub repositories by name and enriches results with release information
623
+
624
+ ##### Parameters
625
+
626
+ <table>
627
+ <thead>
628
+ <tr>
629
+ <th>Parameter</th>
630
+ <th>Type</th>
631
+ <th>Description</th>
632
+ </tr>
633
+ </thead>
634
+ <tbody>
635
+ <tr>
636
+ <td>
637
+
638
+ `query`
639
+
640
+ </td>
641
+ <td>
642
+
643
+ `string`
644
+
645
+ </td>
646
+ <td>
647
+
648
+ Search query for repository names
649
+
650
+ </td>
651
+ </tr>
652
+ <tr>
653
+ <td>
654
+
655
+ `options?`
656
+
657
+ </td>
658
+ <td>
659
+
660
+ \{ `getReleaseInfo?`: `number`; `order?`: `string`; `perPage?`: `number`; `sort?`: `string`; \}
661
+
662
+ </td>
663
+ <td>
664
+
665
+ Search options
666
+
667
+ </td>
668
+ </tr>
669
+ <tr>
670
+ <td>
671
+
672
+ `options.getReleaseInfo?`
673
+
674
+ </td>
675
+ <td>
676
+
677
+ `number`
678
+
679
+ </td>
680
+ <td>
681
+
682
+ Should also check releases for each result
683
+
684
+ </td>
685
+ </tr>
686
+ <tr>
687
+ <td>
688
+
689
+ `options.order?`
690
+
691
+ </td>
692
+ <td>
693
+
694
+ `string`
695
+
696
+ </td>
697
+ <td>
698
+
699
+ Sort order (asc, desc)
700
+
701
+ </td>
702
+ </tr>
703
+ <tr>
704
+ <td>
705
+
706
+ `options.perPage?`
707
+
708
+ </td>
709
+ <td>
710
+
711
+ `number`
712
+
713
+ </td>
714
+ <td>
715
+
716
+ Number of results per page (defaults to DEFAULT_RESULTS_PER_PAGE)
717
+
718
+ </td>
719
+ </tr>
720
+ <tr>
721
+ <td>
722
+
723
+ `options.sort?`
724
+
725
+ </td>
726
+ <td>
727
+
728
+ `string`
729
+
730
+ </td>
731
+ <td>
732
+
733
+ Sort field (stars, forks, updated)
734
+
735
+ </td>
736
+ </tr>
737
+ </tbody>
738
+ </table>
739
+
740
+ ##### Returns
741
+
742
+ `Promise`&lt;`any`[]&gt;
743
+
744
+ Array of repository objects with release information
745
+
746
+ ##### Throws
747
+
748
+ When search fails
749
+
750
+ ##### Example
751
+
752
+ ```ts
753
+ const repos = await github.searchRepositories('nodejs');
754
+ repos.forEach(repo => {
755
+ console.log(`${repo.name}: ${repo.hasReleases ? 'Has releases' : 'No releases'}`);
756
+ });
757
+
758
+ // Custom search options
759
+ const repos = await github.searchRepositories('react', {
760
+ perPage: 5,
761
+ sort: 'updated',
762
+ order: 'desc'
763
+ });
764
+ ```