@finesoft/front 0.5.1 → 0.5.3

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.
Files changed (128) hide show
  1. package/README.md +4 -4
  2. package/dist/Outlet.svelte +39 -0
  3. package/dist/Outlet.svelte.d.ts +7 -0
  4. package/dist/browser-CR5vhgXg.mjs +1317 -0
  5. package/dist/browser-kFMjlLGT.d.mts +262 -0
  6. package/dist/browser.d.mts +7 -2
  7. package/dist/browser.mjs +9 -1
  8. package/dist/controller-types-CgmJ6-le.d.mts +16 -0
  9. package/dist/cookies-BiRlUanX.d.mts +786 -0
  10. package/dist/fetch-policy-BHT8RtrL.mjs +82 -0
  11. package/dist/host-guard-DDWxLpFL.mjs +222 -0
  12. package/dist/http-B6CJqDyf.d.mts +46 -0
  13. package/dist/http-CaxrMD1A.d.mts +1 -0
  14. package/dist/http-D70PL72H.mjs +257 -0
  15. package/dist/http.d.mts +3 -0
  16. package/dist/http.mjs +2 -0
  17. package/dist/index-node.d.mts +15 -0
  18. package/dist/index-node.mjs +15 -0
  19. package/dist/index.d.mts +48 -697
  20. package/dist/index.mjs +44 -261
  21. package/dist/load-node.d.mts +5 -0
  22. package/dist/load-node.mjs +10 -0
  23. package/dist/load-portable.d.mts +5 -0
  24. package/dist/load-portable.mjs +8 -0
  25. package/dist/lru-map-BKoUAySU.mjs +50 -0
  26. package/dist/messages-CAt2QdGr.mjs +140 -0
  27. package/dist/native-contract-DuR25hYB.d.mts +14 -0
  28. package/dist/native-contract.d.mts +2 -0
  29. package/dist/native-contract.mjs +1 -0
  30. package/dist/node-D9hB4dsz.d.mts +35 -0
  31. package/dist/node.d.mts +2 -0
  32. package/dist/node.mjs +59 -0
  33. package/dist/path-CGFl2w7D.mjs +113 -0
  34. package/dist/path-CXT6xGPO.d.mts +261 -0
  35. package/dist/portable-CaxrMD1A.d.mts +1 -0
  36. package/dist/portable.d.mts +11 -0
  37. package/dist/portable.mjs +12 -0
  38. package/dist/proxy-2dSWO-Xw.d.mts +53 -0
  39. package/dist/proxy-z02VvGIj.mjs +7520 -0
  40. package/dist/public-types-BcJM-AYc.mjs +835 -0
  41. package/dist/react-DhwBRw01.d.mts +16 -0
  42. package/dist/react.d.mts +3 -0
  43. package/dist/react.mjs +29 -0
  44. package/dist/rolldown-runtime-B4iAMlE-.mjs +35 -0
  45. package/dist/secure-fetch-Xlht2jd7.d.mts +30 -0
  46. package/dist/server-controller-proxy-BkVuVWVD.d.mts +38 -0
  47. package/dist/session-DnB4ZC3x.d.mts +1279 -0
  48. package/dist/src-BQBfaaPO.mjs +3825 -0
  49. package/dist/src-Ftl_0rhu.mjs +28 -0
  50. package/dist/ssr-BLzYP4wU.d.mts +207 -0
  51. package/dist/ssr-Tn4YkuxM.mjs +357 -0
  52. package/dist/ssr.d.mts +3 -0
  53. package/dist/ssr.mjs +3 -0
  54. package/dist/svelte-Dr5to3SE.d.mts +16 -0
  55. package/dist/svelte.d.mts +3 -0
  56. package/dist/svelte.mjs +13 -0
  57. package/dist/typegen-C-WeJCtf.d.mts +12 -0
  58. package/dist/typegen-cli.d.mts +1 -0
  59. package/dist/typegen-cli.mjs +11 -0
  60. package/dist/typegen.d.mts +3 -0
  61. package/dist/typegen.mjs +2 -0
  62. package/dist/types-B1BT0N3t.mjs +402 -0
  63. package/dist/undici-CPfL25Hr.mjs +22262 -0
  64. package/dist/vite-Cj4SPA8D.d.mts +277 -0
  65. package/dist/vite.d.mts +4 -0
  66. package/dist/vite.mjs +2354 -0
  67. package/dist/vue-DGmzuKho.d.mts +32 -0
  68. package/dist/vue.d.mts +3 -0
  69. package/dist/vue.mjs +56 -0
  70. package/dist/web.d.mts +6 -0
  71. package/dist/web.mjs +8 -0
  72. package/dist/worker.d.mts +2 -0
  73. package/dist/worker.mjs +2 -0
  74. package/docs/01-getting-started.md +67 -199
  75. package/docs/02-routing-and-controllers.md +163 -241
  76. package/docs/03-middleware.md +10 -212
  77. package/docs/04-rendering-and-hydration.md +7 -332
  78. package/docs/05-i18n.md +7 -237
  79. package/docs/06-http-client.md +20 -263
  80. package/docs/07-di-container.md +23 -257
  81. package/docs/08-observability.md +6 -286
  82. package/docs/09-server-and-deployment.md +59 -219
  83. package/docs/10-features-platform-pwa.md +7 -231
  84. package/docs/11-navigation.md +143 -288
  85. package/docs/12-session-restoration.md +6 -214
  86. package/docs/README.md +7 -7
  87. package/docs/advanced/custom-action-handler.md +29 -229
  88. package/docs/advanced/custom-adapter.md +7 -259
  89. package/docs/advanced/custom-event-recorder.md +7 -312
  90. package/docs/advanced/inline-proxy-codegen.md +6 -185
  91. package/docs/advanced/multi-tenant-scopes.md +10 -323
  92. package/docs/engineering/ci-release-flow.md +35 -222
  93. package/docs/engineering/project-structure.md +34 -277
  94. package/docs/engineering/testing.md +8 -310
  95. package/docs/pitfalls/container-scope-leak.md +2 -214
  96. package/docs/pitfalls/i18n-bundle-size.md +6 -176
  97. package/docs/pitfalls/proxy-binary-payloads.md +8 -12
  98. package/docs/pitfalls/ssr-hydration-mismatch.md +9 -155
  99. package/docs/pitfalls/ssr-vs-csr-globals.md +9 -170
  100. package/docs/zh/01-getting-started.md +67 -199
  101. package/docs/zh/02-routing-and-controllers.md +166 -244
  102. package/docs/zh/03-middleware.md +10 -212
  103. package/docs/zh/04-rendering-and-hydration.md +7 -332
  104. package/docs/zh/05-i18n.md +7 -237
  105. package/docs/zh/06-http-client.md +20 -263
  106. package/docs/zh/07-di-container.md +23 -257
  107. package/docs/zh/08-observability.md +6 -283
  108. package/docs/zh/09-server-and-deployment.md +59 -219
  109. package/docs/zh/10-features-platform-pwa.md +7 -231
  110. package/docs/zh/11-navigation.md +130 -290
  111. package/docs/zh/12-session-restoration.md +6 -214
  112. package/docs/zh/README.md +4 -4
  113. package/docs/zh/advanced/custom-action-handler.md +29 -229
  114. package/docs/zh/advanced/custom-adapter.md +7 -259
  115. package/docs/zh/advanced/custom-event-recorder.md +7 -312
  116. package/docs/zh/advanced/inline-proxy-codegen.md +6 -185
  117. package/docs/zh/advanced/multi-tenant-scopes.md +10 -323
  118. package/docs/zh/engineering/ci-release-flow.md +35 -222
  119. package/docs/zh/engineering/project-structure.md +34 -277
  120. package/docs/zh/engineering/testing.md +8 -310
  121. package/docs/zh/pitfalls/container-scope-leak.md +2 -214
  122. package/docs/zh/pitfalls/i18n-bundle-size.md +6 -176
  123. package/docs/zh/pitfalls/proxy-binary-payloads.md +8 -12
  124. package/docs/zh/pitfalls/ssr-hydration-mismatch.md +9 -155
  125. package/docs/zh/pitfalls/ssr-vs-csr-globals.md +9 -170
  126. package/package.json +118 -20
  127. package/dist/browser-BHhVWXik.mjs +0 -2
  128. 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
@@ -0,0 +1,3 @@
1
+ import { g as WebAppView, h as ViewProps } from "./session-DnB4ZC3x.mjs";
2
+ import { a as useSnapshot, n as NativeViews, r as Outlet, t as NativeView } from "./react-DhwBRw01.mjs";
3
+ export { NativeView, NativeViews, Outlet, type ViewProps, type WebAppView, useSnapshot };
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