@ecopages/core 0.2.0-beta.6 → 0.2.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +26 -2
- package/src/adapters/abstract/application-adapter.d.ts +12 -1
- package/src/adapters/abstract/application-adapter.js +13 -0
- package/src/adapters/abstract/server-adapter.d.ts +3 -0
- package/src/adapters/bun/client-bridge.d.ts +1 -0
- package/src/adapters/bun/client-bridge.js +3 -0
- package/src/adapters/bun/create-app.d.ts +2 -0
- package/src/adapters/bun/create-app.js +28 -9
- package/src/adapters/bun/server-adapter.d.ts +13 -0
- package/src/adapters/bun/server-adapter.js +29 -4
- package/src/adapters/create-app.d.ts +13 -0
- package/src/adapters/create-app.js +10 -1
- package/src/adapters/node/create-app.d.ts +1 -0
- package/src/adapters/node/create-app.js +17 -7
- package/src/adapters/node/node-client-bridge.d.ts +1 -0
- package/src/adapters/node/node-client-bridge.js +3 -0
- package/src/adapters/node/server-adapter.d.ts +10 -13
- package/src/adapters/node/server-adapter.js +37 -82
- package/src/adapters/node/static-content-server.d.ts +1 -0
- package/src/adapters/node/static-content-server.js +3 -0
- package/src/adapters/shared/copy-runtime-public-dir.d.ts +6 -0
- package/src/adapters/shared/copy-runtime-public-dir.js +24 -0
- package/src/adapters/shared/runtime-app-bootstrap.d.ts +0 -1
- package/src/adapters/shared/runtime-app-bootstrap.js +1 -6
- package/src/adapters/shared/server-static-builder.d.ts +4 -7
- package/src/adapters/shared/server-static-builder.js +89 -49
- package/src/adapters/shared/shared-hmr-manager.d.ts +1 -0
- package/src/adapters/shared/shared-hmr-manager.js +15 -2
- package/src/build/README.md +44 -4
- package/src/build/build-adapter.d.ts +8 -2
- package/src/build/build-adapter.js +71 -33
- package/src/build/build-input-fingerprint.d.ts +28 -0
- package/src/build/build-input-fingerprint.js +31 -0
- package/src/build/jsx-ownership-plugins.d.ts +10 -0
- package/src/build/jsx-ownership-plugins.js +17 -0
- package/src/build/pages-unified-graph-build.d.ts +31 -0
- package/src/build/pages-unified-graph-build.js +208 -0
- package/src/build/parallel-build-executor.d.ts +21 -0
- package/src/build/parallel-build-executor.js +52 -0
- package/src/build/rolldown-adapter-helpers.js +47 -3
- package/src/build/rolldown-build-adapter.js +2 -0
- package/src/build/rolldown-build-invocation-metrics.d.ts +12 -0
- package/src/build/rolldown-build-invocation-metrics.js +43 -0
- package/src/build/rolldown-dev-build-adapter.d.ts +2 -2
- package/src/build/rolldown-dev-build-adapter.js +30 -14
- package/src/build/runtime-build-executor.d.ts +7 -13
- package/src/build/runtime-build-executor.js +31 -7
- package/src/build/runtime-build-output-normalizer.d.ts +7 -0
- package/src/build/runtime-build-output-normalizer.js +85 -1
- package/src/build/server-entry-build-cache.d.ts +44 -0
- package/src/build/server-entry-build-cache.js +169 -0
- package/src/hmr/hmr.test.e2e.js +15 -4
- package/src/plugins/integration-plugin.d.ts +19 -8
- package/src/plugins/integration-plugin.js +7 -2
- package/src/plugins/processor.d.ts +5 -0
- package/src/plugins/processor.js +7 -0
- package/src/route-renderer/GRAPH.md +4 -4
- package/src/route-renderer/README.md +6 -5
- package/src/route-renderer/orchestration/foreign-subtree-execution.service.js +1 -3
- package/src/route-renderer/orchestration/integration-renderer.d.ts +10 -2
- package/src/route-renderer/orchestration/integration-renderer.js +32 -12
- package/src/route-renderer/orchestration/render-output.utils.d.ts +2 -0
- package/src/route-renderer/orchestration/render-output.utils.js +4 -0
- package/src/route-renderer/orchestration/route-render-orchestrator.d.ts +2 -2
- package/src/route-renderer/orchestration/route-render-orchestrator.js +17 -16
- package/src/router/client/navigation-coordinator.js +10 -0
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.d.ts +1 -0
- package/src/services/assets/asset-processing-service/browser-runtime-asset.factory.js +1 -0
- package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.d.ts +4 -2
- package/src/services/assets/asset-processing-service/browser-runtime-entry.factory.js +27 -7
- package/src/services/assets/asset-processing-service/processors/script/node-module-script.processor.js +17 -3
- package/src/services/assets/browser-bundle.service.d.ts +1 -0
- package/src/services/assets/browser-bundle.service.js +9 -3
- package/src/services/html/html-transformer.service.d.ts +1 -1
- package/src/services/html/html-transformer.service.js +4 -4
- package/src/services/invalidation/development-invalidation.service.d.ts +10 -1
- package/src/services/invalidation/development-invalidation.service.js +29 -0
- package/src/services/module-loading/README.md +49 -0
- package/src/services/module-loading/app-server-module-transpiler.service.js +4 -17
- package/src/services/module-loading/page-module-import.service.d.ts +4 -1
- package/src/services/module-loading/page-module-import.service.js +52 -29
- package/src/services/module-loading/route-module-build-cache-registry.d.ts +24 -0
- package/src/services/module-loading/route-module-build-cache-registry.js +37 -0
- package/src/services/module-loading/route-module-build-cache.d.ts +4 -0
- package/src/services/module-loading/route-module-build-cache.js +38 -0
- package/src/services/module-loading/route-module-build-cache.store.d.ts +57 -0
- package/src/services/module-loading/route-module-build-cache.store.js +203 -0
- package/src/services/module-loading/route-module-build-manifest.d.ts +61 -0
- package/src/services/module-loading/route-module-build-manifest.js +124 -0
- package/src/services/module-loading/route-module-dependency-hasher.d.ts +81 -0
- package/src/services/module-loading/route-module-dependency-hasher.js +121 -0
- package/src/services/module-loading/server-module-transpiler.service.js +1 -1
- package/src/static-site-generator/README.md +33 -0
- package/src/static-site-generator/static-build-invalidation.d.ts +10 -0
- package/src/static-site-generator/static-build-invalidation.js +78 -0
- package/src/static-site-generator/static-export-context.d.ts +22 -0
- package/src/static-site-generator/static-export-context.js +0 -0
- package/src/static-site-generator/static-site-generator.d.ts +17 -20
- package/src/static-site-generator/static-site-generator.js +188 -85
- package/src/types/internal-types.d.ts +8 -0
- package/src/utils/parse-cli-args.d.ts +1 -0
- package/src/utils/parse-cli-args.js +3 -0
- package/src/watchers/project-watcher.d.ts +8 -0
- package/src/watchers/project-watcher.js +32 -12
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileSystem } from "@ecopages/file-system";
|
|
3
|
+
import { RouteModuleDependencyHasher } from "./route-module-dependency-hasher.js";
|
|
4
|
+
import {
|
|
5
|
+
ROUTE_MODULE_BUILD_CACHE_FILENAME,
|
|
6
|
+
createEmptyRouteModuleBuildCacheManifest,
|
|
7
|
+
createPersistedRouteModuleBuildKey,
|
|
8
|
+
getCorePackageVersion,
|
|
9
|
+
normalizeRouteModuleCachePath,
|
|
10
|
+
readRouteModuleBuildCacheManifest,
|
|
11
|
+
shouldPersistRouteModuleBuildCache,
|
|
12
|
+
writeRouteModuleBuildCacheManifest
|
|
13
|
+
} from "./route-module-build-manifest.js";
|
|
14
|
+
class RouteModuleBuildCache {
|
|
15
|
+
manifestPath;
|
|
16
|
+
dependencies;
|
|
17
|
+
dependencyHasher;
|
|
18
|
+
manifest;
|
|
19
|
+
manifestLoaded = false;
|
|
20
|
+
constructor(outdir, dependencies) {
|
|
21
|
+
this.manifestPath = path.join(outdir, ROUTE_MODULE_BUILD_CACHE_FILENAME);
|
|
22
|
+
this.dependencies = {
|
|
23
|
+
readManifest: dependencies?.readManifest ?? readRouteModuleBuildCacheManifest,
|
|
24
|
+
writeManifest: dependencies?.writeManifest ?? writeRouteModuleBuildCacheManifest,
|
|
25
|
+
exists: dependencies?.exists ?? ((filePath) => fileSystem.exists(filePath)),
|
|
26
|
+
getCorePackageVersion: dependencies?.getCorePackageVersion ?? getCorePackageVersion,
|
|
27
|
+
createDependencyHasher: dependencies?.createDependencyHasher ?? (() => new RouteModuleDependencyHasher())
|
|
28
|
+
};
|
|
29
|
+
this.dependencyHasher = this.dependencies.createDependencyHasher();
|
|
30
|
+
}
|
|
31
|
+
lookup(options) {
|
|
32
|
+
if (!shouldPersistRouteModuleBuildCache(options)) {
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
const manifest = this.loadManifest();
|
|
36
|
+
if (manifest.invalidationVersion !== this.dependencies.getCorePackageVersion()) {
|
|
37
|
+
return void 0;
|
|
38
|
+
}
|
|
39
|
+
const buildKey = createPersistedRouteModuleBuildKey(options);
|
|
40
|
+
const cacheFilePath = normalizeRouteModuleCachePath(options.filePath);
|
|
41
|
+
const entry = manifest.entries[cacheFilePath];
|
|
42
|
+
if (!entry || entry.sourceHash !== options.fileHash || entry.buildKey !== buildKey) {
|
|
43
|
+
return void 0;
|
|
44
|
+
}
|
|
45
|
+
if (!this.dependencyHasher.matchesStoredHashes(entry.dependencyHashes, cacheFilePath, options.fileHash)) {
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
const outputPath = path.isAbsolute(entry.outputPath) ? entry.outputPath : path.join(options.outdir, entry.outputPath);
|
|
49
|
+
if (!this.dependencies.exists(outputPath)) {
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
return { outputPath, entry };
|
|
53
|
+
}
|
|
54
|
+
recordBuild(options) {
|
|
55
|
+
if (!shouldPersistRouteModuleBuildCache(options)) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const cacheFilePath = normalizeRouteModuleCachePath(options.filePath);
|
|
59
|
+
const dependencyModulePaths = options.dependencyModulePaths && options.dependencyModulePaths.length > 0 ? options.dependencyModulePaths : [cacheFilePath];
|
|
60
|
+
const dependencyHashes = this.dependencyHasher.createDependencyHashes(dependencyModulePaths);
|
|
61
|
+
dependencyHashes[cacheFilePath] = options.fileHash;
|
|
62
|
+
const manifest = this.loadManifest();
|
|
63
|
+
const existingEntry = manifest.entries[cacheFilePath];
|
|
64
|
+
manifest.invalidationVersion = this.dependencies.getCorePackageVersion();
|
|
65
|
+
manifest.entries[cacheFilePath] = {
|
|
66
|
+
sourceHash: options.fileHash,
|
|
67
|
+
outputPath: options.outputPath,
|
|
68
|
+
builtAt: Date.now(),
|
|
69
|
+
buildKey: createPersistedRouteModuleBuildKey(options),
|
|
70
|
+
dependencyHashes,
|
|
71
|
+
renderedOutputs: existingEntry?.renderedOutputs
|
|
72
|
+
};
|
|
73
|
+
this.persistManifest(manifest);
|
|
74
|
+
}
|
|
75
|
+
isIncrementalStaticGenerationAvailable(context) {
|
|
76
|
+
if (process.env.NODE_ENV !== "production") {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
const manifest = this.loadManifest();
|
|
80
|
+
if (manifest.invalidationVersion !== this.dependencies.getCorePackageVersion()) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
return manifest.configHash === context.configHash && manifest.buildInputsFingerprint === context.buildInputsFingerprint;
|
|
84
|
+
}
|
|
85
|
+
ensureIncrementalStaticGenerationContext(context) {
|
|
86
|
+
if (process.env.NODE_ENV !== "production") {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const manifest = this.loadManifest();
|
|
90
|
+
manifest.invalidationVersion = this.dependencies.getCorePackageVersion();
|
|
91
|
+
manifest.configHash = context.configHash;
|
|
92
|
+
manifest.buildInputsFingerprint = context.buildInputsFingerprint;
|
|
93
|
+
this.persistManifest(manifest);
|
|
94
|
+
}
|
|
95
|
+
canReuseStaticRender(options) {
|
|
96
|
+
if (options.force) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (!fileSystem.exists(options.sourceFile)) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
const sourceHash = fileSystem.hash(options.sourceFile);
|
|
103
|
+
return this.lookupStaticRender({
|
|
104
|
+
filePath: options.sourceFile,
|
|
105
|
+
pathname: options.pathname,
|
|
106
|
+
sourceHash,
|
|
107
|
+
renderedOutputPath: options.renderedOutputPath,
|
|
108
|
+
context: options.context
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
lookupStaticRender(options) {
|
|
112
|
+
if (!this.isIncrementalStaticGenerationAvailable(options.context)) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
const manifest = this.loadManifest();
|
|
116
|
+
const cacheFilePath = normalizeRouteModuleCachePath(options.filePath);
|
|
117
|
+
const entry = manifest.entries[cacheFilePath];
|
|
118
|
+
const renderedOutput = entry?.renderedOutputs?.[options.pathname];
|
|
119
|
+
if (!entry || !renderedOutput) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if (entry.sourceHash !== options.sourceHash || renderedOutput.sourceHash !== options.sourceHash) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
if (!this.dependencyHasher.matchesStoredHashes(entry.dependencyHashes, cacheFilePath, options.sourceHash)) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
const cachedOutputPath = path.isAbsolute(renderedOutput.renderedOutputPath) ? renderedOutput.renderedOutputPath : path.resolve(renderedOutput.renderedOutputPath);
|
|
129
|
+
if (cachedOutputPath !== path.resolve(options.renderedOutputPath)) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
return this.dependencies.exists(cachedOutputPath);
|
|
133
|
+
}
|
|
134
|
+
recordStaticRender(options) {
|
|
135
|
+
if (process.env.NODE_ENV !== "production") {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const cacheFilePath = normalizeRouteModuleCachePath(options.filePath);
|
|
139
|
+
const manifest = this.loadManifest();
|
|
140
|
+
const existingEntry = manifest.entries[cacheFilePath];
|
|
141
|
+
manifest.invalidationVersion = this.dependencies.getCorePackageVersion();
|
|
142
|
+
manifest.configHash = options.context.configHash;
|
|
143
|
+
manifest.buildInputsFingerprint = options.context.buildInputsFingerprint;
|
|
144
|
+
manifest.entries[cacheFilePath] = {
|
|
145
|
+
sourceHash: options.sourceHash,
|
|
146
|
+
outputPath: existingEntry?.outputPath ?? "",
|
|
147
|
+
builtAt: existingEntry?.builtAt ?? Date.now(),
|
|
148
|
+
buildKey: existingEntry?.buildKey ?? "",
|
|
149
|
+
dependencyHashes: existingEntry?.dependencyHashes,
|
|
150
|
+
renderedOutputs: {
|
|
151
|
+
...existingEntry?.renderedOutputs ?? {},
|
|
152
|
+
[options.pathname]: {
|
|
153
|
+
renderedOutputPath: options.renderedOutputPath,
|
|
154
|
+
renderedAt: Date.now(),
|
|
155
|
+
sourceHash: options.sourceHash
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
this.persistManifest(manifest);
|
|
160
|
+
}
|
|
161
|
+
resetMemory() {
|
|
162
|
+
this.manifest = void 0;
|
|
163
|
+
this.manifestLoaded = false;
|
|
164
|
+
}
|
|
165
|
+
pruneStaleRenderedOutputs(activePathnames) {
|
|
166
|
+
if (process.env.NODE_ENV !== "production") {
|
|
167
|
+
return [];
|
|
168
|
+
}
|
|
169
|
+
const manifest = this.loadManifest();
|
|
170
|
+
const removedOutputPaths = [];
|
|
171
|
+
for (const entry of Object.values(manifest.entries)) {
|
|
172
|
+
if (!entry.renderedOutputs) {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
for (const [pathname, renderedOutput] of Object.entries(entry.renderedOutputs)) {
|
|
176
|
+
if (activePathnames.has(pathname)) {
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
removedOutputPaths.push(renderedOutput.renderedOutputPath);
|
|
180
|
+
delete entry.renderedOutputs[pathname];
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (removedOutputPaths.length > 0) {
|
|
184
|
+
this.persistManifest(manifest);
|
|
185
|
+
}
|
|
186
|
+
return removedOutputPaths;
|
|
187
|
+
}
|
|
188
|
+
loadManifest() {
|
|
189
|
+
if (this.manifestLoaded) {
|
|
190
|
+
return this.manifest ?? createEmptyRouteModuleBuildCacheManifest();
|
|
191
|
+
}
|
|
192
|
+
this.manifestLoaded = true;
|
|
193
|
+
this.manifest = this.dependencies.readManifest(this.manifestPath) ?? createEmptyRouteModuleBuildCacheManifest();
|
|
194
|
+
return this.manifest;
|
|
195
|
+
}
|
|
196
|
+
persistManifest(manifest) {
|
|
197
|
+
this.manifest = manifest;
|
|
198
|
+
this.dependencies.writeManifest(this.manifestPath, manifest);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
export {
|
|
202
|
+
RouteModuleBuildCache
|
|
203
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { EcoBuildPlugin } from '../../build/build-types.js';
|
|
2
|
+
import type { PageModuleBuildImportOptions } from './page-module-import.service.js';
|
|
3
|
+
import type { RouteModuleDependencyHashes } from './route-module-dependency-hasher.js';
|
|
4
|
+
/** Filename written beside transpiled server modules that stores incremental build metadata. */
|
|
5
|
+
export declare const ROUTE_MODULE_BUILD_CACHE_FILENAME = ".build-cache.json";
|
|
6
|
+
/** One persisted route-module build entry in {@link ROUTE_MODULE_BUILD_CACHE_FILENAME}. */
|
|
7
|
+
export interface RouteModuleBuildCacheEntry {
|
|
8
|
+
sourceHash: string;
|
|
9
|
+
outputPath: string;
|
|
10
|
+
builtAt: number;
|
|
11
|
+
buildKey: string;
|
|
12
|
+
dependencyHashes?: RouteModuleDependencyHashes;
|
|
13
|
+
renderedOutputs?: Record<string, RouteModuleStaticRenderCacheEntry>;
|
|
14
|
+
}
|
|
15
|
+
/** Metadata for one rendered static HTML artifact derived from a route module. */
|
|
16
|
+
export interface RouteModuleStaticRenderCacheEntry {
|
|
17
|
+
renderedOutputPath: string;
|
|
18
|
+
renderedAt: number;
|
|
19
|
+
sourceHash: string;
|
|
20
|
+
}
|
|
21
|
+
/** On-disk manifest describing all cached route-module builds for one server outdir. */
|
|
22
|
+
export interface RouteModuleBuildCacheManifest {
|
|
23
|
+
invalidationVersion: string;
|
|
24
|
+
configHash?: string;
|
|
25
|
+
buildInputsFingerprint?: string;
|
|
26
|
+
entries: Record<string, RouteModuleBuildCacheEntry>;
|
|
27
|
+
}
|
|
28
|
+
/** Successful route-module cache lookup result. */
|
|
29
|
+
export interface RouteModuleBuildCacheLookup {
|
|
30
|
+
outputPath: string;
|
|
31
|
+
entry: RouteModuleBuildCacheEntry;
|
|
32
|
+
}
|
|
33
|
+
/** Inputs that must remain stable for incremental static HTML generation. */
|
|
34
|
+
export interface RouteModuleStaticRenderCacheContext {
|
|
35
|
+
configHash: string;
|
|
36
|
+
buildInputsFingerprint: string;
|
|
37
|
+
}
|
|
38
|
+
export type RouteModuleBuildCacheManifestReader = (manifestPath: string) => RouteModuleBuildCacheManifest | undefined;
|
|
39
|
+
export type RouteModuleBuildCacheManifestWriter = (manifestPath: string, manifest: RouteModuleBuildCacheManifest) => void;
|
|
40
|
+
/** Returns the installed `@ecopages/core` package version used to invalidate persisted caches. */
|
|
41
|
+
export declare function getCorePackageVersion(): string;
|
|
42
|
+
/** Normalizes filesystem paths used as manifest keys and build-key inputs. */
|
|
43
|
+
export declare function normalizeRouteModuleCachePath(filePath: string): string;
|
|
44
|
+
/** Returns whether route-module disk caching should run for the current import. */
|
|
45
|
+
export declare function shouldPersistRouteModuleBuildCache(options: PageModuleBuildImportOptions): boolean;
|
|
46
|
+
/** Derives the deterministic on-disk filename for one transpiled route module. */
|
|
47
|
+
export declare function resolvePageModuleOutputFileName(options: {
|
|
48
|
+
filePath: string;
|
|
49
|
+
fileHash: string;
|
|
50
|
+
cacheScope?: string;
|
|
51
|
+
invalidationVersion?: number;
|
|
52
|
+
}): string;
|
|
53
|
+
/** Builds the cache key for persisted production route-module builds. */
|
|
54
|
+
export declare function createPersistedRouteModuleBuildKey(options: PageModuleBuildImportOptions): string;
|
|
55
|
+
export declare function createEmptyRouteModuleBuildCacheManifest(): RouteModuleBuildCacheManifest;
|
|
56
|
+
export declare function readRouteModuleBuildCacheManifest(manifestPath: string): RouteModuleBuildCacheManifest | undefined;
|
|
57
|
+
export declare function writeRouteModuleBuildCacheManifest(manifestPath: string, manifest: RouteModuleBuildCacheManifest): void;
|
|
58
|
+
export declare function createJsxCacheKey(jsx: PageModuleBuildImportOptions['jsx']): string;
|
|
59
|
+
export declare function createPluginCacheKey(plugins?: EcoBuildPlugin[]): string;
|
|
60
|
+
/** Exported for in-process import caches that must match persisted build keys. */
|
|
61
|
+
export declare function hashPluginSetup(setup: EcoBuildPlugin['setup']): string;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileSystem } from "@ecopages/file-system";
|
|
4
|
+
const ROUTE_MODULE_BUILD_CACHE_FILENAME = ".build-cache.json";
|
|
5
|
+
let cachedCorePackageVersion;
|
|
6
|
+
function getCorePackageVersion() {
|
|
7
|
+
if (cachedCorePackageVersion) {
|
|
8
|
+
return cachedCorePackageVersion;
|
|
9
|
+
}
|
|
10
|
+
const packageJsonPath = new URL("../../../package.json", import.meta.url);
|
|
11
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
12
|
+
cachedCorePackageVersion = packageJson.version ?? "0.0.0";
|
|
13
|
+
return cachedCorePackageVersion;
|
|
14
|
+
}
|
|
15
|
+
function normalizeRouteModuleCachePath(filePath) {
|
|
16
|
+
return path.resolve(filePath);
|
|
17
|
+
}
|
|
18
|
+
function shouldPersistRouteModuleBuildCache(options) {
|
|
19
|
+
if (process.env.NODE_ENV !== "production") {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (options.bypassCache) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if ((options.invalidationVersion ?? 0) > 0) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (options.cacheScope) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
function resolvePageModuleOutputFileName(options) {
|
|
34
|
+
const fileBaseName = path.basename(options.filePath, path.extname(options.filePath));
|
|
35
|
+
const cacheScopeSuffix = options.cacheScope ? `-${sanitizeCacheScope(options.cacheScope)}` : "";
|
|
36
|
+
const invalidationSuffix = shouldVersionBuildOutputPath(options.invalidationVersion ?? 0) ? `-v${options.invalidationVersion}` : "";
|
|
37
|
+
return `${fileBaseName}-${options.fileHash}${cacheScopeSuffix}${invalidationSuffix}.mjs`;
|
|
38
|
+
}
|
|
39
|
+
function createPersistedRouteModuleBuildKey(options) {
|
|
40
|
+
return [
|
|
41
|
+
path.resolve(options.rootDir),
|
|
42
|
+
path.resolve(options.outdir),
|
|
43
|
+
options.splitting ?? "default",
|
|
44
|
+
options.externalPackages ?? "default",
|
|
45
|
+
createJsxCacheKey(options.jsx),
|
|
46
|
+
createPluginCacheKey(options.plugins)
|
|
47
|
+
].join("::");
|
|
48
|
+
}
|
|
49
|
+
function createEmptyRouteModuleBuildCacheManifest() {
|
|
50
|
+
return {
|
|
51
|
+
invalidationVersion: getCorePackageVersion(),
|
|
52
|
+
entries: {}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function readRouteModuleBuildCacheManifest(manifestPath) {
|
|
56
|
+
if (!fileSystem.exists(manifestPath)) {
|
|
57
|
+
return void 0;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const parsed = JSON.parse(fileSystem.readFileSync(manifestPath));
|
|
61
|
+
if (!parsed || typeof parsed !== "object" || typeof parsed.entries !== "object") {
|
|
62
|
+
return void 0;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
invalidationVersion: parsed.invalidationVersion ?? "",
|
|
66
|
+
configHash: parsed.configHash,
|
|
67
|
+
buildInputsFingerprint: parsed.buildInputsFingerprint,
|
|
68
|
+
entries: parsed.entries
|
|
69
|
+
};
|
|
70
|
+
} catch {
|
|
71
|
+
return void 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function writeRouteModuleBuildCacheManifest(manifestPath, manifest) {
|
|
75
|
+
fileSystem.write(manifestPath, `${JSON.stringify(manifest, null, " ")}
|
|
76
|
+
`);
|
|
77
|
+
}
|
|
78
|
+
function shouldVersionBuildOutputPath(invalidationVersion) {
|
|
79
|
+
return typeof Bun !== "undefined" && invalidationVersion > 0;
|
|
80
|
+
}
|
|
81
|
+
function sanitizeCacheScope(cacheScope) {
|
|
82
|
+
return cacheScope.replace(/[^a-zA-Z0-9_-]+/g, "-");
|
|
83
|
+
}
|
|
84
|
+
function createJsxCacheKey(jsx) {
|
|
85
|
+
if (!jsx) {
|
|
86
|
+
return "jsx:default";
|
|
87
|
+
}
|
|
88
|
+
return JSON.stringify({
|
|
89
|
+
development: jsx.development ?? false,
|
|
90
|
+
factory: jsx.factory ?? null,
|
|
91
|
+
fragment: jsx.fragment ?? null,
|
|
92
|
+
importSource: jsx.importSource ?? null,
|
|
93
|
+
runtime: jsx.runtime ?? null,
|
|
94
|
+
sideEffects: jsx.sideEffects ?? null
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function createPluginCacheKey(plugins) {
|
|
98
|
+
if (!plugins || plugins.length === 0) {
|
|
99
|
+
return "plugins:default";
|
|
100
|
+
}
|
|
101
|
+
return `plugins:${plugins.map((plugin) => `${plugin.name}:${hashPluginSetup(plugin.setup)}`).join(",")}`;
|
|
102
|
+
}
|
|
103
|
+
function hashPluginSetup(setup) {
|
|
104
|
+
let hash = 0;
|
|
105
|
+
const source = setup.toString();
|
|
106
|
+
for (let index = 0; index < source.length; index += 1) {
|
|
107
|
+
hash = hash * 31 + source.charCodeAt(index) | 0;
|
|
108
|
+
}
|
|
109
|
+
return (hash >>> 0).toString(36);
|
|
110
|
+
}
|
|
111
|
+
export {
|
|
112
|
+
ROUTE_MODULE_BUILD_CACHE_FILENAME,
|
|
113
|
+
createEmptyRouteModuleBuildCacheManifest,
|
|
114
|
+
createJsxCacheKey,
|
|
115
|
+
createPersistedRouteModuleBuildKey,
|
|
116
|
+
createPluginCacheKey,
|
|
117
|
+
getCorePackageVersion,
|
|
118
|
+
hashPluginSetup,
|
|
119
|
+
normalizeRouteModuleCachePath,
|
|
120
|
+
readRouteModuleBuildCacheManifest,
|
|
121
|
+
resolvePageModuleOutputFileName,
|
|
122
|
+
shouldPersistRouteModuleBuildCache,
|
|
123
|
+
writeRouteModuleBuildCacheManifest
|
|
124
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { BuildResult } from '../../build/build-adapter.js';
|
|
2
|
+
/**
|
|
3
|
+
* Content hashes for every trackable source file in one route module's import graph.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Keys are normalized absolute filesystem paths. Values are opaque content hashes
|
|
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}.
|
|
10
|
+
*/
|
|
11
|
+
export type RouteModuleDependencyHashes = Record<string, string>;
|
|
12
|
+
type HashFileFn = (filePath: string) => string;
|
|
13
|
+
type ExistsFn = (filePath: string) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Lazily hashes route-module dependency files while memoizing results for one build run.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Multiple route modules often share layouts or utilities. Memoizing per path avoids
|
|
19
|
+
* re-reading the same dependency file while validating or recording many cache entries
|
|
20
|
+
* during one production build.
|
|
21
|
+
*/
|
|
22
|
+
export declare class RouteModuleDependencyHasher {
|
|
23
|
+
private readonly memo;
|
|
24
|
+
private readonly hashFile;
|
|
25
|
+
private readonly exists;
|
|
26
|
+
constructor(dependencies?: {
|
|
27
|
+
hashFile?: HashFileFn;
|
|
28
|
+
exists?: ExistsFn;
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Returns a memoized content hash for one trackable dependency path.
|
|
32
|
+
*
|
|
33
|
+
* @param filePath - Absolute or project-relative source path.
|
|
34
|
+
* @returns The content hash, or `undefined` when the path is not trackable or missing.
|
|
35
|
+
*/
|
|
36
|
+
hashDependency(filePath: string): string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Builds the dependency-hash map for one route entrypoint graph.
|
|
39
|
+
*
|
|
40
|
+
* @param modulePaths - Raw module ids from the bundler dependency graph.
|
|
41
|
+
* @returns Hashes for every trackable, existing source file in the graph.
|
|
42
|
+
*/
|
|
43
|
+
createDependencyHashes(modulePaths: readonly string[]): RouteModuleDependencyHashes;
|
|
44
|
+
/**
|
|
45
|
+
* Returns whether every stored dependency hash still matches the current file contents.
|
|
46
|
+
*
|
|
47
|
+
* @param storedHashes - Dependency hashes previously persisted for one route module.
|
|
48
|
+
* @param entrypointPath - Route entry file whose hash is validated separately.
|
|
49
|
+
* @param entrypointSourceHash - Already-validated content hash for {@link entrypointPath}.
|
|
50
|
+
* @returns `true` when all stored hashes are present and still valid.
|
|
51
|
+
*/
|
|
52
|
+
matchesStoredHashes(storedHashes: RouteModuleDependencyHashes | undefined, entrypointPath?: string, entrypointSourceHash?: string): boolean;
|
|
53
|
+
/** Clears the per-build memo. Intended for unit tests only. */
|
|
54
|
+
clearMemoForTests(): void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Returns whether a bundler module id should participate in route-module cache invalidation.
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* Builtins and installed packages are excluded. Their changes are expected to be
|
|
61
|
+
* reflected through framework-level invalidation instead of per-route file hashing.
|
|
62
|
+
*/
|
|
63
|
+
export declare function isTrackableRouteModuleDependency(modulePath: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Filters a bundler module list down to trackable app-owned source files.
|
|
66
|
+
*/
|
|
67
|
+
export declare function filterTrackableRouteModuleDependencies(modulePaths: readonly string[]): string[];
|
|
68
|
+
/**
|
|
69
|
+
* Resolves the dependency module list for one route entrypoint from a build result.
|
|
70
|
+
*
|
|
71
|
+
* @param buildResult - Completed route-module build output.
|
|
72
|
+
* @param entrypointPath - Absolute or root-relative route source path used as the build entry.
|
|
73
|
+
* @param rootDir - Project root used to normalize relative module ids.
|
|
74
|
+
* @returns Normalized module paths, falling back to the entrypoint when no graph is available.
|
|
75
|
+
*/
|
|
76
|
+
export declare function resolveRouteModuleDependencyPaths(buildResult: Pick<BuildResult, 'dependencyGraph'>, entrypointPath: string, rootDir: string): string[];
|
|
77
|
+
/**
|
|
78
|
+
* Convenience helper that combines graph extraction and dependency hashing.
|
|
79
|
+
*/
|
|
80
|
+
export declare function createRouteModuleDependencyHashes(hasher: RouteModuleDependencyHasher, buildResult: Pick<BuildResult, 'dependencyGraph'>, entrypointPath: string, rootDir: string): RouteModuleDependencyHashes;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileSystem } from "@ecopages/file-system";
|
|
3
|
+
class RouteModuleDependencyHasher {
|
|
4
|
+
memo = /* @__PURE__ */ new Map();
|
|
5
|
+
hashFile;
|
|
6
|
+
exists;
|
|
7
|
+
constructor(dependencies) {
|
|
8
|
+
this.hashFile = dependencies?.hashFile ?? ((filePath) => fileSystem.hash(filePath));
|
|
9
|
+
this.exists = dependencies?.exists ?? ((filePath) => fileSystem.exists(filePath));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns a memoized content hash for one trackable dependency path.
|
|
13
|
+
*
|
|
14
|
+
* @param filePath - Absolute or project-relative source path.
|
|
15
|
+
* @returns The content hash, or `undefined` when the path is not trackable or missing.
|
|
16
|
+
*/
|
|
17
|
+
hashDependency(filePath) {
|
|
18
|
+
const normalizedPath = path.normalize(filePath);
|
|
19
|
+
if (!isTrackableRouteModuleDependency(normalizedPath)) {
|
|
20
|
+
return void 0;
|
|
21
|
+
}
|
|
22
|
+
if (!this.exists(normalizedPath)) {
|
|
23
|
+
return void 0;
|
|
24
|
+
}
|
|
25
|
+
const cachedHash = this.memo.get(normalizedPath);
|
|
26
|
+
if (cachedHash) {
|
|
27
|
+
return cachedHash;
|
|
28
|
+
}
|
|
29
|
+
const nextHash = this.hashFile(normalizedPath);
|
|
30
|
+
this.memo.set(normalizedPath, nextHash);
|
|
31
|
+
return nextHash;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Builds the dependency-hash map for one route entrypoint graph.
|
|
35
|
+
*
|
|
36
|
+
* @param modulePaths - Raw module ids from the bundler dependency graph.
|
|
37
|
+
* @returns Hashes for every trackable, existing source file in the graph.
|
|
38
|
+
*/
|
|
39
|
+
createDependencyHashes(modulePaths) {
|
|
40
|
+
const dependencyHashes = {};
|
|
41
|
+
for (const modulePath of filterTrackableRouteModuleDependencies(modulePaths)) {
|
|
42
|
+
const dependencyHash = this.hashDependency(modulePath);
|
|
43
|
+
if (dependencyHash) {
|
|
44
|
+
dependencyHashes[modulePath] = dependencyHash;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return dependencyHashes;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns whether every stored dependency hash still matches the current file contents.
|
|
51
|
+
*
|
|
52
|
+
* @param storedHashes - Dependency hashes previously persisted for one route module.
|
|
53
|
+
* @param entrypointPath - Route entry file whose hash is validated separately.
|
|
54
|
+
* @param entrypointSourceHash - Already-validated content hash for {@link entrypointPath}.
|
|
55
|
+
* @returns `true` when all stored hashes are present and still valid.
|
|
56
|
+
*/
|
|
57
|
+
matchesStoredHashes(storedHashes, entrypointPath, entrypointSourceHash) {
|
|
58
|
+
if (!storedHashes || Object.keys(storedHashes).length === 0) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
const normalizedEntrypoint = entrypointPath ? path.normalize(entrypointPath) : void 0;
|
|
62
|
+
for (const [dependencyPath, storedHash] of Object.entries(storedHashes)) {
|
|
63
|
+
if (normalizedEntrypoint && path.normalize(dependencyPath) === normalizedEntrypoint) {
|
|
64
|
+
if (entrypointSourceHash && storedHash !== entrypointSourceHash) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const currentHash = this.hashDependency(dependencyPath);
|
|
70
|
+
if (!currentHash || currentHash !== storedHash) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
/** Clears the per-build memo. Intended for unit tests only. */
|
|
77
|
+
clearMemoForTests() {
|
|
78
|
+
this.memo.clear();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function isTrackableRouteModuleDependency(modulePath) {
|
|
82
|
+
const normalizedPath = path.normalize(modulePath);
|
|
83
|
+
if (normalizedPath.startsWith("node:")) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (normalizedPath.includes(`${path.sep}node_modules${path.sep}`)) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
return /\.(?:[cm]?[jt]sx?|mdx)$/iu.test(normalizedPath) || normalizedPath.endsWith(".json");
|
|
90
|
+
}
|
|
91
|
+
function filterTrackableRouteModuleDependencies(modulePaths) {
|
|
92
|
+
const uniquePaths = /* @__PURE__ */ new Set();
|
|
93
|
+
for (const modulePath of modulePaths) {
|
|
94
|
+
const normalizedPath = path.normalize(modulePath);
|
|
95
|
+
if (isTrackableRouteModuleDependency(normalizedPath)) {
|
|
96
|
+
uniquePaths.add(normalizedPath);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return Array.from(uniquePaths).sort();
|
|
100
|
+
}
|
|
101
|
+
function resolveRouteModuleDependencyPaths(buildResult, entrypointPath, rootDir) {
|
|
102
|
+
const normalizedEntrypoint = path.isAbsolute(entrypointPath) ? path.normalize(entrypointPath) : path.normalize(path.resolve(rootDir, entrypointPath));
|
|
103
|
+
const graphEntrypoints = buildResult.dependencyGraph?.entrypoints ?? {};
|
|
104
|
+
const dependencyPaths = graphEntrypoints[normalizedEntrypoint] ?? graphEntrypoints[entrypointPath] ?? Object.entries(graphEntrypoints).find(([candidate]) => path.normalize(candidate) === normalizedEntrypoint)?.[1];
|
|
105
|
+
if (!dependencyPaths || dependencyPaths.length === 0) {
|
|
106
|
+
return [normalizedEntrypoint];
|
|
107
|
+
}
|
|
108
|
+
return dependencyPaths.map(
|
|
109
|
+
(dependencyPath) => path.isAbsolute(dependencyPath) ? path.normalize(dependencyPath) : path.normalize(path.resolve(rootDir, dependencyPath))
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
function createRouteModuleDependencyHashes(hasher, buildResult, entrypointPath, rootDir) {
|
|
113
|
+
return hasher.createDependencyHashes(resolveRouteModuleDependencyPaths(buildResult, entrypointPath, rootDir));
|
|
114
|
+
}
|
|
115
|
+
export {
|
|
116
|
+
RouteModuleDependencyHasher,
|
|
117
|
+
createRouteModuleDependencyHashes,
|
|
118
|
+
filterTrackableRouteModuleDependencies,
|
|
119
|
+
isTrackableRouteModuleDependency,
|
|
120
|
+
resolveRouteModuleDependencyPaths
|
|
121
|
+
};
|
|
@@ -11,7 +11,7 @@ class ServerModuleTranspiler {
|
|
|
11
11
|
* context.
|
|
12
12
|
*/
|
|
13
13
|
constructor(args) {
|
|
14
|
-
this.pageModuleImportService = args.pageModuleImportService ?? new PageModuleImportService({
|
|
14
|
+
this.pageModuleImportService = args.pageModuleImportService ?? new PageModuleImportService(void 0, {
|
|
15
15
|
canLoadSourceModuleFromHost: args.canLoadSourceModuleFromHost,
|
|
16
16
|
getHostModuleLoader: args.getHostModuleLoader
|
|
17
17
|
});
|
|
@@ -24,3 +24,36 @@ That means it should reuse:
|
|
|
24
24
|
- asset processing
|
|
25
25
|
|
|
26
26
|
It should not invent a parallel rendering stack just for build mode.
|
|
27
|
+
|
|
28
|
+
## Files
|
|
29
|
+
|
|
30
|
+
| File | Role |
|
|
31
|
+
| ------------------------------ | ---------------------------------------------------------------------------- |
|
|
32
|
+
| `static-site-generator.ts` | Route enumeration, HTML artifact writes, integration export hooks |
|
|
33
|
+
| `static-export-context.ts` | Hook context type for `beforeStaticExport` / `afterStaticExport` |
|
|
34
|
+
| `static-build-invalidation.ts` | `dist/` reset policy, production cache clearing, static-render cache context |
|
|
35
|
+
|
|
36
|
+
Build-input fingerprinting (`hashAppConfigFile`, `createBuildInputsFingerprint`) lives in `packages/core/src/build/build-input-fingerprint.ts` and is shared with server-entry and unified-graph caches.
|
|
37
|
+
|
|
38
|
+
## Incremental static export
|
|
39
|
+
|
|
40
|
+
`ServerStaticBuilder.prepareExportDirectory()` decides whether to wipe `dist/`:
|
|
41
|
+
|
|
42
|
+
1. `force: true` → always reset
|
|
43
|
+
2. Any processor/integration reports `didChange()` → reset
|
|
44
|
+
3. Route-module manifest lacks matching `configHash` + `buildInputsFingerprint` → reset
|
|
45
|
+
|
|
46
|
+
When `dist/` is preserved (`preserveExportDirectory: true`), `StaticSiteGenerator.run()` prunes HTML files no longer in the active route set.
|
|
47
|
+
|
|
48
|
+
Rendered HTML reuse is tracked in `.eco/.server-modules/.build-cache.json` under each route module's `renderedOutputs`. `canReuseStaticRender()` skips re-rendering when the source file, dependency hashes, and output path are unchanged.
|
|
49
|
+
|
|
50
|
+
`clearProductionBuildCaches()` runs on `force` builds and removes all persisted `.eco` build manifests (route modules, server entry, unified pages graph).
|
|
51
|
+
|
|
52
|
+
## Integration hooks
|
|
53
|
+
|
|
54
|
+
Integrations may implement:
|
|
55
|
+
|
|
56
|
+
- `beforeStaticExport(context)` — runs after unified-graph prebuild, before page rendering
|
|
57
|
+
- `afterStaticExport(context)` — runs in a `finally` block after generation completes
|
|
58
|
+
|
|
59
|
+
See `StaticExportContext` in `static-export-context.ts`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EcoPagesAppConfig } from '../types/internal-types.js';
|
|
2
|
+
import { type RouteModuleStaticRenderCacheContext } from '../services/module-loading/route-module-build-manifest.js';
|
|
3
|
+
export type { BuildInputChangeContributor, IntegrationPlugin, Processor } from '../build/build-input-fingerprint.js';
|
|
4
|
+
export { collectBuildInputContributors, createBuildInputsFingerprint, didBuildInputContributorChange, hashAppConfigFile, haveBuildInputsChanged, } from '../build/build-input-fingerprint.js';
|
|
5
|
+
/** Builds the static-render invalidation context for one app config. */
|
|
6
|
+
export declare function createRouteModuleStaticRenderCacheContext(appConfig: EcoPagesAppConfig): RouteModuleStaticRenderCacheContext;
|
|
7
|
+
/** Returns whether `dist/` should be wiped before the next static export. */
|
|
8
|
+
export declare function shouldResetStaticExportDirectory(appConfig: EcoPagesAppConfig, force?: boolean): boolean;
|
|
9
|
+
/** Removes persisted production build caches so the next build recomputes everything. */
|
|
10
|
+
export declare function clearProductionBuildCaches(appConfig: EcoPagesAppConfig): void;
|