opensource-showcase 0.1.17 → 0.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"generate-site.d.ts","sourceRoot":"","sources":["../../src/repo/generate-site.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAW3D,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAgC5D"}
1
+ {"version":3,"file":"generate-site.d.ts","sourceRoot":"","sources":["../../src/repo/generate-site.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAc3D,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAuC5D"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Generate a minimal static HTML Page shell that mounts the remote React SPA portfolio.
3
3
  */
4
+ const SHOWCASE_UI_URL = 'https://cdn.jsdelivr.net/npm/opensource-showcase-ui@1/dist/showcase-ui.js';
4
5
  function escapeHtml(value) {
5
6
  return String(value ?? '')
6
7
  .replace(/&/g, '&')
@@ -36,8 +37,15 @@ export function generateSite(data) {
36
37
  <title>${escapeHtml(pageTitle)}</title>
37
38
  </head>
38
39
  <body>
39
- <div id="root"></div>
40
- <script src="https://cdn.jsdelivr.net/npm/opensource-showcase-ui@1/dist/showcase-ui.js" crossorigin="anonymous"></script>
40
+ <div id="root">
41
+ <main style="min-height:100vh;display:grid;place-items:center;padding:24px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#f8fafc;color:#0f172a;">
42
+ <section style="max-width:520px;text-align:center;">
43
+ <h1 style="margin:0 0 8px;font-size:24px;line-height:1.2;">Loading open source portfolio...</h1>
44
+ <p style="margin:0;color:#475569;line-height:1.6;">If this message stays here, the showcase UI bundle could not be loaded from the CDN.</p>
45
+ </section>
46
+ </main>
47
+ </div>
48
+ <script type="module" src="${SHOWCASE_UI_URL}" crossorigin="anonymous"></script>
41
49
  </body>
42
50
  </html>`;
43
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generate-site.js","sourceRoot":"","sources":["../../src/repo/generate-site.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,SAAS,UAAU,CAAC,KAAyC;IAC3D,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAuB;IAClD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IAC3C,MAAM,SAAS,GAAG,GAAG,WAAW,8BAA8B,CAAC;IAC/D,MAAM,QAAQ,GAAG,wCAAwC,WAAW,GAAG,CAAC;IAExE,OAAO;;;;;wCAK+B,UAAU,CAAC,QAAQ,CAAC;;;;yCAInB,UAAU,CAAC,SAAS,CAAC;+CACf,UAAU,CAAC,QAAQ,CAAC;4DACP,UAAU,CAAC,QAAQ,CAAC;;;;8CAIlC,UAAU,CAAC,SAAS,CAAC;oDACf,UAAU,CAAC,QAAQ,CAAC;iEACP,UAAU,CAAC,QAAQ,CAAC;;aAExE,UAAU,CAAC,SAAS,CAAC;;;;;;QAM1B,CAAC;AACT,CAAC"}
1
+ {"version":3,"file":"generate-site.js","sourceRoot":"","sources":["../../src/repo/generate-site.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,eAAe,GACnB,2EAA2E,CAAC;AAE9E,SAAS,UAAU,CAAC,KAAyC;IAC3D,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAuB;IAClD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;IAC3C,MAAM,SAAS,GAAG,GAAG,WAAW,8BAA8B,CAAC;IAC/D,MAAM,QAAQ,GAAG,wCAAwC,WAAW,GAAG,CAAC;IAExE,OAAO;;;;;wCAK+B,UAAU,CAAC,QAAQ,CAAC;;;;yCAInB,UAAU,CAAC,SAAS,CAAC;+CACf,UAAU,CAAC,QAAQ,CAAC;4DACP,UAAU,CAAC,QAAQ,CAAC;;;;8CAIlC,UAAU,CAAC,SAAS,CAAC;oDACf,UAAU,CAAC,QAAQ,CAAC;iEACP,UAAU,CAAC,QAAQ,CAAC;;aAExE,UAAU,CAAC,SAAS,CAAC;;;;;;;;;;;iCAWD,eAAe;;QAExC,CAAC;AACT,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opensource-showcase",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "CLI tool to curate and showcase your open source contributions",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
@@ -1,3 +0,0 @@
1
- export declare function renderStyles(): string;
2
- export declare function renderScript(): string;
3
- //# sourceMappingURL=assets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/repo/site/assets.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,IAAI,MAAM,CAgbrC;AAED,wBAAgB,YAAY,IAAI,MAAM,CA0ErC"}
@@ -1,509 +0,0 @@
1
- export function renderStyles() {
2
- return `<style>
3
- :root {
4
- /* GitHub Light Theme */
5
- --bg: #ffffff;
6
- --panel: #f6f8fa;
7
- --panel-soft: #ffffff;
8
- --text: #1f2328;
9
- --muted: #59636e;
10
- --line: #d1d9e0;
11
- --accent: #0969da;
12
- --accent-hover: #0550ae;
13
- --accent-strong: #0a3069;
14
- --shadow: 0 1px 3px rgba(27, 31, 36, 0.12), 0 8px 24px rgba(66, 74, 83, 0.12);
15
- --border-default: #d0d7de;
16
- --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
17
- --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
18
- }
19
-
20
- * { box-sizing: border-box; }
21
-
22
- body {
23
- margin: 0;
24
- background: var(--bg);
25
- color: var(--text);
26
- font-family: var(--font-sans);
27
- line-height: 1.6;
28
- }
29
-
30
- a {
31
- color: var(--accent);
32
- text-decoration: none;
33
- }
34
- a:hover {
35
- text-decoration: underline;
36
- }
37
-
38
- /* Full Width Container */
39
- .shell {
40
- width: 95%;
41
- max-width: 1800px;
42
- margin: 0 auto;
43
- }
44
-
45
- /* Sticky Professional Navbar */
46
- .navbar {
47
- position: sticky;
48
- top: 0;
49
- z-index: 100;
50
- background: var(--panel);
51
- border-bottom: 1px solid var(--border-default);
52
- padding: 16px 0;
53
- box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04);
54
- }
55
-
56
- .navbar-inner {
57
- display: flex;
58
- align-items: center;
59
- justify-content: space-between;
60
- }
61
-
62
- .nav-identity { display: flex; align-items: center; gap: 12px; }
63
- .nav-avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-default); }
64
- .nav-info { display: flex; flex-direction: column; line-height: 1.3; }
65
- .nav-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
66
- .nav-handle { font-size: 0.85rem; color: var(--muted); }
67
- .nav-handle a { color: var(--accent); }
68
- .nav-controls { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
69
-
70
- .search {
71
- width: 300px;
72
- height: 32px;
73
- padding: 5px 12px;
74
- border: 1px solid var(--border-default);
75
- border-radius: 6px;
76
- background: var(--panel-soft);
77
- font-size: 0.875rem;
78
- color: var(--text);
79
- }
80
- .search:focus {
81
- outline: 2px solid var(--accent);
82
- outline-offset: -1px;
83
- border-color: var(--accent);
84
- }
85
-
86
- /* Main Content Layout */
87
- main { padding: 32px 0 64px; }
88
-
89
- /* Repository Section - Full Width */
90
- .repo-section {
91
- margin-top: 24px;
92
- padding: 24px;
93
- background: var(--panel-soft);
94
- border: 1px solid var(--border-default);
95
- border-left: 4px solid var(--accent);
96
- border-radius: 6px;
97
- box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04);
98
- }
99
-
100
- .repo-header {
101
- display: flex;
102
- justify-content: space-between;
103
- align-items: flex-start;
104
- gap: 24px;
105
- margin: -24px -24px 0;
106
- padding: 16px 20px 16px;
107
- background: linear-gradient(180deg, var(--panel) 0%, var(--panel-soft) 100%);
108
- border-bottom: 1px solid var(--border-default);
109
- border-radius: 2px 6px 0 0;
110
- }
111
-
112
- .repo-title-area {
113
- flex: 1;
114
- }
115
-
116
- .repo-name {
117
- display: inline-flex;
118
- gap: 10px;
119
- align-items: center;
120
- font-weight: 600;
121
- font-size: 1.125rem;
122
- color: var(--accent);
123
- }
124
- .repo-name:hover {
125
- color: var(--accent-hover);
126
- text-decoration: underline;
127
- }
128
- .repo-name img {
129
- border: 1px solid var(--border-default);
130
- border-radius: 6px;
131
- }
132
-
133
- .repo-description {
134
- margin: 8px 0 0 42px;
135
- color: var(--muted);
136
- font-size: 0.875rem;
137
- line-height: 1.5;
138
- }
139
-
140
- .repo-stats {
141
- display: flex;
142
- gap: 8px;
143
- align-items: center;
144
- flex-wrap: wrap;
145
- }
146
- .repo-stats span {
147
- padding: 5px 12px;
148
- background: var(--panel-soft);
149
- border: 1px solid var(--border-default);
150
- border-radius: 6px;
151
- font-size: 0.75rem;
152
- font-weight: 500;
153
- color: var(--muted);
154
- }
155
- .repo-stats strong {
156
- font-weight: 600;
157
- color: var(--text);
158
- }
159
-
160
- /* Contribution Details - Recruiter Optimized */
161
- .contribution-list { display: grid; gap: 16px; margin-top: 20px; }
162
- .contribution {
163
- padding: 16px;
164
- border: 1px solid var(--border-default);
165
- border-radius: 6px;
166
- background: var(--bg);
167
- transition: all 0.1s ease;
168
- }
169
- .contribution:hover {
170
- border-color: var(--muted);
171
- box-shadow: var(--shadow);
172
- }
173
- .pr-heading {
174
- display: flex;
175
- align-items: center;
176
- gap: 8px;
177
- min-width: 0;
178
- margin-bottom: 8px;
179
- }
180
-
181
- .merge-icon-wrap {
182
- display: inline-flex;
183
- align-items: center;
184
- justify-content: center;
185
- flex: 0 0 auto;
186
- width: 16px;
187
- height: 16px;
188
- color: #8250df;
189
- }
190
-
191
- .merge-icon {
192
- width: 16px;
193
- height: 16px;
194
- fill: currentColor;
195
- }
196
-
197
- .pr-title {
198
- font-weight: 600;
199
- font-size: 1rem;
200
- min-width: 0;
201
- color: var(--accent);
202
- }
203
- .pr-title:hover {
204
- color: var(--accent-hover);
205
- text-decoration: underline;
206
- }
207
-
208
- .pr-number {
209
- flex: 0 0 auto;
210
- color: var(--muted);
211
- font-size: 0.875rem;
212
- font-weight: 500;
213
- }
214
-
215
- .pr-number:hover {
216
- color: var(--accent-hover);
217
- }
218
-
219
- .brief-description {
220
- margin: 0 0 12px 0;
221
- font-size: 0.875rem;
222
- color: var(--muted);
223
- line-height: 1.5;
224
- }
225
-
226
- .pr-facts {
227
- display: grid;
228
- gap: 6px;
229
- margin: 12px 0 0;
230
- padding-left: 20px;
231
- color: var(--muted);
232
- font-size: 0.875rem;
233
- }
234
-
235
- .pr-facts li {
236
- padding-left: 2px;
237
- }
238
-
239
- .pr-facts strong {
240
- color: var(--text);
241
- font-weight: 600;
242
- }
243
-
244
- .change-fact {
245
- line-height: 1.8;
246
- }
247
-
248
- .change-fact .diff-badge {
249
- margin-left: 4px;
250
- }
251
-
252
- /* GitHub-style diff badges */
253
- .diff-badge {
254
- display: inline-flex;
255
- align-items: center;
256
- min-height: 22px;
257
- padding: 2px 7px;
258
- border: 1px solid transparent;
259
- border-radius: 6px;
260
- font-size: 0.75rem;
261
- font-weight: 600;
262
- line-height: 1.2;
263
- font-family: var(--font-mono);
264
- }
265
- .diff-badge.add {
266
- background: #dafbe1;
267
- border-color: #aceebb;
268
- color: #116329;
269
- }
270
- .diff-badge.del {
271
- background: #ffebe9;
272
- border-color: #ffcecb;
273
- color: #82071e;
274
- }
275
-
276
- .reviewed-by {
277
- display: flex;
278
- align-items: center;
279
- gap: 6px;
280
- font-size: 0.75rem;
281
- }
282
- .review-label {
283
- font-weight: 600;
284
- color: var(--text);
285
- }
286
- .reviewers {
287
- display: flex;
288
- gap: 4px;
289
- }
290
- .reviewers img {
291
- width: 24px;
292
- height: 24px;
293
- border-radius: 50%;
294
- border: 2px solid #1a7f37;
295
- transition: transform 0.1s ease;
296
- }
297
- .reviewers img:hover {
298
- transform: scale(1.15);
299
- }
300
- .merged-by {
301
- color: var(--accent);
302
- font-weight: 600;
303
- }
304
-
305
- .impact-note {
306
- display: flex;
307
- align-items: flex-start;
308
- gap: 8px;
309
- margin-top: 12px;
310
- padding: 12px;
311
- background: #fff8c5;
312
- border-left: 3px solid #bf8700;
313
- border-radius: 6px;
314
- font-size: 0.875rem;
315
- line-height: 1.5;
316
- }
317
-
318
- .impact-icon {
319
- font-size: 1rem;
320
- line-height: 1;
321
- flex-shrink: 0;
322
- }
323
-
324
- .impact-note strong {
325
- color: var(--accent-strong);
326
- font-weight: 600;
327
- }
328
-
329
- .description-details {
330
- margin-top: 12px;
331
- cursor: pointer;
332
- }
333
-
334
- .description-details summary {
335
- color: var(--accent);
336
- font-size: 0.75rem;
337
- font-weight: 500;
338
- list-style: none;
339
- user-select: none;
340
- padding: 6px 0;
341
- }
342
-
343
- .description-details summary:hover {
344
- color: var(--accent-hover);
345
- text-decoration: underline;
346
- }
347
-
348
- .description-details summary::-webkit-details-marker {
349
- display: none;
350
- }
351
-
352
- .description-details[open] summary {
353
- margin-bottom: 8px;
354
- }
355
-
356
- .description {
357
- display: grid;
358
- gap: 8px;
359
- margin-top: 8px;
360
- max-width: 100%;
361
- min-width: 0;
362
- overflow: hidden;
363
- font-size: 0.875rem;
364
- color: var(--muted);
365
- font-family: var(--font-sans);
366
- padding: 12px;
367
- background: var(--panel);
368
- border: 1px solid var(--border-default);
369
- border-radius: 6px;
370
- }
371
- .description.is-plain-markdown { white-space: pre-wrap; }
372
- .description > * { min-width: 0; }
373
- .description p { margin: 0 0 8px; }
374
- .description p:last-child { margin-bottom: 0; }
375
- .description h1,
376
- .description h2,
377
- .description h3,
378
- .description h4,
379
- .description h5,
380
- .description h6 { margin: 16px 0 8px; color: var(--text); font-weight: 600; line-height: 1.25; }
381
- .description h1 { font-size: 1.15rem; padding-bottom: 6px; border-bottom: 1px solid var(--border-default); }
382
- .description h2 { font-size: 1.05rem; padding-bottom: 6px; border-bottom: 1px solid var(--border-default); }
383
- .description h3 { font-size: 0.95rem; }
384
- .description h4,
385
- .description h5,
386
- .description h6 { font-size: 0.875rem; }
387
- .description ul,
388
- .description ol { margin: 6px 0; padding-left: 20px; }
389
- .description li { margin: 3px 0; }
390
- .description li > p { margin: 4px 0; }
391
- .description a,
392
- .description p,
393
- .description li { overflow-wrap: anywhere; }
394
- .description code { background: rgba(175, 184, 193, 0.2); padding: 2px 6px; border-radius: 6px; font-family: var(--font-mono); font-size: 0.85em; overflow-wrap: anywhere; }
395
- .description pre { max-width: 100%; margin: 8px 0; padding: 12px; overflow-x: auto; background: rgba(175, 184, 193, 0.2); border-radius: 6px; }
396
- .description pre code { padding: 0; background: transparent; border-radius: 0; }
397
- .description blockquote { margin: 8px 0; padding: 0 12px; color: var(--muted); border-left: 4px solid var(--border-default); }
398
- .description img { display: block; height: auto; max-width: 100%; border-radius: 6px; border: 1px solid var(--border-default); margin-top: 8px; }
399
- .description table { display: block; width: 100%; max-width: 100%; margin: 8px 0; overflow-x: auto; border-collapse: collapse; font-size: 0.875rem; }
400
- .description th,
401
- .description td { padding: 8px 12px; border: 1px solid var(--border-default); text-align: left; }
402
- .description th { background: var(--panel); font-weight: 600; color: var(--text); }
403
- .description hr { height: 1px; padding: 0; margin: 16px 0; background: var(--border-default); border: 0; }
404
-
405
- .labels { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
406
- .labels span { padding: 3px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
407
-
408
- .empty {
409
- padding: 48px;
410
- text-align: center;
411
- border: 1px dashed var(--line);
412
- border-radius: 8px;
413
- color: var(--muted);
414
- }
415
-
416
- footer {
417
- padding: 24px 0;
418
- border-top: 1px solid var(--line);
419
- text-align: center;
420
- color: var(--muted);
421
- font-size: 0.85rem;
422
- }
423
-
424
- @media (max-width: 768px) {
425
- .navbar-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
426
- .nav-identity { align-self: flex-start; }
427
- .nav-controls { width: 100%; justify-content: flex-start; }
428
- .search { width: 100%; }
429
- .repo-header { flex-direction: column; }
430
- .repo-stats { justify-content: flex-start; }
431
- }
432
- </style>`;
433
- }
434
- export function renderScript() {
435
- return `<script src="https://cdn.jsdelivr.net/npm/marked@18.0.5/marked.min.js" integrity="sha384-tkjnnf9Tzhv5ZFrDroGvUExw9C3EVFo0RFRkzKR8ZX4b5Psoec4yb1PlD8Jh4j4H" crossorigin="anonymous"></script>
436
- <script src="https://cdn.jsdelivr.net/npm/dompurify@3.2.6/dist/purify.min.js" integrity="sha384-JEyTNhjM6R1ElGoJns4U2Ln4ofPcqzSsynQkmEc/KGy6336qAZl70tDLufbkla+3" crossorigin="anonymous"></script>
437
- <script>
438
- function renderMarkdownDescriptions() {
439
- const descriptions = document.querySelectorAll('.description-details');
440
- const canRenderMarkdown = window.marked && window.marked.parse && window.DOMPurify;
441
-
442
- if (window.marked && window.marked.setOptions) {
443
- window.marked.setOptions({ gfm: true, breaks: false });
444
- }
445
-
446
- descriptions.forEach((details) => {
447
- const source = details.querySelector('.description-markdown');
448
- const target = details.querySelector('.description');
449
- let markdown = '';
450
-
451
- if (source && source.textContent) {
452
- try {
453
- markdown = JSON.parse(source.textContent);
454
- } catch {
455
- markdown = source.textContent;
456
- }
457
- }
458
-
459
- markdown = markdown.trim();
460
-
461
- if (!target || !markdown) {
462
- details.hidden = true;
463
- return;
464
- }
465
-
466
- if (!canRenderMarkdown) {
467
- target.textContent = markdown;
468
- target.classList.add('is-plain-markdown');
469
- return;
470
- }
471
-
472
- const html = window.marked.parse(markdown);
473
- target.innerHTML = window.DOMPurify.sanitize(html);
474
-
475
- target.querySelectorAll('a[href]').forEach((link) => {
476
- link.setAttribute('target', '_blank');
477
- link.setAttribute('rel', 'noopener noreferrer');
478
- });
479
- });
480
- }
481
-
482
- renderMarkdownDescriptions();
483
-
484
- const search = document.querySelector('#search');
485
- const sections = document.querySelectorAll('.repo-section');
486
- const empty = document.querySelector('#empty');
487
-
488
- function applyFilters() {
489
- const query = search ? search.value.toLowerCase().trim() : '';
490
- let visibleCount = 0;
491
-
492
- sections.forEach((section) => {
493
- const matchQuery = !query || section.textContent.toLowerCase().includes(query);
494
-
495
- section.hidden = !matchQuery;
496
- if (!section.hidden) visibleCount++;
497
- });
498
-
499
- if (empty) {
500
- empty.hidden = visibleCount !== 0;
501
- }
502
- }
503
-
504
- if (search) {
505
- search.addEventListener('input', applyFilters);
506
- }
507
- </script>`;
508
- }
509
- //# sourceMappingURL=assets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assets.js","sourceRoot":"","sources":["../../../src/repo/site/assets.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8aI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwEK,CAAC;AACf,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { Contributor, EnrichedContribution } from '../../types/index.js';
2
- import type { SiteStats } from './utils.js';
3
- export declare function renderHero(contributor: Contributor, _stats: SiteStats): string;
4
- export declare function renderMainContent(grouped: Array<[string, EnrichedContribution[]]>): string;
5
- export declare function renderRepositorySection(repo: string, contributions: EnrichedContribution[]): string;
6
- export declare function renderContributionCard(contribution: EnrichedContribution): string;
7
- export declare function renderFooter(updatedAt: string): string;
8
- //# sourceMappingURL=components.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/repo/site/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAa5C,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,CAiB9E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC,GAAG,MAAM,CAO1F;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,oBAAoB,EAAE,GACpC,MAAM,CA4BR;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,CAuEjF;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAMtD"}
@@ -1,129 +0,0 @@
1
- import { escapeHtml, formatDate } from './utils.js';
2
- function stringifyScriptJson(value) {
3
- return JSON.stringify(value).replace(/</g, '\\u003c');
4
- }
5
- function renderMergeIcon() {
6
- return `<svg class="merge-icon" viewBox="0 0 16 16" aria-hidden="true">
7
- <path d="M5 3.25a2.25 2.25 0 1 1-2.75-2.193v9.886A2.25 2.25 0 1 1 .75 13V3.057A2.25 2.25 0 1 1 5 3.25Zm-2.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM14.75 3.25a2.25 2.25 0 0 1-3 2.122v.878A3.75 3.75 0 0 1 8 10H6.75a.75.75 0 0 1 0-1.5H8a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 1 4.5-2.122Zm-2.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path>
8
- </svg>`;
9
- }
10
- export function renderHero(contributor, _stats) {
11
- const displayName = contributor.name ?? contributor.username;
12
- return `<nav class="navbar">
13
- <div class="shell navbar-inner">
14
- <div class="nav-identity">
15
- <img class="nav-avatar" src="https://github.com/${escapeHtml(contributor.username)}.png" alt="${escapeHtml(displayName)}" />
16
- <div class="nav-info">
17
- <span class="nav-name">${escapeHtml(displayName)}</span>
18
- <span class="nav-handle"><a href="${escapeHtml(contributor.profile_url)}">@${escapeHtml(contributor.username)}</a></span>
19
- </div>
20
- </div>
21
- <div class="nav-controls">
22
- <input class="search" id="search" type="search" placeholder="Search contributions..." />
23
- </div>
24
- </div>
25
- </nav>`;
26
- }
27
- export function renderMainContent(grouped) {
28
- return `<main class="shell">
29
- <div id="results">
30
- ${grouped.map(([repo, contributions]) => renderRepositorySection(repo, contributions)).join('')}
31
- </div>
32
- <div class="empty" id="empty" hidden>No matching contributions found.</div>
33
- </main>`;
34
- }
35
- export function renderRepositorySection(repo, contributions) {
36
- const first = contributions[0];
37
- if (!first)
38
- return '';
39
- const sorted = [...contributions].sort((a, b) => new Date(b.merged_at).getTime() - new Date(a.merged_at).getTime());
40
- const [owner] = repo.split('/');
41
- const languages = new Set(sorted.map((contribution) => contribution.language ?? 'Unknown'));
42
- return `<section class="repo-section" data-repo="${escapeHtml(repo)}" data-languages="${escapeHtml([...languages].join('|'))}">
43
- <header class="repo-header">
44
- <div>
45
- <a class="repo-name" href="https://github.com/${escapeHtml(repo)}">
46
- <img src="https://github.com/${escapeHtml(owner)}.png" alt="" width="28" height="28" />
47
- ${escapeHtml(repo)}
48
- </a>
49
- ${first.repo_description ? `<p>${escapeHtml(first.repo_description)}</p>` : ''}
50
- </div>
51
- <div class="repo-stats">
52
- <span aria-label="${first.repo_stars.toLocaleString()} stars">★ ${first.repo_stars.toLocaleString()}</span>
53
- <span>${sorted.length} PR${sorted.length === 1 ? '' : 's'}</span>
54
- </div>
55
- </header>
56
- <div class="contribution-list">
57
- ${sorted.map(renderContributionCard).join('')}
58
- </div>
59
- </section>`;
60
- }
61
- export function renderContributionCard(contribution) {
62
- const description = contribution.pr_body?.trim();
63
- const labels = contribution.labels.slice(0, 5);
64
- const language = contribution.language ?? 'Unknown';
65
- const reviewers = contribution.reviewers?.slice(0, 5) ?? [];
66
- // Simplified reviewer display
67
- const reviewHtml = reviewers.length > 0
68
- ? `<div class="reviewed-by">
69
- <span>✅ Approved by</span>
70
- <div class="reviewers">${reviewers
71
- .map((reviewer) => `<a href="https://github.com/${escapeHtml(reviewer.login)}" title="${escapeHtml(reviewer.login)}"><img src="${escapeHtml(reviewer.avatar_url)}" alt="${escapeHtml(reviewer.login)}" width="24" height="24" /></a>`)
72
- .join('')}</div>
73
- </div>`
74
- : contribution.merged_by
75
- ? `<div class="reviewed-by">
76
- <span>✅ Merged by</span>
77
- <a class="merged-by" href="https://github.com/${escapeHtml(contribution.merged_by)}">@${escapeHtml(contribution.merged_by)}</a>
78
- </div>`
79
- : '';
80
- // Personal impact note
81
- const noteHtml = contribution.note
82
- ? `<div class="impact-note">
83
- <span>💡 <strong>My Impact:</strong> ${escapeHtml(contribution.note)}</span>
84
- </div>`
85
- : '';
86
- return `<article class="contribution" data-title="${escapeHtml(contribution.pr_title)}" data-language="${escapeHtml(language)}">
87
- <div class="pr-heading">
88
- <span class="merge-icon-wrap" title="Merged pull request">${renderMergeIcon()}</span>
89
- <a class="pr-title" href="${escapeHtml(contribution.pr_url)}">${escapeHtml(contribution.pr_title)}</a>
90
- <a class="pr-number" href="${escapeHtml(contribution.pr_url)}">#${contribution.pr_number.toLocaleString()}</a>
91
- </div>
92
-
93
- ${description
94
- ? `<details class="description-details">
95
- <summary>📝 <strong>See description</strong></summary>
96
- <script class="description-markdown" type="application/json">${stringifyScriptJson(description)}</script>
97
- <div class="description markdown-body"></div>
98
- </details>`
99
- : ''}
100
-
101
- ${reviewHtml}
102
- ${noteHtml}
103
-
104
- <ul class="pr-facts">
105
- <li><strong>Merged</strong> ${escapeHtml(formatDate(contribution.merged_at))}</li>
106
- <li><strong>Language</strong> ${escapeHtml(language)}</li>
107
- <li class="change-fact">
108
- <strong>Changes</strong>
109
- <span class="diff-badge add">+${contribution.additions.toLocaleString()}</span>
110
- <span class="diff-badge del">-${contribution.deletions.toLocaleString()}</span>
111
- </li>
112
- <li><strong>Files</strong> ${contribution.files_changed.toLocaleString()}</li>
113
- </ul>
114
-
115
- ${labels.length > 0
116
- ? `<div class="labels">${labels
117
- .map((label) => `<span>${escapeHtml(label)}</span>`)
118
- .join('')}</div>`
119
- : ''}
120
- </article>`;
121
- }
122
- export function renderFooter(updatedAt) {
123
- return `<footer>
124
- <div class="shell">
125
- Updated ${escapeHtml(formatDate(updatedAt))}. Data available in <a href="contributions.json">contributions.json</a>.
126
- </div>
127
- </footer>`;
128
- }
129
- //# sourceMappingURL=components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../../../src/repo/site/components.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEpD,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,eAAe;IACtB,OAAO;;SAEA,CAAC;AACV,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,WAAwB,EAAE,MAAiB;IACpE,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,QAAQ,CAAC;IAE7D,OAAO;;;4DAGmD,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,UAAU,CAAC,WAAW,CAAC;;qCAE5F,UAAU,CAAC,WAAW,CAAC;gDACZ,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC;;;;;;;WAO9G,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAgD;IAChF,OAAO;;UAEC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,aAAa,CAAC,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AE,CAAC;IAEP,OAAO,6CAA6C,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,oBAAoB,UAAU,CAAC,QAAQ,CAAC;;8EAEjD,eAAe,EAAE;8CACjD,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;+CACpE,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,YAAY,CAAC,SAAS,CAAC,cAAc,EAAE;;;kBAIzG,WAAW;QACT,CAAC,CAAC;;iFAE2D,mBAAmB,CAAC,WAAW,CAAC;;2BAEtF;QACP,CAAC,CAAC,EACN;;kBAEE,UAAU;kBACV,QAAQ;;;gDAGsB,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;kDAC5C,UAAU,CAAC,QAAQ,CAAC;;;oDAGlB,YAAY,CAAC,SAAS,CAAC,cAAc,EAAE;oDACvC,YAAY,CAAC,SAAS,CAAC,cAAc,EAAE;;+CAE5C,YAAY,CAAC,aAAa,CAAC,cAAc,EAAE;;;kBAIxE,MAAM,CAAC,MAAM,GAAG,CAAC;QACf,CAAC,CAAC,uBAAuB,MAAM;aAC1B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC;aACnD,IAAI,CAAC,EAAE,CAAC,QAAQ;QACrB,CAAC,CAAC,EACN;yBACS,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,OAAO;;kBAES,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;;cAErC,CAAC;AACf,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { EnrichedContribution } from '../../types/index.js';
2
- export interface SiteStats {
3
- totalContributions: number;
4
- totalProjects: number;
5
- totalLanguages: number;
6
- languages: Array<{
7
- name: string;
8
- count: number;
9
- }>;
10
- }
11
- export declare function escapeHtml(value: string | number | null | undefined): string;
12
- export declare function cleanDescription(value: string | null | undefined, maxLength?: number): string;
13
- export declare function renderRichDescription(value: string | null | undefined, maxLength?: number): string;
14
- export declare function formatDate(value: string): string;
15
- export declare function calculateStats(contributions: EnrichedContribution[]): SiteStats;
16
- export declare function groupByRepository(contributions: EnrichedContribution[]): Array<[string, EnrichedContribution[]]>;
17
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/repo/site/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,SAAS;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAO5E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,SAAS,SAAM,GAAG,MAAM,CAa1F;AAyED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,SAAS,SAAQ,GAAG,MAAM,CAmDjG;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED,wBAAgB,cAAc,CAAC,aAAa,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAoB/E;AAED,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,oBAAoB,EAAE,GACpC,KAAK,CAAC,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAczC"}
@@ -1,156 +0,0 @@
1
- export function escapeHtml(value) {
2
- return String(value ?? '')
3
- .replace(/&/g, '&amp;')
4
- .replace(/</g, '&lt;')
5
- .replace(/>/g, '&gt;')
6
- .replace(/"/g, '&quot;')
7
- .replace(/'/g, '&#39;');
8
- }
9
- export function cleanDescription(value, maxLength = 220) {
10
- if (!value)
11
- return '';
12
- const cleaned = value
13
- .replace(/<!--[\s\S]*?-->/g, '')
14
- .replace(/```[\s\S]*?```/g, '')
15
- .replace(/#{1,6}\s+/g, '')
16
- .replace(/\*\*([^*]+)\*\*/g, '$1')
17
- .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
18
- .replace(/\s+/g, ' ')
19
- .trim();
20
- return cleaned.length > maxLength ? `${cleaned.slice(0, maxLength).trim()}...` : cleaned;
21
- }
22
- function escapeAttribute(value) {
23
- return escapeHtml(value).replace(/`/g, '&#96;');
24
- }
25
- function renderInlineMarkdown(value) {
26
- let rendered = escapeHtml(value);
27
- rendered = rendered.replace(/&lt;img\b([\s\S]*?)\/?&gt;/g, (_match, attrs) => {
28
- const src = attrs.match(/src=&quot;(https?:\/\/[^&]+)&quot;/)?.[1];
29
- if (!src)
30
- return '';
31
- const alt = attrs.match(/alt=&quot;([^&]*)&quot;/)?.[1] ?? '';
32
- const width = attrs.match(/width=&quot;(\d+)&quot;/)?.[1];
33
- const height = attrs.match(/height=&quot;(\d+)&quot;/)?.[1];
34
- const dimensions = [width ? `width="${width}"` : '', height ? `height="${height}"` : '']
35
- .filter(Boolean)
36
- .join(' ');
37
- return `<img src="${src}" alt="${alt}" ${dimensions} loading="lazy" />`;
38
- });
39
- rendered = rendered.replace(/!\[([^\]]*)\]\((https?:\/\/[^)\s]+)\)/g, '<img src="$2" alt="$1" loading="lazy" />');
40
- rendered = rendered.replace(/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g, '<a href="$2">$1</a>');
41
- rendered = rendered.replace(/`([^`]+)`/g, '<code>$1</code>');
42
- rendered = rendered.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');
43
- return rendered;
44
- }
45
- function splitMarkdownTableRow(row) {
46
- return row
47
- .trim()
48
- .replace(/^\|/, '')
49
- .replace(/\|$/, '')
50
- .split('|')
51
- .map((cell) => cell.trim());
52
- }
53
- function isMarkdownTable(block) {
54
- const lines = block.split('\n').map((line) => line.trim());
55
- if (lines.length < 3)
56
- return false;
57
- return (lines[0]?.startsWith('|') === true &&
58
- /^\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?$/.test(lines[1] ?? ''));
59
- }
60
- function renderMarkdownTable(block) {
61
- const lines = block
62
- .split('\n')
63
- .map((line) => line.trim())
64
- .filter(Boolean);
65
- const headers = splitMarkdownTableRow(lines[0] ?? '');
66
- const rows = lines.slice(2).map(splitMarkdownTableRow);
67
- return `<div class="markdown-table-wrap"><table class="markdown-table">
68
- <thead><tr>${headers
69
- .map((header) => `<th>${renderInlineMarkdown(header)}</th>`)
70
- .join('')}</tr></thead>
71
- <tbody>${rows
72
- .map((row) => `<tr>${row.map((cell) => `<td>${renderInlineMarkdown(cell)}</td>`).join('')}</tr>`)
73
- .join('')}</tbody>
74
- </table></div>`;
75
- }
76
- export function renderRichDescription(value, maxLength = 12000) {
77
- if (!value)
78
- return '';
79
- const withoutComments = value
80
- .replace(/<!--[\s\S]*?-->/g, '')
81
- .replace(/```[\s\S]*?```/g, '')
82
- .trim();
83
- const blocks = withoutComments
84
- .split(/\n{2,}/)
85
- .map((block) => block.trim())
86
- .filter(Boolean);
87
- let remainingLength = maxLength;
88
- return blocks
89
- .map((block) => {
90
- if (isMarkdownTable(block)) {
91
- return renderMarkdownTable(block);
92
- }
93
- if (remainingLength <= 0)
94
- return '';
95
- const blockToRender = block.length > remainingLength ? `${block.slice(0, remainingLength).trim()}\n\n...` : block;
96
- remainingLength -= block.length;
97
- const heading = blockToRender.match(/^#{1,3}\s+(.+)$/);
98
- if (heading) {
99
- return `<h4>${renderInlineMarkdown(heading[1] ?? '')}</h4>`;
100
- }
101
- const image = blockToRender.match(/^!\[([^\]]*)\]\((https?:\/\/[^)\s]+)\)$/);
102
- if (image) {
103
- return `<figure><img src="${escapeAttribute(image[2] ?? '')}" alt="${escapeAttribute(image[1] ?? '')}" loading="lazy" /></figure>`;
104
- }
105
- const listItems = blockToRender
106
- .split('\n')
107
- .map((line) => line.match(/^\s*[-*]\s+(.+)$/)?.[1])
108
- .filter((line) => Boolean(line));
109
- if (listItems.length > 0) {
110
- return `<ul>${listItems
111
- .map((item) => `<li>${renderInlineMarkdown(item)}</li>`)
112
- .join('')}</ul>`;
113
- }
114
- return `<p>${renderInlineMarkdown(blockToRender).replace(/\n/g, '<br />')}</p>`;
115
- })
116
- .join('');
117
- }
118
- export function formatDate(value) {
119
- return new Date(value).toLocaleDateString('en-US', {
120
- month: 'short',
121
- day: 'numeric',
122
- year: 'numeric',
123
- });
124
- }
125
- export function calculateStats(contributions) {
126
- const repos = new Set();
127
- const languages = new Map();
128
- contributions.forEach((contribution) => {
129
- repos.add(contribution.repo);
130
- if (contribution.language) {
131
- languages.set(contribution.language, (languages.get(contribution.language) ?? 0) + 1);
132
- }
133
- });
134
- return {
135
- totalContributions: contributions.length,
136
- totalProjects: repos.size,
137
- totalLanguages: languages.size,
138
- languages: [...languages.entries()]
139
- .map(([name, count]) => ({ name, count }))
140
- .sort((a, b) => b.count - a.count || a.name.localeCompare(b.name)),
141
- };
142
- }
143
- export function groupByRepository(contributions) {
144
- const grouped = new Map();
145
- contributions.forEach((contribution) => {
146
- const existing = grouped.get(contribution.repo) ?? [];
147
- existing.push(contribution);
148
- grouped.set(contribution.repo, existing);
149
- });
150
- return [...grouped.entries()].sort((a, b) => {
151
- const aStars = a[1][0]?.repo_stars ?? 0;
152
- const bStars = b[1][0]?.repo_stars ?? 0;
153
- return bStars - aStars || a[0].localeCompare(b[0]);
154
- });
155
- }
156
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/repo/site/utils.ts"],"names":[],"mappings":"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