nuxt-studio 1.0.0-alpha.0 → 1.0.0-alpha.2

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 (50) hide show
  1. package/README.md +11 -9
  2. package/dist/app/en-CeGQDKH5.js +7 -0
  3. package/dist/app/en-D0jd_r21.js +7 -0
  4. package/dist/app/en-XbfkDcMn.js +7 -0
  5. package/dist/app/fr-CbcFrmHX.js +7 -0
  6. package/dist/app/fr-Ct4HO5e1.js +7 -0
  7. package/dist/app/fr-ILHmVnG9.js +7 -0
  8. package/dist/app/main.d.ts +83 -33
  9. package/dist/app/main.js +34187 -30512
  10. package/dist/app/service-worker.js +29 -5
  11. package/dist/app/shared-B6H2zqDG.js +8 -0
  12. package/dist/app/{shared-D04791PA.js → shared-DLETHbvn.js} +2311 -2307
  13. package/dist/app/{shared-DI6F-ifc.js → shared-Dvm_mWyG.js} +3120 -3132
  14. package/dist/app/shared.d.ts +1 -20
  15. package/dist/app/shared.js +2 -4
  16. package/dist/module/module.d.mts +70 -27
  17. package/dist/module/module.json +1 -1
  18. package/dist/module/module.mjs +101 -58
  19. package/dist/module/runtime/host.dev.js +19 -12
  20. package/dist/module/runtime/host.js +124 -61
  21. package/dist/module/runtime/plugins/studio.client.js +1 -1
  22. package/dist/module/runtime/server/routes/admin.js +11 -2
  23. package/dist/module/runtime/server/routes/auth/github.get.d.ts +4 -4
  24. package/dist/module/runtime/server/routes/auth/github.get.js +17 -9
  25. package/dist/module/runtime/server/routes/auth/gitlab.get.d.ts +55 -0
  26. package/dist/module/runtime/server/routes/auth/gitlab.get.js +157 -0
  27. package/dist/module/runtime/server/routes/auth/session.delete.js +2 -1
  28. package/dist/module/runtime/server/routes/auth/session.get.js +4 -1
  29. package/dist/module/runtime/server/routes/dev/content/[...path].js +0 -11
  30. package/dist/module/runtime/server/routes/dev/public/[...path].d.ts +1 -0
  31. package/dist/module/runtime/server/routes/dev/public/[...path].js +2 -0
  32. package/dist/module/runtime/types/content.d.ts +6 -0
  33. package/dist/module/runtime/types/content.js +7 -0
  34. package/dist/module/runtime/utils/activation.js +16 -5
  35. package/dist/module/runtime/utils/collection.d.ts +10 -17
  36. package/dist/module/runtime/utils/collection.js +32 -92
  37. package/dist/module/runtime/utils/document.d.ts +15 -0
  38. package/dist/module/runtime/utils/document.js +288 -0
  39. package/dist/module/runtime/utils/media.d.ts +1 -0
  40. package/dist/module/runtime/utils/media.js +5 -0
  41. package/dist/module/runtime/utils/object.d.ts +4 -0
  42. package/dist/module/runtime/utils/object.js +27 -0
  43. package/dist/module/runtime/utils/source.d.ts +11 -0
  44. package/dist/module/runtime/utils/source.js +36 -0
  45. package/license.md +9 -0
  46. package/package.json +7 -6
  47. package/dist/app/shared-R5zYJ3Dl.js +0 -25803
  48. package/dist/app/utils-DI6F-ifc.js +0 -25774
  49. package/dist/app/utils.d.ts +0 -22
  50. package/dist/app/utils.js +0 -6
@@ -19,6 +19,31 @@ const IMAGE_EXTENSIONS = [
19
19
  'gif',
20
20
  ]
21
21
 
22
+ function extractImagePath(url) {
23
+ const pathname = url.pathname;
24
+ if (pathname.startsWith('/_ipx/_/')) {
25
+ return pathname.replace('/_ipx/_', '')
26
+ }
27
+
28
+ if (pathname.startsWith('/_vercel/image')) {
29
+ return url.searchParams.get('url') || null
30
+ }
31
+
32
+ if (IMAGE_EXTENSIONS.includes(pathname.split('.').pop())) {
33
+ return pathname
34
+ }
35
+
36
+ return null
37
+ }
38
+
39
+ self.addEventListener('install', event => {
40
+ self.skipWaiting()
41
+ })
42
+
43
+ self.addEventListener('activate', event => {
44
+ event.waitUntil(self.clients.claim())
45
+ })
46
+
22
47
  self.addEventListener('fetch', event => {
23
48
  const url = new URL(event.request.url);
24
49
  const isSameDomain = url.origin === self.location.origin;
@@ -27,19 +52,18 @@ self.addEventListener('fetch', event => {
27
52
  return event.respondWith(fetch(event.request));
28
53
  }
29
54
 
30
- if (url.pathname.startsWith('/_ipx/_/') || IMAGE_EXTENSIONS.includes(url.pathname.split('.').pop())) {
31
- return event.respondWith(fetchFromIndexedDB(event, url));
55
+ const imageUrl = extractImagePath(url);
56
+ if (imageUrl) {
57
+ return event.respondWith(fetchFromIndexedDB(event, imageUrl));
32
58
  }
33
59
 
34
60
  event.respondWith(fetch(event.request))
35
61
  })
36
62
 
37
63
  function fetchFromIndexedDB(event, url) {
38
- console.log('Fetching from IndexedDB:', url.pathname);
39
- const dbKey = ['public-assets:', url.pathname.replace(/^\\/+(_ipx\\/_\\/)?/, '').replace('/', ':')].join('')
64
+ const dbKey = url.replace(/^\\//g, '').replace(/\\//g, ':')
40
65
  return getData(dbKey).then(data => {
41
66
  if (!data) {
42
- console.log('No data found in IndexedDB:', url.pathname, dbKey);
43
67
  return fetch(event.request);
44
68
  }
45
69
 
@@ -0,0 +1,8 @@
1
+ function t(e) {
2
+ return e.split(".").slice(0, -1).join(".");
3
+ }
4
+ const s = "public-assets";
5
+ export {
6
+ s as V,
7
+ t as g
8
+ };