@foxford/den 3.6.0 → 4.0.0

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 (42) hide show
  1. package/README.mdx +31 -6
  2. package/adapter.d.cts +1 -1
  3. package/adapter.d.ts +1 -1
  4. package/bin/den.cjs +3 -3
  5. package/bin/den.js +1 -1
  6. package/builder/index.cjs +2 -2
  7. package/builder/index.d.cts +4 -2
  8. package/builder/index.d.ts +4 -2
  9. package/builder/index.js +1 -1
  10. package/chunk-2P5TAWRW.cjs +227 -0
  11. package/chunk-DUU4MQ4B.js +227 -0
  12. package/{chunk-2GTQK2PZ.js → chunk-FMRORLLE.js} +6 -4
  13. package/{chunk-P4J4M2WZ.cjs → chunk-OC4LQ2CK.cjs} +6 -4
  14. package/{define-repository-AO7JI6Cb.d.ts → define-repository-Ck45La_2.d.ts} +1 -1
  15. package/{define-repository-C0MI-J32.d.cts → define-repository-DAyeXF48.d.cts} +1 -1
  16. package/{define-slot-CdWdFM16.d.ts → define-slot-BTlLQ__T.d.ts} +1 -1
  17. package/{define-slot-BEeHNEph.d.cts → define-slot-C6hrdJS3.d.cts} +1 -1
  18. package/define.d.cts +3 -3
  19. package/define.d.ts +3 -3
  20. package/{descriptor-BSaHM5B4.d.ts → descriptor-CNJFrEbS.d.ts} +2 -2
  21. package/{descriptor-C2j6Zz6c.d.cts → descriptor-DmfJP4jQ.d.cts} +2 -2
  22. package/index.d.cts +6 -6
  23. package/index.d.ts +6 -6
  24. package/island/index.cjs +23 -1
  25. package/island/index.d.cts +17 -7
  26. package/island/index.d.ts +17 -7
  27. package/island/index.js +22 -0
  28. package/ops/index.cjs +17 -0
  29. package/ops/index.d.cts +39 -0
  30. package/ops/index.d.ts +39 -0
  31. package/ops/index.js +17 -0
  32. package/package.json +25 -16
  33. package/{routes-BvV405k4.d.cts → routes-DQ4ud4bu.d.cts} +1 -1
  34. package/{routes-Di3K_0uQ.d.ts → routes-TkIxQ0Uc.d.ts} +1 -1
  35. package/serve/index.cjs +70 -16
  36. package/serve/index.d.cts +10 -5
  37. package/serve/index.d.ts +10 -5
  38. package/serve/index.js +71 -17
  39. package/{types-BxMQ-VOd.d.cts → types-Ccd5bmt1.d.cts} +23 -4
  40. package/{types-BxMQ-VOd.d.ts → types-Ccd5bmt1.d.ts} +23 -4
  41. package/{view-adapter-DMLlp3Iu.d.cts → view-adapter-CrHh7CjB.d.cts} +2 -2
  42. package/{view-adapter-DNLRSFka.d.ts → view-adapter-DPDvv09J.d.ts} +2 -2
@@ -66,7 +66,7 @@ function collectAssets(outDir, base) {
66
66
  }
67
67
 
68
68
  // src/serve/port.ts
69
- var DEFAULT_PORT = 3e3;
69
+ var DEFAULT_PORT = 8080;
70
70
  function resolvePort(declared) {
71
71
  var _a, _b;
72
72
  return Number((_b = (_a = process.env["PORT"]) != null ? _a : declared) != null ? _b : DEFAULT_PORT);
@@ -145,7 +145,8 @@ loadAppEnv(fileURLToPath(new URL('..', import.meta.url)))
145
145
  await serveApp(app, {
146
146
  ${assets} configure: config.server?.configure,
147
147
  host: process.env.HOST,
148
- port: Number(process.env.PORT ?? config.server?.port ?? ${String(DEFAULT_PORT)}),
148
+ ops: { host: process.env.OPS_HOST, port: Number(process.env.SERVICE_PORT ?? ${mode === "development" ? "config.server?.opsPort ?? 9090" : "9090"}) },
149
+ port: Number(process.env.PORT ?? ${mode === "development" ? "config.server?.port ?? " : ""}${String(DEFAULT_PORT)}),
149
150
  })
150
151
  `;
151
152
  }
@@ -201,7 +202,8 @@ function loadAppConfig(root) {
201
202
  configFile: false,
202
203
  logLevel: "silent",
203
204
  root,
204
- server: { middlewareMode: true }
205
+ // Этот сервер только загружает конфиг; пересборкой в dev управляет watchSources.
206
+ server: { middlewareMode: true, watch: null }
205
207
  });
206
208
  try {
207
209
  const loaded = yield server.ssrLoadModule(configPath);
@@ -324,7 +326,7 @@ var _url = require('url');
324
326
  var _os = require('os'); var _os2 = _interopRequireDefault(_os);
325
327
  var TOOL = "den";
326
328
  var PAD = 11;
327
- var ENDPOINTS = ["/_render?url=<\u043F\u0443\u0442\u044C>", "/_routes", "/_health"];
329
+ var ENDPOINTS = ["/_render?url=<\u043F\u0443\u0442\u044C>", "/_routes"];
328
330
  var OUTPUTS = ["build/client", "build/server", "build/server.mjs"];
329
331
  var SHORTCUTS = [
330
332
  { key: "r", title: "\u043F\u0435\u0440\u0435\u0441\u043E\u0431\u0440\u0430\u0442\u044C" },
@@ -1,4 +1,4 @@
1
- import { a as DefineServiceOptions, S as ServiceDefinition, b as DefineViewModelOptions, V as ViewModelDefinition, D as DefineRepositoryOptions, d as RepositoryDefinition } from './types-BxMQ-VOd.js';
1
+ import { a as DefineServiceOptions, S as ServiceDefinition, b as DefineViewModelOptions, V as ViewModelDefinition, D as DefineRepositoryOptions, d as RepositoryDefinition } from './types-Ccd5bmt1.js';
2
2
  import { Token } from '@foxford/ioc';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as DefineServiceOptions, S as ServiceDefinition, b as DefineViewModelOptions, V as ViewModelDefinition, D as DefineRepositoryOptions, d as RepositoryDefinition } from './types-BxMQ-VOd.cjs';
1
+ import { a as DefineServiceOptions, S as ServiceDefinition, b as DefineViewModelOptions, V as ViewModelDefinition, D as DefineRepositoryOptions, d as RepositoryDefinition } from './types-Ccd5bmt1.cjs';
2
2
  import { Token } from '@foxford/ioc';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { c as Definition, L as LayerDefinition } from './types-BxMQ-VOd.js';
1
+ import { c as Definition, L as LayerDefinition } from './types-Ccd5bmt1.js';
2
2
  import { Container } from '@foxford/ioc';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { c as Definition, L as LayerDefinition } from './types-BxMQ-VOd.cjs';
1
+ import { c as Definition, L as LayerDefinition } from './types-Ccd5bmt1.cjs';
2
2
  import { Container } from '@foxford/ioc';
3
3
 
4
4
  /**
package/define.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- export { d as defineRepository, a as defineService, b as defineViewModel } from './define-repository-C0MI-J32.cjs';
2
- export { D as DefineSlotOptions, S as SlotDefinition, d as defineSlot } from './define-slot-BEeHNEph.cjs';
3
- export { D as DefineRepositoryOptions, a as DefineServiceOptions, b as DefineViewModelOptions, c as Definition, d as RepositoryDefinition, S as ServiceDefinition, e as SlotEntry, f as SlotRegistry, g as SlotRegistryToken, V as ViewModelDefinition } from './types-BxMQ-VOd.cjs';
1
+ export { d as defineRepository, a as defineService, b as defineViewModel } from './define-repository-DAyeXF48.cjs';
2
+ export { D as DefineSlotOptions, S as SlotDefinition, d as defineSlot } from './define-slot-C6hrdJS3.cjs';
3
+ export { D as DefineRepositoryOptions, a as DefineServiceOptions, b as DefineViewModelOptions, c as Definition, d as RepositoryDefinition, S as ServiceDefinition, e as SlotEntry, f as SlotRegistry, g as SlotRegistryToken, V as ViewModelDefinition } from './types-Ccd5bmt1.cjs';
4
4
  import { Token, Container } from '@foxford/ioc';
5
5
  import { HierarchicalLogger } from '@foxford/logger';
6
6
 
package/define.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { d as defineRepository, a as defineService, b as defineViewModel } from './define-repository-AO7JI6Cb.js';
2
- export { D as DefineSlotOptions, S as SlotDefinition, d as defineSlot } from './define-slot-CdWdFM16.js';
3
- export { D as DefineRepositoryOptions, a as DefineServiceOptions, b as DefineViewModelOptions, c as Definition, d as RepositoryDefinition, S as ServiceDefinition, e as SlotEntry, f as SlotRegistry, g as SlotRegistryToken, V as ViewModelDefinition } from './types-BxMQ-VOd.js';
1
+ export { d as defineRepository, a as defineService, b as defineViewModel } from './define-repository-Ck45La_2.js';
2
+ export { D as DefineSlotOptions, S as SlotDefinition, d as defineSlot } from './define-slot-BTlLQ__T.js';
3
+ export { D as DefineRepositoryOptions, a as DefineServiceOptions, b as DefineViewModelOptions, c as Definition, d as RepositoryDefinition, S as ServiceDefinition, e as SlotEntry, f as SlotRegistry, g as SlotRegistryToken, V as ViewModelDefinition } from './types-Ccd5bmt1.js';
4
4
  import { Token, Container } from '@foxford/ioc';
5
5
  import { HierarchicalLogger } from '@foxford/logger';
6
6
 
@@ -1,5 +1,5 @@
1
- import { S as SlotDefinition } from './define-slot-CdWdFM16.js';
2
- import { L as LayerDefinition, c as Definition } from './types-BxMQ-VOd.js';
1
+ import { S as SlotDefinition } from './define-slot-BTlLQ__T.js';
2
+ import { L as LayerDefinition, c as Definition } from './types-Ccd5bmt1.js';
3
3
  import { Token } from '@foxford/ioc';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { S as SlotDefinition } from './define-slot-BEeHNEph.cjs';
2
- import { L as LayerDefinition, c as Definition } from './types-BxMQ-VOd.cjs';
1
+ import { S as SlotDefinition } from './define-slot-C6hrdJS3.cjs';
2
+ import { L as LayerDefinition, c as Definition } from './types-Ccd5bmt1.cjs';
3
3
  import { Token } from '@foxford/ioc';
4
4
 
5
5
  /**
package/index.d.cts CHANGED
@@ -1,11 +1,11 @@
1
- import { C as Core, j as ContainerManager, R as RequestContext, k as GuardRunner, l as Guard, m as GuardResult, N as NavigationManager, n as NavigationEntry, o as NavigationInterceptor, p as Disposable, q as LeaveGuardResult, r as StateSerializer, s as DefineGuardOptions, G as GuardDefinition, E as ExtensionConfig, t as DefineExtensionOptions, u as ExtensionDefinition, A as ActionGuard, v as DefineActionGuardOptions, w as ActionGuardDefinition, x as LayoutConfig, y as DefineLayoutOptions, z as LayoutDefinition, h as LayerConfig, B as DefineLayerOptions, L as LayerDefinition } from './types-BxMQ-VOd.cjs';
2
- export { F as Activatable, H as ActivatableToken, I as ContainerManagerToken, D as DefineRepositoryOptions, a as DefineServiceOptions, b as DefineViewModelOptions, c as Definition, J as GuardRunnerToken, K as NavigationManagerToken, d as RepositoryDefinition, i as RequestContextToken, S as ServiceDefinition, e as SlotEntry, f as SlotRegistry, g as SlotRegistryToken, M as StateCache, O as StateParticipant, P as StateRegistry, Q as StateRegistryToken, T as StateSerializerToken, V as ViewModelDefinition } from './types-BxMQ-VOd.cjs';
1
+ import { C as Core, j as ContainerManager, R as RequestContext, k as GuardRunner, l as Guard, m as GuardResult, N as NavigationManager, n as NavigationEntry, o as NavigationInterceptor, p as Disposable, q as LeaveGuardResult, r as StateSerializer, s as DefineGuardOptions, G as GuardDefinition, E as ExtensionConfig, t as DefineExtensionOptions, u as ExtensionDefinition, A as ActionGuard, v as DefineActionGuardOptions, w as ActionGuardDefinition, x as LayoutConfig, y as DefineLayoutOptions, z as LayoutDefinition, h as LayerConfig, B as DefineLayerOptions, L as LayerDefinition } from './types-Ccd5bmt1.cjs';
2
+ export { F as Activatable, H as ActivatableToken, I as ContainerManagerToken, D as DefineRepositoryOptions, a as DefineServiceOptions, b as DefineViewModelOptions, c as Definition, J as GuardRunnerToken, K as NavigationManagerToken, d as RepositoryDefinition, i as RequestContextToken, S as ServiceDefinition, e as SlotEntry, f as SlotRegistry, g as SlotRegistryToken, M as StateCache, O as StateParticipant, P as StateRegistry, Q as StateRegistryToken, T as StateSerializerToken, V as ViewModelDefinition } from './types-Ccd5bmt1.cjs';
3
3
  import { Container, Token } from '@foxford/ioc';
4
4
  import { DefinitionResolver } from './adapter.cjs';
5
- export { d as defineRepository, a as defineService, b as defineViewModel } from './define-repository-C0MI-J32.cjs';
6
- export { D as DefineSlotOptions, S as SlotDefinition, d as defineSlot } from './define-slot-BEeHNEph.cjs';
7
- export { V as ViewAdapter, a as ViewLayerDefinition, b as ViewLayerToken } from './view-adapter-DMLlp3Iu.cjs';
8
- import './descriptor-C2j6Zz6c.cjs';
5
+ export { d as defineRepository, a as defineService, b as defineViewModel } from './define-repository-DAyeXF48.cjs';
6
+ export { D as DefineSlotOptions, S as SlotDefinition, d as defineSlot } from './define-slot-C6hrdJS3.cjs';
7
+ export { V as ViewAdapter, a as ViewLayerDefinition, b as ViewLayerToken } from './view-adapter-CrHh7CjB.cjs';
8
+ import './descriptor-DmfJP4jQ.cjs';
9
9
  import './server-render-CocWXQKC.cjs';
10
10
 
11
11
  /**
package/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { C as Core, j as ContainerManager, R as RequestContext, k as GuardRunner, l as Guard, m as GuardResult, N as NavigationManager, n as NavigationEntry, o as NavigationInterceptor, p as Disposable, q as LeaveGuardResult, r as StateSerializer, s as DefineGuardOptions, G as GuardDefinition, E as ExtensionConfig, t as DefineExtensionOptions, u as ExtensionDefinition, A as ActionGuard, v as DefineActionGuardOptions, w as ActionGuardDefinition, x as LayoutConfig, y as DefineLayoutOptions, z as LayoutDefinition, h as LayerConfig, B as DefineLayerOptions, L as LayerDefinition } from './types-BxMQ-VOd.js';
2
- export { F as Activatable, H as ActivatableToken, I as ContainerManagerToken, D as DefineRepositoryOptions, a as DefineServiceOptions, b as DefineViewModelOptions, c as Definition, J as GuardRunnerToken, K as NavigationManagerToken, d as RepositoryDefinition, i as RequestContextToken, S as ServiceDefinition, e as SlotEntry, f as SlotRegistry, g as SlotRegistryToken, M as StateCache, O as StateParticipant, P as StateRegistry, Q as StateRegistryToken, T as StateSerializerToken, V as ViewModelDefinition } from './types-BxMQ-VOd.js';
1
+ import { C as Core, j as ContainerManager, R as RequestContext, k as GuardRunner, l as Guard, m as GuardResult, N as NavigationManager, n as NavigationEntry, o as NavigationInterceptor, p as Disposable, q as LeaveGuardResult, r as StateSerializer, s as DefineGuardOptions, G as GuardDefinition, E as ExtensionConfig, t as DefineExtensionOptions, u as ExtensionDefinition, A as ActionGuard, v as DefineActionGuardOptions, w as ActionGuardDefinition, x as LayoutConfig, y as DefineLayoutOptions, z as LayoutDefinition, h as LayerConfig, B as DefineLayerOptions, L as LayerDefinition } from './types-Ccd5bmt1.js';
2
+ export { F as Activatable, H as ActivatableToken, I as ContainerManagerToken, D as DefineRepositoryOptions, a as DefineServiceOptions, b as DefineViewModelOptions, c as Definition, J as GuardRunnerToken, K as NavigationManagerToken, d as RepositoryDefinition, i as RequestContextToken, S as ServiceDefinition, e as SlotEntry, f as SlotRegistry, g as SlotRegistryToken, M as StateCache, O as StateParticipant, P as StateRegistry, Q as StateRegistryToken, T as StateSerializerToken, V as ViewModelDefinition } from './types-Ccd5bmt1.js';
3
3
  import { Container, Token } from '@foxford/ioc';
4
4
  import { DefinitionResolver } from './adapter.js';
5
- export { d as defineRepository, a as defineService, b as defineViewModel } from './define-repository-AO7JI6Cb.js';
6
- export { D as DefineSlotOptions, S as SlotDefinition, d as defineSlot } from './define-slot-CdWdFM16.js';
7
- export { V as ViewAdapter, a as ViewLayerDefinition, b as ViewLayerToken } from './view-adapter-DNLRSFka.js';
8
- import './descriptor-BSaHM5B4.js';
5
+ export { d as defineRepository, a as defineService, b as defineViewModel } from './define-repository-Ck45La_2.js';
6
+ export { D as DefineSlotOptions, S as SlotDefinition, d as defineSlot } from './define-slot-BTlLQ__T.js';
7
+ export { V as ViewAdapter, a as ViewLayerDefinition, b as ViewLayerToken } from './view-adapter-DPDvv09J.js';
8
+ import './descriptor-CNJFrEbS.js';
9
9
  import './server-render-CocWXQKC.js';
10
10
 
11
11
  /**
package/island/index.cjs CHANGED
@@ -121,6 +121,28 @@ function describeIsland(descriptor, denState) {
121
121
  };
122
122
  }
123
123
 
124
+ // src/island/remount.ts
125
+ var generation = 0;
126
+ var listeners2 = /* @__PURE__ */ new Set();
127
+ function remountIslands() {
128
+ generation += 1;
129
+ for (const listener of listeners2) {
130
+ listener();
131
+ }
132
+ }
133
+ function getIslandsGeneration() {
134
+ return generation;
135
+ }
136
+ function subscribeIslandsGeneration(listener) {
137
+ listeners2.add(listener);
138
+ return () => {
139
+ listeners2.delete(listener);
140
+ };
141
+ }
142
+
143
+
144
+
145
+
124
146
 
125
147
 
126
148
 
@@ -158,4 +180,4 @@ function describeIsland(descriptor, denState) {
158
180
 
159
181
 
160
182
 
161
- exports.DOCUMENT_EVENT = DOCUMENT_EVENT; exports.ISLAND_ERRORS_KEY = ISLAND_ERRORS_KEY; exports.NAVIGATE_EVENT = NAVIGATE_EVENT; exports.RequestContextToken = _chunk6QV4L6R2cjs.RequestContextToken; exports.RuntimeExtensionsToken = _chunkQTWJTYZWcjs.RuntimeExtensionsToken; exports.ViewLayerToken = _chunkXOJ2VWX4cjs.ViewLayerToken; exports.activateIslandViewModels = _chunkQTWJTYZWcjs.activateIslandViewModels; exports.bindIslandInputs = _chunkQTWJTYZWcjs.bindIslandInputs; exports.bindRequestContext = _chunkQTWJTYZWcjs.bindRequestContext; exports.browserRequestContext = _chunkQTWJTYZWcjs.browserRequestContext; exports.collectDocumentContribution = _chunkQTWJTYZWcjs.collectDocumentContribution; exports.collectIslandState = _chunkQTWJTYZWcjs.collectIslandState; exports.createIslandContainer = _chunkQTWJTYZWcjs.createIslandContainer; exports.describeIsland = describeIsland; exports.getAppContainer = _chunkQTWJTYZWcjs.getAppContainer; exports.getIslandsSnapshot = getIslandsSnapshot; exports.hydrateIslandState = _chunkQTWJTYZWcjs.hydrateIslandState; exports.installRuntime = _chunkQTWJTYZWcjs.installRuntime; exports.isDocumentSource = _chunkQTWJTYZWcjs.isDocumentSource; exports.islandInputsOf = _chunkQTWJTYZWcjs.islandInputsOf; exports.matchRoute = _chunkQTWJTYZWcjs.matchRoute; exports.navigateIsland = navigateIsland; exports.normalizeRoutes = _chunkQTWJTYZWcjs.normalizeRoutes; exports.onIslandDocument = onIslandDocument; exports.onIslandNavigate = onIslandNavigate; exports.parseCookieHeader = _chunkQTWJTYZWcjs.parseCookieHeader; exports.pathPattern = _chunkQTWJTYZWcjs.pathPattern; exports.publishIslandDocument = publishIslandDocument; exports.registerIsland = registerIsland; exports.renderApp = _chunkQTWJTYZWcjs.renderApp; exports.reportIslandError = reportIslandError; exports.resolveEagerUnits = _chunkQTWJTYZWcjs.resolveEagerUnits; exports.resolveViewAdapter = _chunkXOJ2VWX4cjs.resolveViewAdapter; exports.runtimeRequiresOf = _chunkQTWJTYZWcjs.runtimeRequiresOf; exports.slotAddress = slotAddress; exports.subscribeIslands = subscribeIslands; exports.viewAdapterOf = _chunkXOJ2VWX4cjs.viewAdapterOf;
183
+ exports.DOCUMENT_EVENT = DOCUMENT_EVENT; exports.ISLAND_ERRORS_KEY = ISLAND_ERRORS_KEY; exports.NAVIGATE_EVENT = NAVIGATE_EVENT; exports.RequestContextToken = _chunk6QV4L6R2cjs.RequestContextToken; exports.RuntimeExtensionsToken = _chunkQTWJTYZWcjs.RuntimeExtensionsToken; exports.ViewLayerToken = _chunkXOJ2VWX4cjs.ViewLayerToken; exports.activateIslandViewModels = _chunkQTWJTYZWcjs.activateIslandViewModels; exports.bindIslandInputs = _chunkQTWJTYZWcjs.bindIslandInputs; exports.bindRequestContext = _chunkQTWJTYZWcjs.bindRequestContext; exports.browserRequestContext = _chunkQTWJTYZWcjs.browserRequestContext; exports.collectDocumentContribution = _chunkQTWJTYZWcjs.collectDocumentContribution; exports.collectIslandState = _chunkQTWJTYZWcjs.collectIslandState; exports.createIslandContainer = _chunkQTWJTYZWcjs.createIslandContainer; exports.describeIsland = describeIsland; exports.getAppContainer = _chunkQTWJTYZWcjs.getAppContainer; exports.getIslandsGeneration = getIslandsGeneration; exports.getIslandsSnapshot = getIslandsSnapshot; exports.hydrateIslandState = _chunkQTWJTYZWcjs.hydrateIslandState; exports.installRuntime = _chunkQTWJTYZWcjs.installRuntime; exports.isDocumentSource = _chunkQTWJTYZWcjs.isDocumentSource; exports.islandInputsOf = _chunkQTWJTYZWcjs.islandInputsOf; exports.matchRoute = _chunkQTWJTYZWcjs.matchRoute; exports.navigateIsland = navigateIsland; exports.normalizeRoutes = _chunkQTWJTYZWcjs.normalizeRoutes; exports.onIslandDocument = onIslandDocument; exports.onIslandNavigate = onIslandNavigate; exports.parseCookieHeader = _chunkQTWJTYZWcjs.parseCookieHeader; exports.pathPattern = _chunkQTWJTYZWcjs.pathPattern; exports.publishIslandDocument = publishIslandDocument; exports.registerIsland = registerIsland; exports.remountIslands = remountIslands; exports.renderApp = _chunkQTWJTYZWcjs.renderApp; exports.reportIslandError = reportIslandError; exports.resolveEagerUnits = _chunkQTWJTYZWcjs.resolveEagerUnits; exports.resolveViewAdapter = _chunkXOJ2VWX4cjs.resolveViewAdapter; exports.runtimeRequiresOf = _chunkQTWJTYZWcjs.runtimeRequiresOf; exports.slotAddress = slotAddress; exports.subscribeIslands = subscribeIslands; exports.subscribeIslandsGeneration = subscribeIslandsGeneration; exports.viewAdapterOf = _chunkXOJ2VWX4cjs.viewAdapterOf;
@@ -1,11 +1,11 @@
1
- import { A as AppAssets, I as IslandDescriptor } from '../descriptor-C2j6Zz6c.cjs';
2
- import { R as RequestContext, c as Definition } from '../types-BxMQ-VOd.cjs';
3
- export { i as RequestContextToken } from '../types-BxMQ-VOd.cjs';
1
+ import { A as AppAssets, I as IslandDescriptor } from '../descriptor-DmfJP4jQ.cjs';
2
+ import { R as RequestContext, c as Definition } from '../types-Ccd5bmt1.cjs';
3
+ export { i as RequestContextToken } from '../types-Ccd5bmt1.cjs';
4
4
  import { Container, Token } from '@foxford/ioc';
5
- export { A as AppRoute, R as RouteDeclaration, a as RouteMatch, m as matchRoute, n as normalizeRoutes, p as pathPattern } from '../routes-BvV405k4.cjs';
5
+ export { A as AppRoute, R as RouteDeclaration, a as RouteMatch, m as matchRoute, n as normalizeRoutes, p as pathPattern } from '../routes-DQ4ud4bu.cjs';
6
6
  export { R as RenderTree, a as ServerRender, S as ServerRenderResult } from '../server-render-CocWXQKC.cjs';
7
- export { R as RenderIslandOptions, V as ViewAdapter, a as ViewLayerDefinition, b as ViewLayerToken, r as resolveViewAdapter, v as viewAdapterOf } from '../view-adapter-DMLlp3Iu.cjs';
8
- import '../define-slot-BEeHNEph.cjs';
7
+ export { R as RenderIslandOptions, V as ViewAdapter, a as ViewLayerDefinition, b as ViewLayerToken, r as resolveViewAdapter, v as viewAdapterOf } from '../view-adapter-CrHh7CjB.cjs';
8
+ import '../define-slot-C6hrdJS3.cjs';
9
9
 
10
10
  /** Вклад приложения в `<head>` документа. */
11
11
  interface DocumentHead {
@@ -278,6 +278,9 @@ declare function parseCookieHeader(header: string | undefined): Record<string, s
278
278
  /**
279
279
  * Реквизиты запроса в браузере: куки документа, заголовков нет.
280
280
  *
281
+ * Реквизитов бэкенда тоже нет: в браузере их подставляет он сам — куку по своим правилам,
282
+ * остальное ему предъявлять нечем и незачем.
283
+ *
281
284
  * Биндится в контейнер острова при сборке, чтобы единица, требующая `RequestContextToken`,
282
285
  * резолвилась на обеих сторонах одинаково; иначе приложению пришлось бы держать две
283
286
  * реализации и переключать их по среде.
@@ -393,6 +396,13 @@ declare function subscribeIslands(listener: () => void): () => void;
393
396
  */
394
397
  declare function describeIsland(descriptor: IslandDescriptor, denState?: Record<string, unknown>): Omit<IslandRecord, 'id'>;
395
398
 
399
+ /** Пересобрать все острова вкладки: следующее поколение, подписчики перемонтируют. */
400
+ declare function remountIslands(): void;
401
+ /** Текущее поколение островов — ключ монтирования у адаптера. */
402
+ declare function getIslandsGeneration(): number;
403
+ /** Подписка на смену поколения (совместима с `useSyncExternalStore`). */
404
+ declare function subscribeIslandsGeneration(listener: () => void): () => void;
405
+
396
406
  /** App-scope контейнер федерации (создаётся при первом обращении). */
397
407
  declare function getAppContainer(): Container;
398
408
  /**
@@ -450,4 +460,4 @@ declare function runtimeRequiresOf(container: Container): ReadonlyArray<Token<un
450
460
  */
451
461
  declare function slotAddress(app: string, slot: string): string;
452
462
 
453
- export { AppAssets, type CreateIslandContainerOptions, DOCUMENT_EVENT, type DocumentContribution, type DocumentHead, type DocumentSource, ISLAND_ERRORS_KEY, IslandDescriptor, type IslandErrorContext, type IslandErrorPhase, type IslandErrorReport, type IslandRecord, type IslandRoute, NAVIGATE_EVENT, type RenderAppRequest, type RenderAppResult, RequestContext, type RuntimeExtension, RuntimeExtensionsToken, activateIslandViewModels, bindIslandInputs, bindRequestContext, browserRequestContext, collectDocumentContribution, collectIslandState, createIslandContainer, describeIsland, getAppContainer, getIslandsSnapshot, hydrateIslandState, installRuntime, isDocumentSource, islandInputsOf, navigateIsland, onIslandDocument, onIslandNavigate, parseCookieHeader, publishIslandDocument, registerIsland, renderApp, reportIslandError, resolveEagerUnits, runtimeRequiresOf, slotAddress, subscribeIslands };
463
+ export { AppAssets, type CreateIslandContainerOptions, DOCUMENT_EVENT, type DocumentContribution, type DocumentHead, type DocumentSource, ISLAND_ERRORS_KEY, IslandDescriptor, type IslandErrorContext, type IslandErrorPhase, type IslandErrorReport, type IslandRecord, type IslandRoute, NAVIGATE_EVENT, type RenderAppRequest, type RenderAppResult, RequestContext, type RuntimeExtension, RuntimeExtensionsToken, activateIslandViewModels, bindIslandInputs, bindRequestContext, browserRequestContext, collectDocumentContribution, collectIslandState, createIslandContainer, describeIsland, getAppContainer, getIslandsGeneration, getIslandsSnapshot, hydrateIslandState, installRuntime, isDocumentSource, islandInputsOf, navigateIsland, onIslandDocument, onIslandNavigate, parseCookieHeader, publishIslandDocument, registerIsland, remountIslands, renderApp, reportIslandError, resolveEagerUnits, runtimeRequiresOf, slotAddress, subscribeIslands, subscribeIslandsGeneration };
package/island/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { A as AppAssets, I as IslandDescriptor } from '../descriptor-BSaHM5B4.js';
2
- import { R as RequestContext, c as Definition } from '../types-BxMQ-VOd.js';
3
- export { i as RequestContextToken } from '../types-BxMQ-VOd.js';
1
+ import { A as AppAssets, I as IslandDescriptor } from '../descriptor-CNJFrEbS.js';
2
+ import { R as RequestContext, c as Definition } from '../types-Ccd5bmt1.js';
3
+ export { i as RequestContextToken } from '../types-Ccd5bmt1.js';
4
4
  import { Container, Token } from '@foxford/ioc';
5
- export { A as AppRoute, R as RouteDeclaration, a as RouteMatch, m as matchRoute, n as normalizeRoutes, p as pathPattern } from '../routes-Di3K_0uQ.js';
5
+ export { A as AppRoute, R as RouteDeclaration, a as RouteMatch, m as matchRoute, n as normalizeRoutes, p as pathPattern } from '../routes-TkIxQ0Uc.js';
6
6
  export { R as RenderTree, a as ServerRender, S as ServerRenderResult } from '../server-render-CocWXQKC.js';
7
- export { R as RenderIslandOptions, V as ViewAdapter, a as ViewLayerDefinition, b as ViewLayerToken, r as resolveViewAdapter, v as viewAdapterOf } from '../view-adapter-DNLRSFka.js';
8
- import '../define-slot-CdWdFM16.js';
7
+ export { R as RenderIslandOptions, V as ViewAdapter, a as ViewLayerDefinition, b as ViewLayerToken, r as resolveViewAdapter, v as viewAdapterOf } from '../view-adapter-DPDvv09J.js';
8
+ import '../define-slot-BTlLQ__T.js';
9
9
 
10
10
  /** Вклад приложения в `<head>` документа. */
11
11
  interface DocumentHead {
@@ -278,6 +278,9 @@ declare function parseCookieHeader(header: string | undefined): Record<string, s
278
278
  /**
279
279
  * Реквизиты запроса в браузере: куки документа, заголовков нет.
280
280
  *
281
+ * Реквизитов бэкенда тоже нет: в браузере их подставляет он сам — куку по своим правилам,
282
+ * остальное ему предъявлять нечем и незачем.
283
+ *
281
284
  * Биндится в контейнер острова при сборке, чтобы единица, требующая `RequestContextToken`,
282
285
  * резолвилась на обеих сторонах одинаково; иначе приложению пришлось бы держать две
283
286
  * реализации и переключать их по среде.
@@ -393,6 +396,13 @@ declare function subscribeIslands(listener: () => void): () => void;
393
396
  */
394
397
  declare function describeIsland(descriptor: IslandDescriptor, denState?: Record<string, unknown>): Omit<IslandRecord, 'id'>;
395
398
 
399
+ /** Пересобрать все острова вкладки: следующее поколение, подписчики перемонтируют. */
400
+ declare function remountIslands(): void;
401
+ /** Текущее поколение островов — ключ монтирования у адаптера. */
402
+ declare function getIslandsGeneration(): number;
403
+ /** Подписка на смену поколения (совместима с `useSyncExternalStore`). */
404
+ declare function subscribeIslandsGeneration(listener: () => void): () => void;
405
+
396
406
  /** App-scope контейнер федерации (создаётся при первом обращении). */
397
407
  declare function getAppContainer(): Container;
398
408
  /**
@@ -450,4 +460,4 @@ declare function runtimeRequiresOf(container: Container): ReadonlyArray<Token<un
450
460
  */
451
461
  declare function slotAddress(app: string, slot: string): string;
452
462
 
453
- export { AppAssets, type CreateIslandContainerOptions, DOCUMENT_EVENT, type DocumentContribution, type DocumentHead, type DocumentSource, ISLAND_ERRORS_KEY, IslandDescriptor, type IslandErrorContext, type IslandErrorPhase, type IslandErrorReport, type IslandRecord, type IslandRoute, NAVIGATE_EVENT, type RenderAppRequest, type RenderAppResult, RequestContext, type RuntimeExtension, RuntimeExtensionsToken, activateIslandViewModels, bindIslandInputs, bindRequestContext, browserRequestContext, collectDocumentContribution, collectIslandState, createIslandContainer, describeIsland, getAppContainer, getIslandsSnapshot, hydrateIslandState, installRuntime, isDocumentSource, islandInputsOf, navigateIsland, onIslandDocument, onIslandNavigate, parseCookieHeader, publishIslandDocument, registerIsland, renderApp, reportIslandError, resolveEagerUnits, runtimeRequiresOf, slotAddress, subscribeIslands };
463
+ export { AppAssets, type CreateIslandContainerOptions, DOCUMENT_EVENT, type DocumentContribution, type DocumentHead, type DocumentSource, ISLAND_ERRORS_KEY, IslandDescriptor, type IslandErrorContext, type IslandErrorPhase, type IslandErrorReport, type IslandRecord, type IslandRoute, NAVIGATE_EVENT, type RenderAppRequest, type RenderAppResult, RequestContext, type RuntimeExtension, RuntimeExtensionsToken, activateIslandViewModels, bindIslandInputs, bindRequestContext, browserRequestContext, collectDocumentContribution, collectIslandState, createIslandContainer, describeIsland, getAppContainer, getIslandsGeneration, getIslandsSnapshot, hydrateIslandState, installRuntime, isDocumentSource, islandInputsOf, navigateIsland, onIslandDocument, onIslandNavigate, parseCookieHeader, publishIslandDocument, registerIsland, remountIslands, renderApp, reportIslandError, resolveEagerUnits, runtimeRequiresOf, slotAddress, subscribeIslands, subscribeIslandsGeneration };
package/island/index.js CHANGED
@@ -120,6 +120,25 @@ function describeIsland(descriptor, denState) {
120
120
  viewModels: ((_b = descriptor.viewModels) != null ? _b : []).map((vm) => vm.token.description)
121
121
  };
122
122
  }
123
+
124
+ // src/island/remount.ts
125
+ var generation = 0;
126
+ var listeners2 = /* @__PURE__ */ new Set();
127
+ function remountIslands() {
128
+ generation += 1;
129
+ for (const listener of listeners2) {
130
+ listener();
131
+ }
132
+ }
133
+ function getIslandsGeneration() {
134
+ return generation;
135
+ }
136
+ function subscribeIslandsGeneration(listener) {
137
+ listeners2.add(listener);
138
+ return () => {
139
+ listeners2.delete(listener);
140
+ };
141
+ }
123
142
  export {
124
143
  DOCUMENT_EVENT,
125
144
  ISLAND_ERRORS_KEY,
@@ -136,6 +155,7 @@ export {
136
155
  createIslandContainer,
137
156
  describeIsland,
138
157
  getAppContainer,
158
+ getIslandsGeneration,
139
159
  getIslandsSnapshot,
140
160
  hydrateIslandState,
141
161
  installRuntime,
@@ -150,6 +170,7 @@ export {
150
170
  pathPattern,
151
171
  publishIslandDocument,
152
172
  registerIsland,
173
+ remountIslands,
153
174
  renderApp,
154
175
  reportIslandError,
155
176
  resolveEagerUnits,
@@ -157,5 +178,6 @@ export {
157
178
  runtimeRequiresOf,
158
179
  slotAddress,
159
180
  subscribeIslands,
181
+ subscribeIslandsGeneration,
160
182
  viewAdapterOf
161
183
  };
package/ops/index.cjs ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+ var _chunk2P5TAWRWcjs = require('../chunk-2P5TAWRW.cjs');
9
+ require('../chunk-T5QVCXVB.cjs');
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ exports.ProcessMetrics = _chunk2P5TAWRWcjs.ProcessMetrics; exports.closeHttpServer = _chunk2P5TAWRWcjs.closeHttpServer; exports.clusterMetrics = _chunk2P5TAWRWcjs.clusterMetrics; exports.getProcessMetrics = _chunk2P5TAWRWcjs.getProcessMetrics; exports.isOpsPath = _chunk2P5TAWRWcjs.isOpsPath; exports.startOpsServer = _chunk2P5TAWRWcjs.startOpsServer;
@@ -0,0 +1,39 @@
1
+ import * as _prometheus_io_client from '@prometheus-io/client';
2
+ import { Registry, Counter, Histogram } from '@prometheus-io/client';
3
+ import { IncomingMessage, ServerResponse, Server } from 'node:http';
4
+
5
+ /** Реестр одного процесса; точкам измерений не нужен включённый Sentry. */
6
+ declare class ProcessMetrics {
7
+ readonly registry: Registry<_prometheus_io_client.RegistryContentType>;
8
+ private runtimeStarted;
9
+ counter(name: string, labelNames?: string[]): Counter<string>;
10
+ histogram(name: string, labelNames?: string[]): Histogram<string>;
11
+ /** Полный штатный набор Node/process-метрик клиента и дополнительные данные процесса. */
12
+ startRuntime(appName: string): void;
13
+ /** HTTP-измерения с ограниченными метками маршрута; вызывается один раз на запрос. */
14
+ trackHttp(req: IncomingMessage, res: ServerResponse, route: () => string): void;
15
+ }
16
+ declare function getProcessMetrics(): ProcessMetrics;
17
+
18
+ /** Служебный путь без query; работает и с относительным URL node:http. */
19
+ declare function isOpsPath(url?: string): boolean;
20
+ /** Подключает штатную межпроцессную агрегацию; вызывается и в primary, и в воркерах. */
21
+ declare function clusterMetrics(metrics?: ProcessMetrics): {
22
+ contentType: string;
23
+ collect: () => Promise<string>;
24
+ shutdown: () => Promise<void>;
25
+ };
26
+ interface OpsOptions {
27
+ port?: number;
28
+ host?: string;
29
+ metrics?: ProcessMetrics;
30
+ collect?: () => Promise<string>;
31
+ contentType?: string;
32
+ isLive?: () => boolean;
33
+ }
34
+ /** Второй HTTP-сервер в том же приложении. GET /healthz и /livez отвечают 200. */
35
+ declare function startOpsServer(options?: OpsOptions): Promise<Server>;
36
+ /** Ограниченное по времени закрытие обоих видов серверов node:http. */
37
+ declare function closeHttpServer(server: Server, timeoutMs?: number): Promise<void>;
38
+
39
+ export { type OpsOptions, ProcessMetrics, closeHttpServer, clusterMetrics, getProcessMetrics, isOpsPath, startOpsServer };
package/ops/index.d.ts ADDED
@@ -0,0 +1,39 @@
1
+ import * as _prometheus_io_client from '@prometheus-io/client';
2
+ import { Registry, Counter, Histogram } from '@prometheus-io/client';
3
+ import { IncomingMessage, ServerResponse, Server } from 'node:http';
4
+
5
+ /** Реестр одного процесса; точкам измерений не нужен включённый Sentry. */
6
+ declare class ProcessMetrics {
7
+ readonly registry: Registry<_prometheus_io_client.RegistryContentType>;
8
+ private runtimeStarted;
9
+ counter(name: string, labelNames?: string[]): Counter<string>;
10
+ histogram(name: string, labelNames?: string[]): Histogram<string>;
11
+ /** Полный штатный набор Node/process-метрик клиента и дополнительные данные процесса. */
12
+ startRuntime(appName: string): void;
13
+ /** HTTP-измерения с ограниченными метками маршрута; вызывается один раз на запрос. */
14
+ trackHttp(req: IncomingMessage, res: ServerResponse, route: () => string): void;
15
+ }
16
+ declare function getProcessMetrics(): ProcessMetrics;
17
+
18
+ /** Служебный путь без query; работает и с относительным URL node:http. */
19
+ declare function isOpsPath(url?: string): boolean;
20
+ /** Подключает штатную межпроцессную агрегацию; вызывается и в primary, и в воркерах. */
21
+ declare function clusterMetrics(metrics?: ProcessMetrics): {
22
+ contentType: string;
23
+ collect: () => Promise<string>;
24
+ shutdown: () => Promise<void>;
25
+ };
26
+ interface OpsOptions {
27
+ port?: number;
28
+ host?: string;
29
+ metrics?: ProcessMetrics;
30
+ collect?: () => Promise<string>;
31
+ contentType?: string;
32
+ isLive?: () => boolean;
33
+ }
34
+ /** Второй HTTP-сервер в том же приложении. GET /healthz и /livez отвечают 200. */
35
+ declare function startOpsServer(options?: OpsOptions): Promise<Server>;
36
+ /** Ограниченное по времени закрытие обоих видов серверов node:http. */
37
+ declare function closeHttpServer(server: Server, timeoutMs?: number): Promise<void>;
38
+
39
+ export { type OpsOptions, ProcessMetrics, closeHttpServer, clusterMetrics, getProcessMetrics, isOpsPath, startOpsServer };
package/ops/index.js ADDED
@@ -0,0 +1,17 @@
1
+ import {
2
+ ProcessMetrics,
3
+ closeHttpServer,
4
+ clusterMetrics,
5
+ getProcessMetrics,
6
+ isOpsPath,
7
+ startOpsServer
8
+ } from "../chunk-DUU4MQ4B.js";
9
+ import "../chunk-6FNC3XMI.js";
10
+ export {
11
+ ProcessMetrics,
12
+ closeHttpServer,
13
+ clusterMetrics,
14
+ getProcessMetrics,
15
+ isOpsPath,
16
+ startOpsServer
17
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foxford/den",
3
- "version": "3.6.0",
3
+ "version": "4.0.0",
4
4
  "description": "Den — декларативный метафреймворк Foxford (core runtime)",
5
5
  "keywords": [
6
6
  "foxford",
@@ -30,6 +30,7 @@
30
30
  "den": "./den.js"
31
31
  },
32
32
  "dependencies": {
33
+ "@prometheus-io/client": "0.16.1",
33
34
  "fastify": "^5.12.1",
34
35
  "@foxford/ioc": "^1.1.2",
35
36
  "@foxford/logger": "^1.2.2"
@@ -75,6 +76,11 @@
75
76
  "require": "./island/index.cjs",
76
77
  "types": "./island/index.d.ts"
77
78
  },
79
+ "./ops": {
80
+ "import": "./ops/index.js",
81
+ "require": "./ops/index.cjs",
82
+ "types": "./ops/index.d.ts"
83
+ },
78
84
  "./serve": {
79
85
  "import": "./serve/index.js",
80
86
  "require": "./serve/index.cjs",
@@ -89,17 +95,19 @@
89
95
  "adapter.js",
90
96
  "bin",
91
97
  "builder",
92
- "chunk-2GTQK2PZ.js",
98
+ "chunk-2P5TAWRW.cjs",
93
99
  "chunk-3RX2OSUL.js",
94
100
  "chunk-6FNC3XMI.js",
95
101
  "chunk-6QV4L6R2.cjs",
96
102
  "chunk-A6ZPAM6Z.cjs",
97
103
  "chunk-C7BM4DGX.cjs",
104
+ "chunk-DUU4MQ4B.js",
98
105
  "chunk-E23E2VUC.js",
99
106
  "chunk-E56BKBQZ.js",
107
+ "chunk-FMRORLLE.js",
100
108
  "chunk-H5DKRHHQ.cjs",
101
109
  "chunk-KQAB6C6Q.cjs",
102
- "chunk-P4J4M2WZ.cjs",
110
+ "chunk-OC4LQ2CK.cjs",
103
111
  "chunk-QTWJTYZW.cjs",
104
112
  "chunk-RG7ZV5BD.js",
105
113
  "chunk-T5QVCXVB.cjs",
@@ -107,33 +115,34 @@
107
115
  "chunk-WBHHHICS.js",
108
116
  "chunk-XOJ2VWX4.cjs",
109
117
  "chunk-XQ7EHXHG.js",
110
- "define-repository-AO7JI6Cb.d.ts",
111
- "define-repository-C0MI-J32.d.cts",
112
- "define-slot-BEeHNEph.d.cts",
113
- "define-slot-CdWdFM16.d.ts",
118
+ "define-repository-Ck45La_2.d.ts",
119
+ "define-repository-DAyeXF48.d.cts",
120
+ "define-slot-BTlLQ__T.d.ts",
121
+ "define-slot-C6hrdJS3.d.cts",
114
122
  "define.cjs",
115
123
  "define.d.cts",
116
124
  "define.d.ts",
117
125
  "define.js",
118
126
  "den.js",
119
- "descriptor-BSaHM5B4.d.ts",
120
- "descriptor-C2j6Zz6c.d.cts",
127
+ "descriptor-CNJFrEbS.d.ts",
128
+ "descriptor-DmfJP4jQ.d.cts",
121
129
  "index.cjs",
122
130
  "index.d.cts",
123
131
  "index.d.ts",
124
132
  "index.js",
125
133
  "island",
134
+ "ops",
126
135
  "package.json",
127
- "routes-BvV405k4.d.cts",
128
- "routes-Di3K_0uQ.d.ts",
136
+ "routes-DQ4ud4bu.d.cts",
137
+ "routes-TkIxQ0Uc.d.ts",
129
138
  "serve",
130
139
  "server-render-CocWXQKC.d.cts",
131
140
  "server-render-CocWXQKC.d.ts",
132
- "types-BxMQ-VOd.d.cts",
133
- "types-BxMQ-VOd.d.ts",
134
- "view-adapter-DMLlp3Iu.d.cts",
135
- "view-adapter-DNLRSFka.d.ts"
141
+ "types-Ccd5bmt1.d.cts",
142
+ "types-Ccd5bmt1.d.ts",
143
+ "view-adapter-CrHh7CjB.d.cts",
144
+ "view-adapter-DPDvv09J.d.ts"
136
145
  ],
137
- "sha": "c7de9de",
146
+ "sha": "46c9d1a",
138
147
  "scripts": {}
139
148
  }
@@ -1,4 +1,4 @@
1
- import { G as GuardDefinition } from './types-BxMQ-VOd.cjs';
1
+ import { G as GuardDefinition } from './types-Ccd5bmt1.cjs';
2
2
 
3
3
  /** Маршрут с политикой доступа. */
4
4
  interface RouteDeclaration {
@@ -1,4 +1,4 @@
1
- import { G as GuardDefinition } from './types-BxMQ-VOd.js';
1
+ import { G as GuardDefinition } from './types-Ccd5bmt1.js';
2
2
 
3
3
  /** Маршрут с политикой доступа. */
4
4
  interface RouteDeclaration {