@ecopages/core 0.2.0-rc.10 → 0.2.0-rc.11

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 (159) hide show
  1. package/README.md +0 -9
  2. package/package.json +3 -144
  3. package/src/adapters/README.md +8 -2
  4. package/src/adapters/abstract/application-adapter.d.ts +6 -32
  5. package/src/adapters/abstract/application-adapter.js +6 -45
  6. package/src/adapters/abstract/ws-pattern-matcher.d.ts +0 -5
  7. package/src/adapters/abstract/ws-pattern-matcher.js +0 -9
  8. package/src/adapters/bun/create-app.d.ts +8 -12
  9. package/src/adapters/bun/create-app.js +13 -55
  10. package/src/adapters/bun/hmr-manager.d.ts +0 -1
  11. package/src/adapters/bun/hmr-manager.js +2 -4
  12. package/src/adapters/bun/server-adapter.d.ts +9 -19
  13. package/src/adapters/bun/server-adapter.js +19 -66
  14. package/src/adapters/bun/static-preview-host.d.ts +1 -0
  15. package/src/adapters/bun/static-preview-host.js +1 -1
  16. package/src/adapters/create-app.d.ts +1 -1
  17. package/src/adapters/create-app.js +2 -1
  18. package/src/adapters/node/create-app.d.ts +4 -8
  19. package/src/adapters/node/create-app.js +7 -12
  20. package/src/adapters/node/runtime-host.d.ts +10 -10
  21. package/src/adapters/node/runtime-host.js +4 -4
  22. package/src/adapters/node/server-adapter-dependencies.d.ts +2 -10
  23. package/src/adapters/node/server-adapter-dependencies.js +8 -13
  24. package/src/adapters/node/server-adapter.d.ts +25 -31
  25. package/src/adapters/node/server-adapter.js +43 -64
  26. package/src/adapters/shared/hmr/shared-hmr-manager.d.ts +0 -4
  27. package/src/adapters/shared/hmr/shared-hmr-manager.js +0 -12
  28. package/src/adapters/shared/http/api-request-pipeline.d.ts +27 -1
  29. package/src/adapters/shared/http/api-request-pipeline.js +31 -16
  30. package/src/adapters/shared/http/fs-server-response-factory.d.ts +0 -1
  31. package/src/adapters/shared/http/fs-server-response-factory.js +0 -3
  32. package/src/adapters/shared/runtime/collect-dev-prewarm-plan.d.ts +1 -3
  33. package/src/adapters/shared/runtime/collect-dev-prewarm-plan.js +1 -4
  34. package/src/adapters/shared/runtime/runtime-app-bootstrap.d.ts +0 -10
  35. package/src/adapters/shared/runtime/runtime-app-bootstrap.js +0 -7
  36. package/src/adapters/shared/runtime/runtime-host.d.ts +5 -2
  37. package/src/adapters/shared/runtime/runtime-server-lifecycle.d.ts +1 -1
  38. package/src/adapters/shared/runtime/runtime-server-lifecycle.js +1 -1
  39. package/src/adapters/shared/runtime/server-adapter.d.ts +13 -0
  40. package/src/adapters/shared/runtime/server-adapter.js +22 -0
  41. package/src/adapters/shared/ws/node-http-websocket-upgrades.d.ts +9 -1
  42. package/src/adapters/shared/ws/node-http-websocket-upgrades.js +8 -2
  43. package/src/build/README.md +5 -6
  44. package/src/build/cache/cache-constants.d.ts +0 -2
  45. package/src/build/cache/cache-constants.js +0 -2
  46. package/src/build/cache/cache-keys.d.ts +0 -2
  47. package/src/build/cache/cache-keys.js +0 -2
  48. package/src/build/cache/output-imports.d.ts +27 -0
  49. package/src/build/cache/output-imports.js +80 -0
  50. package/src/build/cache/pages-unified-graph-build.d.ts +6 -1
  51. package/src/build/cache/pages-unified-graph-build.js +42 -17
  52. package/src/build/cache/production-build-cache.d.ts +2 -2
  53. package/src/build/cache/production-build-cache.js +2 -2
  54. package/src/build/cache/server-entry-build-cache.d.ts +1 -2
  55. package/src/build/cache/server-entry-build-cache.js +4 -5
  56. package/src/build/contracts/build-contracts.d.ts +1 -13
  57. package/src/build/rolldown/runtime-build-output-normalizer.js +3 -6
  58. package/src/build/runtime/build-request-identity.d.ts +2 -6
  59. package/src/build/runtime/build-request-identity.js +2 -8
  60. package/src/build/runtime/deduping-build-executor.d.ts +0 -1
  61. package/src/build/runtime/deduping-build-executor.js +0 -1
  62. package/src/cache/index.d.ts +1 -1
  63. package/src/cache/index.js +1 -1
  64. package/src/cache/module-parse-cache.d.ts +2 -29
  65. package/src/cache/module-parse-cache.js +6 -39
  66. package/src/config/README.md +3 -3
  67. package/src/config/apply-user-config.d.ts +3 -1
  68. package/src/config/apply-user-config.js +3 -2
  69. package/src/config/config-builder.d.ts +1 -0
  70. package/src/config/config-builder.js +2 -2
  71. package/src/config/constants.d.ts +0 -4
  72. package/src/config/constants.js +0 -4
  73. package/src/config/index.d.ts +1 -1
  74. package/src/config/index.js +1 -1
  75. package/src/config/load-eco-config.d.ts +1 -1
  76. package/src/config/load-eco-config.js +18 -11
  77. package/src/config/resolve-eco-config-path.d.ts +9 -0
  78. package/src/config/resolve-eco-config-path.js +11 -0
  79. package/src/config/server-config-bundle.js +2 -2
  80. package/src/config/user-config-types.d.ts +9 -3
  81. package/src/dev/host-runtime.d.ts +0 -1
  82. package/src/dev/host-runtime.js +0 -3
  83. package/src/dev/sc-server.d.ts +4 -1
  84. package/src/dev/sc-server.js +11 -20
  85. package/src/dev/transform-server/dev-transform-import-rewriter.js +2 -2
  86. package/src/hmr/hmr-file-change-prep.d.ts +0 -1
  87. package/src/hmr/hmr-file-change-prep.js +2 -5
  88. package/src/hmr/hmr-strategy.d.ts +3 -8
  89. package/src/hmr/hmr-strategy.js +3 -8
  90. package/src/index.browser.d.ts +1 -2
  91. package/src/index.browser.js +1 -2
  92. package/src/index.d.ts +5 -6
  93. package/src/index.js +5 -6
  94. package/src/islands/island-host.d.ts +0 -9
  95. package/src/islands/island-host.js +1 -13
  96. package/src/plugins/component-import-discovery.js +2 -2
  97. package/src/plugins/eco-component-meta-plugin.js +5 -5
  98. package/src/plugins/integration-plugin.d.ts +0 -1
  99. package/src/plugins/integration-plugin.js +0 -4
  100. package/src/route-renderer/orchestration/document-shell/document-shell-render.service.js +1 -4
  101. package/src/route-renderer/orchestration/integration-renderer.d.ts +0 -6
  102. package/src/route-renderer/orchestration/integration-renderer.js +1 -11
  103. package/src/route-renderer/orchestration/integration-renderer.test-fixtures.js +1 -1
  104. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.d.ts +1 -1
  105. package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js +1 -1
  106. package/src/services/README.md +1 -1
  107. package/src/services/assets/browser-bundle.service.d.ts +1 -6
  108. package/src/services/error-pages/default-error-pages.d.ts +1 -6
  109. package/src/services/error-pages/default-error-pages.js +0 -8
  110. package/src/services/html/html-rewriter.d.ts +77 -0
  111. package/src/services/html/html-rewriter.js +751 -0
  112. package/src/services/html/html-rewriter.parity.test.bun.d.ts +1 -0
  113. package/src/services/html/html-rewriter.parity.test.bun.js +74 -0
  114. package/src/services/html/html-transformer.service.d.ts +26 -39
  115. package/src/services/html/html-transformer.service.js +81 -153
  116. package/src/services/invalidation/development-invalidation.service.d.ts +2 -19
  117. package/src/services/invalidation/development-invalidation.service.js +1 -39
  118. package/src/services/module-loading/README.md +1 -1
  119. package/src/services/module-loading/app-module-loader.service.d.ts +0 -2
  120. package/src/services/module-loading/app-server-module-transpiler.service.d.ts +1 -1
  121. package/src/services/module-loading/app-server-module-transpiler.service.js +0 -10
  122. package/src/services/module-loading/collection-server-module-build.service.d.ts +0 -1
  123. package/src/services/module-loading/collection-server-module-build.service.js +0 -3
  124. package/src/services/module-loading/host-module-loader-registry.d.ts +0 -1
  125. package/src/services/module-loading/host-module-loader-registry.js +0 -3
  126. package/src/services/module-loading/route-module-build-cache-registry.d.ts +0 -4
  127. package/src/services/module-loading/route-module-build-cache-registry.js +0 -4
  128. package/src/services/module-loading/route-module-build-cache.store.d.ts +3 -0
  129. package/src/services/module-loading/route-module-build-cache.store.js +18 -5
  130. package/src/services/module-loading/route-module-build-manifest.d.ts +6 -1
  131. package/src/services/module-loading/route-module-build-manifest.js +1 -2
  132. package/src/services/module-loading/route-module-dependency-hasher.d.ts +3 -2
  133. package/src/services/module-loading/server-module-transpiler.service.d.ts +1 -15
  134. package/src/services/module-loading/server-module-transpiler.service.js +0 -24
  135. package/src/services/runtime-state/entrypoint-dependency-graph.service.js +0 -12
  136. package/src/services/runtime-state/server-invalidation-state.service.d.ts +4 -2
  137. package/src/services/runtime-state/server-invalidation-state.service.js +7 -14
  138. package/src/types/internal-types.d.ts +0 -38
  139. package/src/types/public-types.d.ts +0 -112
  140. package/src/watchers/project-watcher.d.ts +0 -15
  141. package/src/watchers/project-watcher.js +1 -27
  142. package/src/watchers/project-watcher.test-helpers.d.ts +10 -1
  143. package/src/watchers/project-watcher.test-helpers.js +12 -0
  144. package/src/adapters/abstract/router-adapter.d.ts +0 -26
  145. package/src/adapters/abstract/router-adapter.js +0 -13
  146. package/src/adapters/bun/index.d.ts +0 -2
  147. package/src/adapters/bun/index.js +0 -2
  148. package/src/adapters/index.d.ts +0 -2
  149. package/src/adapters/index.js +0 -2
  150. package/src/eco/eco.utils.d.ts +0 -1
  151. package/src/eco/eco.utils.js +0 -1
  152. package/src/services/cache/index.d.ts +0 -9
  153. package/src/services/cache/index.js +0 -8
  154. package/src/services/html/html-rewriter-provider.service.d.ts +0 -40
  155. package/src/services/html/html-rewriter-provider.service.js +0 -68
  156. package/src/services/module-loading/route-module-build-cache.d.ts +0 -4
  157. package/src/services/module-loading/route-module-build-cache.js +0 -3
  158. package/src/services/runtime-state/dev-graph.service.d.ts +0 -118
  159. package/src/services/runtime-state/dev-graph.service.js +0 -170
@@ -7,7 +7,6 @@ export type CollectionServerBuildArtifact = {
7
7
  buildIdentity: string;
8
8
  invalidationVersion: number;
9
9
  };
10
- export declare function getCollectionServerBuildArtifact(appConfig: EcoPagesAppConfig, collectionName: string): CollectionServerBuildArtifact | undefined;
11
10
  export declare function clearCollectionServerBuildArtifacts(appConfig: EcoPagesAppConfig): void;
12
11
  /**
13
12
  * Builds one generated collection server module as an independent server unit.
@@ -17,9 +17,6 @@ function getArtifactMap(appConfig) {
17
17
  }
18
18
  return artifacts;
19
19
  }
20
- export function getCollectionServerBuildArtifact(appConfig, collectionName) {
21
- return getArtifactMap(appConfig).get(collectionName);
22
- }
23
20
  export function clearCollectionServerBuildArtifacts(appConfig) {
24
21
  getArtifactMap(appConfig).clear();
25
22
  }
@@ -1,4 +1,3 @@
1
1
  import type { SourceModuleLoader } from './module-loading-types.js';
2
2
  export declare function setHostModuleLoader(loader: SourceModuleLoader): void;
3
3
  export declare function getHostModuleLoader(): SourceModuleLoader | undefined;
4
- export declare function clearHostModuleLoader(): void;
@@ -5,6 +5,3 @@ export function setHostModuleLoader(loader) {
5
5
  export function getHostModuleLoader() {
6
6
  return hostModuleLoader;
7
7
  }
8
- export function clearHostModuleLoader() {
9
- hostModuleLoader = undefined;
10
- }
@@ -10,10 +10,6 @@ import { RouteModuleBuildCache } from './route-module-build-cache.store.js';
10
10
  * scanning.
11
11
  */
12
12
  export declare function getServerModuleBuildCacheOutdir(appConfig: EcoPagesAppConfig): string;
13
- /**
14
- * @deprecated Use {@link getServerModuleBuildCacheOutdir}.
15
- */
16
- export declare const getRouteModuleBuildCacheOutdir: typeof getServerModuleBuildCacheOutdir;
17
13
  /**
18
14
  * Returns the shared production build cache for one server-module outdir.
19
15
  *
@@ -13,10 +13,6 @@ import { RouteModuleBuildCache } from './route-module-build-cache.store.js';
13
13
  export function getServerModuleBuildCacheOutdir(appConfig) {
14
14
  return path.join(resolveInternalExecutionDir(appConfig), '.server-modules');
15
15
  }
16
- /**
17
- * @deprecated Use {@link getServerModuleBuildCacheOutdir}.
18
- */
19
- export const getRouteModuleBuildCacheOutdir = getServerModuleBuildCacheOutdir;
20
16
  function getRouteModuleBuildCacheMap(appConfig) {
21
17
  const existing = appConfig.runtime?.routeModuleBuildCaches;
22
18
  if (existing) {
@@ -6,6 +6,7 @@ type RouteModuleBuildCacheDependencies = {
6
6
  readManifest: (manifestPath: string) => RouteModuleBuildCacheManifest | undefined;
7
7
  writeManifest: (manifestPath: string, manifest: RouteModuleBuildCacheManifest) => void;
8
8
  exists: (filePath: string) => boolean;
9
+ readFile: (filePath: string) => string;
9
10
  getCorePackageVersion: () => string;
10
11
  createDependencyHasher: () => RouteModuleDependencyHasher;
11
12
  };
@@ -26,6 +27,8 @@ export declare class RouteModuleBuildCache {
26
27
  fileHash: string;
27
28
  outputPath: string;
28
29
  dependencyModulePaths?: readonly string[];
30
+ /** Local imports of the output when the caller already collected them. */
31
+ outputImports?: string[];
29
32
  }): void;
30
33
  isIncrementalStaticGenerationAvailable(context: RouteModuleStaticRenderCacheContext): boolean;
31
34
  ensureIncrementalStaticGenerationContext(context: RouteModuleStaticRenderCacheContext): void;
@@ -1,7 +1,9 @@
1
1
  import path from 'node:path';
2
2
  import { fileSystem } from '@ecopages/file-system';
3
+ import { collectReachableLocalImports } from '../../build/cache/output-imports.js';
3
4
  import { RouteModuleDependencyHasher } from './route-module-dependency-hasher.js';
4
- import { ROUTE_MODULE_BUILD_CACHE_FILENAME, createEmptyRouteModuleBuildCacheManifest, createPersistedRouteModuleBuildKey, getCorePackageVersion, normalizeRouteModuleCachePath, readRouteModuleBuildCacheManifest, shouldPersistRouteModuleBuildCache, writeRouteModuleBuildCacheManifest, } from './route-module-build-manifest.js';
5
+ import { ROUTE_MODULE_BUILD_CACHE_FILENAME, createEmptyRouteModuleBuildCacheManifest, createPersistedRouteModuleBuildKey, normalizeRouteModuleCachePath, readRouteModuleBuildCacheManifest, shouldPersistRouteModuleBuildCache, writeRouteModuleBuildCacheManifest, } from './route-module-build-manifest.js';
6
+ import { getCorePackageVersion } from '../../build/cache/cache-keys.js';
5
7
  import { isProductionCacheManifestCurrent, matchesProductionCacheFingerprint, } from '../../build/cache/production-build-cache.js';
6
8
  /**
7
9
  * Persists route-module transpile and static-render metadata under one server outdir.
@@ -18,6 +20,7 @@ export class RouteModuleBuildCache {
18
20
  readManifest: dependencies?.readManifest ?? readRouteModuleBuildCacheManifest,
19
21
  writeManifest: dependencies?.writeManifest ?? writeRouteModuleBuildCacheManifest,
20
22
  exists: dependencies?.exists ?? ((filePath) => fileSystem.exists(filePath)),
23
+ readFile: dependencies?.readFile ?? ((filePath) => fileSystem.readFileSync(filePath)),
21
24
  getCorePackageVersion: dependencies?.getCorePackageVersion ?? getCorePackageVersion,
22
25
  createDependencyHasher: dependencies?.createDependencyHasher ?? (() => new RouteModuleDependencyHasher()),
23
26
  };
@@ -40,12 +43,13 @@ export class RouteModuleBuildCache {
40
43
  if (!this.dependencyHasher.matchesStoredHashes(entry.dependencyHashes, cacheFilePath, options.fileHash)) {
41
44
  return undefined;
42
45
  }
43
- const outputPath = path.isAbsolute(entry.outputPath)
44
- ? entry.outputPath
45
- : path.join(options.outdir, entry.outputPath);
46
+ const outputPath = resolveOutputPath(entry.outputPath, options.outdir);
46
47
  if (!this.dependencies.exists(outputPath)) {
47
48
  return undefined;
48
49
  }
50
+ if (!entry.outputImports?.every((importPath) => this.dependencies.exists(importPath))) {
51
+ return undefined;
52
+ }
49
53
  return { outputPath, entry };
50
54
  }
51
55
  recordBuild(options) {
@@ -58,6 +62,7 @@ export class RouteModuleBuildCache {
58
62
  : [cacheFilePath];
59
63
  const dependencyHashes = this.dependencyHasher.createDependencyHashes(dependencyModulePaths);
60
64
  dependencyHashes[cacheFilePath] = options.fileHash;
65
+ const outputPath = resolveOutputPath(options.outputPath, options.outdir);
61
66
  const manifest = this.loadManifest();
62
67
  const existingEntry = manifest.entries[cacheFilePath];
63
68
  manifest.corePackageVersion = this.dependencies.getCorePackageVersion();
@@ -67,6 +72,11 @@ export class RouteModuleBuildCache {
67
72
  builtAt: Date.now(),
68
73
  buildKey: createPersistedRouteModuleBuildKey(options, options.sourceTransforms),
69
74
  dependencyHashes,
75
+ outputImports: options.outputImports ??
76
+ collectReachableLocalImports(outputPath, {
77
+ exists: (filePath) => this.dependencies.exists(filePath),
78
+ readFile: (filePath) => this.dependencies.readFile(filePath),
79
+ }),
70
80
  renderedOutputs: existingEntry?.renderedOutputs,
71
81
  };
72
82
  this.persistManifest(manifest);
@@ -144,11 +154,11 @@ export class RouteModuleBuildCache {
144
154
  manifest.configHash = options.context.configHash;
145
155
  manifest.buildInputsFingerprint = options.context.buildInputsFingerprint;
146
156
  manifest.entries[cacheFilePath] = {
157
+ ...existingEntry,
147
158
  sourceHash: options.sourceHash,
148
159
  outputPath: existingEntry?.outputPath ?? '',
149
160
  builtAt: existingEntry?.builtAt ?? Date.now(),
150
161
  buildKey: existingEntry?.buildKey ?? '',
151
- dependencyHashes: existingEntry?.dependencyHashes,
152
162
  renderedOutputs: {
153
163
  ...(existingEntry?.renderedOutputs ?? {}),
154
164
  [options.pathname]: {
@@ -218,3 +228,6 @@ export class RouteModuleBuildCache {
218
228
  this.dependencies.writeManifest(this.manifestPath, manifest);
219
229
  }
220
230
  }
231
+ function resolveOutputPath(outputPath, outdir) {
232
+ return path.isAbsolute(outputPath) ? outputPath : path.join(outdir, outputPath);
233
+ }
@@ -1,7 +1,6 @@
1
1
  import type { BuildOptions } from '../../build/contracts/build-contracts.js';
2
2
  import type { PageModuleBuildImportOptions } from './page-module-import.service.js';
3
3
  import type { RouteModuleDependencyHashes } from './route-module-dependency-hasher.js';
4
- export { createJsxCacheKey, createPluginCacheKey, getCorePackageVersion, hashPluginSetup, } from '../../build/cache/cache-keys.js';
5
4
  export { ROUTE_MODULE_BUILD_CACHE_FILENAME } from '../../build/cache/cache-constants.js';
6
5
  /** One persisted route-module build entry in {@link ROUTE_MODULE_BUILD_CACHE_FILENAME}. */
7
6
  export interface RouteModuleBuildCacheEntry {
@@ -10,6 +9,11 @@ export interface RouteModuleBuildCacheEntry {
10
9
  builtAt: number;
11
10
  buildKey: string;
12
11
  dependencyHashes?: RouteModuleDependencyHashes;
12
+ /**
13
+ * Local files the compiled output imports (shared chunks, collection modules).
14
+ * The entry is reused only while all of them exist.
15
+ */
16
+ outputImports?: string[];
13
17
  renderedOutputs?: Record<string, RouteModuleStaticRenderCacheEntry>;
14
18
  }
15
19
  /** Metadata for one rendered static HTML artifact derived from a route module. */
@@ -20,6 +24,7 @@ export interface RouteModuleStaticRenderCacheEntry {
20
24
  }
21
25
  /** On-disk manifest describing all cached route-module builds for one server outdir. */
22
26
  export interface RouteModuleBuildCacheManifest {
27
+ /** `getCorePackageVersion()` of the build that wrote the manifest. */
23
28
  corePackageVersion: string;
24
29
  configHash?: string;
25
30
  buildInputsFingerprint?: string;
@@ -1,7 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import { readProductionCacheManifest, writeProductionCacheManifest } from '../../build/cache/production-build-cache.js';
3
3
  import { createJsxCacheKey, createPluginCacheKey, createSourceTransformCacheKey, getCorePackageVersion, } from '../../build/cache/cache-keys.js';
4
- export { createJsxCacheKey, createPluginCacheKey, getCorePackageVersion, hashPluginSetup, } from '../../build/cache/cache-keys.js';
5
4
  export { ROUTE_MODULE_BUILD_CACHE_FILENAME } from '../../build/cache/cache-constants.js';
6
5
  /** Normalizes filesystem paths used as manifest keys and build-key inputs. */
7
6
  export function normalizeRouteModuleCachePath(filePath) {
@@ -49,7 +48,7 @@ export function readRouteModuleBuildCacheManifest(manifestPath) {
49
48
  return undefined;
50
49
  }
51
50
  return {
52
- corePackageVersion: parsed.corePackageVersion ?? parsed.invalidationVersion ?? '',
51
+ corePackageVersion: parsed.corePackageVersion ?? '',
53
52
  configHash: parsed.configHash,
54
53
  buildInputsFingerprint: parsed.buildInputsFingerprint,
55
54
  entries: parsed.entries,
@@ -5,8 +5,9 @@ import type { BuildResult } from '../../build/build-adapter.js';
5
5
  * @remarks
6
6
  * Keys are normalized absolute filesystem paths. Values are opaque content hashes
7
7
  * produced by the active {@link FileSystem} implementation. Only app-owned source
8
- * files are tracked; `node:` builtins and `node_modules` paths are excluded
9
- * because they are covered by the core package {@link getCorePackageVersion | invalidation version}.
8
+ * files are tracked; `node:` builtins and `node_modules` paths are excluded.
9
+ * Installed packages stay external to route modules, and framework code changes
10
+ * with a release, which the core package version covers.
10
11
  */
11
12
  export type RouteModuleDependencyHashes = Record<string, string>;
12
13
  type HashFileFn = (filePath: string) => string;
@@ -4,7 +4,7 @@ import type { AppModuleLoader } from './app-module-loader.service.js';
4
4
  import { type PageModuleBuildImportOptions } from './page-module-import.service.js';
5
5
  import type { SourceModuleLoaderFactory } from './module-loading-types.js';
6
6
  export type ServerModuleTranspilerOptions = Omit<PageModuleBuildImportOptions, 'rootDir' | 'buildExecutor'>;
7
- export type ServerModuleImportDependency = Pick<AppModuleLoader, 'importModule' | 'invalidateDevelopmentGraph'>;
7
+ export type ServerModuleImportDependency = Pick<AppModuleLoader, 'importModule'>;
8
8
  /**
9
9
  * Immutable execution context for one server-transpiler instance.
10
10
  *
@@ -18,7 +18,6 @@ export type ServerModuleTranspilerBootstrapArgs = {
18
18
  getBuildExecutor?: () => BuildExecutor | undefined;
19
19
  canLoadSourceModuleFromHost?: (filePath: string) => boolean;
20
20
  getHostModuleLoader?: SourceModuleLoaderFactory;
21
- invalidateModules?: (changedFiles?: string[]) => void;
22
21
  pageModuleImportService?: ServerModuleImportDependency;
23
22
  /** Factory evaluated on each importModule call to produce plugins applied to every load. */
24
23
  getDefaultPlugins?: () => EcoBuildPlugin[];
@@ -34,7 +33,6 @@ export declare class ServerModuleTranspiler {
34
33
  private readonly pageModuleImportService;
35
34
  private readonly getRootDir;
36
35
  private readonly getBuildExecutor;
37
- private readonly invalidateModules;
38
36
  private readonly getDefaultPlugins;
39
37
  /**
40
38
  * Creates one explicit server-transpiler boundary for a given execution
@@ -46,16 +44,4 @@ export declare class ServerModuleTranspiler {
46
44
  * context.
47
45
  */
48
46
  importModule<T = unknown>(options: ServerModuleTranspilerOptions): Promise<T>;
49
- /**
50
- * Invalidates cached module state for development reloads.
51
- */
52
- invalidate(changedFiles?: string[]): void;
53
- /**
54
- * Releases transpiler-owned resources.
55
- *
56
- * @remarks
57
- * The current implementation delegates cache ownership to lower-level module
58
- * loading services, so disposal is intentionally a no-op for now.
59
- */
60
- dispose(): Promise<void>;
61
47
  }
@@ -10,7 +10,6 @@ export class ServerModuleTranspiler {
10
10
  pageModuleImportService;
11
11
  getRootDir;
12
12
  getBuildExecutor;
13
- invalidateModules;
14
13
  getDefaultPlugins;
15
14
  /**
16
15
  * Creates one explicit server-transpiler boundary for a given execution
@@ -26,13 +25,6 @@ export class ServerModuleTranspiler {
26
25
  this.getRootDir = () => args.rootDir;
27
26
  this.getBuildExecutor = args.getBuildExecutor ?? (() => undefined);
28
27
  this.getDefaultPlugins = args.getDefaultPlugins ?? (() => []);
29
- this.invalidateModules = (changedFiles) => {
30
- if (args.invalidateModules) {
31
- args.invalidateModules(changedFiles);
32
- return;
33
- }
34
- this.pageModuleImportService.invalidateDevelopmentGraph();
35
- };
36
28
  }
37
29
  /**
38
30
  * Loads a server-side source module through the caller-owned transpile
@@ -48,20 +40,4 @@ export class ServerModuleTranspiler {
48
40
  buildExecutor: this.getBuildExecutor(),
49
41
  });
50
42
  }
51
- /**
52
- * Invalidates cached module state for development reloads.
53
- */
54
- invalidate(changedFiles) {
55
- this.invalidateModules(changedFiles);
56
- }
57
- /**
58
- * Releases transpiler-owned resources.
59
- *
60
- * @remarks
61
- * The current implementation delegates cache ownership to lower-level module
62
- * loading services, so disposal is intentionally a no-op for now.
63
- */
64
- async dispose() {
65
- return;
66
- }
67
43
  }
@@ -62,15 +62,6 @@ export class InMemoryEntrypointDependencyGraph {
62
62
  this.entrypointDependencies.clear();
63
63
  }
64
64
  }
65
- function isLegacyEntrypointDependencyGraph(value) {
66
- return (Boolean(value) &&
67
- typeof value === 'object' &&
68
- typeof value.supportsSelectiveInvalidation === 'function' &&
69
- typeof value.getDependencyEntrypoints === 'function' &&
70
- typeof value.setEntrypointDependencies === 'function' &&
71
- typeof value.clearEntrypointDependencies === 'function' &&
72
- typeof value.reset === 'function');
73
- }
74
65
  /**
75
66
  * Returns the app-owned entrypoint dependency graph.
76
67
  */
@@ -78,9 +69,6 @@ export function getAppEntrypointDependencyGraph(appConfig) {
78
69
  if (appConfig.runtime?.entrypointDependencyGraph) {
79
70
  return appConfig.runtime.entrypointDependencyGraph;
80
71
  }
81
- if (isLegacyEntrypointDependencyGraph(appConfig.runtime?.devGraphService)) {
82
- return appConfig.runtime.devGraphService;
83
- }
84
72
  return new NoopEntrypointDependencyGraph();
85
73
  }
86
74
  /**
@@ -5,7 +5,6 @@ import type { EcoPagesAppConfig } from '../../types/internal-types.js';
5
5
  export interface ServerInvalidationState {
6
6
  getServerInvalidationVersion(): number;
7
7
  invalidateServerModules(changedFiles?: string[]): void;
8
- reset(): void;
9
8
  }
10
9
  /**
11
10
  * Minimal app-local invalidation state backed by a single generation counter.
@@ -14,10 +13,13 @@ export declare class CounterServerInvalidationState implements ServerInvalidatio
14
13
  private serverInvalidationVersion;
15
14
  getServerInvalidationVersion(): number;
16
15
  invalidateServerModules(_changedFiles?: string[]): void;
17
- reset(): void;
18
16
  }
19
17
  /**
20
18
  * Returns the app-owned server invalidation state.
19
+ *
20
+ * @remarks
21
+ * When nothing is installed yet, a counter is installed on first read so later
22
+ * reads share its version instead of each starting from zero.
21
23
  */
22
24
  export declare function getAppServerInvalidationState(appConfig: EcoPagesAppConfig): ServerInvalidationState;
23
25
  /**
@@ -9,28 +9,21 @@ export class CounterServerInvalidationState {
9
9
  invalidateServerModules(_changedFiles) {
10
10
  this.serverInvalidationVersion += 1;
11
11
  }
12
- reset() {
13
- this.serverInvalidationVersion += 1;
14
- }
15
- }
16
- function isLegacyServerInvalidationState(value) {
17
- return (Boolean(value) &&
18
- typeof value === 'object' &&
19
- typeof value.getServerInvalidationVersion === 'function' &&
20
- typeof value.invalidateServerModules === 'function' &&
21
- typeof value.reset === 'function');
22
12
  }
23
13
  /**
24
14
  * Returns the app-owned server invalidation state.
15
+ *
16
+ * @remarks
17
+ * When nothing is installed yet, a counter is installed on first read so later
18
+ * reads share its version instead of each starting from zero.
25
19
  */
26
20
  export function getAppServerInvalidationState(appConfig) {
27
21
  if (appConfig.runtime?.serverInvalidationState) {
28
22
  return appConfig.runtime.serverInvalidationState;
29
23
  }
30
- if (isLegacyServerInvalidationState(appConfig.runtime?.devGraphService)) {
31
- return appConfig.runtime.devGraphService;
32
- }
33
- return new CounterServerInvalidationState();
24
+ const serverInvalidationState = new CounterServerInvalidationState();
25
+ setAppServerInvalidationState(appConfig, serverInvalidationState);
26
+ return serverInvalidationState;
34
27
  }
35
28
  /**
36
29
  * Installs the invalidation state used by one app instance.
@@ -10,9 +10,7 @@ import type { ComponentRenderInput, EcoComponent, PageMetadataProps, SitemapConf
10
10
  export type InternalComponentRenderInput = ComponentRenderInput & {
11
11
  foreignChildRoots?: ReadonlyArray<EcoComponent | Partial<EcoComponent>>;
12
12
  };
13
- import type { RouteRegistry } from '../router/server/route-registry.js';
14
13
  import type { CacheConfig } from '../services/cache/cache.types.js';
15
- import type { DevGraphService } from '../services/runtime-state/dev-graph.service.js';
16
14
  import type { AppModuleLoader } from '../services/module-loading/app-module-loader.service.js';
17
15
  import type { SourceModuleLoader } from '../services/module-loading/module-loading-types.js';
18
16
  import type { EntrypointDependencyGraph } from '../services/runtime-state/entrypoint-dependency-graph.service.js';
@@ -121,8 +119,6 @@ export type EcoPagesAppConfig = {
121
119
  defaultMetadata: PageMetadataProps;
122
120
  /** Integrations plugins */
123
121
  integrations: AnyIntegrationPlugin[];
124
- /** Integrations dependencies */
125
- integrationsDependencies: IntegrationDependencyConfig[];
126
122
  /** Derived Paths */
127
123
  absolutePaths: {
128
124
  config: string;
@@ -170,7 +166,6 @@ export type EcoPagesAppConfig = {
170
166
  buildOwnership?: BuildOwnership;
171
167
  buildAdapter?: BuildAdapter;
172
168
  buildManifest?: AppBuildManifest;
173
- devGraphService?: DevGraphService;
174
169
  entrypointDependencyGraph?: EntrypointDependencyGraph;
175
170
  pageBrowserGraphSession?: SessionPageBrowserGraphCache;
176
171
  hostModuleLoader?: SourceModuleLoader;
@@ -223,15 +218,6 @@ export type EcoPagesAppConfig = {
223
218
  unsafe?: Record<string, unknown>;
224
219
  };
225
220
  };
226
- export type IntegrationDependencyConfig = {
227
- integration: string;
228
- kind: 'script' | 'stylesheet';
229
- position?: 'head' | 'body';
230
- srcUrl: string;
231
- filePath: string;
232
- /** @todo inline dependencies not implemented yet */
233
- inline?: boolean;
234
- };
235
221
  /**
236
222
  * The possible kinds of a route.
237
223
  */
@@ -249,18 +235,6 @@ export type MatchResult = {
249
235
  query: Record<string, string>;
250
236
  params: Record<string, string | string[]>;
251
237
  };
252
- /**
253
- * Represents a route in EcoPages.
254
- */
255
- export type Route = {
256
- kind: RouteKind;
257
- filePath: string;
258
- pathname: string;
259
- };
260
- /**
261
- * Represents the routes in EcoPages.
262
- */
263
- export type Routes = Record<string, Route>;
264
238
  /**
265
239
  * Represents the options for the file system server.
266
240
  */
@@ -268,16 +242,4 @@ export type FileSystemServerOptions = {
268
242
  watchMode: boolean;
269
243
  port?: number | string;
270
244
  };
271
- /**
272
- * Represents the file system server adapter.
273
- */
274
- export interface EcoPagesFileSystemServerAdapter<ServerInstanceOptions = unknown> {
275
- startServer(serverOptions: ServerInstanceOptions): {
276
- router: RouteRegistry;
277
- server: unknown;
278
- } | Promise<{
279
- router: RouteRegistry;
280
- server: unknown;
281
- }>;
282
- }
283
245
  export type { ClientBridgeEvent, DefaultHmrContext, HmrFileChangeOptions, IHmrManager, IClientBridge, } from './public-types.js';
@@ -655,11 +655,8 @@ export interface ErrorPageTemplateProps extends Omit<HtmlTemplateProps, 'childre
655
655
  message?: string;
656
656
  stack?: string;
657
657
  }
658
- export type Error400TemplateProps = ErrorPageTemplateProps;
659
- export type Error401TemplateProps = ErrorPageTemplateProps;
660
658
  export type Error403TemplateProps = ErrorPageTemplateProps;
661
659
  export type Error404TemplateProps = ErrorPageTemplateProps;
662
- export type Error409TemplateProps = ErrorPageTemplateProps;
663
660
  export type Error500TemplateProps = ErrorPageTemplateProps;
664
661
  /**
665
662
  * Represents the parameters for a page.
@@ -759,23 +756,6 @@ export type EcoPageFile<T = unknown> = T & {
759
756
  getMetadata?: GetMetadata;
760
757
  cache?: CacheStrategy;
761
758
  };
762
- /**
763
- * Represents a CSS processor.
764
- */
765
- export interface CssProcessor {
766
- /**
767
- * Processes a CSS file at the specified path.
768
- * @param path - The path to the CSS file.
769
- * @returns A promise that resolves to the processed CSS as a string.
770
- */
771
- processPath: (path: string, options?: any) => Promise<string>;
772
- /**
773
- * Processes a CSS string or buffer.
774
- * @param contents - The CSS contents as a string or buffer.
775
- * @returns A promise that resolves to the processed CSS as a string.
776
- */
777
- processStringOrBuffer: (contents: string | Buffer, options?: any) => Promise<string>;
778
- }
779
759
  /**
780
760
  * The options for the route renderer.
781
761
  */
@@ -813,57 +793,6 @@ export type RouteRenderResult = {
813
793
  /** Source paths observed during render preparation for HTML cache invalidation. */
814
794
  sourceDependencyPaths?: readonly string[];
815
795
  };
816
- /**
817
- * Represents the dependencies required for an integration plugin.
818
- * It combines the base integration plugin dependencies with specific integration plugin dependencies.
819
- */
820
- export type IntegrationPluginDependencies = BaseIntegrationPluginDependencies & SpecificIntegrationPluginDependencies;
821
- type BaseIntegrationPluginDependencies = {
822
- inline?: boolean;
823
- };
824
- /**
825
- * Represents the dependencies required for a specific integration plugin.
826
- * It can be one of the following types:
827
- * {@link ScriptImportIntegrationPluginDependencies}
828
- * {@link ScriptContentIntegrationPluginDependencies}
829
- * {@link StylesheetImportIntegrationPluginDependencies}
830
- * {@link StylesheetContentIntegrationPluginDependencies}
831
- */
832
- type SpecificIntegrationPluginDependencies = ScriptImportIntegrationPluginDependencies | ScriptContentIntegrationPluginDependencies | StylesheetImportIntegrationPluginDependencies | StylesheetContentIntegrationPluginDependencies;
833
- /**
834
- * Script dependencies for an integration plugin with an import path.
835
- */
836
- type ScriptImportIntegrationPluginDependencies = {
837
- kind: 'script';
838
- importPath: string;
839
- position?: 'head' | 'body';
840
- /** @default true */
841
- minify?: boolean;
842
- };
843
- /**
844
- * Script dependencies for an integration plugin with content.
845
- */
846
- type ScriptContentIntegrationPluginDependencies = {
847
- kind: 'script';
848
- content: string;
849
- position?: 'head' | 'body';
850
- /** @default true */
851
- minify?: boolean;
852
- };
853
- /**
854
- * Stylesheet dependencies for an integration plugin with an import path.
855
- */
856
- type StylesheetImportIntegrationPluginDependencies = {
857
- kind: 'stylesheet';
858
- importPath: string;
859
- };
860
- /**
861
- * Stylesheet dependencies for an integration plugin with content.
862
- */
863
- type StylesheetContentIntegrationPluginDependencies = {
864
- kind: 'stylesheet';
865
- content: string;
866
- };
867
796
  /**
868
797
  * The options for the integration renderer.
869
798
  */
@@ -1016,18 +945,6 @@ export interface ComponentRenderResult {
1016
945
  rootAttributes?: Record<string, string>;
1017
946
  assets?: ProcessedAsset[];
1018
947
  }
1019
- /**
1020
- * Represents a deep required type for a given object
1021
- */
1022
- export type DeepRequired<T> = Required<{
1023
- [K in keyof T]: T[K] extends Required<T[K]> ? T[K] : DeepRequired<T[K]>;
1024
- }>;
1025
- /**
1026
- * The Prettify helper is a utility type that takes an object type and makes the hover overlay more readable.
1027
- */
1028
- export type Prettify<T> = {
1029
- [K in keyof T]: T[K];
1030
- } & {};
1031
948
  /**
1032
949
  * Services available to API handlers.
1033
950
  */
@@ -1431,35 +1348,6 @@ export interface RouteSchema {
1431
1348
  * Helper type to extract inferred types from a schema, with fallback to unknown.
1432
1349
  */
1433
1350
  export type InferSchemaOutput<T> = T extends StandardSchema ? InferOutput<T> : unknown;
1434
- /**
1435
- * Context with typed body/query/headers based on the provided schema.
1436
- */
1437
- export type TypedApiHandlerContext<TSchema extends RouteSchema, TRequest extends Request = Request, TServer = any> = Omit<ApiHandlerContext<TRequest, TServer>, 'body' | 'query' | 'headers'> & {
1438
- body: InferSchemaOutput<TSchema['body']>;
1439
- query: InferSchemaOutput<TSchema['query']>;
1440
- headers: InferSchemaOutput<TSchema['headers']>;
1441
- params: InferSchemaOutput<TSchema['params']>;
1442
- };
1443
- /**
1444
- * Options for the group method.
1445
- *
1446
- * @typeParam TContext - Extended context type that middleware provides to handlers
1447
- *
1448
- * @example Group with auth middleware extending context
1449
- * ```typescript
1450
- * type AuthContext = ApiHandlerContext<BunRequest<string>, Server> & { user: User };
1451
- *
1452
- * app.group<AuthContext>('/api', (r) => {
1453
- * r.get('/profile', (ctx) => {
1454
- * // ctx.user is properly typed!
1455
- * return ctx.json({ name: ctx.user.name });
1456
- * });
1457
- * }, { middleware: [authMiddleware] });
1458
- * ```
1459
- */
1460
- export interface GroupOptions<TRequest extends Request = Request, TServer = any, TContext extends ApiHandlerContext<TRequest, TServer> = ApiHandlerContext<TRequest, TServer>> {
1461
- middleware?: Middleware<TRequest, TServer, TContext>[];
1462
- }
1463
1351
  /**
1464
1352
  * Context type that combines schema-typed fields with an extended base context.
1465
1353
  * Used by RouteGroupBuilder to merge schema validation types with middleware-extended context.
@@ -68,7 +68,6 @@ export declare class ProjectWatcher {
68
68
  */
69
69
  private uncacheModules;
70
70
  private isRouteSourceFile;
71
- private isIncludeSourceFile;
72
71
  private requestBrowserReload;
73
72
  /**
74
73
  * Handles public directory file changes by copying only the changed file.
@@ -120,20 +119,6 @@ export declare class ProjectWatcher {
120
119
  */
121
120
  private notifyProcessors;
122
121
  private getProcessorHandler;
123
- /**
124
- * Checks if a file is in the public directory.
125
- */
126
- private isPublicDirFile;
127
- /**
128
- * Checks if file path matches any additionalWatchPaths patterns.
129
- */
130
- private matchesAdditionalWatchPaths;
131
- /**
132
- * Checks if a file is owned by a processor as an asset input.
133
- * Ownership requires declared asset capabilities; watch config only drives
134
- * {@link notifyProcessors} notifications.
135
- */
136
- private isHandledByProcessor;
137
122
  /**
138
123
  * Triggers router refresh for page directory changes.
139
124
  * This ensures the router is updated when pages are added or removed.