@finesoft/front 0.5.1 → 0.5.2
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 +4 -4
- package/dist/Outlet.svelte +39 -0
- package/dist/Outlet.svelte.d.ts +7 -0
- package/dist/browser-DIU6Sxl3.mjs +1237 -0
- package/dist/browser-kFMjlLGT.d.mts +262 -0
- package/dist/browser.d.mts +7 -2
- package/dist/browser.mjs +9 -1
- package/dist/controller-types-CgmJ6-le.d.mts +16 -0
- package/dist/cookies-Bpf9VayB.d.mts +779 -0
- package/dist/fetch-policy-BHT8RtrL.mjs +82 -0
- package/dist/host-guard-DDWxLpFL.mjs +222 -0
- package/dist/http-B6CJqDyf.d.mts +46 -0
- package/dist/http-CaxrMD1A.d.mts +1 -0
- package/dist/http-D70PL72H.mjs +257 -0
- package/dist/http.d.mts +3 -0
- package/dist/http.mjs +2 -0
- package/dist/index-node.d.mts +15 -0
- package/dist/index-node.mjs +15 -0
- package/dist/index.d.mts +48 -697
- package/dist/index.mjs +44 -261
- package/dist/load-node.d.mts +5 -0
- package/dist/load-node.mjs +10 -0
- package/dist/load-portable.d.mts +5 -0
- package/dist/load-portable.mjs +8 -0
- package/dist/lru-map-BKoUAySU.mjs +50 -0
- package/dist/messages-CAt2QdGr.mjs +140 -0
- package/dist/native-contract-DuR25hYB.d.mts +14 -0
- package/dist/native-contract.d.mts +2 -0
- package/dist/native-contract.mjs +1 -0
- package/dist/node-D9hB4dsz.d.mts +35 -0
- package/dist/node.d.mts +2 -0
- package/dist/node.mjs +59 -0
- package/dist/path-CGFl2w7D.mjs +113 -0
- package/dist/path-CXT6xGPO.d.mts +261 -0
- package/dist/portable-CaxrMD1A.d.mts +1 -0
- package/dist/portable.d.mts +11 -0
- package/dist/portable.mjs +12 -0
- package/dist/proxy-1SphZ7x7.mjs +436 -0
- package/dist/proxy-2dSWO-Xw.d.mts +53 -0
- package/dist/public-types-BcJM-AYc.mjs +835 -0
- package/dist/react-DhwBRw01.d.mts +16 -0
- package/dist/react.d.mts +3 -0
- package/dist/react.mjs +29 -0
- package/dist/rolldown-runtime-B4iAMlE-.mjs +35 -0
- package/dist/secure-fetch-Xlht2jd7.d.mts +30 -0
- package/dist/server-controller-proxy-BkVuVWVD.d.mts +38 -0
- package/dist/session-DnB4ZC3x.d.mts +1279 -0
- package/dist/src-Ftl_0rhu.mjs +28 -0
- package/dist/src-qwx7Vw8g.mjs +3807 -0
- package/dist/ssr-BEUNDvbj.d.mts +210 -0
- package/dist/ssr-C8xnYXoY.mjs +357 -0
- package/dist/ssr.d.mts +3 -0
- package/dist/ssr.mjs +3 -0
- package/dist/svelte-Dr5to3SE.d.mts +16 -0
- package/dist/svelte.d.mts +3 -0
- package/dist/svelte.mjs +13 -0
- package/dist/typegen-C-WeJCtf.d.mts +12 -0
- package/dist/typegen-cli.d.mts +1 -0
- package/dist/typegen-cli.mjs +11 -0
- package/dist/typegen.d.mts +3 -0
- package/dist/typegen.mjs +2 -0
- package/dist/types-BuaZHRG7.mjs +402 -0
- package/dist/undici-CPfL25Hr.mjs +22262 -0
- package/dist/vite-Cj4SPA8D.d.mts +277 -0
- package/dist/vite.d.mts +4 -0
- package/dist/vite.mjs +2354 -0
- package/dist/vue-DGmzuKho.d.mts +32 -0
- package/dist/vue.d.mts +3 -0
- package/dist/vue.mjs +56 -0
- package/dist/web.d.mts +6 -0
- package/dist/web.mjs +8 -0
- package/dist/worker.d.mts +2 -0
- package/dist/worker.mjs +2 -0
- package/docs/01-getting-started.md +67 -199
- package/docs/02-routing-and-controllers.md +163 -241
- package/docs/03-middleware.md +10 -212
- package/docs/04-rendering-and-hydration.md +6 -333
- package/docs/05-i18n.md +7 -237
- package/docs/06-http-client.md +20 -263
- package/docs/07-di-container.md +23 -257
- package/docs/08-observability.md +6 -286
- package/docs/09-server-and-deployment.md +59 -219
- package/docs/10-features-platform-pwa.md +7 -231
- package/docs/11-navigation.md +143 -288
- package/docs/12-session-restoration.md +6 -214
- package/docs/README.md +7 -7
- package/docs/advanced/custom-action-handler.md +29 -229
- package/docs/advanced/custom-adapter.md +7 -259
- package/docs/advanced/custom-event-recorder.md +7 -312
- package/docs/advanced/inline-proxy-codegen.md +6 -185
- package/docs/advanced/multi-tenant-scopes.md +10 -323
- package/docs/engineering/ci-release-flow.md +35 -222
- package/docs/engineering/project-structure.md +34 -277
- package/docs/engineering/testing.md +8 -310
- package/docs/pitfalls/container-scope-leak.md +2 -214
- package/docs/pitfalls/i18n-bundle-size.md +6 -176
- package/docs/pitfalls/proxy-binary-payloads.md +8 -12
- package/docs/pitfalls/ssr-hydration-mismatch.md +4 -160
- package/docs/pitfalls/ssr-vs-csr-globals.md +9 -170
- package/docs/zh/01-getting-started.md +67 -199
- package/docs/zh/02-routing-and-controllers.md +166 -244
- package/docs/zh/03-middleware.md +10 -212
- package/docs/zh/04-rendering-and-hydration.md +6 -333
- package/docs/zh/05-i18n.md +7 -237
- package/docs/zh/06-http-client.md +20 -263
- package/docs/zh/07-di-container.md +23 -257
- package/docs/zh/08-observability.md +6 -283
- package/docs/zh/09-server-and-deployment.md +59 -219
- package/docs/zh/10-features-platform-pwa.md +7 -231
- package/docs/zh/11-navigation.md +130 -290
- package/docs/zh/12-session-restoration.md +6 -214
- package/docs/zh/README.md +4 -4
- package/docs/zh/advanced/custom-action-handler.md +29 -229
- package/docs/zh/advanced/custom-adapter.md +7 -259
- package/docs/zh/advanced/custom-event-recorder.md +7 -312
- package/docs/zh/advanced/inline-proxy-codegen.md +6 -185
- package/docs/zh/advanced/multi-tenant-scopes.md +10 -323
- package/docs/zh/engineering/ci-release-flow.md +35 -222
- package/docs/zh/engineering/project-structure.md +34 -277
- package/docs/zh/engineering/testing.md +8 -310
- package/docs/zh/pitfalls/container-scope-leak.md +2 -214
- package/docs/zh/pitfalls/i18n-bundle-size.md +6 -176
- package/docs/zh/pitfalls/proxy-binary-payloads.md +8 -12
- package/docs/zh/pitfalls/ssr-hydration-mismatch.md +4 -160
- package/docs/zh/pitfalls/ssr-vs-csr-globals.md +9 -170
- package/package.json +118 -20
- package/dist/browser-BHhVWXik.mjs +0 -2
- package/dist/browser-BV2BBXm7.d.mts +0 -2811
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { f as AppSnapshot, g as WebAppView, h as ViewProps } from "./session-DnB4ZC3x.mjs";
|
|
2
|
+
import { ComponentType, ReactNode } from "react";
|
|
3
|
+
declare namespace react_d_exports {
|
|
4
|
+
export { NativeView, NativeViews, Outlet, ViewProps, WebAppView, useSnapshot };
|
|
5
|
+
}
|
|
6
|
+
/** Views choose their own page subtype; Outlet supplies the common runtime props. */
|
|
7
|
+
type NativeView = ComponentType<never>;
|
|
8
|
+
type NativeViews = Readonly<Record<string, NativeView>>;
|
|
9
|
+
declare function useSnapshot(app: WebAppView): AppSnapshot;
|
|
10
|
+
declare function Outlet({ app, views }: {
|
|
11
|
+
readonly app: WebAppView;
|
|
12
|
+
readonly views: NativeViews;
|
|
13
|
+
}): ReactNode;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { useSnapshot as a, react_d_exports as i, NativeViews as n, Outlet as r, NativeView as t };
|
|
16
|
+
//# sourceMappingURL=react-DhwBRw01.d.mts.map
|
package/dist/react.d.mts
ADDED
package/dist/react.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createElement, useLayoutEffect, useSyncExternalStore } from "react";
|
|
2
|
+
//#region src/react.ts
|
|
3
|
+
function useSnapshot(app) {
|
|
4
|
+
return useSyncExternalStore(app.subscribe, () => app.getSnapshot(), () => app.getSnapshot());
|
|
5
|
+
}
|
|
6
|
+
function Outlet({ app, views }) {
|
|
7
|
+
const snapshot = useSnapshot(app);
|
|
8
|
+
useLayoutEffect(() => app.commit(snapshot.revision), [app, snapshot.revision]);
|
|
9
|
+
return createElement("main", { "data-fs-outlet": "" }, snapshot.entries.map((entry) => {
|
|
10
|
+
const View = views[entry.page.pageType] ?? views["*"];
|
|
11
|
+
if (!View) throw Error("Missing view: " + entry.page.pageType);
|
|
12
|
+
return createElement("div", {
|
|
13
|
+
key: entry.entryId,
|
|
14
|
+
hidden: !entry.visible,
|
|
15
|
+
"data-fs-entry": entry.entryId,
|
|
16
|
+
"data-fs-key": entry.entryId,
|
|
17
|
+
"data-fs-intent": entry.intent
|
|
18
|
+
}, createElement(View, {
|
|
19
|
+
key: entry.entryId + ":" + entry.page.pageType,
|
|
20
|
+
page: entry.page,
|
|
21
|
+
app,
|
|
22
|
+
entry
|
|
23
|
+
}));
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Outlet, useSnapshot };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=react.mjs.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
|
+
var __exportAll = (all, no_symbols) => {
|
|
11
|
+
let target = {};
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
21
|
+
key = keys[i];
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
23
|
+
get: ((k) => from[k]).bind(null, key),
|
|
24
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
34
|
+
//#endregion
|
|
35
|
+
export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region ../core/src/http/target-guard.d.ts
|
|
2
|
+
/** Host adapter lookup, returning every address used by its resolver. */
|
|
3
|
+
type DnsLookup = (hostname: string) => Promise<readonly string[]>;
|
|
4
|
+
interface TargetGuardOptions {
|
|
5
|
+
readonly validateDns?: boolean;
|
|
6
|
+
readonly lookup?: DnsLookup;
|
|
7
|
+
}
|
|
8
|
+
/** Shared target policy for HttpClient and secureFetch. */
|
|
9
|
+
declare function enforceHostGuard(url: string, options?: TargetGuardOptions): Promise<void>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ../core/src/http/secure-fetch.d.ts
|
|
12
|
+
interface SecureFetchOptions {
|
|
13
|
+
/** Opt out of SSRF defense entirely (default false). */
|
|
14
|
+
allowInternalHosts?: boolean;
|
|
15
|
+
/** DNS-resolve hostnames and check each resolved IP (default true). */
|
|
16
|
+
validateDns?: boolean;
|
|
17
|
+
/** Required when DNS validation is enabled for a hostname. */
|
|
18
|
+
lookup?: DnsLookup;
|
|
19
|
+
/** Host transport enforcing policy at connection time; preserves the injected fetch. */
|
|
20
|
+
wrapFetch?: (baseFetch: typeof globalThis.fetch) => typeof globalThis.fetch;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Return a `fetch`-shaped function that refuses requests to private hosts
|
|
24
|
+
* before each request. DNS preflight alone cannot pin an arbitrary transport;
|
|
25
|
+
* select a host connection policy when DNS rebinding protection is required.
|
|
26
|
+
*/
|
|
27
|
+
declare function secureFetch(baseFetch: typeof globalThis.fetch, options?: SecureFetchOptions): typeof globalThis.fetch;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { enforceHostGuard as a, TargetGuardOptions as i, secureFetch as n, DnsLookup as r, SecureFetchOptions as t };
|
|
30
|
+
//# sourceMappingURL=secure-fetch-Xlht2jd7.d.mts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { c as ExecutionContext } from "./path-CXT6xGPO.mjs";
|
|
2
|
+
import { gt as PrefetchedIntent, it as SerializedNavigation, un as BasePage, yn as RouteParams } from "./session-DnB4ZC3x.mjs";
|
|
3
|
+
//#region ../web/src/protocol.d.ts
|
|
4
|
+
declare const FRAMEWORK_PROTOCOL_VERSION = 2;
|
|
5
|
+
declare function getFrameworkBuildId(): string;
|
|
6
|
+
interface WebHydration {
|
|
7
|
+
readonly tree?: SerializedNavigation;
|
|
8
|
+
readonly pages: PrefetchedIntent[];
|
|
9
|
+
}
|
|
10
|
+
interface WireEnvelope {
|
|
11
|
+
readonly protocolVersion: number;
|
|
12
|
+
readonly buildId: string;
|
|
13
|
+
readonly payload: WebHydration;
|
|
14
|
+
}
|
|
15
|
+
type WireDecodeResult = {
|
|
16
|
+
readonly status: "ready";
|
|
17
|
+
readonly data: WebHydration;
|
|
18
|
+
} | {
|
|
19
|
+
readonly status: "fresh-load";
|
|
20
|
+
readonly code: "missing" | "invalid-json" | "protocol-mismatch" | "build-mismatch" | "invalid-payload";
|
|
21
|
+
};
|
|
22
|
+
declare function decodeWireEnvelope(value: unknown, buildId?: string): WireDecodeResult;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region ../web/src/application/server-controller-proxy.d.ts
|
|
25
|
+
declare const SERVER_CONTROLLER_PATH = "/__finesoft/controller";
|
|
26
|
+
interface ServerControllerRequest {
|
|
27
|
+
readonly intent: string;
|
|
28
|
+
readonly params: RouteParams;
|
|
29
|
+
readonly query: RouteParams;
|
|
30
|
+
readonly url: string;
|
|
31
|
+
}
|
|
32
|
+
/** The compiler replaces a complete server controller module with these inert references. */
|
|
33
|
+
declare class ServerControllerProxy {
|
|
34
|
+
perform(params: RouteParams, execution: ExecutionContext, query?: RouteParams): Promise<BasePage>;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { WebHydration as a, decodeWireEnvelope as c, FRAMEWORK_PROTOCOL_VERSION as i, getFrameworkBuildId as l, ServerControllerProxy as n, WireDecodeResult as o, ServerControllerRequest as r, WireEnvelope as s, SERVER_CONTROLLER_PATH as t };
|
|
38
|
+
//# sourceMappingURL=server-controller-proxy-BkVuVWVD.d.mts.map
|