revojs 0.0.43 → 0.0.44
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/app/index.d.ts +0 -2
- package/dist/index.js +3 -9
- package/package.json +1 -1
- package/src/types/index.d.ts +2 -2
package/dist/app/index.d.ts
CHANGED
|
@@ -24,8 +24,6 @@ export type App<T> = {
|
|
|
24
24
|
config: Config<T>;
|
|
25
25
|
virtuals: Record<string, (environment: Environment) => string>;
|
|
26
26
|
};
|
|
27
|
-
export declare const getRoutes: <T>() => Promise<Record<string, () => Promise<T>>>;
|
|
28
|
-
export declare const getAssets: <T>() => Promise<Record<string, () => Promise<T>>>;
|
|
29
27
|
export declare const createApp: <T>(config?: NestedPartial<Config<T>>) => App<T>;
|
|
30
28
|
export declare const SERVER = "ssr";
|
|
31
29
|
export declare const CLIENT = "client";
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,6 @@ import { defu } from "defu";
|
|
|
2
2
|
import { h } from "revojs/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/app/index.ts
|
|
5
|
-
const getRoutes = async () => {
|
|
6
|
-
return await import("#virtual/routes").then((module) => module.routes);
|
|
7
|
-
};
|
|
8
|
-
const getAssets = async () => {
|
|
9
|
-
return await import("#virtual/assets").then((module) => module.assets);
|
|
10
|
-
};
|
|
11
5
|
const createApp = (config) => {
|
|
12
6
|
return {
|
|
13
7
|
config: defu(config, {
|
|
@@ -633,7 +627,7 @@ const getVariables = (event) => {
|
|
|
633
627
|
const createRuntime = async () => {
|
|
634
628
|
const radix = new Radix();
|
|
635
629
|
const middlewares = new Array();
|
|
636
|
-
const routes = await
|
|
630
|
+
const routes = await import("#virtual/routes").then((module) => module.routes);
|
|
637
631
|
for (const path in routes) {
|
|
638
632
|
const [name, method] = toPath(path);
|
|
639
633
|
radix.insert((method ?? "GET").toUpperCase() + name, defineRoute({ fetch: async (event) => {
|
|
@@ -650,7 +644,7 @@ const createRuntime = async () => {
|
|
|
650
644
|
}
|
|
651
645
|
} }));
|
|
652
646
|
}
|
|
653
|
-
const assets = await
|
|
647
|
+
const assets = await import("#virtual/assets").then((module) => module.assets);
|
|
654
648
|
for (const path in assets) radix.insert("GET/" + path, defineRoute({ fetch: async (event) => {
|
|
655
649
|
event.response.headers.set("Content-Type", getMimeType(path));
|
|
656
650
|
return new Response(await assets[path]?.(), event.response);
|
|
@@ -900,4 +894,4 @@ const markdownToSlot = (input, options) => {
|
|
|
900
894
|
};
|
|
901
895
|
|
|
902
896
|
//#endregion
|
|
903
|
-
export { $fetch, CLIENT, Compute, HOST_CONTEXT, Handler, LOCALE_CONTEXT, MountedEvent, NavigateEvent, Page, ROUTER_CONTEXT, RUNTIME_CONTEXT, Radix, SERVER, Scope, StopEvent, activeCompute, components, createApp, createCompute, createElement, createEvent, createLocale, createMemo, createRouter, createRuntime, createState, defineComponent, defineContext, defineRoute, fileName, fromValue,
|
|
897
|
+
export { $fetch, CLIENT, Compute, HOST_CONTEXT, Handler, LOCALE_CONTEXT, MountedEvent, NavigateEvent, Page, ROUTER_CONTEXT, RUNTIME_CONTEXT, Radix, SERVER, Scope, StopEvent, activeCompute, components, createApp, createCompute, createElement, createEvent, createLocale, createMemo, createRouter, createRuntime, createState, defineComponent, defineContext, defineRoute, fileName, fromValue, getCookies, getCustomElement, getMimeType, getRequestUrl, getSetCookies, getVariables, hydrate, isClient, isServer, isTemplate, markdownToSlot, preventDefault, registerComponent, renderToString, sendBadRequest, sendHtml, sendJson, sendRedirect, sendText, sendUnauthorized, setCookie, stopImmediatePropagation, stopPropagation, targets, toArray, toCustomElement, toFragment, toPath, toRange, toString, useEvent, useHost, useLocale, useRouter, useRuntime };
|
package/package.json
CHANGED
package/src/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare module "#virtual/locales" {
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
declare module "#virtual/assets" {
|
|
6
|
-
export const assets: Record<string, () => Promise<
|
|
6
|
+
export const assets: Record<string, () => Promise<string>>;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
declare module "#virtual/client" {
|
|
@@ -13,7 +13,7 @@ declare module "#virtual/client" {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
declare module "#virtual/routes" {
|
|
16
|
-
export const routes: Record<string, () => Promise<T
|
|
16
|
+
export const routes: Record<string, () => Promise<Route<T> | ComponentConstructor<Events, Attributes>>>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
declare module "#virtual/runtime" {
|