@depup/nuxt 4.2.2-depup.0

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 (233) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -0
  3. package/app.d.ts +1 -0
  4. package/bin/nuxt.mjs +2 -0
  5. package/config.cjs +7 -0
  6. package/config.d.ts +8 -0
  7. package/config.js +5 -0
  8. package/dist/app/compat/capi.d.ts +4 -0
  9. package/dist/app/compat/capi.js +19 -0
  10. package/dist/app/compat/idle-callback.d.ts +2 -0
  11. package/dist/app/compat/idle-callback.js +15 -0
  12. package/dist/app/compat/interval.d.ts +1 -0
  13. package/dist/app/compat/interval.js +11 -0
  14. package/dist/app/compat/vue-demi.d.ts +4 -0
  15. package/dist/app/compat/vue-demi.js +4 -0
  16. package/dist/app/components/client-fallback.client.d.ts +50 -0
  17. package/dist/app/components/client-fallback.client.js +50 -0
  18. package/dist/app/components/client-fallback.server.d.ts +57 -0
  19. package/dist/app/components/client-fallback.server.js +80 -0
  20. package/dist/app/components/client-only.d.ts +26 -0
  21. package/dist/app/components/client-only.js +130 -0
  22. package/dist/app/components/dev-only.d.ts +11 -0
  23. package/dist/app/components/dev-only.js +14 -0
  24. package/dist/app/components/error-404.d.vue.ts +51 -0
  25. package/dist/app/components/error-404.vue +48 -0
  26. package/dist/app/components/error-404.vue.d.ts +51 -0
  27. package/dist/app/components/error-500.d.vue.ts +51 -0
  28. package/dist/app/components/error-500.vue +46 -0
  29. package/dist/app/components/error-500.vue.d.ts +51 -0
  30. package/dist/app/components/index.d.ts +3 -0
  31. package/dist/app/components/index.js +1 -0
  32. package/dist/app/components/injections.d.ts +7 -0
  33. package/dist/app/components/injections.js +2 -0
  34. package/dist/app/components/island-renderer.d.ts +20 -0
  35. package/dist/app/components/island-renderer.js +28 -0
  36. package/dist/app/components/nuxt-error-boundary.d.vue.ts +24 -0
  37. package/dist/app/components/nuxt-error-boundary.vue +46 -0
  38. package/dist/app/components/nuxt-error-boundary.vue.d.ts +24 -0
  39. package/dist/app/components/nuxt-error-page.d.vue.ts +7 -0
  40. package/dist/app/components/nuxt-error-page.vue +27 -0
  41. package/dist/app/components/nuxt-error-page.vue.d.ts +7 -0
  42. package/dist/app/components/nuxt-island.d.ts +70 -0
  43. package/dist/app/components/nuxt-island.js +331 -0
  44. package/dist/app/components/nuxt-layout.d.ts +14 -0
  45. package/dist/app/components/nuxt-layout.js +171 -0
  46. package/dist/app/components/nuxt-link.d.ts +101 -0
  47. package/dist/app/components/nuxt-link.js +409 -0
  48. package/dist/app/components/nuxt-loading-indicator.d.ts +78 -0
  49. package/dist/app/components/nuxt-loading-indicator.js +75 -0
  50. package/dist/app/components/nuxt-root.d.vue.ts +3 -0
  51. package/dist/app/components/nuxt-root.vue +60 -0
  52. package/dist/app/components/nuxt-root.vue.d.ts +3 -0
  53. package/dist/app/components/nuxt-route-announcer.d.ts +26 -0
  54. package/dist/app/components/nuxt-route-announcer.js +48 -0
  55. package/dist/app/components/nuxt-stubs.d.ts +6 -0
  56. package/dist/app/components/nuxt-stubs.js +14 -0
  57. package/dist/app/components/nuxt-teleport-island-component.d.ts +22 -0
  58. package/dist/app/components/nuxt-teleport-island-component.js +38 -0
  59. package/dist/app/components/nuxt-teleport-island-slot.d.ts +32 -0
  60. package/dist/app/components/nuxt-teleport-island-slot.js +53 -0
  61. package/dist/app/components/nuxt-time.d.vue.ts +37 -0
  62. package/dist/app/components/nuxt-time.vue +148 -0
  63. package/dist/app/components/nuxt-time.vue.d.ts +37 -0
  64. package/dist/app/components/route-provider.d.ts +48 -0
  65. package/dist/app/components/route-provider.js +49 -0
  66. package/dist/app/components/server-placeholder.d.ts +2 -0
  67. package/dist/app/components/server-placeholder.js +7 -0
  68. package/dist/app/components/test-component-wrapper.d.ts +4 -0
  69. package/dist/app/components/test-component-wrapper.js +27 -0
  70. package/dist/app/components/utils.d.ts +48 -0
  71. package/dist/app/components/utils.js +126 -0
  72. package/dist/app/components/welcome.d.vue.ts +24 -0
  73. package/dist/app/components/welcome.vue +34 -0
  74. package/dist/app/components/welcome.vue.d.ts +24 -0
  75. package/dist/app/composables/asyncContext.d.ts +2 -0
  76. package/dist/app/composables/asyncContext.js +7 -0
  77. package/dist/app/composables/asyncData.d.ts +146 -0
  78. package/dist/app/composables/asyncData.js +491 -0
  79. package/dist/app/composables/chunk.d.ts +25 -0
  80. package/dist/app/composables/chunk.js +30 -0
  81. package/dist/app/composables/component.d.ts +4 -0
  82. package/dist/app/composables/component.js +82 -0
  83. package/dist/app/composables/cookie.d.ts +22 -0
  84. package/dist/app/composables/cookie.js +205 -0
  85. package/dist/app/composables/error.d.ts +25 -0
  86. package/dist/app/composables/error.js +39 -0
  87. package/dist/app/composables/fetch.d.ts +37 -0
  88. package/dist/app/composables/fetch.js +123 -0
  89. package/dist/app/composables/head.d.ts +1 -0
  90. package/dist/app/composables/head.js +1 -0
  91. package/dist/app/composables/hydrate.d.ts +9 -0
  92. package/dist/app/composables/hydrate.js +14 -0
  93. package/dist/app/composables/id.d.ts +3 -0
  94. package/dist/app/composables/id.js +2 -0
  95. package/dist/app/composables/index.d.ts +29 -0
  96. package/dist/app/composables/index.js +21 -0
  97. package/dist/app/composables/lazy-hydration.d.ts +40 -0
  98. package/dist/app/composables/lazy-hydration.js +2 -0
  99. package/dist/app/composables/loading-indicator.d.ts +39 -0
  100. package/dist/app/composables/loading-indicator.js +142 -0
  101. package/dist/app/composables/manifest.d.ts +20 -0
  102. package/dist/app/composables/manifest.js +59 -0
  103. package/dist/app/composables/once.d.ts +14 -0
  104. package/dist/app/composables/once.js +49 -0
  105. package/dist/app/composables/payload.d.ts +27 -0
  106. package/dist/app/composables/payload.js +137 -0
  107. package/dist/app/composables/preload.d.ts +20 -0
  108. package/dist/app/composables/preload.js +55 -0
  109. package/dist/app/composables/preview.d.ts +38 -0
  110. package/dist/app/composables/preview.js +61 -0
  111. package/dist/app/composables/ready.d.ts +2 -0
  112. package/dist/app/composables/ready.js +15 -0
  113. package/dist/app/composables/route-announcer.d.ts +19 -0
  114. package/dist/app/composables/route-announcer.js +55 -0
  115. package/dist/app/composables/router.d.ts +96 -0
  116. package/dist/app/composables/router.js +197 -0
  117. package/dist/app/composables/runtime-hook.d.ts +9 -0
  118. package/dist/app/composables/runtime-hook.js +7 -0
  119. package/dist/app/composables/script-stubs.d.ts +32 -0
  120. package/dist/app/composables/script-stubs.js +104 -0
  121. package/dist/app/composables/ssr.d.ts +33 -0
  122. package/dist/app/composables/ssr.js +113 -0
  123. package/dist/app/composables/state.d.ts +11 -0
  124. package/dist/app/composables/state.js +40 -0
  125. package/dist/app/composables/url.d.ts +3 -0
  126. package/dist/app/composables/url.js +8 -0
  127. package/dist/app/config.d.ts +14 -0
  128. package/dist/app/config.js +72 -0
  129. package/dist/app/entry-spa.d.ts +2 -0
  130. package/dist/app/entry-spa.js +2 -0
  131. package/dist/app/entry.async.d.ts +3 -0
  132. package/dist/app/entry.async.js +5 -0
  133. package/dist/app/entry.d.ts +7 -0
  134. package/dist/app/entry.js +78 -0
  135. package/dist/app/index.d.ts +12 -0
  136. package/dist/app/index.js +8 -0
  137. package/dist/app/middleware/manifest-route-rule.d.ts +2 -0
  138. package/dist/app/middleware/manifest-route-rule.js +17 -0
  139. package/dist/app/nuxt.d.ts +271 -0
  140. package/dist/app/nuxt.js +279 -0
  141. package/dist/app/plugins/browser-devtools-timing.client.d.ts +2 -0
  142. package/dist/app/plugins/browser-devtools-timing.client.js +23 -0
  143. package/dist/app/plugins/check-if-layout-used.d.ts +2 -0
  144. package/dist/app/plugins/check-if-layout-used.js +28 -0
  145. package/dist/app/plugins/check-outdated-build.client.d.ts +2 -0
  146. package/dist/app/plugins/check-outdated-build.client.js +39 -0
  147. package/dist/app/plugins/chunk-reload-immediate.client.d.ts +2 -0
  148. package/dist/app/plugins/chunk-reload-immediate.client.js +20 -0
  149. package/dist/app/plugins/chunk-reload.client.d.ts +2 -0
  150. package/dist/app/plugins/chunk-reload.client.js +30 -0
  151. package/dist/app/plugins/cross-origin-prefetch.client.d.ts +2 -0
  152. package/dist/app/plugins/cross-origin-prefetch.client.js +37 -0
  153. package/dist/app/plugins/debug-hooks.d.ts +2 -0
  154. package/dist/app/plugins/debug-hooks.js +9 -0
  155. package/dist/app/plugins/dev-server-logs.d.ts +2 -0
  156. package/dist/app/plugins/dev-server-logs.js +60 -0
  157. package/dist/app/plugins/navigation-repaint.client.d.ts +2 -0
  158. package/dist/app/plugins/navigation-repaint.client.js +16 -0
  159. package/dist/app/plugins/payload.client.d.ts +2 -0
  160. package/dist/app/plugins/payload.client.js +50 -0
  161. package/dist/app/plugins/preload.server.d.ts +2 -0
  162. package/dist/app/plugins/preload.server.js +13 -0
  163. package/dist/app/plugins/restore-state.client.d.ts +2 -0
  164. package/dist/app/plugins/restore-state.client.js +18 -0
  165. package/dist/app/plugins/revive-payload.client.d.ts +2 -0
  166. package/dist/app/plugins/revive-payload.client.js +44 -0
  167. package/dist/app/plugins/revive-payload.server.d.ts +2 -0
  168. package/dist/app/plugins/revive-payload.server.js +26 -0
  169. package/dist/app/plugins/router.d.ts +59 -0
  170. package/dist/app/plugins/router.js +222 -0
  171. package/dist/app/plugins/utils.d.ts +1 -0
  172. package/dist/app/plugins/utils.js +4 -0
  173. package/dist/app/plugins/view-transitions.client.d.ts +2 -0
  174. package/dist/app/plugins/view-transitions.client.js +55 -0
  175. package/dist/app/plugins/warn.dev.server.d.ts +2 -0
  176. package/dist/app/plugins/warn.dev.server.js +6 -0
  177. package/dist/app/types/augments.d.ts +49 -0
  178. package/dist/app/types/augments.js +0 -0
  179. package/dist/app/types.d.ts +39 -0
  180. package/dist/app/types.js +0 -0
  181. package/dist/app/utils.d.ts +13 -0
  182. package/dist/app/utils.js +34 -0
  183. package/dist/components/runtime/client-component.d.ts +2 -0
  184. package/dist/components/runtime/client-component.js +59 -0
  185. package/dist/components/runtime/lazy-hydrated-component.d.ts +124 -0
  186. package/dist/components/runtime/lazy-hydrated-component.js +101 -0
  187. package/dist/components/runtime/server-component.d.ts +20 -0
  188. package/dist/components/runtime/server-component.js +69 -0
  189. package/dist/head/runtime/components.d.ts +1058 -0
  190. package/dist/head/runtime/components.js +297 -0
  191. package/dist/head/runtime/composables.d.ts +25 -0
  192. package/dist/head/runtime/composables.js +47 -0
  193. package/dist/head/runtime/plugins/unhead.d.ts +2 -0
  194. package/dist/head/runtime/plugins/unhead.js +31 -0
  195. package/dist/head/runtime/types.d.ts +7 -0
  196. package/dist/head/runtime/types.js +0 -0
  197. package/dist/index.d.mts +9 -0
  198. package/dist/index.d.ts +9 -0
  199. package/dist/index.mjs +6974 -0
  200. package/dist/pages/runtime/app.d.vue.ts +3 -0
  201. package/dist/pages/runtime/app.vue +6 -0
  202. package/dist/pages/runtime/app.vue.d.ts +3 -0
  203. package/dist/pages/runtime/component-stub.d.ts +2 -0
  204. package/dist/pages/runtime/component-stub.js +1 -0
  205. package/dist/pages/runtime/composables.d.ts +58 -0
  206. package/dist/pages/runtime/composables.js +24 -0
  207. package/dist/pages/runtime/index.d.ts +3 -0
  208. package/dist/pages/runtime/index.js +1 -0
  209. package/dist/pages/runtime/page-placeholder.d.ts +4 -0
  210. package/dist/pages/runtime/page-placeholder.js +11 -0
  211. package/dist/pages/runtime/page.d.ts +30 -0
  212. package/dist/pages/runtime/page.js +212 -0
  213. package/dist/pages/runtime/plugins/check-if-page-unused.d.ts +2 -0
  214. package/dist/pages/runtime/plugins/check-if-page-unused.js +29 -0
  215. package/dist/pages/runtime/plugins/prefetch.client.d.ts +2 -0
  216. package/dist/pages/runtime/plugins/prefetch.client.js +41 -0
  217. package/dist/pages/runtime/plugins/prerender.server.d.ts +2 -0
  218. package/dist/pages/runtime/plugins/prerender.server.js +47 -0
  219. package/dist/pages/runtime/plugins/router.d.ts +6 -0
  220. package/dist/pages/runtime/plugins/router.js +236 -0
  221. package/dist/pages/runtime/router.options.d.ts +3 -0
  222. package/dist/pages/runtime/router.options.js +60 -0
  223. package/dist/pages/runtime/utils.d.ts +11 -0
  224. package/dist/pages/runtime/utils.js +18 -0
  225. package/dist/pages/runtime/validate.d.ts +2 -0
  226. package/dist/pages/runtime/validate.js +23 -0
  227. package/kit.d.ts +1 -0
  228. package/kit.js +1 -0
  229. package/package.json +156 -0
  230. package/schema.d.ts +1 -0
  231. package/schema.js +1 -0
  232. package/types.d.mts +14 -0
  233. package/types.d.ts +14 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016-present - Nuxt Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,117 @@
1
+ [![Nuxt banner](https://github.com/nuxt/nuxt/blob/main/.github/assets/banner.svg)](https://nuxt.com)
2
+
3
+ # Nuxt
4
+
5
+ <p>
6
+ <a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/v/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Version"></a>
7
+ <a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/dm/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Downloads"></a>
8
+ <a href="https://github.com/nuxt/nuxt/blob/main/LICENSE"><img src="https://img.shields.io/github/license/nuxt/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="License"></a>
9
+ <a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt" alt="Website"></a>
10
+ <a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
11
+ <a href="https://securityscorecards.dev/"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
12
+ </p>
13
+
14
+ Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.
15
+
16
+ It provides a number of features that make it easy to build fast, SEO-friendly, and scalable web applications, including:
17
+ - Server-side rendering, static site generation, hybrid rendering and edge-side rendering
18
+ - Automatic routing with code-splitting and pre-fetching
19
+ - Data fetching and state management
20
+ - Search engine optimization and defining meta tags
21
+ - Auto imports of components, composables and utils
22
+ - TypeScript with zero configuration
23
+ - Go full-stack with our server/ directory
24
+ - Extensible with [200+ modules](https://nuxt.com/modules)
25
+ - Deployment to a variety of [hosting platforms](https://nuxt.com/deploy)
26
+ - ...[and much more](https://nuxt.com) 🚀
27
+
28
+ ### Table of Contents
29
+
30
+ - 🚀 [Getting Started](#getting-started)
31
+ - 💻 [ Vue Development](#vue-development)
32
+ - 📖 [Documentation](#documentation)
33
+ - 🧩 [Modules](#modules)
34
+ - ❤️ [Contribute](#contribute)
35
+ - 🏠 [Local Development](#local-development)
36
+ - 🛟 [Professional Support](#professional-support)
37
+ - 🔗 [Follow Us](#follow-us)
38
+ - ⚖️ [License](#license)
39
+
40
+ ---
41
+
42
+ ## <a name="getting-started">🚀 Getting Started</a>
43
+
44
+ Use the following command to create a new starter project. This will create a starter project with all the necessary files and dependencies:
45
+
46
+ ```bash
47
+ npm create nuxt@latest <my-project>
48
+ ```
49
+
50
+ > [!TIP]
51
+ > Discover also [nuxt.new](https://nuxt.new): Open a Nuxt starter on CodeSandbox, StackBlitz or locally to get up and running in a few seconds.
52
+
53
+ ## <a name="vue-development">💻 Vue Development</a>
54
+
55
+ Simple, intuitive and powerful, Nuxt lets you write Vue components in a way that makes sense. Every repetitive task is automated, so you can focus on writing your full-stack Vue application with confidence.
56
+
57
+ Example of an `app.vue`:
58
+
59
+ ```vue
60
+ <script setup lang="ts">
61
+ useSeoMeta({
62
+ title: 'Meet Nuxt',
63
+ description: 'The Intuitive Vue Framework.',
64
+ })
65
+ </script>
66
+
67
+ <template>
68
+ <div id="app">
69
+ <AppHeader />
70
+ <NuxtPage />
71
+ <AppFooter />
72
+ </div>
73
+ </template>
74
+
75
+ <style scoped>
76
+ #app {
77
+ background-color: #020420;
78
+ color: #00DC82;
79
+ }
80
+ </style>
81
+ ```
82
+
83
+ ## <a name="documentation">📖 Documentation</a>
84
+
85
+ We highly recommend you take a look at the [Nuxt documentation](https://nuxt.com/docs) to level up. It’s a great resource for learning more about the framework. It covers everything from getting started to advanced topics.
86
+
87
+ ## <a name="modules">🧩 Modules</a>
88
+
89
+ Discover our [list of modules](https://nuxt.com/modules) to supercharge your Nuxt project, created by the Nuxt team and community.
90
+
91
+ ## <a name="contribute">❤️ Contribute</a>
92
+
93
+ We invite you to contribute and help improve Nuxt 💚
94
+
95
+ Here are a few ways you can get involved:
96
+ - **Reporting Bugs:** If you come across any bugs or issues, please check out the [reporting bugs guide](https://nuxt.com/docs/4.x/community/reporting-bugs) to learn how to submit a bug report.
97
+ - **Suggestions:** Have ideas to enhance Nuxt? We'd love to hear them! Check out the [contribution guide](https://nuxt.com/docs/4.x/community/contribution) to share your suggestions.
98
+ - **Questions:** If you have questions or need assistance, the [getting help guide](https://nuxt.com/docs/4.x/community/getting-help) provides resources to help you out.
99
+
100
+ ## <a name="local-development">🏠 Local Development</a>
101
+
102
+ Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/docs/4.x/community/framework-contribution#setup) to contribute to the framework and documentation.
103
+
104
+ ## <a name="professional-support">🛟 Professional Support</a>
105
+
106
+ - Technical audit & consulting: [Nuxt Experts](https://nuxt.com/enterprise/support)
107
+ - Custom development & more: [Nuxt Agencies Partners](https://nuxt.com/enterprise/agencies)
108
+
109
+ ## <a name="follow-us">🔗 Follow Us</a>
110
+
111
+ <p valign="center">
112
+ <a href="https://go.nuxt.com/discord"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/discord.svg" alt="Discord"></a>&nbsp;&nbsp;<a href="https://go.nuxt.com/x"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/twitter.svg" alt="Twitter"></a>&nbsp;&nbsp;<a href="https://go.nuxt.com/github"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/github.svg" alt="GitHub"></a>&nbsp;&nbsp;<a href="https://go.nuxt.com/bluesky"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/bluesky.svg" alt="Bluesky"></a>
113
+ </p>
114
+
115
+ ## <a name="license">⚖️ License</a>
116
+
117
+ [MIT](https://github.com/nuxt/nuxt/blob/main/LICENSE)
package/app.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/app/index'
package/bin/nuxt.mjs ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '@nuxt/cli/cli'
package/config.cjs ADDED
@@ -0,0 +1,7 @@
1
+ function defineNuxtConfig (config) {
2
+ return config
3
+ }
4
+
5
+ module.exports = {
6
+ defineNuxtConfig,
7
+ }
package/config.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import type { ConfigLayerMeta, DefineConfig } from 'c12'
2
+ import type { NuxtConfig } from 'nuxt/schema'
3
+
4
+ export { NuxtConfig } from 'nuxt/schema'
5
+
6
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
7
+ export interface DefineNuxtConfig extends DefineConfig<NuxtConfig, ConfigLayerMeta> {}
8
+ export declare const defineNuxtConfig: DefineNuxtConfig
package/config.js ADDED
@@ -0,0 +1,5 @@
1
+ function defineNuxtConfig (config) {
2
+ return config
3
+ }
4
+
5
+ export { defineNuxtConfig }
@@ -0,0 +1,4 @@
1
+ export * from 'vue';
2
+ export declare const install: () => void;
3
+ export declare function set(target: any, key: string | number | symbol, val: any): any;
4
+ export declare function del(target: any, key: string | number | symbol): void;
@@ -0,0 +1,19 @@
1
+ export * from "vue";
2
+ export const install = () => {
3
+ };
4
+ export function set(target, key, val) {
5
+ if (Array.isArray(target)) {
6
+ target.length = Math.max(target.length, key);
7
+ target.splice(key, 1, val);
8
+ return val;
9
+ }
10
+ target[key] = val;
11
+ return val;
12
+ }
13
+ export function del(target, key) {
14
+ if (Array.isArray(target)) {
15
+ target.splice(key, 1);
16
+ return;
17
+ }
18
+ delete target[key];
19
+ }
@@ -0,0 +1,2 @@
1
+ export declare const requestIdleCallback: Window['requestIdleCallback'];
2
+ export declare const cancelIdleCallback: Window['cancelIdleCallback'];
@@ -0,0 +1,15 @@
1
+ export const requestIdleCallback = import.meta.server ? (() => {
2
+ }) : globalThis.requestIdleCallback || ((cb) => {
3
+ const start = Date.now();
4
+ const idleDeadline = {
5
+ didTimeout: false,
6
+ timeRemaining: () => Math.max(0, 50 - (Date.now() - start))
7
+ };
8
+ return setTimeout(() => {
9
+ cb(idleDeadline);
10
+ }, 1);
11
+ });
12
+ export const cancelIdleCallback = import.meta.server ? (() => {
13
+ }) : globalThis.cancelIdleCallback || ((id) => {
14
+ clearTimeout(id);
15
+ });
@@ -0,0 +1 @@
1
+ export declare const setInterval: typeof globalThis.setInterval | (() => void);
@@ -0,0 +1,11 @@
1
+ import { createError } from "../composables/error.js";
2
+ const intervalError = "[nuxt] `setInterval` should not be used on the server. Consider wrapping it with an `onNuxtReady`, `onBeforeMount` or `onMounted` lifecycle hook, or ensure you only call it in the browser by checking `import.meta.client`.";
3
+ export const setInterval = import.meta.client ? globalThis.setInterval : () => {
4
+ if (import.meta.dev) {
5
+ throw createError({
6
+ statusCode: 500,
7
+ message: intervalError
8
+ });
9
+ }
10
+ console.error(intervalError);
11
+ };
@@ -0,0 +1,4 @@
1
+ export * from './capi.js';
2
+ export declare const Vue2: undefined;
3
+ export declare const isVue2 = false;
4
+ export declare const isVue3 = true;
@@ -0,0 +1,4 @@
1
+ export * from "./capi.js";
2
+ export const Vue2 = void 0;
3
+ export const isVue2 = false;
4
+ export const isVue3 = true;
@@ -0,0 +1,50 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ fallbackTag: {
3
+ type: StringConstructor;
4
+ default: () => string;
5
+ };
6
+ fallback: {
7
+ type: StringConstructor;
8
+ default: () => string;
9
+ };
10
+ placeholder: {
11
+ type: StringConstructor;
12
+ };
13
+ placeholderTag: {
14
+ type: StringConstructor;
15
+ };
16
+ keepFallback: {
17
+ type: BooleanConstructor;
18
+ default: () => boolean;
19
+ };
20
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
21
+ [key: string]: any;
22
+ }> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
23
+ [key: string]: any;
24
+ }>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "ssr-error"[], "ssr-error", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
+ fallbackTag: {
26
+ type: StringConstructor;
27
+ default: () => string;
28
+ };
29
+ fallback: {
30
+ type: StringConstructor;
31
+ default: () => string;
32
+ };
33
+ placeholder: {
34
+ type: StringConstructor;
35
+ };
36
+ placeholderTag: {
37
+ type: StringConstructor;
38
+ };
39
+ keepFallback: {
40
+ type: BooleanConstructor;
41
+ default: () => boolean;
42
+ };
43
+ }>> & Readonly<{
44
+ "onSsr-error"?: ((...args: any[]) => any) | undefined;
45
+ }>, {
46
+ fallback: string;
47
+ fallbackTag: string;
48
+ keepFallback: boolean;
49
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
50
+ export default _default;
@@ -0,0 +1,50 @@
1
+ import { createElementBlock, defineComponent, onMounted, shallowRef, useId } from "vue";
2
+ import { useState } from "../composables/state.js";
3
+ export default defineComponent({
4
+ name: "NuxtClientFallback",
5
+ inheritAttrs: false,
6
+ props: {
7
+ fallbackTag: {
8
+ type: String,
9
+ default: () => "div"
10
+ },
11
+ fallback: {
12
+ type: String,
13
+ default: () => ""
14
+ },
15
+ placeholder: {
16
+ type: String
17
+ },
18
+ placeholderTag: {
19
+ type: String
20
+ },
21
+ keepFallback: {
22
+ type: Boolean,
23
+ default: () => false
24
+ }
25
+ },
26
+ emits: ["ssr-error"],
27
+ setup(props, ctx) {
28
+ const mounted = shallowRef(false);
29
+ const ssrFailed = useState(useId());
30
+ if (ssrFailed.value) {
31
+ onMounted(() => {
32
+ mounted.value = true;
33
+ });
34
+ }
35
+ return () => {
36
+ if (ssrFailed.value) {
37
+ if (!mounted.value || props.keepFallback) {
38
+ const slot = ctx.slots.placeholder || ctx.slots.fallback;
39
+ if (slot) {
40
+ return slot();
41
+ }
42
+ const fallbackStr = props.placeholder || props.fallback;
43
+ const fallbackTag = props.placeholderTag || props.fallbackTag;
44
+ return createElementBlock(fallbackTag, null, fallbackStr);
45
+ }
46
+ }
47
+ return ctx.slots.default?.();
48
+ };
49
+ }
50
+ });
@@ -0,0 +1,57 @@
1
+ declare const NuxtClientFallbackServer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ fallbackTag: {
3
+ type: StringConstructor;
4
+ default: () => string;
5
+ };
6
+ fallback: {
7
+ type: StringConstructor;
8
+ default: () => string;
9
+ };
10
+ placeholder: {
11
+ type: StringConstructor;
12
+ };
13
+ placeholderTag: {
14
+ type: StringConstructor;
15
+ };
16
+ keepFallback: {
17
+ type: BooleanConstructor;
18
+ default: () => boolean;
19
+ };
20
+ }>, {
21
+ ssrFailed: import("vue").ShallowRef<boolean, boolean>;
22
+ ssrVNodes: {
23
+ getBuffer(): import("./utils.js").SSRBuffer;
24
+ push(item: import("./utils.js").SSRBufferItem): void;
25
+ };
26
+ } | {
27
+ ssrFailed: boolean;
28
+ ssrVNodes: never[];
29
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
+ 'ssr-error'(_error: unknown): true;
31
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
32
+ fallbackTag: {
33
+ type: StringConstructor;
34
+ default: () => string;
35
+ };
36
+ fallback: {
37
+ type: StringConstructor;
38
+ default: () => string;
39
+ };
40
+ placeholder: {
41
+ type: StringConstructor;
42
+ };
43
+ placeholderTag: {
44
+ type: StringConstructor;
45
+ };
46
+ keepFallback: {
47
+ type: BooleanConstructor;
48
+ default: () => boolean;
49
+ };
50
+ }>> & Readonly<{
51
+ "onSsr-error"?: ((_error: unknown) => any) | undefined;
52
+ }>, {
53
+ fallback: string;
54
+ fallbackTag: string;
55
+ keepFallback: boolean;
56
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
57
+ export default NuxtClientFallbackServer;
@@ -0,0 +1,80 @@
1
+ import { defineComponent, getCurrentInstance, onErrorCaptured, shallowRef, useId } from "vue";
2
+ import { ssrRenderAttrs, ssrRenderSlot, ssrRenderVNode } from "vue/server-renderer";
3
+ import { isPromise } from "@vue/shared";
4
+ import { useState } from "../composables/state.js";
5
+ import { createBuffer } from "./utils.js";
6
+ const NuxtClientFallbackServer = defineComponent({
7
+ name: "NuxtClientFallback",
8
+ inheritAttrs: false,
9
+ props: {
10
+ fallbackTag: {
11
+ type: String,
12
+ default: () => "div"
13
+ },
14
+ fallback: {
15
+ type: String,
16
+ default: () => ""
17
+ },
18
+ placeholder: {
19
+ type: String
20
+ },
21
+ placeholderTag: {
22
+ type: String
23
+ },
24
+ keepFallback: {
25
+ type: Boolean,
26
+ default: () => false
27
+ }
28
+ },
29
+ emits: {
30
+ "ssr-error"(_error) {
31
+ return true;
32
+ }
33
+ },
34
+ async setup(_, ctx) {
35
+ const vm = getCurrentInstance();
36
+ const ssrFailed = shallowRef(false);
37
+ const error = useState(useId());
38
+ onErrorCaptured((err) => {
39
+ error.value = true;
40
+ ssrFailed.value = true;
41
+ ctx.emit("ssr-error", err);
42
+ return false;
43
+ });
44
+ try {
45
+ const defaultSlot = ctx.slots.default?.();
46
+ const ssrVNodes = createBuffer();
47
+ if (defaultSlot) {
48
+ for (let i = 0; i < defaultSlot.length; i++) {
49
+ ssrRenderVNode(ssrVNodes.push, defaultSlot[i], vm);
50
+ }
51
+ }
52
+ const buffer = ssrVNodes.getBuffer();
53
+ if (buffer.hasAsync) {
54
+ await Promise.all(buffer.filter(isPromise));
55
+ }
56
+ return { ssrFailed, ssrVNodes };
57
+ } catch (ssrError) {
58
+ error.value = true;
59
+ ctx.emit("ssr-error", ssrError);
60
+ return { ssrFailed: true, ssrVNodes: [] };
61
+ }
62
+ },
63
+ ssrRender(ctx, push, parent) {
64
+ if (ctx.ssrFailed) {
65
+ const { fallback, placeholder } = ctx.$slots;
66
+ if (fallback || placeholder) {
67
+ ssrRenderSlot(ctx.$slots, fallback ? "fallback" : "placeholder", {}, null, push, parent);
68
+ } else {
69
+ const content = ctx.placeholder || ctx.fallback;
70
+ const tag = ctx.placeholderTag || ctx.fallbackTag;
71
+ push(`<${tag}${ssrRenderAttrs(ctx.$attrs)}>${content}</${tag}>`);
72
+ }
73
+ } else {
74
+ push("<!--[-->");
75
+ push(ctx.ssrVNodes.getBuffer());
76
+ push("<!--]-->");
77
+ }
78
+ }
79
+ });
80
+ export default NuxtClientFallbackServer;
@@ -0,0 +1,26 @@
1
+ import type { ComponentOptions, InjectionKey, SlotsType, VNode } from 'vue';
2
+ export declare const clientOnlySymbol: InjectionKey<boolean>;
3
+ declare const _default: import("vue").DefineComponent<{
4
+ placeholder?: any;
5
+ fallback?: any;
6
+ placeholderTag?: any;
7
+ fallbackTag?: any;
8
+ }, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
9
+ [key: string]: any;
10
+ }> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
11
+ [key: string]: any;
12
+ }>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
13
+ placeholder?: any;
14
+ fallback?: any;
15
+ placeholderTag?: any;
16
+ fallbackTag?: any;
17
+ }> & Readonly<{}>, {}, SlotsType<{
18
+ default?: () => VNode[];
19
+ /**
20
+ * Specify a content to be rendered on the server and displayed until `<ClientOnly>` is mounted in the browser.
21
+ */
22
+ fallback?: () => VNode[];
23
+ placeholder?: () => VNode[];
24
+ }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
25
+ export default _default;
26
+ export declare function createClientOnly<T extends ComponentOptions>(component: T): any;
@@ -0,0 +1,130 @@
1
+ import { cloneVNode, createElementBlock, defineComponent, getCurrentInstance, h, onMounted, provide, shallowRef } from "vue";
2
+ import { isPromise } from "@vue/shared";
3
+ import { useNuxtApp } from "../nuxt.js";
4
+ import ServerPlaceholder from "./server-placeholder.js";
5
+ import { elToStaticVNode } from "./utils.js";
6
+ export const clientOnlySymbol = Symbol.for("nuxt:client-only");
7
+ const STATIC_DIV = "<div></div>";
8
+ export default defineComponent({
9
+ name: "ClientOnly",
10
+ inheritAttrs: false,
11
+ props: ["fallback", "placeholder", "placeholderTag", "fallbackTag"],
12
+ ...import.meta.dev && {
13
+ slots: Object
14
+ },
15
+ setup(props, { slots, attrs }) {
16
+ const mounted = shallowRef(false);
17
+ onMounted(() => {
18
+ mounted.value = true;
19
+ });
20
+ if (import.meta.dev) {
21
+ const nuxtApp = useNuxtApp();
22
+ nuxtApp._isNuxtPageUsed = true;
23
+ nuxtApp._isNuxtLayoutUsed = true;
24
+ }
25
+ const vm = getCurrentInstance();
26
+ if (vm) {
27
+ vm._nuxtClientOnly = true;
28
+ }
29
+ provide(clientOnlySymbol, true);
30
+ return () => {
31
+ if (mounted.value) {
32
+ const vnodes = slots.default?.();
33
+ if (vnodes && vnodes.length === 1) {
34
+ return [cloneVNode(vnodes[0], attrs)];
35
+ }
36
+ return vnodes;
37
+ }
38
+ const slot = slots.fallback || slots.placeholder;
39
+ if (slot) {
40
+ return h(slot);
41
+ }
42
+ const fallbackStr = props.fallback || props.placeholder || "";
43
+ const fallbackTag = props.fallbackTag || props.placeholderTag || "span";
44
+ return createElementBlock(fallbackTag, attrs, fallbackStr);
45
+ };
46
+ }
47
+ });
48
+ const cache = /* @__PURE__ */ new WeakMap();
49
+ // @__NO_SIDE_EFFECTS__
50
+ export function createClientOnly(component) {
51
+ if (import.meta.server) {
52
+ return ServerPlaceholder;
53
+ }
54
+ if (cache.has(component)) {
55
+ return cache.get(component);
56
+ }
57
+ const clone = { ...component };
58
+ if (clone.render) {
59
+ clone.render = (ctx, cache2, $props, $setup, $data, $options) => {
60
+ if ($setup.mounted$ ?? ctx.mounted$) {
61
+ const res = component.render?.bind(ctx)(ctx, cache2, $props, $setup, $data, $options);
62
+ return res.children === null || typeof res.children === "string" ? cloneVNode(res) : h(res);
63
+ }
64
+ return elToStaticVNode(ctx._.vnode.el, STATIC_DIV);
65
+ };
66
+ } else {
67
+ clone.template &&= `
68
+ <template v-if="mounted$">${component.template}</template>
69
+ <template v-else>${STATIC_DIV}</template>
70
+ `;
71
+ }
72
+ clone.setup = (props, ctx) => {
73
+ const nuxtApp = useNuxtApp();
74
+ const mounted$ = shallowRef(nuxtApp.isHydrating === false);
75
+ const instance = getCurrentInstance();
76
+ if (nuxtApp.isHydrating) {
77
+ const attrs = { ...instance.attrs };
78
+ const directives = extractDirectives(instance);
79
+ for (const key in attrs) {
80
+ delete instance.attrs[key];
81
+ }
82
+ onMounted(() => {
83
+ Object.assign(instance.attrs, attrs);
84
+ instance.vnode.dirs = directives;
85
+ });
86
+ }
87
+ onMounted(() => {
88
+ mounted$.value = true;
89
+ });
90
+ const setupState = component.setup?.(props, ctx) || {};
91
+ if (isPromise(setupState)) {
92
+ return Promise.resolve(setupState).then((setupState2) => {
93
+ if (typeof setupState2 !== "function") {
94
+ setupState2 ||= {};
95
+ setupState2.mounted$ = mounted$;
96
+ return setupState2;
97
+ }
98
+ return (...args) => {
99
+ if (mounted$.value || !nuxtApp.isHydrating) {
100
+ const res = setupState2(...args);
101
+ return res.children === null || typeof res.children === "string" ? cloneVNode(res) : h(res);
102
+ }
103
+ return elToStaticVNode(instance?.vnode.el, STATIC_DIV);
104
+ };
105
+ });
106
+ } else {
107
+ if (typeof setupState === "function") {
108
+ return (...args) => {
109
+ if (mounted$.value) {
110
+ const res = setupState(...args);
111
+ const attrs = clone.inheritAttrs !== false ? ctx.attrs : void 0;
112
+ return res.children === null || typeof res.children === "string" ? cloneVNode(res, attrs) : h(res, attrs);
113
+ }
114
+ return elToStaticVNode(instance?.vnode.el, STATIC_DIV);
115
+ };
116
+ }
117
+ return Object.assign(setupState, { mounted$ });
118
+ }
119
+ };
120
+ cache.set(component, clone);
121
+ return clone;
122
+ }
123
+ function extractDirectives(instance) {
124
+ if (!instance || !instance.vnode.dirs) {
125
+ return null;
126
+ }
127
+ const directives = instance.vnode.dirs;
128
+ instance.vnode.dirs = null;
129
+ return directives;
130
+ }
@@ -0,0 +1,11 @@
1
+ import type { SlotsType, VNode } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
+ [key: string]: any;
4
+ }>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
5
+ default?: () => VNode[];
6
+ /**
7
+ * If you ever require to have a replacement during production.
8
+ */
9
+ fallback?: () => VNode[];
10
+ }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { defineComponent } from "vue";
2
+ export default defineComponent({
3
+ name: "DevOnly",
4
+ inheritAttrs: false,
5
+ ...import.meta.dev && {
6
+ slots: Object
7
+ },
8
+ setup(_, props) {
9
+ if (import.meta.dev) {
10
+ return () => props.slots.default?.();
11
+ }
12
+ return () => props.slots.fallback?.();
13
+ }
14
+ });