revojs 0.1.30 → 0.1.32
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-CCcPUyzp.js → app-BSezdpbh.js} +5 -4
- package/dist/{index-DsgldOjD.d.ts → index-DjSDi9V_.d.ts} +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/index.d.ts +1 -1
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +10 -6
- package/package.json +1 -1
- package/src/types/index.d.ts +2 -2
|
@@ -146,8 +146,8 @@ function useQuery(scope, schema) {
|
|
|
146
146
|
const entries = Object.fromEntries(searchParams);
|
|
147
147
|
return schema ? parseSchema(scope, schema, entries) : entries;
|
|
148
148
|
}
|
|
149
|
-
function withQuery(input, query) {
|
|
150
|
-
const url = new URL(input);
|
|
149
|
+
function withQuery(scope, input, query) {
|
|
150
|
+
const url = new URL(input, useUrl(scope));
|
|
151
151
|
for (const name in query) url.searchParams.set(name, query[name]);
|
|
152
152
|
return url.href;
|
|
153
153
|
}
|
|
@@ -282,8 +282,8 @@ const WILDCARD_MATCH = /\[\.\.\.(.*?)\]/;
|
|
|
282
282
|
const OPTIONAL_WILDCARD_MATCH = /\[\[\.\.\.(.*?)\]\]/;
|
|
283
283
|
const PARAMETER_MATCH = /\[(.*?)\]/;
|
|
284
284
|
const OPTIONAL_PARAMETER_MATCH = /\[\[(.*?)\]\]/;
|
|
285
|
-
const isServer = import.meta.
|
|
286
|
-
const isClient = import.meta.
|
|
285
|
+
const isServer = import.meta.SERVER ?? globalThis?.import?.meta?.SERVER;
|
|
286
|
+
const isClient = import.meta.CLIENT ?? globalThis?.import?.meta?.CLIENT;
|
|
287
287
|
const mimeTypes = {
|
|
288
288
|
txt: "text/plain",
|
|
289
289
|
css: "text/css",
|
|
@@ -426,6 +426,7 @@ var App = class extends Hookable {
|
|
|
426
426
|
match: "**/{get,head,post,put,delete,connect,options,trace,patch}.{js,ts}",
|
|
427
427
|
entries: ["./routes"]
|
|
428
428
|
} },
|
|
429
|
+
variables: {},
|
|
429
430
|
development: { middlewares: [] },
|
|
430
431
|
build: {
|
|
431
432
|
externals: [],
|
|
@@ -138,7 +138,7 @@ declare function useUrl(scope: Scope, base?: string): URL;
|
|
|
138
138
|
declare function useHeaders(scope: Scope): Headers;
|
|
139
139
|
declare function useQuery(scope: Scope): Record<string, string>;
|
|
140
140
|
declare function useQuery<T extends Schema>(scope: Scope, schema: T): InferOutput<T>;
|
|
141
|
-
declare function withQuery(input: string, query: Record<string, string>): string;
|
|
141
|
+
declare function withQuery(scope: Scope, input: string, query: Record<string, string>): string;
|
|
142
142
|
declare function useCookies(scope: Scope): Record<string, string>;
|
|
143
143
|
declare function useCookies<T extends Schema>(scope: Scope, schema: T): InferOutput<T>;
|
|
144
144
|
declare function useSetCookies(scope: Scope): Record<string, string>;
|
|
@@ -195,6 +195,7 @@ interface Config {
|
|
|
195
195
|
server?: string;
|
|
196
196
|
template: Record<"head" | "body", Template>;
|
|
197
197
|
sources: Record<string, Source>;
|
|
198
|
+
variables: Record<string, unknown>;
|
|
198
199
|
development: DevelopmentConfig;
|
|
199
200
|
build: BuildConfig;
|
|
200
201
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as invoke, A as PARAMETER_MATCH, At as Schema, B as SERVER_CONTEXT, C as OPTIONAL_PARAMETER, Ct as Hookable, D as OptionalParameterNode, Dt as Issue, E as OPTIONAL_WILDCARD_MATCH, Et as Invoke, F as ResponseConfig, Ft as isFailure, G as StatusCode, H as Server, I as Result, It as mergeObjects, J as WildcardNode, K as WILDCARD, L as Route, Lt as parseSchema, M as PathNode, Mt as Success, N as ROUTER_CONTEXT, Nt as defineContext, O as OptionalWildcardNode, Ot as Mergeable, P as Radix, Pt as defineHook, Q as getState, R as Router, S as Node, St as Failure, T as OPTIONAL_WILDCARD, Tt as InferOutput, U as ServerContext, V as STATES, W as States, X as defineMiddleware, Y as createServer, Z as defineRoute, _ as CookieSameSite, _t as useSetCookies, a as CLOSE_HOOK, at as sendHtml, b as Middleware, bt as Context, c as DevelopmentConfig, ct as sendText, d as SERVER, dt as setState, et as isClient, f as Source, ft as useCookies, g as CookiePriority, gt as useServer, h as CookieOptions, ht as useRouter, i as CLIENT, it as sendBadRequest, j as ParameterNode, jt as Scope, k as PARAMETER, kt as Output, l as Environment, lt as sendUnauthorized, m as Virtual, mt as useQuery, n as App, nt as mimeType, o as Config, ot as sendJson, p as Template, pt as useHeaders, q as WILDCARD_MATCH, r as BuildConfig, rt as mimeTypes, s as Content, st as sendRedirect, t as $fetch, tt as isServer, u as Module, ut as setCookie, v as Encoding, vt as useUrl, w as OPTIONAL_PARAMETER_MATCH, wt as InferInput, x as MimeType, xt as Descriptor, y as HttpMethod, yt as withQuery, z as RouterContext } from "./index-
|
|
1
|
+
import { $ as invoke, A as PARAMETER_MATCH, At as Schema, B as SERVER_CONTEXT, C as OPTIONAL_PARAMETER, Ct as Hookable, D as OptionalParameterNode, Dt as Issue, E as OPTIONAL_WILDCARD_MATCH, Et as Invoke, F as ResponseConfig, Ft as isFailure, G as StatusCode, H as Server, I as Result, It as mergeObjects, J as WildcardNode, K as WILDCARD, L as Route, Lt as parseSchema, M as PathNode, Mt as Success, N as ROUTER_CONTEXT, Nt as defineContext, O as OptionalWildcardNode, Ot as Mergeable, P as Radix, Pt as defineHook, Q as getState, R as Router, S as Node, St as Failure, T as OPTIONAL_WILDCARD, Tt as InferOutput, U as ServerContext, V as STATES, W as States, X as defineMiddleware, Y as createServer, Z as defineRoute, _ as CookieSameSite, _t as useSetCookies, a as CLOSE_HOOK, at as sendHtml, b as Middleware, bt as Context, c as DevelopmentConfig, ct as sendText, d as SERVER, dt as setState, et as isClient, f as Source, ft as useCookies, g as CookiePriority, gt as useServer, h as CookieOptions, ht as useRouter, i as CLIENT, it as sendBadRequest, j as ParameterNode, jt as Scope, k as PARAMETER, kt as Output, l as Environment, lt as sendUnauthorized, m as Virtual, mt as useQuery, n as App, nt as mimeType, o as Config, ot as sendJson, p as Template, pt as useHeaders, q as WILDCARD_MATCH, r as BuildConfig, rt as mimeTypes, s as Content, st as sendRedirect, t as $fetch, tt as isServer, u as Module, ut as setCookie, v as Encoding, vt as useUrl, w as OPTIONAL_PARAMETER_MATCH, wt as InferInput, x as MimeType, xt as Descriptor, y as HttpMethod, yt as withQuery, z as RouterContext } from "./index-DjSDi9V_.js";
|
|
2
2
|
export { $fetch, App, BuildConfig, CLIENT, CLOSE_HOOK, Config, Content, Context, CookieOptions, CookiePriority, CookieSameSite, Descriptor, DevelopmentConfig, Encoding, Environment, Failure, Hookable, HttpMethod, InferInput, InferOutput, Invoke, Issue, Mergeable, Middleware, MimeType, Module, Node, OPTIONAL_PARAMETER, OPTIONAL_PARAMETER_MATCH, OPTIONAL_WILDCARD, OPTIONAL_WILDCARD_MATCH, OptionalParameterNode, OptionalWildcardNode, Output, PARAMETER, PARAMETER_MATCH, ParameterNode, PathNode, ROUTER_CONTEXT, Radix, ResponseConfig, Result, Route, Router, RouterContext, SERVER, SERVER_CONTEXT, STATES, Schema, Scope, Server, ServerContext, Source, States, StatusCode, Success, Template, Virtual, WILDCARD, WILDCARD_MATCH, WildcardNode, createServer, defineContext, defineHook, defineMiddleware, defineRoute, getState, invoke, isClient, isFailure, isServer, mergeObjects, mimeType, mimeTypes, parseSchema, sendBadRequest, sendHtml, sendJson, sendRedirect, sendText, sendUnauthorized, setCookie, setState, useCookies, useHeaders, useQuery, useRouter, useServer, useSetCookies, useUrl, withQuery };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as isClient, B as setCookie, C as WILDCARD, D as defineRoute, E as defineMiddleware, F as sendHtml, G as useRouter, H as useCookies, I as sendJson, J as useUrl, K as useServer, L as sendRedirect, M as mimeType, N as mimeTypes, O as getState, P as sendBadRequest, R as sendText, S as STATES, T as createServer, U as useHeaders, V as setState, W as useQuery, Y as withQuery, _ as PARAMETER_MATCH, a as Hookable, b as Router, c as defineHook, d as parseSchema, f as OPTIONAL_PARAMETER, g as PARAMETER, h as OPTIONAL_WILDCARD_MATCH, i as SERVER, j as isServer, k as invoke, l as isFailure, m as OPTIONAL_WILDCARD, n as CLIENT, o as Scope, p as OPTIONAL_PARAMETER_MATCH, q as useSetCookies, r as CLOSE_HOOK, s as defineContext, t as App, u as mergeObjects, v as ROUTER_CONTEXT, w as WILDCARD_MATCH, x as SERVER_CONTEXT, y as Radix, z as sendUnauthorized } from "./app-
|
|
1
|
+
import { A as isClient, B as setCookie, C as WILDCARD, D as defineRoute, E as defineMiddleware, F as sendHtml, G as useRouter, H as useCookies, I as sendJson, J as useUrl, K as useServer, L as sendRedirect, M as mimeType, N as mimeTypes, O as getState, P as sendBadRequest, R as sendText, S as STATES, T as createServer, U as useHeaders, V as setState, W as useQuery, Y as withQuery, _ as PARAMETER_MATCH, a as Hookable, b as Router, c as defineHook, d as parseSchema, f as OPTIONAL_PARAMETER, g as PARAMETER, h as OPTIONAL_WILDCARD_MATCH, i as SERVER, j as isServer, k as invoke, l as isFailure, m as OPTIONAL_WILDCARD, n as CLIENT, o as Scope, p as OPTIONAL_PARAMETER_MATCH, q as useSetCookies, r as CLOSE_HOOK, s as defineContext, t as App, u as mergeObjects, v as ROUTER_CONTEXT, w as WILDCARD_MATCH, x as SERVER_CONTEXT, y as Radix, z as sendUnauthorized } from "./app-BSezdpbh.js";
|
|
2
2
|
|
|
3
3
|
//#region src/client/index.ts
|
|
4
4
|
async function $fetch(scope, input, options) {
|
package/dist/kit/index.d.ts
CHANGED
package/dist/vite/index.d.ts
CHANGED
package/dist/vite/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as SERVER, k as invoke, n as CLIENT, o as Scope, r as CLOSE_HOOK, t as App, x as SERVER_CONTEXT } from "../app-
|
|
1
|
+
import { i as SERVER, k as invoke, n as CLIENT, o as Scope, r as CLOSE_HOOK, t as App, x as SERVER_CONTEXT } from "../app-BSezdpbh.js";
|
|
2
2
|
import { a as addVirtual, i as addTypes, o as useKit } from "../kit-Vr6NzLTO.js";
|
|
3
3
|
import { basename, isAbsolute, join, posix, resolve, win32 } from "path";
|
|
4
4
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
@@ -10,7 +10,7 @@ import { Readable, Stream } from "stream";
|
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
12
|
var name = "revojs";
|
|
13
|
-
var version = "0.1.
|
|
13
|
+
var version = "0.1.32";
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/vite/node/index.ts
|
|
@@ -294,6 +294,10 @@ function revojs(config) {
|
|
|
294
294
|
assetsInlineLimit: 4096 * 4,
|
|
295
295
|
rollupOptions: { external: app.config.build.externals }
|
|
296
296
|
},
|
|
297
|
+
define: Object.entries(app.config.variables).reduce((variables, [name$1, value]) => ({
|
|
298
|
+
...variables,
|
|
299
|
+
[`import.meta.${name$1}`]: value
|
|
300
|
+
}), {}),
|
|
297
301
|
builder: {
|
|
298
302
|
sharedConfigBuild: true,
|
|
299
303
|
async buildApp(builder) {
|
|
@@ -318,8 +322,8 @@ function revojs(config) {
|
|
|
318
322
|
copyPublicDir: true
|
|
319
323
|
},
|
|
320
324
|
define: {
|
|
321
|
-
"import.meta.
|
|
322
|
-
"import.meta.
|
|
325
|
+
"import.meta.SERVER": false,
|
|
326
|
+
"import.meta.CLIENT": true
|
|
323
327
|
}
|
|
324
328
|
} },
|
|
325
329
|
...app.config.server && { [SERVER]: {
|
|
@@ -335,8 +339,8 @@ function revojs(config) {
|
|
|
335
339
|
copyPublicDir: false
|
|
336
340
|
},
|
|
337
341
|
define: {
|
|
338
|
-
"import.meta.
|
|
339
|
-
"import.meta.
|
|
342
|
+
"import.meta.SERVER": true,
|
|
343
|
+
"import.meta.CLIENT": false
|
|
340
344
|
}
|
|
341
345
|
} }
|
|
342
346
|
}
|
package/package.json
CHANGED
package/src/types/index.d.ts
CHANGED