@finesoft/front 0.5.0 → 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.
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-DIU6Sxl3.mjs +1237 -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-Bpf9VayB.d.mts +779 -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 -698
  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-1SphZ7x7.mjs +436 -0
  39. package/dist/proxy-2dSWO-Xw.d.mts +53 -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-Ftl_0rhu.mjs +28 -0
  49. package/dist/src-qwx7Vw8g.mjs +3807 -0
  50. package/dist/ssr-BEUNDvbj.d.mts +210 -0
  51. package/dist/ssr-C8xnYXoY.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-BuaZHRG7.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 +6 -333
  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 +4 -160
  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 +6 -333
  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 +4 -160
  125. package/docs/zh/pitfalls/ssr-vs-csr-globals.md +9 -170
  126. package/package.json +118 -20
  127. package/dist/browser-BYZq9Jp7.mjs +0 -2
  128. package/dist/browser-JTs2jqVY.d.mts +0 -2811
@@ -0,0 +1,32 @@
1
+ import { f as AppSnapshot, g as WebAppView, h as ViewProps } from "./session-DnB4ZC3x.mjs";
2
+ import { Component, PropType } from "vue";
3
+ declare namespace vue_d_exports {
4
+ export { NativeView, NativeViews, Outlet, ViewProps, WebAppView, useSnapshot };
5
+ }
6
+ type NativeView = Component;
7
+ type NativeViews = Readonly<Record<string, NativeView>>;
8
+ declare function useSnapshot(app: WebAppView): import("vue").ShallowRef<AppSnapshot, AppSnapshot>;
9
+ declare const Outlet: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ app: {
11
+ type: PropType<WebAppView>;
12
+ required: true;
13
+ };
14
+ views: {
15
+ type: PropType<NativeViews>;
16
+ required: true;
17
+ };
18
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
19
+ [key: string]: any;
20
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
21
+ app: {
22
+ type: PropType<WebAppView>;
23
+ required: true;
24
+ };
25
+ views: {
26
+ type: PropType<NativeViews>;
27
+ required: true;
28
+ };
29
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
30
+ //#endregion
31
+ export { vue_d_exports as a, useSnapshot as i, NativeViews as n, Outlet as r, NativeView as t };
32
+ //# sourceMappingURL=vue-DGmzuKho.d.mts.map
package/dist/vue.d.mts ADDED
@@ -0,0 +1,3 @@
1
+ import { g as WebAppView, h as ViewProps } from "./session-DnB4ZC3x.mjs";
2
+ import { i as useSnapshot, n as NativeViews, r as Outlet, t as NativeView } from "./vue-DGmzuKho.mjs";
3
+ export { NativeView, NativeViews, Outlet, type ViewProps, type WebAppView, useSnapshot };
package/dist/vue.mjs ADDED
@@ -0,0 +1,56 @@
1
+ import { defineComponent, h, nextTick, onMounted, onUnmounted, onUpdated, shallowRef } from "vue";
2
+ //#region src/vue.ts
3
+ function useSnapshot(app) {
4
+ const snapshot = shallowRef(app.getSnapshot());
5
+ const unsubscribe = app.subscribe(() => {
6
+ snapshot.value = app.getSnapshot();
7
+ });
8
+ onUnmounted(unsubscribe);
9
+ return snapshot;
10
+ }
11
+ const Outlet = defineComponent({
12
+ name: "FinesoftOutlet",
13
+ props: {
14
+ app: {
15
+ type: Object,
16
+ required: true
17
+ },
18
+ views: {
19
+ type: Object,
20
+ required: true
21
+ }
22
+ },
23
+ setup(props) {
24
+ const snapshot = useSnapshot(props.app);
25
+ let renderedRevision = snapshot.value.revision;
26
+ const commit = () => {
27
+ const revision = renderedRevision;
28
+ nextTick(() => props.app.commit(revision));
29
+ };
30
+ onMounted(commit);
31
+ onUpdated(commit);
32
+ return () => {
33
+ renderedRevision = snapshot.value.revision;
34
+ return h("main", { "data-fs-outlet": "" }, snapshot.value.entries.map((entry) => {
35
+ const View = props.views[entry.page.pageType] ?? props.views["*"];
36
+ if (!View) throw Error("Missing view: " + entry.page.pageType);
37
+ return h("div", {
38
+ key: entry.entryId,
39
+ hidden: !entry.visible,
40
+ "data-fs-entry": entry.entryId,
41
+ "data-fs-key": entry.entryId,
42
+ "data-fs-intent": entry.intent
43
+ }, [h(View, {
44
+ key: entry.entryId + ":" + entry.page.pageType,
45
+ page: entry.page,
46
+ app: props.app,
47
+ entry
48
+ })]);
49
+ }));
50
+ };
51
+ }
52
+ });
53
+ //#endregion
54
+ export { Outlet, useSnapshot };
55
+
56
+ //# sourceMappingURL=vue.mjs.map
package/dist/web.d.mts ADDED
@@ -0,0 +1,6 @@
1
+ import { A as makeSchema, C as ImpressionEntry, D as StandardIssue, E as ParamSchema, F as Token, I as createToken, M as Provider, N as ProviderContext, O as StandardResult, P as provide, S as EventRecorder, T as InferOutput, _ as OperationPolicy, a as compilePath, b as RuntimeOptions, c as ExecutionContext, d as ExecutionHandle, f as Implementation, g as OperationHandler, h as Operation, i as PathParams, j as Container, k as StandardSchemaV1, l as ExecutionError, m as ModuleDefinition, n as PathDescriptor, o as AnyOperation, p as Invocation, r as PathParameterDescriptor, s as AppDefinition, t as CompiledPath, u as ExecutionErrorCode, v as QueryCache, w as MetricsFieldsProvider, x as executionErrorFromHttp, y as RuntimeHandle } from "./path-CXT6xGPO.mjs";
2
+ import { $ as createActiveLeafCodec, $n as list, $t as MiddlewareResult, A as SessionStore, An as PlatformInfo, At as isCompoundAction, B as ControllerContext, Bn as ConsoleLoggerFactory, Bt as NavigationPath, C as SessionFailure, Cn as Storage, Ct as ACTION_KINDS, D as SessionSlice, Dn as LocaleInfo, Dt as ExternalUrlAction, E as SessionRestoreResult, En as LocaleAttributes, Et as CompoundAction, F as WebRuntime, Fn as ReportCallback, Ft as LeafNode, G as controllerContext, Gn as InferParams, Gt as SplitColumn, H as SERVER_CONTROLLER, Hn as Logger, Ht as NavigationSnapshot, I as WebRuntimeOptions, In as ReportingLogger, It as NAVIGATION_NODE_KINDS, J as resolveConfiguredMessages, Jn as QuerySchemaMap, Jt as StackNode, K as MessagesLoader, Kn as InferQuery, Kt as SplitNode, L as createWebRuntime, Ln as ReportingLoggerFactory, Lt as NavigationError, M as SessionWriteResult, Mn as BaseController, Mt as isFlowAction, N as StorageUnavailableError, Nn as ControllerFailure, Nt as makeExternalUrlAction, O as SessionSnapshot, On as TextDirection, Ot as FlowAction, P as WebConfiguration, Pn as ControllerInput, Pt as makeFlowAction, Q as NavigationRouterLike, Qn as isMultiValueSchema, Qt as DenyResult, R as PageControllerDefinition, Rn as ReportingLoggerOptions, Rt as NavigationNode, S as SessionErrorContext, Sn as FeatureFlagsProvider, St as ActionHandler, T as SessionNavigation, Tn as resolveMessages, Tt as ActionInvocation, U as SERVER_REQUEST, Un as LoggerFactory, Ut as ResolvedDestination, V as PageControllerInput, Vn as LogFilter, Vt as NavigationPathStep, W as ServerRequestState, Wn as ExtractParamNames, Wt as SPLIT_VISIBILITIES, X as FullStateCodecOptions, Xn as ListOptions, Xt as AfterLoadGuard, Y as DEFAULT_NAV_PARAM, Yn as StripOptional, Yt as TabsNode, Z as NavigationCodec, Zn as MultiValueSchema, Zt as BeforeLoadGuard, _ as AsyncStorage, _n as RouteInput, _t as PrefetchedIntents, a as NavigationCommitContext, an as deny, at as SerializedSplit, b as SESSION_DEFAULT_VERSION, bn as DEP_KEYS, bt as Router, c as NavigationTransactionContext, cn as rewrite, ct as SerializedTabs, d as createWebSession, dn as FINESOFT_PUBLIC, dt as serializeNavigationStable, en as NavigationContext, er as Intent, et as createFullStateCodec, f as AppSnapshot, fn as PublicProjection, ft as PageRoute, g as WebAppView, gn as markPublic, gt as PrefetchedIntent, h as ViewProps, hn as isPublicMarked, ht as route, i as BeforeNavigateResult, in as RewriteResult, it as SerializedNavigation, j as SessionStoreOptions, jn as detectPlatform, jt as isExternalUrlAction, k as SessionStateProvider, kn as Translator, kt as TreeAction, l as WebSession, ln as BASE_PAGE_FIELDS, lt as deserializeNavigation, m as ViewEntry, mn as getPublicFields, mt as RouteDefinition, n as BeforeCommitResult, nn as PostLoadContext, nt as encodeNavigationTreeParam, o as NavigationCommitError, on as next, ot as SerializedSplitColumn, p as NavigationSummary, pn as PublicValueCodec, pt as RenderMode, q as MessagesLoaderContext, qn as ParamsFor, qt as SplitVisibility, r as BeforeNavigatePolicy, rn as RedirectResult, rt as SerializedLeaf, s as NavigationContextInput, sn as redirect, st as SerializedStack, t as BeforeCommitPolicy, tn as NextResult, tt as decodeNavigationTreeParam, u as WebSessionOptions, un as BasePage, ut as serializeNavigation, v as NavigationScopedState, vn as RouteIntent, vt as RouteAddOptions, w as SessionLoadResult, wn as TranslationMessages, wt as Action, x as SessionError, xn as FeatureFlags, xt as ActionDispatcher, y as SESSION_DEFAULT_KEY, yn as RouteParams, yt as RouteMatch, z as WebAppDefinition, zn as ConsoleLogger, zt as NavigationNodeKind } from "./session-DnB4ZC3x.mjs";
3
+ import { $ as SimpleTranslatorOptions, $t as uuid, A as setVisibility, At as fetchWithRedirects, B as split, Bt as HttpError, C as popTo, Ct as isSome, D as resolveActivePath, Dt as mapEach, E as replaceTop, Et as Mapper, F as isLeafNode, Ft as HttpClientConfig, G as safeErrorPage, Gt as withDefault, H as tabs, Ht as CompositeLogger, I as isSplitNode, It as HttpRequestOptions, J as defineModule, Jt as bool, K as createRuntime, Kt as NumOptions, L as isStackNode, Lt as RequestInterceptor, M as resourceKey, Mt as classifyHost, N as SplitColumnInit, Nt as classifyUrl, O as selectColumn, Ot as pipe, P as TabsInit, Pt as HttpClient, Q as SimpleTranslator, Qt as str, R as isTabsNode, Rt as ResponseInterceptor, S as pop, St as isNone, T as push, Tt as AsyncMapper, U as RouteInputFor, Ut as CompositeLoggerFactory, V as stack, Vt as stableStringify, W as SafeErrorPageOptions, Wt as optional, X as implementController, Xt as num, Y as defineOperation, Yt as int, Z as implementOperation, Zt as oneOf, _ as collectAllLeaves, _t as removeHost, a as LoadPageOptions, at as PluralCategory, b as findNode, bt as None, c as defineWebApp, ct as interpolate, d as runBeforeLoadGuards, dt as VoidEventRecorder, et as getLocaleAttributes, f as createSessionStore, ft as ConsoleEventRecorder, g as encodeSnapshot, gt as getBaseUrl, h as decodeSnapshot, ht as buildUrl, i as resolveInitialNavigation, it as resolveLocaleFromUrl, j as visibleSplitColumns, jt as HostCheckResult, k as selectTab, kt as pipeAsync, l as getWebPlan, lt as resolvePluralKey, m as createNavigationScopedState, mt as generateUuid, n as PageReference, nt as isRtl, o as PageLoadResult, ot as PluralRuleProvider, p as collectLeafKeys, pt as CompositeEventRecorder, q as defineApp, qt as StrOptions, r as definePage, rt as makeLocaleInfo, s as loadPage, st as englishPlural, t as parseCookieString, tt as getTextDirection, u as runAfterLoadGuards, ut as WithFieldsRecorder, v as collectVisibleDestinations, vt as removeQueryParams, w as popToRoot, wt as LruMap, x as mapNavigationLeaves, xt as Optional, y as findNearestStack, yt as removeScheme, z as leaf, zt as HostGuardError } from "./cookies-Bpf9VayB.mjs";
4
+ import { a as enforceHostGuard, i as TargetGuardOptions, n as secureFetch, r as DnsLookup, t as SecureFetchOptions } from "./secure-fetch-Xlht2jd7.mjs";
5
+ import { a as WebHydration, c as decodeWireEnvelope, i as FRAMEWORK_PROTOCOL_VERSION, l as getFrameworkBuildId, n as ServerControllerProxy, o as WireDecodeResult, r as ServerControllerRequest, s as WireEnvelope, t as SERVER_CONTROLLER_PATH } from "./server-controller-proxy-BkVuVWVD.mjs";
6
+ export { ACTION_KINDS, type Action, ActionDispatcher, type ActionHandler, type ActionInvocation, type AfterLoadGuard, AnyOperation, AppDefinition, AppSnapshot, type AsyncMapper, type AsyncStorage, BASE_PAGE_FIELDS, BaseController, type BasePage, type BeforeCommitPolicy, type BeforeCommitResult, type BeforeLoadGuard, type BeforeNavigatePolicy, type BeforeNavigateResult, type CompiledPath, CompositeEventRecorder, CompositeLogger, CompositeLoggerFactory, type CompoundAction, ConsoleEventRecorder, ConsoleLogger, ConsoleLoggerFactory, Container, ControllerContext, type ControllerFailure, type ControllerInput, DEFAULT_NAV_PARAM, DEP_KEYS, type DenyResult, type DnsLookup, type EventRecorder, ExecutionContext, ExecutionError, ExecutionErrorCode, ExecutionHandle, type ExternalUrlAction, type ExtractParamNames, FINESOFT_PUBLIC, FRAMEWORK_PROTOCOL_VERSION, type FeatureFlags, type FeatureFlagsProvider, type FlowAction, type FullStateCodecOptions, type HostCheckResult, HostGuardError, HttpClient, type HttpClientConfig, HttpError, type HttpRequestOptions, Implementation, type ImpressionEntry, type InferOutput, type InferParams, type InferQuery, type Intent, Invocation, type LeafNode, type ListOptions, type LoadPageOptions, type LocaleAttributes, type LocaleInfo, type LogFilter, type Logger, type LoggerFactory, LruMap, type Mapper, type MessagesLoader, type MessagesLoaderContext, type MetricsFieldsProvider, type MiddlewareResult, ModuleDefinition, type MultiValueSchema, NAVIGATION_NODE_KINDS, type NavigationCodec, type NavigationCommitContext, NavigationCommitError, type NavigationContext, type NavigationContextInput, NavigationError, type NavigationNode, type NavigationNodeKind, type NavigationPath, type NavigationPathStep, type NavigationRouterLike, type NavigationScopedState, type NavigationSnapshot, NavigationSummary, type NavigationTransactionContext, type NextResult, type None, type NumOptions, Operation, OperationHandler, OperationPolicy, type Optional, type PageControllerDefinition, PageControllerInput, type PageLoadResult, type PageReference, type PageRoute, type ParamSchema, type ParamsFor, type PathDescriptor, type PathParameterDescriptor, type PathParams, type PlatformInfo, type PluralCategory, type PluralRuleProvider, type PostLoadContext, type PrefetchedIntent, PrefetchedIntents, type Provider, type ProviderContext, type PublicProjection, type PublicValueCodec, QueryCache, type QuerySchemaMap, type RedirectResult, type RenderMode, type ReportCallback, ReportingLogger, ReportingLoggerFactory, type ReportingLoggerOptions, type RequestInterceptor, type ResolvedDestination, type ResponseInterceptor, type RewriteResult, type RouteAddOptions, type RouteDefinition, type RouteInput, type RouteInputFor, type RouteIntent, type RouteMatch, type RouteParams, Router, RuntimeHandle, RuntimeOptions, SERVER_CONTROLLER, SERVER_CONTROLLER_PATH, SERVER_REQUEST, SESSION_DEFAULT_KEY, SESSION_DEFAULT_VERSION, SPLIT_VISIBILITIES, type SafeErrorPageOptions, type SecureFetchOptions, type SerializedLeaf, type SerializedNavigation, type SerializedSplit, type SerializedSplitColumn, type SerializedStack, type SerializedTabs, ServerControllerProxy, type ServerControllerRequest, ServerRequestState, SessionError, type SessionErrorContext, type SessionFailure, type SessionLoadResult, type SessionNavigation, type SessionRestoreResult, type SessionSlice, type SessionSnapshot, type SessionStateProvider, type SessionStore, type SessionStoreOptions, type SessionWriteResult, SimpleTranslator, type SimpleTranslatorOptions, type SplitColumn, type SplitColumnInit, type SplitNode, type SplitVisibility, type StackNode, type StandardIssue, type StandardResult, type StandardSchemaV1, type Storage, StorageUnavailableError, type StrOptions, type StripOptional, type TabsInit, type TabsNode, type TargetGuardOptions, type TextDirection, type Token, type TranslationMessages, type Translator, type TreeAction, ViewEntry, ViewProps, VoidEventRecorder, type WebAppDefinition, WebAppView, type WebConfiguration, type WebHydration, type WebRuntime, type WebRuntimeOptions, type WebSession, type WebSessionOptions, type WireDecodeResult, type WireEnvelope, WithFieldsRecorder, bool, buildUrl, classifyHost, classifyUrl, collectAllLeaves, collectLeafKeys, collectVisibleDestinations, compilePath, controllerContext, createActiveLeafCodec, createFullStateCodec, createNavigationScopedState, createRuntime, createSessionStore, createToken, createWebRuntime, createWebSession, decodeNavigationTreeParam, decodeSnapshot, decodeWireEnvelope, defineApp, defineModule, defineOperation, definePage, defineWebApp, deny, deserializeNavigation, detectPlatform, encodeNavigationTreeParam, encodeSnapshot, enforceHostGuard, englishPlural, executionErrorFromHttp, fetchWithRedirects, findNearestStack, findNode, generateUuid, getBaseUrl, getFrameworkBuildId, getLocaleAttributes, getPublicFields, getTextDirection, getWebPlan, implementController, implementOperation, int, interpolate, isCompoundAction, isExternalUrlAction, isFlowAction, isLeafNode, isMultiValueSchema, isNone, isPublicMarked, isRtl, isSome, isSplitNode, isStackNode, isTabsNode, leaf, list, loadPage, makeExternalUrlAction, makeFlowAction, makeLocaleInfo, makeSchema, mapEach, mapNavigationLeaves, markPublic, next, num, oneOf, optional, parseCookieString, pipe, pipeAsync, pop, popTo, popToRoot, provide, push, redirect, removeHost, removeQueryParams, removeScheme, replaceTop, resolveActivePath, resolveConfiguredMessages, resolveInitialNavigation, resolveLocaleFromUrl, resolveMessages, resolvePluralKey, resourceKey, rewrite, route, runAfterLoadGuards, runBeforeLoadGuards, safeErrorPage, secureFetch, selectColumn, selectTab, serializeNavigation, serializeNavigationStable, setVisibility, split, stableStringify, stack, str, tabs, uuid, visibleSplitColumns, withDefault };
package/dist/web.mjs ADDED
@@ -0,0 +1,8 @@
1
+ import { $ as isLeafNode, A as createActiveLeafCodec, At as getTextDirection, B as findNode, Bt as fetchWithRedirects, C as runBeforeLoadGuards, Ct as defineModule, D as SERVER_REQUEST, Dt as SimpleTranslator, E as SERVER_CONTROLLER, Et as implementOperation, F as serializeNavigation, Ft as interpolate, G as push, Gt as ConsoleLogger, H as pop, Ht as stableStringify, I as serializeNavigationStable, It as resolvePluralKey, J as selectColumn, Jt as CompositeLoggerFactory, K as replaceTop, Kt as ConsoleLoggerFactory, L as collectAllLeaves, Lt as generateUuid, M as decodeNavigationTreeParam, Mt as makeLocaleInfo, N as encodeNavigationTreeParam, Nt as resolveLocaleFromUrl, O as controllerContext, Ot as resolveMessages, P as deserializeNavigation, Pt as englishPlural, Q as resourceKey, R as collectVisibleDestinations, Rt as detectPlatform, S as runAfterLoadGuards, St as defineApp, T as getWebPlan, Tt as implementController, U as popTo, Ut as ReportingLogger, V as mapNavigationLeaves, Vt as enforceHostGuard, W as popToRoot, Wt as ReportingLoggerFactory, X as setVisibility, Xt as list, Y as selectTab, Yt as isMultiValueSchema, Z as visibleSplitColumns, Zt as Container, _ as SERVER_CONTROLLER_PATH, _t as isFlowAction, a as createSessionStore, at as stack, b as decodeWireEnvelope, bt as provide, c as decodeSnapshot, ct as NavigationError, d as createWebSession, dt as PrefetchedIntents, et as isSplitNode, f as SESSION_DEFAULT_KEY, ft as Router, g as loadPage, gt as isExternalUrlAction, h as StorageUnavailableError, ht as isCompoundAction, i as createWebRuntime, it as split, j as createFullStateCodec, jt as isRtl, k as DEFAULT_NAV_PARAM, kt as getLocaleAttributes, l as encodeSnapshot, lt as SPLIT_VISIBILITIES, m as SessionError, mt as ACTION_KINDS, n as definePage, nt as isTabsNode, o as collectLeafKeys, ot as tabs, p as SESSION_DEFAULT_VERSION, pt as ActionDispatcher, q as resolveActivePath, qt as CompositeLogger, r as resolveInitialNavigation, rt as leaf, s as createNavigationScopedState, st as NAVIGATION_NODE_KINDS, t as parseCookieString, tt as isStackNode, u as NavigationCommitError, ut as route, v as ServerControllerProxy, vt as makeExternalUrlAction, w as defineWebApp, wt as defineOperation, x as getFrameworkBuildId, xt as createRuntime, y as FRAMEWORK_PROTOCOL_VERSION, yt as makeFlowAction, z as findNearestStack, zt as secureFetch } from "./src-qwx7Vw8g.mjs";
2
+ import { C as bool, D as str, E as oneOf, O as uuid, S as withDefault, T as num, _ as mapEach, a as safeErrorPage, b as HttpClient, c as ConsoleEventRecorder, d as getBaseUrl, f as removeHost, g as isSome, h as isNone, i as rewrite, k as makeSchema, l as CompositeEventRecorder, m as removeScheme, n as next, o as WithFieldsRecorder, p as removeQueryParams, r as redirect, s as VoidEventRecorder, t as deny, u as buildUrl, v as pipe, w as int, x as optional, y as pipeAsync } from "./types-BuaZHRG7.mjs";
3
+ import { i as HttpError, n as classifyUrl, r as HostGuardError, t as classifyHost } from "./host-guard-DDWxLpFL.mjs";
4
+ import { n as ExecutionError, r as executionErrorFromHttp, t as compilePath } from "./path-CGFl2w7D.mjs";
5
+ import { a as isPublicMarked, i as getPublicFields, n as BASE_PAGE_FIELDS, o as markPublic, r as FINESOFT_PUBLIC, s as BaseController, t as resolveConfiguredMessages } from "./messages-CAt2QdGr.mjs";
6
+ import { t as LruMap } from "./lru-map-BKoUAySU.mjs";
7
+ import { n as createToken, t as DEP_KEYS } from "./src-Ftl_0rhu.mjs";
8
+ export { ACTION_KINDS, ActionDispatcher, BASE_PAGE_FIELDS, BaseController, CompositeEventRecorder, CompositeLogger, CompositeLoggerFactory, ConsoleEventRecorder, ConsoleLogger, ConsoleLoggerFactory, Container, DEFAULT_NAV_PARAM, DEP_KEYS, ExecutionError, FINESOFT_PUBLIC, FRAMEWORK_PROTOCOL_VERSION, HostGuardError, HttpClient, HttpError, LruMap, NAVIGATION_NODE_KINDS, NavigationCommitError, NavigationError, PrefetchedIntents, ReportingLogger, ReportingLoggerFactory, Router, SERVER_CONTROLLER, SERVER_CONTROLLER_PATH, SERVER_REQUEST, SESSION_DEFAULT_KEY, SESSION_DEFAULT_VERSION, SPLIT_VISIBILITIES, ServerControllerProxy, SessionError, SimpleTranslator, StorageUnavailableError, VoidEventRecorder, WithFieldsRecorder, bool, buildUrl, classifyHost, classifyUrl, collectAllLeaves, collectLeafKeys, collectVisibleDestinations, compilePath, controllerContext, createActiveLeafCodec, createFullStateCodec, createNavigationScopedState, createRuntime, createSessionStore, createToken, createWebRuntime, createWebSession, decodeNavigationTreeParam, decodeSnapshot, decodeWireEnvelope, defineApp, defineModule, defineOperation, definePage, defineWebApp, deny, deserializeNavigation, detectPlatform, encodeNavigationTreeParam, encodeSnapshot, enforceHostGuard, englishPlural, executionErrorFromHttp, fetchWithRedirects, findNearestStack, findNode, generateUuid, getBaseUrl, getFrameworkBuildId, getLocaleAttributes, getPublicFields, getTextDirection, getWebPlan, implementController, implementOperation, int, interpolate, isCompoundAction, isExternalUrlAction, isFlowAction, isLeafNode, isMultiValueSchema, isNone, isPublicMarked, isRtl, isSome, isSplitNode, isStackNode, isTabsNode, leaf, list, loadPage, makeExternalUrlAction, makeFlowAction, makeLocaleInfo, makeSchema, mapEach, mapNavigationLeaves, markPublic, next, num, oneOf, optional, parseCookieString, pipe, pipeAsync, pop, popTo, popToRoot, provide, push, redirect, removeHost, removeQueryParams, removeScheme, replaceTop, resolveActivePath, resolveConfiguredMessages, resolveInitialNavigation, resolveLocaleFromUrl, resolveMessages, resolvePluralKey, resourceKey, rewrite, route, runAfterLoadGuards, runBeforeLoadGuards, safeErrorPage, secureFetch, selectColumn, selectTab, serializeNavigation, serializeNavigationStable, setVisibility, split, stableStringify, stack, str, tabs, uuid, visibleSplitColumns, withDefault };
@@ -0,0 +1,2 @@
1
+ import { a as HttpHost, i as HttpHandlerOptions, l as runManagedTask, o as ManagedTask, r as HttpHandler, s as createHttpHandler } from "./http-B6CJqDyf.mjs";
2
+ export { type HttpHandler, type HttpHandlerOptions, type HttpHost, type ManagedTask, createHttpHandler, runManagedTask };
@@ -0,0 +1,2 @@
1
+ import { r as runManagedTask, t as createHttpHandler } from "./http-D70PL72H.mjs";
2
+ export { createHttpHandler, runManagedTask };
@@ -1,230 +1,98 @@
1
- # 1. Getting started
1
+ # Getting started
2
2
 
3
- A working `@finesoft/front` app in five minutes. By the end you have a Vue/React/Svelte page rendering on the server, hydrating in the browser, and ready to deploy.
3
+ All framework APIs use `from "@finesoft/front"`. The application creates one native React, Vue or Svelte root; its layout and providers surround Outlet. All six templates use this same model.
4
4
 
5
- ## Prerequisites
6
-
7
- - Node.js `>= 22.12.0`
8
- - A package manager: pnpm (recommended), npm, or yarn
9
- - A view layer (Vue 3, React 19, or Svelte 5) — these docs use Vue, but every example translates one-to-one
10
-
11
- ## Scaffold a new app
12
-
13
- ```bash
14
- npx @finesoft/create-app my-app
15
- cd my-app
16
- pnpm install
17
- pnpm dev
18
- ```
19
-
20
- The scaffolder generates a runnable app with routing, SSR, and proxy already wired. Open <http://localhost:5173>.
21
-
22
- If you want to understand what was generated, the rest of this page builds the same setup from scratch.
23
-
24
- ## Add to an existing project
5
+ Install dependencies first. Node must satisfy `^22.18.0 || >=24.11.0`; use Vite+ for project tooling. Full demonstrates products, search and guards; minimal demonstrates tabs/stacks, drafts and session restoration.
25
6
 
26
7
  ```bash
27
- pnpm add @finesoft/front
28
- pnpm add -D vite hono
8
+ vp dlx @finesoft/create-app my-app
9
+ vp install
29
10
  ```
30
11
 
31
- Peer dependencies: `hono >= 4.0.0`. Optional but recommended: `@hono/node-server` for Node deployment, `vite >= 5.0.0` for the dev server.
32
-
33
- ## Minimal project layout
34
-
35
- ```
36
- my-app/
37
- ├── src/
38
- │ ├── bootstrap.ts # routes + controllers (shared SSR + CSR)
39
- │ ├── main.ts # browser entry
40
- │ ├── ssr.ts # SSR entry
41
- │ ├── App.vue # root component
42
- │ └── lib/
43
- │ └── controllers/
44
- │ └── home.ts
45
- ├── index.html
46
- ├── vite.config.ts
47
- ├── package.json
48
- └── tsconfig.json
49
- ```
50
-
51
- ## Vite config
12
+ ## Page and route
52
13
 
53
14
  ```ts
54
- // vite.config.ts
55
- import { finesoftFrontViteConfig } from "@finesoft/front";
56
- import vue from "@vitejs/plugin-vue";
57
- import { defineConfig } from "vite";
58
-
59
- export default defineConfig({
60
- plugins: [
61
- vue(),
62
- finesoftFrontViteConfig({
63
- ssr: { entry: "src/ssr.ts" },
64
- i18n: { messagesDir: "src/locales" },
65
- adapter: "auto",
66
- }),
67
- ],
15
+ // src/app-definition.ts
16
+ import { definePage, defineWebApp, markPublic } from "@finesoft/front";
17
+ export const home = definePage({
18
+ id: "home",
19
+ routes: ["/"],
20
+ handler: () => markPublic({ id: "home", pageType: "home" as const, title: "Home" }, []),
21
+ });
22
+ export const app = defineWebApp({
23
+ id: "example",
24
+ pages: [home],
25
+ getErrorPage: (status, title) => ({ id: String(status), pageType: "error", title }),
68
26
  });
69
27
  ```
70
28
 
71
- What `finesoftFrontViteConfig` adds:
72
-
73
- - A Hono-based dev server that runs your SSR entry on every request
74
- - Locale JSON auto-loading from `messagesDir`
75
- - A build pipeline that emits both the client bundle and a server entry
76
- - Platform adapter wiring for `adapter: "auto" | "node" | "vercel" | "cloudflare" | "netlify" | "static"`
77
-
78
- ## Bootstrap (shared by SSR and CSR)
79
-
80
- ```ts
81
- // src/bootstrap.ts
82
- import { type Framework, defineRoutes } from "@finesoft/front";
83
- import { HomeController } from "./lib/controllers/home";
84
-
85
- export function bootstrap(framework: Framework): void {
86
- defineRoutes(framework, [{ path: "/", intentId: "home", controller: new HomeController() }]);
29
+ ## Native application root
30
+
31
+ ```tsx
32
+ // src/App.tsx
33
+ import { Outlet as selectOutlet, type WebAppView } from "@finesoft/front";
34
+ import Home from "./pages/Home";
35
+ import ErrorPage from "./pages/ErrorPage";
36
+ const Outlet = selectOutlet("react");
37
+ const views = { home: Home, error: ErrorPage };
38
+ export default function App({ app }: { app: WebAppView }) {
39
+ return (
40
+ <div className="layout">
41
+ <Outlet app={app} views={views} />
42
+ </div>
43
+ );
87
44
  }
88
45
  ```
89
46
 
90
- The same `bootstrap()` runs on both sides. This is what guarantees the server and browser resolve URLs identically.
91
-
92
- ## Controller
93
-
94
- ```ts
95
- // src/lib/controllers/home.ts
96
- import { BaseController, type Container } from "@finesoft/front";
97
-
98
- interface HomePage {
99
- kind: "home";
100
- title: string;
101
- items: string[];
102
- }
47
+ Page components receive `{ page, app, entry }` and inherit native context from their layout. Real `<a href>` links use the same navigation flow; composed actions use `app.perform(action)`. Class-based loaders may use `BaseController.execute({ params, query, context })`.
103
48
 
104
- export class HomeController extends BaseController<Record<string, string>, HomePage> {
105
- readonly intentId = "home";
106
-
107
- async execute(_params: Record<string, string>, _container: Container): Promise<HomePage> {
108
- return {
109
- kind: "home",
110
- title: "Welcome",
111
- items: ["one", "two", "three"],
112
- };
113
- }
49
+ ## Browser entry
114
50
 
115
- fallback(_params: Record<string, string>, error: unknown): HomePage {
116
- return { kind: "home", title: "Failed", items: [] };
117
- }
118
- }
51
+ ```tsx
52
+ // src/main.tsx
53
+ import { createBrowserApp } from "@finesoft/front";
54
+ import { createRoot, hydrateRoot } from "react-dom/client";
55
+ import { app as definition } from "./app-definition";
56
+ import App from "./App";
57
+ const target = document.getElementById("app")!;
58
+ const app = await createBrowserApp({ definition, target });
59
+ const root = app.shouldHydrate ? hydrateRoot(target, <App app={app} />) : createRoot(target);
60
+ if (!app.shouldHydrate) root.render(<App app={app} />);
61
+ await app.ready;
62
+ // Cleanup owned by the application:
63
+ // try { await app.dispose(); } finally { root.unmount(); }
119
64
  ```
120
65
 
121
- `BaseController` wraps `execute()` in `try/catch` and calls `fallback()` on error. Always provide a `fallback` see [error handling](./08-observability.md#error-handling-via-fallback) for why.
66
+ `createBrowserApp` returns a session ready to mount. Mount first, then await `ready`. Outlet acknowledges the native commit before session restoration starts. Awaiting ready before mounting would deadlock.
122
67
 
123
- ## SSR entry
124
-
125
- ```ts
126
- // src/ssr.ts
127
- import { createSSRRender, serializeServerData } from "@finesoft/front";
128
- import { createSSRApp } from "vue";
129
- import { renderToString } from "vue/server-renderer";
130
- import App from "./App.vue";
131
- import { bootstrap } from "./bootstrap";
68
+ ## SSR
132
69
 
70
+ ```tsx
71
+ // src/ssr.tsx
72
+ import { renderToString } from "react-dom/server";
73
+ import { createSSRRender } from "@finesoft/front";
74
+ import { app as definition } from "./app-definition";
75
+ import App from "./App";
133
76
  export const render = createSSRRender({
134
- bootstrap,
135
- getErrorPage: () => ({ kind: "error", title: "Error" }),
136
- async renderApp(page) {
137
- const html = await renderToString(createSSRApp(App, { page }));
138
- return { html, head: `<title>${(page as { title: string }).title}</title>`, css: "" };
139
- },
77
+ definition,
78
+ render: (app) => renderToString(<App app={app} />),
140
79
  });
141
-
142
- export { serializeServerData };
80
+ export { serializeServerData } from "@finesoft/front";
143
81
  ```
144
82
 
145
- `createSSRRender` returns a function that takes a URL and returns rendered HTML + serialized prefetched intent data. The Vite plugin and adapters call it for you — you do not invoke it directly.
146
-
147
- ## Browser entry
83
+ ## Vite
148
84
 
149
85
  ```ts
150
- // src/main.ts
151
- import { startBrowserApp } from "@finesoft/front/browser";
152
- import { createSSRApp } from "vue";
153
- import App from "./App.vue";
154
- import { bootstrap } from "./bootstrap";
155
-
156
- startBrowserApp({
157
- bootstrap,
158
- mount(target, { framework }) {
159
- const app = createSSRApp(App, { framework });
160
- app.mount(target);
161
- },
86
+ import { defineConfig } from "vite-plus";
87
+ import react from "@vitejs/plugin-react";
88
+ import { finesoftFrontViteConfig } from "@finesoft/front";
89
+ export default defineConfig({
90
+ plugins: [react(), finesoftFrontViteConfig({ adapter: "node", ssr: { entry: "src/ssr.tsx" } })],
162
91
  });
163
92
  ```
164
93
 
165
- `startBrowserApp` reads the SSR-injected `PrefetchedIntents` from the DOM, creates the `Framework`, runs the same `bootstrap()` as the server, and triggers the first page. By the time `mount()` runs the framework already has the initial `Page` ready.
166
-
167
- Import from `@finesoft/front/browser` (not `@finesoft/front`) on the client to avoid pulling server-only modules into your client bundle.
168
-
169
- ## Root component (Vue example)
170
-
171
- ```vue
172
- <!-- src/App.vue -->
173
- <script setup lang="ts">
174
- import { computed } from "vue";
175
- import type { Framework } from "@finesoft/front";
176
-
177
- const props = defineProps<{ framework?: Framework; page?: { title: string; items: string[] } }>();
178
-
179
- // SSR receives `page` directly; CSR pulls the current page from the framework.
180
- const page = computed(() => props.page ?? props.framework?.getCurrentPage());
181
- </script>
182
-
183
- <template>
184
- <main>
185
- <h1>{{ page?.title }}</h1>
186
- <ul>
187
- <li v-for="item in page?.items" :key="item">{{ item }}</li>
188
- </ul>
189
- </main>
190
- </template>
191
- ```
192
-
193
- ## index.html
194
-
195
- ```html
196
- <!doctype html>
197
- <html lang="en">
198
- <head>
199
- <meta charset="UTF-8" />
200
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
201
- <!--head-->
202
- </head>
203
- <body>
204
- <div id="app"><!--ssr--></div>
205
- <script type="module" src="/src/main.ts"></script>
206
- </body>
207
- </html>
208
- ```
209
-
210
- The `<!--head-->` and `<!--ssr-->` placeholders are where the framework injects the SSR head fragment and rendered HTML. The placeholder names are exported as `SSR_PLACEHOLDERS` if you need them.
211
-
212
- ## Run it
213
-
214
- ```bash
215
- pnpm dev # development with HMR
216
- pnpm build # production build
217
- pnpm preview # serve the production build locally
218
- ```
219
-
220
- Done. You have an app that:
221
-
222
- - Renders on the server with prefetched data
223
- - Hydrates without an extra fetch (SSR data is reused via `PrefetchedIntents`)
224
- - Routes client-side without page reloads
225
- - Is ready to deploy to any of the supported adapters
94
+ Vue selects `Outlet("vue")` and uses `createSSRApp` / `createApp` with `renderToString`. Svelte selects `Outlet("svelte")` and uses `hydrate` / `mount` with `render` from `svelte/server`. See the matching templates. Before a fresh Svelte `mount`, clear the target when `hydrate` is false so rejected SSR markup cannot remain beside the new app.
226
95
 
227
- ## Next
96
+ `useSnapshot("react", app)` returns a snapshot, `useSnapshot("vue", app)` a native ref, and `useSnapshot("svelte", app)` a store. Use a string literal for the renderer. The Vite plugin resolves the selected native implementation at build time, preserving component identity, subscriptions and cleanup.
228
97
 
229
- - [Routing & controllers](./02-routing-and-controllers.md) define more routes and control how they render
230
- - [Project structure](./engineering/project-structure.md) — recommended layout once the app grows past a handful of pages
98
+ On initialization the plugin generates `.finesoft/front.d.ts` and maintains the exact `@finesoft/front` type path in `tsconfig.json`. Only the selected UI peers are required. Ignore `.finesoft/` in Git and restart development after dependency changes. For standalone `tsc` or Node projects, run `vp exec finesoft-types` first, or call `generateFrontTypes({ root })` from the unified entry. The alias affects types only; runtime imports resolve the published package.