@xyd-js/sources 0.0.0-build

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 (97) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/ISSUES.md +10 -0
  3. package/LICENSE +21 -0
  4. package/README.md +3 -0
  5. package/TODO.md +9 -0
  6. package/__fixtures__/-1.typescript/package.json +5 -0
  7. package/__fixtures__/-1.typescript/src/index.ts +0 -0
  8. package/__fixtures__/-1.typescript/src/settings.ts +592 -0
  9. package/__fixtures__/-1.typescript/tsconfig.json +8 -0
  10. package/__fixtures__/-2.react.basic/1.flat-interface.output.json +114 -0
  11. package/__fixtures__/-2.react.basic/2.file-connect-interface.output.json +60 -0
  12. package/__fixtures__/-2.react.basic/2a.file-connect-interface-advanced.output.json +92 -0
  13. package/__fixtures__/-2.react.basic/3.props-as-variants.output.json +166 -0
  14. package/__fixtures__/-2.react.basic/4.outside-interface.output.json +60 -0
  15. package/__fixtures__/-2.react.basic/5.inline-props.output.json +60 -0
  16. package/__fixtures__/-2.react.basic/5.outside-inline-props.output.json +60 -0
  17. package/__fixtures__/-2.react.basic/5a.inline-props+outside.output.json +60 -0
  18. package/__fixtures__/-2.react.basic/5b.inline-props+interfaces.output.json +92 -0
  19. package/__fixtures__/-2.react.basic/package.json +4 -0
  20. package/__fixtures__/-2.react.basic/src/1.flat-interface.tsx +41 -0
  21. package/__fixtures__/-2.react.basic/src/2.file-connect-interface.tsx +28 -0
  22. package/__fixtures__/-2.react.basic/src/2a.file-connect-interace+advanced.tsx +54 -0
  23. package/__fixtures__/-2.react.basic/src/3.props-as-variants.tsx +67 -0
  24. package/__fixtures__/-2.react.basic/src/4.outside-interface.tsx +13 -0
  25. package/__fixtures__/-2.react.basic/src/4.outside-interface2.ts +15 -0
  26. package/__fixtures__/-2.react.basic/src/5.inline-props.tsx +19 -0
  27. package/__fixtures__/-2.react.basic/src/5a.inline-props+outside.tsx +19 -0
  28. package/__fixtures__/-2.react.basic/src/5b.inline-props+interfaces.tsx +62 -0
  29. package/__fixtures__/-2.react.basic/src/index.ts +0 -0
  30. package/__fixtures__/-2.react.basic/tsconfig.json +8 -0
  31. package/__tests__/sourcesToUniform.test.ts +167 -0
  32. package/__tests__/testResolvePropertySymbol.ts +838 -0
  33. package/__tests__/types.ts +12 -0
  34. package/__tests__/utils.ts +108 -0
  35. package/dist/index.cjs +2 -0
  36. package/dist/index.cjs.map +1 -0
  37. package/dist/index.d.cts +2 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +1 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/react.cjs +237 -0
  42. package/dist/react.cjs.map +1 -0
  43. package/dist/react.d.cts +6 -0
  44. package/dist/react.d.ts +6 -0
  45. package/dist/react.js +212 -0
  46. package/dist/react.js.map +1 -0
  47. package/dist/ts.cjs +1794 -0
  48. package/dist/ts.cjs.map +1 -0
  49. package/dist/ts.d.cts +14 -0
  50. package/dist/ts.d.ts +14 -0
  51. package/dist/ts.js +1760 -0
  52. package/dist/ts.js.map +1 -0
  53. package/package.json +41 -0
  54. package/packages/react/index.ts +1 -0
  55. package/packages/react/uniformToReactUniform.ts +275 -0
  56. package/packages/ts/SignatureText.ts +233 -0
  57. package/packages/ts/TypeDocTransformer.ts +1519 -0
  58. package/packages/ts/__fixtures__/packages/package-a/package.json +4 -0
  59. package/packages/ts/__fixtures__/packages/package-a/src/index.ts +56 -0
  60. package/packages/ts/__fixtures__/packages/package-a/tsconfig.json +23 -0
  61. package/packages/ts/__fixtures__/packages/package-b/package.json +7 -0
  62. package/packages/ts/__fixtures__/packages/package-b/src/billing.ts +193 -0
  63. package/packages/ts/__fixtures__/packages/package-b/src/index.ts +8 -0
  64. package/packages/ts/__fixtures__/packages/package-b/tsconfig.json +20 -0
  65. package/packages/ts/__fixtures__/packages2/package-a/package.json +4 -0
  66. package/packages/ts/__fixtures__/packages2/package-a/src/index.ts +496 -0
  67. package/packages/ts/__fixtures__/packages2/package-a/tsconfig.json +6 -0
  68. package/packages/ts/__fixtures__/packages3/package-a/package.json +4 -0
  69. package/packages/ts/__fixtures__/packages3/package-a/src/index.ts +488 -0
  70. package/packages/ts/__fixtures__/packages3/package-a/tsconfig.json +6 -0
  71. package/packages/ts/__fixtures__/packages3/project.json +171 -0
  72. package/packages/ts/__fixtures__/react/react-a/package.json +5 -0
  73. package/packages/ts/__fixtures__/react/react-a/src/TestAbc.tsx +90 -0
  74. package/packages/ts/__fixtures__/react/react-a/src/TestBasic.tsx +27 -0
  75. package/packages/ts/__fixtures__/react/react-a/src/TestNamedParameters.tsx +27 -0
  76. package/packages/ts/__fixtures__/react/react-a/src/TestNamedParameters2.tsx +26 -0
  77. package/packages/ts/__fixtures__/react/react-a/src/TestUnion.tsx +32 -0
  78. package/packages/ts/__fixtures__/react/react-a/src/index.ts +1 -0
  79. package/packages/ts/__fixtures__/react/react-a/tsconfig.json +8 -0
  80. package/packages/ts/__fixtures__/references-output-project.json +344 -0
  81. package/packages/ts/__fixtures__/references-output-react.json +68 -0
  82. package/packages/ts/__fixtures__/references-output.json +129 -0
  83. package/packages/ts/__tests__/sourcesToUniform.test.ts +106 -0
  84. package/packages/ts/context.ts +0 -0
  85. package/packages/ts/converterts/ts-class.ts +0 -0
  86. package/packages/ts/converterts/ts-enum.ts +0 -0
  87. package/packages/ts/converterts/ts-function.ts +0 -0
  88. package/packages/ts/converterts/ts-interface.ts +0 -0
  89. package/packages/ts/converterts/ts-type.ts +0 -0
  90. package/packages/ts/index.ts +129 -0
  91. package/packages/ts/ts-core.ts +0 -0
  92. package/packages/ts/uniformToMiniUniform.ts +486 -0
  93. package/src/index.ts +0 -0
  94. package/test-cmd/index.ts +62 -0
  95. package/tsconfig.json +38 -0
  96. package/tsup.config.ts +39 -0
  97. package/vitest.config.ts +34 -0
@@ -0,0 +1,496 @@
1
+ // import React from "react";
2
+
3
+ import type { Theme as SyntaxHighlight } from "@code-hike/lighter";
4
+
5
+ /**
6
+ * Main settings interface for the application
7
+ */
8
+ export interface Settings {
9
+ /** Theme configuration for the application */
10
+ theme?: Theme | ThemeResolver
11
+
12
+ /** Navigation configuration */
13
+ navigation?: Navigation
14
+
15
+ /** API configuration */
16
+ api?: API
17
+
18
+ /** Integrations configuration */
19
+ integrations?: Integrations
20
+
21
+ /** Redirects configuration */
22
+ redirects?: Redirects[]
23
+
24
+ /** SEO configuration */
25
+ seo?: SEO
26
+ }
27
+
28
+ // ------ START setting for theme START ------
29
+ // #region Theme
30
+ /**
31
+ * Theme configuration that changes the look and feel of the project
32
+ */
33
+ export interface Theme {
34
+ /**
35
+ * A preset theme configuration that changes the look and feel of the project.
36
+ * A theme is a set of default styling configurations.
37
+ * Examples: cosmo, gusto, poetry, picasso,
38
+ */
39
+ readonly name: ThemePresetName | string
40
+
41
+ /** Markdown configuration for the theme, including options like syntax highlighting */
42
+ markdown?: Markdown
43
+
44
+ /**
45
+ * Path to logo image or object with path to "light" and "dark" mode logo images, and where the logo links to.
46
+ * SVG format is recommended as it does not pixelate and the file size is generally smaller.
47
+ */
48
+ logo?: string | Logo | React.JSX.Element
49
+
50
+ /** Path to the favicon image. For example: /path/to/favicon.svg */
51
+ favicon?: string;
52
+
53
+ /** Hex color codes for your global theme */
54
+ colors?: Colors
55
+
56
+ /** Set a custom background image to be displayed behind every page */
57
+ backgroundImage?: string
58
+
59
+ /**
60
+ * Custom fonts. Apply globally or set different fonts for headings and the body text.
61
+ */
62
+ font?: FontDetailsType | { headings?: FontDetailsType, body?: FontDetailsType }
63
+
64
+ /** The location of the search bar entry */
65
+ search?: SearchType
66
+ }
67
+ // #endregion Theme
68
+
69
+ /**
70
+ * Theme resolver interface (TODO: in the future (typescript))
71
+ */
72
+ export interface ThemeResolver extends Theme {
73
+
74
+ }
75
+
76
+ /**
77
+ * Markdown configuration interface
78
+ */
79
+ export interface Markdown {
80
+ /** Syntax highlighting configuration */
81
+ syntaxHighlight: SyntaxHighlight
82
+ }
83
+
84
+ /**
85
+ * Logo configuration interface
86
+ */
87
+ export interface Logo {
88
+ /** Path to the logo in light mode. For example: `/path/to/logo.svg` */
89
+ light?: string;
90
+
91
+ /** Path to the logo in dark mode. For example: `/path/to/logo.svg` */
92
+ dark?: string;
93
+
94
+ /** Where clicking on the logo links you to */
95
+ href?: string;
96
+ }
97
+
98
+ /**
99
+ * Color configuration interface
100
+ */
101
+ export interface Colors {
102
+ /** The primary color. Used most often for highlighted content, section headers, accents, in light mode */
103
+ primary: string
104
+
105
+ /** The primary color for dark mode. Used most often for highlighted content, section headers, accents, in dark mode */
106
+ light?: string
107
+
108
+ /** The primary color for important buttons */
109
+ dark?: string
110
+
111
+ /** The color of the background in both light and dark mode */
112
+ background?: {
113
+ /** Light mode background color */
114
+ light: string
115
+
116
+ /** Dark mode background color */
117
+ dark: string
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Font details configuration interface
123
+ */
124
+ export interface FontDetailsType {
125
+ /**
126
+ * The font family name. Custom fonts and all Google Fonts are supported.
127
+ * e.g. "Open Sans", "Playfair Display"
128
+ */
129
+ family: string
130
+
131
+ /**
132
+ * The font weight. Precise values such as 560 are also supported for variable fonts.
133
+ * Check under the Styles section for your Google Font for the available weights.
134
+ */
135
+ weight?: number
136
+
137
+ /** The URL to the font file. Can be used to specify a font that is not from Google Fonts */
138
+ url?: string
139
+
140
+ /** The font format. Required if using a custom font source (url) */
141
+ format?: "woff" | "woff2"
142
+ }
143
+
144
+ /** Available theme preset names */
145
+ export type ThemePresetName = "poetry" | "cosmo" | "opener" | "picasso" | "picasso"
146
+
147
+ /** Search bar location options */
148
+ export type SearchType = "side" | "top"
149
+
150
+ // ------ END setting for theme END ------
151
+
152
+
153
+ // ------ START setting for navigation START ------
154
+ /**
155
+ * Navigation configuration interface
156
+ */
157
+ export interface Navigation {
158
+ /** Definition of sidebar - an array of groups with all the pages within that group */
159
+ sidebar: (SidebarRoute | Sidebar)[]
160
+
161
+ /** Array of headers */
162
+ header?: Header[]
163
+
164
+ /** The call to action button in the topbar */
165
+ topbarCtaButton?: CallToAction
166
+
167
+ /**
168
+ * Array of version names. Only use this if you want to show different versions of docs
169
+ * with a dropdown in the navigation bar.
170
+ */
171
+ versions?: string[]
172
+
173
+ /** Anchors, includes the icon, name, and url */
174
+ anchors?: AnchorRoot
175
+
176
+ /**
177
+ * An object of social media accounts where the key:property pair represents
178
+ * the social media platform and the account url.
179
+ */
180
+ footerSocials?: FooterSocials
181
+
182
+ /** Configurations to enable feedback buttons */
183
+ feedback?: Feedback
184
+
185
+ /** Configurations to change the search prompt */
186
+ search?: Search
187
+ }
188
+
189
+ /**
190
+ * Sidebar multi-group configuration
191
+ */
192
+ export interface SidebarRoute {
193
+ /** Route for this sidebar group */
194
+ route: string
195
+
196
+ /** Sidebar items within this group */
197
+ items: Sidebar[]
198
+ }
199
+
200
+ /**
201
+ * Sidebar configuration
202
+ */
203
+ export interface Sidebar {
204
+ /** The name of the group */
205
+ group?: string
206
+
207
+ /**
208
+ * The relative paths to the markdown files that will serve as pages.
209
+ * Note: groups are recursive, so to add a sub-folder add another group object in the page array.
210
+ */
211
+ pages?: (string | Sidebar)[]
212
+
213
+ /** The Fontawesome icon for the group. Note: this only applies to sub-folders */
214
+ icon?: string
215
+
216
+ /**
217
+ * The type of Fontawesome icon. Must be one of: brands, duotone, light, sharp-solid, solid, thin
218
+ */
219
+ iconType?: string
220
+ }
221
+
222
+ /**
223
+ * Sub-header configuration
224
+ */
225
+ export interface SubHeader {
226
+ /** Route for this sub-header */
227
+ route: string
228
+
229
+ /** Name of this sub-header */
230
+ name: string
231
+
232
+ /** Items within this sub-header */
233
+ items: Header[]
234
+ }
235
+
236
+ /**
237
+ * Header configuration
238
+ */
239
+ export interface Header {
240
+ /** The name of the button */
241
+ name?: string
242
+
243
+ /** The url once you click on the button */
244
+ url?: string
245
+
246
+ /** Sub-header configuration */
247
+ sub?: SubHeader
248
+ }
249
+
250
+ /**
251
+ * Call to action configuration
252
+ */
253
+ export interface CallToAction {
254
+ /**
255
+ * Link shows a button. GitHub shows the repo information at the url provided
256
+ * including the number of GitHub stars.
257
+ */
258
+ type?: "link" | "github"
259
+
260
+ /**
261
+ * If type is a link: What the button links to.
262
+ * If type is a github: Link to the repository to load GitHub information from.
263
+ */
264
+ url?: string
265
+
266
+ /** Text inside the button. Only required if type is a link */
267
+ name?: string
268
+
269
+ /** The style of the button */
270
+ style?: "pill" | "roundedRectangle"
271
+
272
+ /** Whether to display the arrow */
273
+ arrow?: boolean
274
+ }
275
+
276
+ /**
277
+ * Anchor configuration
278
+ */
279
+ export interface Anchor {
280
+ /** The Font Awesome or JSX icon used to feature the anchor */
281
+ icon?: string | React.JSX.Element
282
+
283
+ /** The name of the anchor label */
284
+ name?: string
285
+
286
+ /**
287
+ * The start of the URL that marks what pages go in the anchor.
288
+ * Generally, this is the name of the folder you put your pages in.
289
+ */
290
+ url?: string
291
+ }
292
+
293
+ /**
294
+ * Anchor root configuration
295
+ */
296
+ export interface AnchorRoot {
297
+ /** Bottom anchors */
298
+ bottom: Anchor[]
299
+ }
300
+
301
+ /**
302
+ * Footer socials configuration
303
+ */
304
+ export interface FooterSocials {
305
+ /**
306
+ * One of the following values website, facebook, x, youtube, discord, slack,
307
+ * github, linkedin, instagram, hacker-news
308
+ */
309
+ [key: string]: string
310
+
311
+ /** The URL to the social platform */
312
+ property: string
313
+ }
314
+
315
+ /**
316
+ * Feedback configuration
317
+ */
318
+ export interface Feedback {
319
+ /** Enables a rating system for users to indicate whether the page has been helpful */
320
+ thumbsRating?: boolean
321
+
322
+ /** Enables a button to allow users to suggest edits via pull requests */
323
+ suggestEdit?: boolean
324
+
325
+ /** Enables a button to allow users to raise an issue about the documentation */
326
+ raiseIssue?: boolean
327
+ }
328
+
329
+ /**
330
+ * Search configuration
331
+ */
332
+ export interface Search {
333
+ /** Set the prompt for the search bar. Default is Search... */
334
+ prompt?: string
335
+ }
336
+
337
+ // ------ END setting for structure END ------
338
+
339
+
340
+ // ------ START setting for API START ------
341
+ /**
342
+ * API file type - can be a string, array of strings, or a map of strings
343
+ */
344
+ export type APIFile = string | string[] | { [id: string]: string }
345
+
346
+ /**
347
+ * API configuration interface
348
+ */
349
+ export interface API {
350
+ /** API information */
351
+ info?: APIInfo
352
+
353
+ /**
354
+ * A string/array/map of strings of URL(s) or relative path(s) pointing to your OpenAPI file.
355
+ */
356
+ openapi?: APIFile
357
+
358
+ /**
359
+ * A string or an array of strings of URL(s) or relative path(s) pointing to your GraphQL file.
360
+ */
361
+ graphql?: APIFile
362
+
363
+ /**
364
+ * A string or an array of strings of URL(s) or relative path(s) pointing to your source code folder.
365
+ */
366
+ sources?: APIFile
367
+
368
+ /**
369
+ * TODO: better in the future? -> move outside of API ?
370
+ * Route configuration for API endpoints
371
+ */
372
+ route?: {
373
+ /** GraphQL route */
374
+ graphql?: string
375
+
376
+ /** OpenAPI route */
377
+ openapi?: string
378
+
379
+ /** Sources route */
380
+ sources?: string
381
+ }
382
+ }
383
+
384
+ /**
385
+ * API information configuration
386
+ */
387
+ export interface APIInfo {
388
+ /**
389
+ * The base url for all API endpoints. If baseUrl is an array, it will enable
390
+ * for multiple base url options that the user can toggle.
391
+ */
392
+ baseUrl?: string
393
+
394
+ /** Authentication information */
395
+ auth?: APIAuth
396
+
397
+ /**
398
+ * The name of the authentication parameter used in the API playground.
399
+ * If method is basic, the format should be [usernameName]:[passwordName]
400
+ */
401
+ name?: string
402
+
403
+ /**
404
+ * The default value that's designed to be a prefix for the authentication input field.
405
+ * E.g. If an inputPrefix of AuthKey would inherit the default input result of the authentication field as AuthKey.
406
+ */
407
+ inputPrefix?: string
408
+
409
+ /** Configurations for the API playground */
410
+ playground?: APIPlayground
411
+
412
+ /** Request configuration */
413
+ request?: APIInfoRequest
414
+ }
415
+
416
+ /**
417
+ * API authentication configuration
418
+ */
419
+ export interface APIAuth {
420
+ /** The authentication strategy used for all API endpoints */
421
+ method: "bearer" | "basic" | "key"
422
+ }
423
+
424
+ /**
425
+ * API playground configuration
426
+ */
427
+ export interface APIPlayground {
428
+ /** Playground display mode */
429
+ mode?: "show" | "simple" | "hide"
430
+ }
431
+
432
+ /**
433
+ * API request configuration
434
+ */
435
+ export interface APIInfoRequest {
436
+ /** Configurations for the auto-generated API request examples */
437
+ example?: {
438
+ /**
439
+ * An array of strings that determine the order of the languages of the auto-generated request examples.
440
+ * You can either define custom languages utilizing x-codeSamples or use our default languages which include
441
+ * bash, python, javascript, php, go, java
442
+ */
443
+ languages?: string[]
444
+ }
445
+ }
446
+
447
+ // ------ END setting for API END ------
448
+
449
+
450
+ // ------ START setting for integrations START ------
451
+ /**
452
+ * Integrations configuration
453
+ */
454
+ export interface Integrations {
455
+ /**
456
+ * Configurations to add third-party analytics integrations.
457
+ * See full list of supported analytics here.
458
+ */
459
+ analytics?: Analytics
460
+ }
461
+
462
+ /**
463
+ * Analytics configuration
464
+ */
465
+ export interface Analytics {
466
+ /** Livesession analytics configuration */
467
+ livesession: {
468
+ /** Tracking ID for Livesession */
469
+ trackId: string
470
+ }
471
+ }
472
+
473
+ // ------ END setting for integrations END ------
474
+
475
+
476
+ // ------ START setting for redirecs START ------
477
+ /**
478
+ * Redirects configuration
479
+ */
480
+ export interface Redirects {
481
+ /** Source path to redirect from */
482
+ source: string
483
+
484
+ /** Destination path to redirect to */
485
+ destination: string
486
+ }
487
+
488
+ /**
489
+ * SEO configuration
490
+ */
491
+ export interface SEO {
492
+ /** Whether to index hidden pages */
493
+ indexHiddenPages: boolean
494
+ }
495
+
496
+ // ------ END setting for redirects END ------
@@ -0,0 +1,6 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./dist",
4
+ "skipLibCheck": true
5
+ }
6
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "@xyd-sources-examples/package-a",
3
+ "main": "dist/index.js"
4
+ }