@stati/core 1.24.2 → 1.24.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/core/build.ts"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAEV,UAAU,EACV,MAAM,EASP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,iDAAiD;IACjD,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,uCAAuC;IACvC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,iCAAiC;IACjC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACrC,uEAAuE;IACvE,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,sGAAsG;IACtG,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,mFAAmF;IACnF,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACrC;AAED;;GA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AgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,mFAAmF;IACnF,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,wDAAwD;IACxD,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAkGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAsB5E"}
@@ -6,7 +6,7 @@ import { loadContent } from './content.js';
6
6
  import { createMarkdownProcessor, renderMarkdown, extractToc } from './markdown.js';
7
7
  import { createTemplateEngine, renderPage } from './templates.js';
8
8
  import { buildNavigation } from './navigation.js';
9
- import { loadCacheManifest, saveCacheManifest, shouldRebuildPage, createCacheEntry, updateCacheEntry, withBuildLock, computeNavigationHash, clearFileHashCache, clearTemplatePathCache, } from './isg/index.js';
9
+ import { loadCacheManifest, saveCacheManifest, shouldRebuildPage, createCacheEntry, updateCacheEntry, withBuildLock, computeNavigationHash, computeContentHash, clearFileHashCache, clearTemplatePathCache, } from './isg/index.js';
10
10
  import { generateSitemap, generateRobotsTxtFromConfig, autoInjectSEO, } from '../seo/index.js';
11
11
  import { generateRSSFeeds, validateRSSConfig } from '../rss/index.js';
12
12
  import { computeSearchIndexFilename, generateSearchIndex, writeSearchIndex, autoInjectSearchMeta, } from '../search/index.js';
@@ -255,9 +255,25 @@ async function processPagesWithCache(pages, manifest, config, outDir, md, eta, n
255
255
  const relativePath = relative(outDir, outputPath).replace(/\\/g, '/');
256
256
  const cacheKey = relativePath.startsWith('/') ? relativePath : `/${relativePath}`;
257
257
  const existingEntry = manifest.entries[cacheKey];
258
+ const bundlePaths = getBundlePathsForPage(page.url, compiledBundles);
259
+ const assets = {
260
+ bundlePaths,
261
+ ...(config.search?.enabled === true &&
262
+ searchIndexFilename && {
263
+ searchIndexPath: `/${searchIndexFilename}`,
264
+ }),
265
+ };
266
+ const renderInputsHash = computeContentHash('', {
267
+ ...assets,
268
+ bundleAutoInject: config.typescript?.autoInject !== false,
269
+ searchAutoInject: config.search?.autoInjectMetaTag !== false,
270
+ });
258
271
  // Check if we should rebuild this page (considering ISG logic)
259
272
  const shouldRebuildStart = performance.now();
260
- const shouldRebuild = options.force || (await shouldRebuildPage(page, existingEntry, config, buildTime));
273
+ const shouldRebuild = options.force ||
274
+ config.isg?.enabled === false ||
275
+ !(await pathExists(outputPath)) ||
276
+ (await shouldRebuildPage(page, existingEntry, config, buildTime, renderInputsHash));
261
277
  const shouldRebuildTime = performance.now() - shouldRebuildStart;
262
278
  totalShouldRebuildTime += shouldRebuildTime;
263
279
  if (!shouldRebuild) {
@@ -289,16 +305,6 @@ async function processPagesWithCache(pages, manifest, config, outDir, md, eta, n
289
305
  // Render markdown to HTML with TOC extraction
290
306
  const tocEnabled = config.markdown?.toc !== false;
291
307
  const { html: htmlContent, toc } = renderMarkdown(page.content, md, tocEnabled);
292
- // Compute matched bundle paths for this page
293
- const bundlePaths = getBundlePathsForPage(page.url, compiledBundles);
294
- // Build assets object with bundle paths and search index path
295
- const assets = {
296
- bundlePaths,
297
- ...(config.search?.enabled === true &&
298
- searchIndexFilename && {
299
- searchIndexPath: `/${searchIndexFilename}`,
300
- }),
301
- };
302
308
  // Render with template
303
309
  const renderPageStart = performance.now();
304
310
  const renderResult = await renderPage(page, htmlContent, config, eta, navigation, pages, assets, toc, logger);
@@ -339,7 +345,7 @@ async function processPagesWithCache(pages, manifest, config, outDir, md, eta, n
339
345
  // In dev mode, batch writes for parallel execution to avoid Windows filesystem slowdown
340
346
  if (isDevMode) {
341
347
  pendingWrites.push({ outputPath, content: finalHtml });
342
- pendingCacheUpdates.push({ cacheKey, page, existingEntry });
348
+ pendingCacheUpdates.push({ cacheKey, page, existingEntry, renderInputsHash });
343
349
  }
344
350
  else {
345
351
  // Production mode: write immediately
@@ -351,10 +357,10 @@ async function processPagesWithCache(pages, manifest, config, outDir, md, eta, n
351
357
  if (!options.skipCacheUpdate) {
352
358
  const cacheEntryStart = performance.now();
353
359
  if (existingEntry) {
354
- manifest.entries[cacheKey] = await updateCacheEntry(existingEntry, page, config, buildTime);
360
+ manifest.entries[cacheKey] = await updateCacheEntry(existingEntry, page, config, buildTime, false, renderInputsHash);
355
361
  }
356
362
  else {
357
- manifest.entries[cacheKey] = await createCacheEntry(page, config, buildTime);
363
+ manifest.entries[cacheKey] = await createCacheEntry(page, config, buildTime, renderInputsHash);
358
364
  }
359
365
  totalCacheEntryTime += performance.now() - cacheEntryStart;
360
366
  }
@@ -384,13 +390,14 @@ async function processPagesWithCache(pages, manifest, config, outDir, md, eta, n
384
390
  // This avoids expensive template dependency tracking on each incremental rebuild
385
391
  if (!options.skipCacheUpdate) {
386
392
  const cacheEntryStart = performance.now();
387
- for (const { cacheKey, page, existingEntry } of pendingCacheUpdates) {
393
+ for (const { cacheKey, page, existingEntry, renderInputsHash } of pendingCacheUpdates) {
388
394
  if (existingEntry) {
389
395
  // Fast update: reuse existing deps, just update hashes and timestamp
390
- manifest.entries[cacheKey] = await updateCacheEntry(existingEntry, page, config, buildTime, true);
396
+ manifest.entries[cacheKey] = await updateCacheEntry(existingEntry, page, config, buildTime, true, // fastUpdate = true in dev mode
397
+ renderInputsHash);
391
398
  }
392
399
  else {
393
- manifest.entries[cacheKey] = await createCacheEntry(page, config, buildTime);
400
+ manifest.entries[cacheKey] = await createCacheEntry(page, config, buildTime, renderInputsHash);
394
401
  }
395
402
  }
396
403
  totalCacheEntryTime = performance.now() - cacheEntryStart;
@@ -8,6 +8,7 @@ import type { PageModel, CacheEntry, StatiConfig } from '../../types/index.js';
8
8
  * @param entry - Existing cache entry, or undefined if not cached
9
9
  * @param config - Stati configuration
10
10
  * @param now - Current date/time
11
+ * @param renderInputsHash - Optional hash of asset URLs and injection settings
11
12
  * @returns True if the page should be rebuilt
12
13
  *
13
14
  * @example
@@ -18,13 +19,14 @@ import type { PageModel, CacheEntry, StatiConfig } from '../../types/index.js';
18
19
  * }
19
20
  * ```
20
21
  */
21
- export declare function shouldRebuildPage(page: PageModel, entry: CacheEntry | undefined, config: StatiConfig, now: Date): Promise<boolean>;
22
+ export declare function shouldRebuildPage(page: PageModel, entry: CacheEntry | undefined, config: StatiConfig, now: Date, renderInputsHash?: string): Promise<boolean>;
22
23
  /**
23
24
  * Creates a new cache entry for a page after it has been rendered.
24
25
  *
25
26
  * @param page - The page model
26
27
  * @param config - Stati configuration
27
28
  * @param renderedAt - When the page was rendered
29
+ * @param renderInputsHash - Optional hash of asset URLs and injection settings
28
30
  * @returns New cache entry
29
31
  *
30
32
  * @example
@@ -32,7 +34,7 @@ export declare function shouldRebuildPage(page: PageModel, entry: CacheEntry | u
32
34
  * const entry = await createCacheEntry(page, config, new Date());
33
35
  * ```
34
36
  */
35
- export declare function createCacheEntry(page: PageModel, config: StatiConfig, renderedAt: Date): Promise<CacheEntry>;
37
+ export declare function createCacheEntry(page: PageModel, config: StatiConfig, renderedAt: Date, renderInputsHash?: string): Promise<CacheEntry>;
36
38
  /**
37
39
  * Updates an existing cache entry with new information after rebuilding.
38
40
  * In dev mode, this is optimized to reuse the existing deps array since
@@ -43,6 +45,7 @@ export declare function createCacheEntry(page: PageModel, config: StatiConfig, r
43
45
  * @param config - Stati configuration
44
46
  * @param renderedAt - When the page was rendered
45
47
  * @param fastUpdate - If true, skip expensive dep tracking (dev mode optimization)
48
+ * @param renderInputsHash - Optional hash of asset URLs and injection settings
46
49
  * @returns Updated cache entry
47
50
  *
48
51
  * @example
@@ -50,5 +53,5 @@ export declare function createCacheEntry(page: PageModel, config: StatiConfig, r
50
53
  * const updatedEntry = await updateCacheEntry(existingEntry, page, config, new Date());
51
54
  * ```
52
55
  */
53
- export declare function updateCacheEntry(entry: CacheEntry, page: PageModel, config: StatiConfig, renderedAt: Date, fastUpdate?: boolean): Promise<CacheEntry>;
56
+ export declare function updateCacheEntry(entry: CacheEntry, page: PageModel, config: StatiConfig, renderedAt: Date, fastUpdate?: boolean, renderInputsHash?: string): Promise<CacheEntry>;
54
57
  //# sourceMappingURL=builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../src/core/isg/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAoE/E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,IAAI,GACR,OAAO,CAAC,OAAO,CAAC,CAgKlB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,IAAI,GACf,OAAO,CAAC,UAAU,CAAC,CAqFrB;AAkDD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,IAAI,EAChB,UAAU,UAAQ,GACjB,OAAO,CAAC,UAAU,CAAC,CA4CrB"}
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../src/core/isg/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAoE/E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,IAAI,EACT,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,OAAO,CAAC,CAoKlB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,IAAI,EAChB,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,UAAU,CAAC,CAqFrB;AAkDD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,IAAI,EAChB,UAAU,UAAQ,EAClB,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,UAAU,CAAC,CA4CrB"}
@@ -65,6 +65,7 @@ function isValidCacheEntry(entry) {
65
65
  * @param entry - Existing cache entry, or undefined if not cached
66
66
  * @param config - Stati configuration
67
67
  * @param now - Current date/time
68
+ * @param renderInputsHash - Optional hash of asset URLs and injection settings
68
69
  * @returns True if the page should be rebuilt
69
70
  *
70
71
  * @example
@@ -75,7 +76,10 @@ function isValidCacheEntry(entry) {
75
76
  * }
76
77
  * ```
77
78
  */
78
- export async function shouldRebuildPage(page, entry, config, now) {
79
+ export async function shouldRebuildPage(page, entry, config, now, renderInputsHash) {
80
+ if (config.isg?.enabled === false) {
81
+ return true;
82
+ }
79
83
  // Always rebuild if no cache entry exists
80
84
  if (!entry) {
81
85
  return true;
@@ -127,7 +131,7 @@ export async function shouldRebuildPage(page, entry, config, now) {
127
131
  console.warn(`${dependencyErrors} dependency errors for ${page.url}, forcing rebuild`);
128
132
  return true;
129
133
  }
130
- const currentInputsHash = computeInputsHash(currentContentHash, depsHashes);
134
+ const currentInputsHash = computeInputsHash(currentContentHash, depsHashes, renderInputsHash);
131
135
  // If inputs changed, always rebuild
132
136
  if (currentInputsHash !== entry.inputsHash) {
133
137
  return true;
@@ -207,6 +211,7 @@ export async function shouldRebuildPage(page, entry, config, now) {
207
211
  * @param page - The page model
208
212
  * @param config - Stati configuration
209
213
  * @param renderedAt - When the page was rendered
214
+ * @param renderInputsHash - Optional hash of asset URLs and injection settings
210
215
  * @returns New cache entry
211
216
  *
212
217
  * @example
@@ -214,7 +219,7 @@ export async function shouldRebuildPage(page, entry, config, now) {
214
219
  * const entry = await createCacheEntry(page, config, new Date());
215
220
  * ```
216
221
  */
217
- export async function createCacheEntry(page, config, renderedAt) {
222
+ export async function createCacheEntry(page, config, renderedAt, renderInputsHash) {
218
223
  const timings = {};
219
224
  let start = performance.now();
220
225
  // Validate page-level ISG overrides first
@@ -238,7 +243,7 @@ export async function createCacheEntry(page, config, renderedAt) {
238
243
  }
239
244
  }
240
245
  timings.depsHashes = performance.now() - start;
241
- const inputsHash = computeInputsHash(contentHash, depsHashes);
246
+ const inputsHash = computeInputsHash(contentHash, depsHashes, renderInputsHash);
242
247
  // Extract tags from front matter
243
248
  let tags = [];
244
249
  if (Array.isArray(page.frontMatter.tags)) {
@@ -335,6 +340,7 @@ async function hasTemplateStructureChanged(entry) {
335
340
  * @param config - Stati configuration
336
341
  * @param renderedAt - When the page was rendered
337
342
  * @param fastUpdate - If true, skip expensive dep tracking (dev mode optimization)
343
+ * @param renderInputsHash - Optional hash of asset URLs and injection settings
338
344
  * @returns Updated cache entry
339
345
  *
340
346
  * @example
@@ -342,7 +348,7 @@ async function hasTemplateStructureChanged(entry) {
342
348
  * const updatedEntry = await updateCacheEntry(existingEntry, page, config, new Date());
343
349
  * ```
344
350
  */
345
- export async function updateCacheEntry(entry, page, config, renderedAt, fastUpdate = false) {
351
+ export async function updateCacheEntry(entry, page, config, renderedAt, fastUpdate = false, renderInputsHash) {
346
352
  // In fast update mode (dev), reuse existing deps to avoid expensive tracking
347
353
  if (fastUpdate && entry.deps.length > 0) {
348
354
  // Detect if template structure has changed (new includes/extends added)
@@ -365,7 +371,7 @@ export async function updateCacheEntry(entry, page, config, renderedAt, fastUpda
365
371
  depsHashes.push(depHash);
366
372
  }
367
373
  }
368
- const inputsHash = computeInputsHash(contentHash, depsHashes);
374
+ const inputsHash = computeInputsHash(contentHash, depsHashes, renderInputsHash);
369
375
  return {
370
376
  ...entry,
371
377
  inputsHash,
@@ -374,7 +380,7 @@ export async function updateCacheEntry(entry, page, config, renderedAt, fastUpda
374
380
  }
375
381
  }
376
382
  // Full update - create new entry and preserve original publishedAt
377
- const newEntry = await createCacheEntry(page, config, renderedAt);
383
+ const newEntry = await createCacheEntry(page, config, renderedAt, renderInputsHash);
378
384
  // Preserve original publishedAt if no new one is specified
379
385
  if (!newEntry.publishedAt && entry.publishedAt) {
380
386
  newEntry.publishedAt = entry.publishedAt;
@@ -39,6 +39,7 @@ export declare function computeFileHash(filePath: string): Promise<string | null
39
39
  *
40
40
  * @param contentHash - Hash of the page content and front matter
41
41
  * @param depsHashes - Array of dependency file hashes
42
+ * @param renderInputsHash - Optional hash of asset URLs and injection settings used during rendering
42
43
  * @returns Combined SHA-256 hash as a hex string
43
44
  *
44
45
  * @example
@@ -48,7 +49,7 @@ export declare function computeFileHash(filePath: string): Promise<string | null
48
49
  * const inputsHash = computeInputsHash(contentHash, depsHashes);
49
50
  * ```
50
51
  */
51
- export declare function computeInputsHash(contentHash: string, depsHashes: string[]): string;
52
+ export declare function computeInputsHash(contentHash: string, depsHashes: string[], renderInputsHash?: string): string;
52
53
  /**
53
54
  * Computes a hash of the navigation tree structure.
54
55
  * Used to detect when navigation has changed (title, url, order, children structure).
@@ -1 +1 @@
1
- {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../src/core/isg/hash.ts"],"names":[],"mappings":"AA+BA;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAiBhG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA8B9E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAKnF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,CAqCnE"}
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../src/core/isg/hash.ts"],"names":[],"mappings":"AA+BA;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAiBhG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA8B9E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAAE,EACpB,gBAAgB,CAAC,EAAE,MAAM,GACxB,MAAM,CASR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,CAqCnE"}
@@ -110,6 +110,7 @@ export async function computeFileHash(filePath) {
110
110
  *
111
111
  * @param contentHash - Hash of the page content and front matter
112
112
  * @param depsHashes - Array of dependency file hashes
113
+ * @param renderInputsHash - Optional hash of asset URLs and injection settings used during rendering
113
114
  * @returns Combined SHA-256 hash as a hex string
114
115
  *
115
116
  * @example
@@ -119,10 +120,14 @@ export async function computeFileHash(filePath) {
119
120
  * const inputsHash = computeInputsHash(contentHash, depsHashes);
120
121
  * ```
121
122
  */
122
- export function computeInputsHash(contentHash, depsHashes) {
123
+ export function computeInputsHash(contentHash, depsHashes, renderInputsHash) {
123
124
  // Sort dependency hashes for consistency
124
125
  const sortedDepsHashes = [...depsHashes].sort();
125
- return createSha256Hash([contentHash, ...sortedDepsHashes]);
126
+ return createSha256Hash([
127
+ contentHash,
128
+ ...sortedDepsHashes,
129
+ ...(renderInputsHash ? [renderInputsHash] : []),
130
+ ]);
126
131
  }
127
132
  /**
128
133
  * Computes a hash of the navigation tree structure.
@@ -67,7 +67,7 @@ export interface ISGConfig {
67
67
  export interface CacheEntry {
68
68
  /** Output path of the rendered page */
69
69
  readonly path: string;
70
- /** Hash of page content and all dependencies */
70
+ /** Hash of page content, template dependencies, and rendering asset inputs */
71
71
  readonly inputsHash: string;
72
72
  /** Array of file paths this page depends on (templates, partials) */
73
73
  readonly deps: readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"isg.d.ts","sourceRoot":"","sources":["../../src/types/isg.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,SAAS;IACxB,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,UAAU;IACzB,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,SAAS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AAE,CAAC;IACjC,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,6CAA6C;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stati/core",
3
- "version": "1.24.2",
3
+ "version": "1.24.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",