@nuxt/nitro-server-nightly 4.3.0-29465977.c4f46c64 → 4.3.0-29466366.fa21bb17
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.
- package/dist/index.d.mts +177 -177
- package/dist/index.mjs +664 -835
- package/dist/runtime/handlers/{error.d.ts → error.d.mts} +1 -1
- package/dist/runtime/handlers/error.mjs +77 -0
- package/dist/runtime/handlers/island.d.mts +2 -0
- package/dist/runtime/handlers/island.mjs +120 -0
- package/dist/runtime/handlers/renderer.d.mts +2 -0
- package/dist/runtime/handlers/renderer.mjs +298 -0
- package/dist/runtime/middleware/no-ssr.d.mts +2 -0
- package/dist/runtime/middleware/no-ssr.mjs +7 -0
- package/dist/runtime/plugins/dev-server-logs.d.mts +2 -0
- package/dist/runtime/plugins/dev-server-logs.mjs +94 -0
- package/dist/runtime/templates/error-500.mjs +15 -0
- package/dist/runtime/utils/app-config.d.mts +3 -0
- package/dist/runtime/utils/app-config.mjs +31 -0
- package/dist/runtime/utils/cache.d.mts +5 -0
- package/dist/runtime/utils/{cache.js → cache.mjs} +13 -12
- package/dist/runtime/utils/config.d.mts +1 -0
- package/dist/runtime/utils/{dev.d.ts → dev.d.mts} +1 -1
- package/dist/runtime/utils/{dev.js → dev.mjs} +15 -27
- package/dist/runtime/utils/error.d.mts +6 -0
- package/dist/runtime/utils/error.mjs +15 -0
- package/dist/runtime/utils/paths.mjs +19 -0
- package/dist/runtime/utils/renderer/{app.d.ts → app.d.mts} +4 -4
- package/dist/runtime/utils/renderer/app.mjs +39 -0
- package/dist/runtime/utils/renderer/build-files.d.mts +18 -0
- package/dist/runtime/utils/renderer/build-files.mjs +100 -0
- package/dist/runtime/utils/renderer/{inline-styles.d.ts → inline-styles.d.mts} +1 -1
- package/dist/runtime/utils/renderer/inline-styles.mjs +13 -0
- package/dist/runtime/utils/renderer/{islands.d.ts → islands.d.mts} +5 -5
- package/dist/runtime/utils/renderer/islands.mjs +87 -0
- package/dist/runtime/utils/renderer/payload.d.mts +24 -0
- package/dist/runtime/utils/renderer/payload.mjs +64 -0
- package/package.json +8 -8
- package/dist/index.d.ts +0 -185
- package/dist/runtime/handlers/error.js +0 -65
- package/dist/runtime/handlers/island.d.ts +0 -4
- package/dist/runtime/handlers/island.js +0 -101
- package/dist/runtime/handlers/renderer.d.ts +0 -2
- package/dist/runtime/handlers/renderer.js +0 -237
- package/dist/runtime/middleware/no-ssr.d.ts +0 -2
- package/dist/runtime/middleware/no-ssr.js +0 -7
- package/dist/runtime/plugins/dev-server-logs.d.ts +0 -3
- package/dist/runtime/plugins/dev-server-logs.js +0 -82
- package/dist/runtime/templates/error-500.js +0 -6
- package/dist/runtime/utils/app-config.d.ts +0 -3
- package/dist/runtime/utils/app-config.js +0 -25
- package/dist/runtime/utils/cache-driver.d.ts +0 -6
- package/dist/runtime/utils/cache.d.ts +0 -8
- package/dist/runtime/utils/config.d.ts +0 -1
- package/dist/runtime/utils/error.d.ts +0 -6
- package/dist/runtime/utils/error.js +0 -11
- package/dist/runtime/utils/paths.js +0 -16
- package/dist/runtime/utils/renderer/app.js +0 -34
- package/dist/runtime/utils/renderer/build-files.d.ts +0 -16
- package/dist/runtime/utils/renderer/build-files.js +0 -86
- package/dist/runtime/utils/renderer/inline-styles.js +0 -13
- package/dist/runtime/utils/renderer/islands.js +0 -82
- package/dist/runtime/utils/renderer/payload.d.ts +0 -24
- package/dist/runtime/utils/renderer/payload.js +0 -67
- /package/dist/runtime/templates/{error-500.d.ts → error-500.d.mts} +0 -0
- /package/dist/runtime/utils/{config.js → config.mjs} +0 -0
- /package/dist/runtime/utils/{paths.d.ts → paths.d.mts} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,185 +1,185 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { LogObject } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { EventHandler, H3Event } from "h3";
|
|
2
|
+
import { Nuxt } from "@nuxt/schema";
|
|
3
|
+
import { Nitro, NitroConfig, NitroDevEventHandler, NitroEventHandler, NitroOptions, NitroRouteConfig, NitroRuntimeConfig, NitroRuntimeConfigApp } from "nitropack/types";
|
|
4
|
+
import { LogObject } from "consola";
|
|
5
|
+
import { NuxtIslandContext, NuxtIslandResponse, NuxtRenderHTMLContext } from "nuxt/app";
|
|
6
|
+
import { HookResult, RuntimeConfig, TSReference } from "nuxt/schema";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
//#region src/augments.d.ts
|
|
9
|
+
declare module "nitropack" {
|
|
10
|
+
interface NitroRuntimeConfigApp {
|
|
11
|
+
buildAssetsDir: string;
|
|
12
|
+
cdnURL: string;
|
|
13
|
+
}
|
|
14
|
+
interface NitroRouteRules {
|
|
15
|
+
ssr?: boolean;
|
|
16
|
+
noScripts?: boolean;
|
|
17
|
+
/** @deprecated Use `noScripts` instead */
|
|
18
|
+
experimentalNoScripts?: boolean;
|
|
19
|
+
appMiddleware?: Record<string, boolean>;
|
|
20
|
+
appLayout?: string | false;
|
|
21
|
+
}
|
|
21
22
|
}
|
|
22
|
-
declare module
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}) => void | Promise<void>;
|
|
36
|
-
'render:html': (htmlContext: NuxtRenderHTMLContext, context: {
|
|
37
|
-
event: H3Event;
|
|
38
|
-
}) => void | Promise<void>;
|
|
39
|
-
'render:island': (islandResponse: NuxtIslandResponse, context: {
|
|
40
|
-
event: H3Event;
|
|
41
|
-
islandContext: NuxtIslandContext;
|
|
42
|
-
}) => void | Promise<void>;
|
|
43
|
-
}
|
|
23
|
+
declare module "nitropack/types" {
|
|
24
|
+
interface NitroRuntimeConfigApp {
|
|
25
|
+
buildAssetsDir: string;
|
|
26
|
+
cdnURL: string;
|
|
27
|
+
}
|
|
28
|
+
interface NitroRouteRules {
|
|
29
|
+
ssr?: boolean;
|
|
30
|
+
noScripts?: boolean;
|
|
31
|
+
/** @deprecated Use `noScripts` instead */
|
|
32
|
+
experimentalNoScripts?: boolean;
|
|
33
|
+
appMiddleware?: Record<string, boolean>;
|
|
34
|
+
appLayout?: string | false;
|
|
35
|
+
}
|
|
44
36
|
}
|
|
45
|
-
declare module
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
37
|
+
declare module "nitropack" {
|
|
38
|
+
interface NitroRuntimeConfig extends RuntimeConfig {}
|
|
39
|
+
interface NitroRouteConfig {
|
|
40
|
+
ssr?: boolean;
|
|
41
|
+
noScripts?: boolean;
|
|
42
|
+
/** @deprecated Use `noScripts` instead */
|
|
43
|
+
experimentalNoScripts?: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface NitroRuntimeHooks {
|
|
46
|
+
"dev:ssr-logs": (ctx: {
|
|
47
|
+
logs: LogObject[];
|
|
48
|
+
path: string;
|
|
49
|
+
}) => void | Promise<void>;
|
|
50
|
+
"render:html": (htmlContext: NuxtRenderHTMLContext, context: {
|
|
51
|
+
event: H3Event;
|
|
52
|
+
}) => void | Promise<void>;
|
|
53
|
+
"render:island": (islandResponse: NuxtIslandResponse, context: {
|
|
54
|
+
event: H3Event;
|
|
55
|
+
islandContext: NuxtIslandContext;
|
|
56
|
+
}) => void | Promise<void>;
|
|
57
|
+
}
|
|
58
58
|
}
|
|
59
|
-
declare module
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
59
|
+
declare module "nitropack/types" {
|
|
60
|
+
interface NitroRuntimeConfig extends RuntimeConfig {}
|
|
61
|
+
interface NitroRouteConfig {
|
|
62
|
+
ssr?: boolean;
|
|
63
|
+
noScripts?: boolean;
|
|
64
|
+
/** @deprecated Use `noScripts` instead */
|
|
65
|
+
experimentalNoScripts?: boolean;
|
|
66
|
+
}
|
|
67
|
+
interface NitroRuntimeHooks {
|
|
68
|
+
"dev:ssr-logs": (ctx: {
|
|
69
|
+
logs: LogObject[];
|
|
70
|
+
path: string;
|
|
71
|
+
}) => void | Promise<void>;
|
|
72
|
+
"render:html": (htmlContext: NuxtRenderHTMLContext, context: {
|
|
73
|
+
event: H3Event;
|
|
74
|
+
}) => void | Promise<void>;
|
|
75
|
+
"render:island": (islandResponse: NuxtIslandResponse, context: {
|
|
76
|
+
event: H3Event;
|
|
77
|
+
islandContext: NuxtIslandContext;
|
|
78
|
+
}) => void | Promise<void>;
|
|
79
|
+
}
|
|
81
80
|
}
|
|
82
|
-
declare module
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
81
|
+
declare module "@nuxt/schema" {
|
|
82
|
+
interface NuxtHooks {
|
|
83
|
+
/**
|
|
84
|
+
* Called when the dev middleware is being registered on the Nitro dev server.
|
|
85
|
+
* @param handler the Vite or Webpack event handler
|
|
86
|
+
* @returns Promise
|
|
87
|
+
*/
|
|
88
|
+
"server:devHandler": (handler: EventHandler) => HookResult;
|
|
89
|
+
/**
|
|
90
|
+
* Called before Nitro writes `.nuxt/tsconfig.server.json`, allowing addition of custom references and declarations.
|
|
91
|
+
* @param options Objects containing `references`, `declarations`
|
|
92
|
+
* @returns Promise
|
|
93
|
+
*/
|
|
94
|
+
"nitro:prepare:types": (options: {
|
|
95
|
+
references: TSReference[];
|
|
96
|
+
declarations: string[];
|
|
97
|
+
}) => HookResult;
|
|
98
|
+
/**
|
|
99
|
+
* Called before initializing Nitro, allowing customization of Nitro's configuration.
|
|
100
|
+
* @param nitroConfig The nitro config to be extended
|
|
101
|
+
* @returns Promise
|
|
102
|
+
*/
|
|
103
|
+
"nitro:config": (nitroConfig: NitroConfig) => HookResult;
|
|
104
|
+
/**
|
|
105
|
+
* Called after Nitro is initialized, which allows registering Nitro hooks and interacting directly with Nitro.
|
|
106
|
+
* @param nitro The created nitro object
|
|
107
|
+
* @returns Promise
|
|
108
|
+
*/
|
|
109
|
+
"nitro:init": (nitro: Nitro) => HookResult;
|
|
110
|
+
/**
|
|
111
|
+
* Called before building the Nitro instance.
|
|
112
|
+
* @param nitro The created nitro object
|
|
113
|
+
* @returns Promise
|
|
114
|
+
*/
|
|
115
|
+
"nitro:build:before": (nitro: Nitro) => HookResult;
|
|
116
|
+
/**
|
|
117
|
+
* Called after copying public assets. Allows modifying public assets before Nitro server is built.
|
|
118
|
+
* @param nitro The created nitro object
|
|
119
|
+
* @returns Promise
|
|
120
|
+
*/
|
|
121
|
+
"nitro:build:public-assets": (nitro: Nitro) => HookResult;
|
|
122
|
+
}
|
|
123
|
+
interface ConfigSchema {
|
|
124
|
+
/**
|
|
125
|
+
* Configuration for Nitro.
|
|
126
|
+
*
|
|
127
|
+
* @see [Nitro configuration docs](https://nitro.build/config)
|
|
128
|
+
*/
|
|
129
|
+
nitro: NitroConfig;
|
|
130
|
+
/**
|
|
131
|
+
* Global route options applied to matching server routes.
|
|
132
|
+
*
|
|
133
|
+
* @experimental This is an experimental feature and API may change in the future.
|
|
134
|
+
*
|
|
135
|
+
* @see [Nitro route rules documentation](https://nitro.build/config#routerules)
|
|
136
|
+
*/
|
|
137
|
+
routeRules: NitroConfig["routeRules"];
|
|
138
|
+
/**
|
|
139
|
+
* Nitro server handlers.
|
|
140
|
+
*
|
|
141
|
+
* Each handler accepts the following options:
|
|
142
|
+
* - handler: The path to the file defining the handler. - route: The route under which the handler is available. This follows the conventions of [rou3](https://github.com/h3js/rou3). - method: The HTTP method of requests that should be handled. - middleware: Specifies whether it is a middleware handler. - lazy: Specifies whether to use lazy loading to import the handler.
|
|
143
|
+
*
|
|
144
|
+
* @see [`server/` directory documentation](https://nuxt.com/docs/4.x/directory-structure/server)
|
|
145
|
+
*
|
|
146
|
+
* @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Nuxt.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```js
|
|
150
|
+
* serverHandlers: [
|
|
151
|
+
* { route: '/path/foo/**:name', handler: '~/server/foohandler.ts' }
|
|
152
|
+
* ]
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
serverHandlers: NitroEventHandler[];
|
|
156
|
+
/**
|
|
157
|
+
* Nitro development-only server handlers.
|
|
158
|
+
*
|
|
159
|
+
* @see [Nitro server routes documentation](https://nitro.build/guide/routing)
|
|
160
|
+
*/
|
|
161
|
+
devServerHandlers: NitroDevEventHandler[];
|
|
162
|
+
}
|
|
163
|
+
interface NuxtConfig {
|
|
164
|
+
nitro?: NitroConfig;
|
|
165
|
+
}
|
|
166
|
+
interface RuntimeConfig {
|
|
167
|
+
app: NitroRuntimeConfigApp;
|
|
168
|
+
/** Only available on the server. */
|
|
169
|
+
nitro?: NitroRuntimeConfig["nitro"];
|
|
170
|
+
}
|
|
171
|
+
interface NuxtDebugOptions {
|
|
172
|
+
/** Debug options for Nitro */
|
|
173
|
+
nitro?: NitroOptions["debug"];
|
|
174
|
+
}
|
|
175
|
+
interface NuxtPage {
|
|
176
|
+
rules?: NitroRouteConfig;
|
|
177
|
+
}
|
|
179
178
|
}
|
|
180
|
-
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/index.d.ts
|
|
181
181
|
declare function bundle(nuxt: Nuxt & {
|
|
182
|
-
|
|
182
|
+
_nitro?: Nitro;
|
|
183
183
|
}): Promise<void>;
|
|
184
|
-
|
|
185
|
-
export { bundle };
|
|
184
|
+
//#endregion
|
|
185
|
+
export { bundle };
|