@marko/run 0.5.13 → 0.5.15
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/README.md +85 -76
- package/dist/.tsbuildinfo +1 -1
- package/dist/adapter/default-entry.mjs +12 -13
- package/dist/adapter/index.cjs +476 -453
- package/dist/adapter/index.d.ts +2 -2
- package/dist/adapter/index.js +480 -457
- package/dist/adapter/load-dev-worker.mjs +5 -5
- package/dist/adapter/middleware.cjs +5 -3
- package/dist/adapter/middleware.d.ts +1 -1
- package/dist/adapter/middleware.js +5 -3
- package/dist/adapter/polyfill.d.ts +1 -1
- package/dist/cli/default.config.mjs +2 -2
- package/dist/cli/index.mjs +1353 -1280
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime/internal.cjs +12 -2
- package/dist/runtime/internal.d.ts +3 -1
- package/dist/runtime/internal.js +9 -1
- package/dist/runtime/namespace.d.ts +1 -1
- package/dist/runtime/types.d.ts +1 -1
- package/dist/vite/codegen/index.d.ts +1 -1
- package/dist/vite/constants.d.ts +2 -2
- package/dist/vite/index.cjs +1468 -1395
- package/dist/vite/index.d.ts +2 -2
- package/dist/vite/index.js +1463 -1390
- package/dist/vite/plugin.d.ts +1 -1
- package/dist/vite/routes/vdir.d.ts +1 -1
- package/dist/vite/types.d.ts +3 -3
- package/dist/vite/utils/config.d.ts +1 -1
- package/dist/vite/utils/log.d.ts +1 -1
- package/dist/vite/utils/route.d.ts +2 -2
- package/dist/vite/utils/server.d.ts +1 -1
- package/package.json +60 -63
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { InlineConfig } from "vite";
|
|
2
2
|
import { NotHandled, NotMatched } from "./namespace";
|
|
3
|
-
import type {
|
|
3
|
+
import type { AnyContext, AnyHandler, AnyRoute, GetableHref, GetablePath, GetPaths, HandlerTypeFn, Platform, PostableHref, PostablePath, PostPaths, RuntimeModule } from "./types";
|
|
4
4
|
declare global {
|
|
5
5
|
var __marko_run__: RuntimeModule;
|
|
6
6
|
var __marko_run_vite_config__: InlineConfig | undefined;
|
|
7
7
|
namespace MarkoRun {
|
|
8
8
|
/** @deprecated use `((context, next) => { ... }) satisfies MarkoRun.Handler` instead */
|
|
9
9
|
export const route: HandlerTypeFn;
|
|
10
|
-
export {
|
|
10
|
+
export { AnyContext as Context, GetableHref, GetablePath, GetPaths, AnyHandler as Handler, NotHandled, NotMatched, Platform, PostableHref, PostablePath, PostPaths, AnyRoute as Route, };
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
export type { AppData, Context, DefineApp, Fetch,
|
|
13
|
+
export type { AppData, Context, DefineApp, Fetch, HandlerLike, HandlerTypeFn, InputObject, Invoke, Match, MultiRouteContext, NextFunction, ParamsObject, Platform, Route, RouteHandler, Routes, RouteWithHandler, RuntimeModule, } from "./types";
|
|
@@ -30,7 +30,9 @@ __export(internal_exports, {
|
|
|
30
30
|
notHandled: () => notHandled,
|
|
31
31
|
notMatched: () => notMatched,
|
|
32
32
|
pageResponse: () => pageResponse,
|
|
33
|
-
passthrough: () => passthrough
|
|
33
|
+
passthrough: () => passthrough,
|
|
34
|
+
stripResponseBody: () => stripResponseBody,
|
|
35
|
+
stripResponseBodySync: () => stripResponseBodySync
|
|
34
36
|
});
|
|
35
37
|
module.exports = __toCommonJS(internal_exports);
|
|
36
38
|
|
|
@@ -160,6 +162,12 @@ function normalize(obj) {
|
|
|
160
162
|
}
|
|
161
163
|
return passthrough;
|
|
162
164
|
}
|
|
165
|
+
function stripResponseBodySync(response) {
|
|
166
|
+
return response.body ? new Response(null, response) : response;
|
|
167
|
+
}
|
|
168
|
+
function stripResponseBody(response) {
|
|
169
|
+
return "then" in response ? response.then(stripResponseBodySync) : stripResponseBodySync(response);
|
|
170
|
+
}
|
|
163
171
|
function passthrough() {
|
|
164
172
|
}
|
|
165
173
|
function noContent() {
|
|
@@ -185,5 +193,7 @@ function notMatched() {
|
|
|
185
193
|
notHandled,
|
|
186
194
|
notMatched,
|
|
187
195
|
pageResponse,
|
|
188
|
-
passthrough
|
|
196
|
+
passthrough,
|
|
197
|
+
stripResponseBody,
|
|
198
|
+
stripResponseBodySync
|
|
189
199
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnyRoute, Awaitable, Context, InputObject, MultiRouteContext, NextFunction, Platform, RouteHandler } from "./types";
|
|
2
2
|
export declare function pageResponse(template: any, input: Record<PropertyKey, unknown>): Response;
|
|
3
3
|
export declare const NotHandled: typeof MarkoRun.NotHandled;
|
|
4
4
|
export declare const NotMatched: typeof MarkoRun.NotMatched;
|
|
@@ -6,6 +6,8 @@ export declare function createContext<TRoute extends AnyRoute>(route: TRoute | u
|
|
|
6
6
|
export declare function call<TRoute extends AnyRoute>(handler: RouteHandler<TRoute>, next: NextFunction, context: MultiRouteContext<TRoute>): Promise<Response>;
|
|
7
7
|
export declare function compose(handlers: RouteHandler[]): RouteHandler;
|
|
8
8
|
export declare function normalize(obj: RouteHandler | RouteHandler[] | Promise<RouteHandler | RouteHandler[]>): RouteHandler;
|
|
9
|
+
export declare function stripResponseBodySync(response: Response): Response;
|
|
10
|
+
export declare function stripResponseBody(response: Awaitable<Response>): Awaitable<Response>;
|
|
9
11
|
export declare function passthrough(): void;
|
|
10
12
|
export declare function noContent(): Response;
|
|
11
13
|
export declare function notHandled(): void;
|
package/dist/runtime/internal.js
CHANGED
|
@@ -120,6 +120,12 @@ function normalize(obj) {
|
|
|
120
120
|
}
|
|
121
121
|
return passthrough;
|
|
122
122
|
}
|
|
123
|
+
function stripResponseBodySync(response) {
|
|
124
|
+
return response.body ? new Response(null, response) : response;
|
|
125
|
+
}
|
|
126
|
+
function stripResponseBody(response) {
|
|
127
|
+
return "then" in response ? response.then(stripResponseBodySync) : stripResponseBodySync(response);
|
|
128
|
+
}
|
|
123
129
|
function passthrough() {
|
|
124
130
|
}
|
|
125
131
|
function noContent() {
|
|
@@ -144,5 +150,7 @@ export {
|
|
|
144
150
|
notHandled,
|
|
145
151
|
notMatched,
|
|
146
152
|
pageResponse,
|
|
147
|
-
passthrough
|
|
153
|
+
passthrough,
|
|
154
|
+
stripResponseBody,
|
|
155
|
+
stripResponseBodySync
|
|
148
156
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const NotHandled: unique symbol;
|
|
2
2
|
export declare const NotMatched: unique symbol;
|
|
3
|
-
export type {
|
|
3
|
+
export type { GetableHref, GetablePath, GetPaths, Platform, PostableHref, PostablePath, PostPaths, } from "./types";
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Adapter,
|
|
1
|
+
import type { Adapter, BuiltRoutes, RoutableFile, Route, RouterOptions } from "../types";
|
|
2
2
|
export declare function renderRouteTemplate(route: Route, getRelativePath: (path: string) => string): string;
|
|
3
3
|
export declare function renderEntryTemplate(name: string, files: string[], pageInputs?: string[]): string;
|
|
4
4
|
export declare function renderRouteEntry(route: Route, entriesDir: string): string;
|
package/dist/vite/constants.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type ValuesOf<T> = T[keyof T];
|
|
2
2
|
export declare const markoRunFilePrefix = "__marko-run__";
|
|
3
3
|
export declare const virtualFilePrefix = "virtual:marko-run";
|
|
4
|
-
export declare const httpVerbs: readonly ["get", "post", "put", "delete"];
|
|
4
|
+
export declare const httpVerbs: readonly ["get", "head", "post", "put", "delete", "patch", "options"];
|
|
5
5
|
export declare const serverEntryQuery = "?marko-server-entry";
|
|
6
6
|
export declare const browserEntryQuery = "?marko-browser-entry";
|
|
7
7
|
export declare const RoutableFileTypes: {
|
|
@@ -14,5 +14,5 @@ export declare const RoutableFileTypes: {
|
|
|
14
14
|
readonly Error: "500";
|
|
15
15
|
};
|
|
16
16
|
export type RoutableFileType = ValuesOf<typeof RoutableFileTypes>;
|
|
17
|
-
export type HttpVerb = typeof httpVerbs[number];
|
|
17
|
+
export type HttpVerb = (typeof httpVerbs)[number];
|
|
18
18
|
export {};
|