opensource-showcase 0.1.21 → 0.1.22
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;AAc3D,wBAAgB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,
|
|
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,CAiE5D"}
|
|
@@ -1,7 +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
|
+
const SHOWCASE_UI_URL = 'https://cdn.jsdelivr.net/npm/opensource-showcase-ui@1.1.1/dist/showcase-ui.js';
|
|
5
5
|
function escapeHtml(value) {
|
|
6
6
|
return String(value ?? '')
|
|
7
7
|
.replace(/&/g, '&')
|
|
@@ -45,7 +45,33 @@ export function generateSite(data) {
|
|
|
45
45
|
</section>
|
|
46
46
|
</main>
|
|
47
47
|
</div>
|
|
48
|
-
<script type="module"
|
|
48
|
+
<script type="module">
|
|
49
|
+
const fallbackUrl = '${SHOWCASE_UI_URL}';
|
|
50
|
+
let uiUrl = fallbackUrl;
|
|
51
|
+
const controller = new AbortController();
|
|
52
|
+
const timeout = setTimeout(() => controller.abort(), 5000);
|
|
53
|
+
try {
|
|
54
|
+
const response = await fetch(
|
|
55
|
+
'https://data.jsdelivr.com/v1/package/resolve/npm/opensource-showcase-ui@1',
|
|
56
|
+
{ cache: 'no-store', signal: controller.signal }
|
|
57
|
+
);
|
|
58
|
+
if (!response.ok) throw new Error('Could not resolve the UI version');
|
|
59
|
+
const { version } = await response.json();
|
|
60
|
+
if (/^1\\.\\d+\\.\\d+$/.test(version)) {
|
|
61
|
+
uiUrl = 'https://cdn.jsdelivr.net/npm/opensource-showcase-ui@' + version + '/dist/showcase-ui.js';
|
|
62
|
+
}
|
|
63
|
+
} catch {
|
|
64
|
+
// Keep the last known notebook release available when discovery is offline.
|
|
65
|
+
} finally {
|
|
66
|
+
clearTimeout(timeout);
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
await import(uiUrl);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
if (uiUrl === fallbackUrl) throw error;
|
|
72
|
+
await import(fallbackUrl);
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
49
75
|
</body>
|
|
50
76
|
</html>`;
|
|
51
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-site.js","sourceRoot":"","sources":["../../src/repo/generate-site.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,eAAe,GACnB,
|
|
1
|
+
{"version":3,"file":"generate-site.js","sourceRoot":"","sources":["../../src/repo/generate-site.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,eAAe,GACnB,+EAA+E,CAAC;AAElF,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;;;;;;;;;;;;6BAYL,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BpC,CAAC;AACT,CAAC"}
|