@stati/core 1.16.1 → 1.16.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.
package/dist/core/dev.js
CHANGED
|
@@ -198,7 +198,7 @@ async function handleTemplateChange(templatePath, configPath, logger) {
|
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
200
|
// Find pages that depend on this template
|
|
201
|
-
|
|
201
|
+
let affectedPagesCount = 0;
|
|
202
202
|
const normalizedTemplatePath = posix.normalize(templatePath.replace(/\\/g, '/'));
|
|
203
203
|
for (const [pagePath, entry] of Object.entries(cacheManifest.entries)) {
|
|
204
204
|
if (entry.deps.some((dep) => {
|
|
@@ -207,12 +207,12 @@ async function handleTemplateChange(templatePath, configPath, logger) {
|
|
|
207
207
|
return (normalizedDep === normalizedTemplatePath ||
|
|
208
208
|
normalizedDep.endsWith('/' + normalizedTemplatePath));
|
|
209
209
|
})) {
|
|
210
|
-
|
|
210
|
+
affectedPagesCount++;
|
|
211
211
|
// Remove from cache to force rebuild
|
|
212
212
|
delete cacheManifest.entries[pagePath];
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
if (
|
|
215
|
+
if (affectedPagesCount > 0) {
|
|
216
216
|
// Save updated cache manifest
|
|
217
217
|
await saveCacheManifest(cacheDir, cacheManifest);
|
|
218
218
|
// Perform incremental rebuild (only affected pages will be rebuilt)
|
package/dist/core/isg/ttl.js
CHANGED
|
@@ -209,7 +209,7 @@ function getPublishedDate(page) {
|
|
|
209
209
|
// Handle Date objects
|
|
210
210
|
if (value instanceof Date) {
|
|
211
211
|
const safeDate = getSafeCurrentTime(value);
|
|
212
|
-
if (
|
|
212
|
+
if (!isNaN(safeDate.getTime())) {
|
|
213
213
|
return safeDate;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/core/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1B,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAkB,MAAM,mBAAmB,CAAC;AAmNzF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,GAAG,CAW7D;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,GAAG,EACR,UAAU,CAAC,EAAE,OAAO,EAAE,EACtB,QAAQ,CAAC,EAAE,SAAS,EAAE,EACtB,MAAM,CAAC,EAAE,OAAO,mBAAmB,EAAE,WAAW,GAC/C,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/core/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1B,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAkB,MAAM,mBAAmB,CAAC;AAmNzF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,GAAG,CAW7D;AAED,wBAAsB,UAAU,CAC9B,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,GAAG,EACR,UAAU,CAAC,EAAE,OAAO,EAAE,EACtB,QAAQ,CAAC,EAAE,SAAS,EAAE,EACtB,MAAM,CAAC,EAAE,OAAO,mBAAmB,EAAE,WAAW,GAC/C,OAAO,CAAC,MAAM,CAAC,CA+KjB"}
|
package/dist/core/templates.js
CHANGED
|
@@ -235,17 +235,9 @@ export async function renderPage(page, body, config, eta, navigation, allPages,
|
|
|
235
235
|
const renderedPartials = {};
|
|
236
236
|
const maxPasses = 3; // Prevent infinite loops
|
|
237
237
|
for (let pass = 0; pass < maxPasses; pass++) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
partialsToRender = { ...partialPaths };
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
// Subsequent passes: re-render partials that might need updated dependencies
|
|
245
|
-
// For simplicity, re-render all partials to ensure they have access to all previously rendered ones
|
|
246
|
-
// TODO: Optimize by tracking which partials changed or have dependencies
|
|
247
|
-
partialsToRender = { ...partialPaths };
|
|
248
|
-
}
|
|
238
|
+
// Each pass renders all partials to ensure they have access to all previously rendered ones
|
|
239
|
+
// TODO: Optimize by tracking which partials changed or have dependencies
|
|
240
|
+
const partialsToRender = { ...partialPaths };
|
|
249
241
|
if (Object.keys(partialsToRender).length === 0) {
|
|
250
242
|
break;
|
|
251
243
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob-patterns.utils.d.ts","sourceRoot":"","sources":["../../../src/core/utils/glob-patterns.utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"glob-patterns.utils.d.ts","sourceRoot":"","sources":["../../../src/core/utils/glob-patterns.utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAgFnD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAQlE"}
|
|
@@ -39,13 +39,8 @@ export function globToRegex(pattern) {
|
|
|
39
39
|
regexStr += '(?:.*/)?';
|
|
40
40
|
i += 3;
|
|
41
41
|
}
|
|
42
|
-
else if (i + 2 === normalizedPattern.length) {
|
|
43
|
-
// ** at end - matches everything
|
|
44
|
-
regexStr += '.*';
|
|
45
|
-
i += 2;
|
|
46
|
-
}
|
|
47
42
|
else {
|
|
48
|
-
// ** in middle not followed by / - match everything remaining
|
|
43
|
+
// ** at end or in middle not followed by / - match everything remaining
|
|
49
44
|
regexStr += '.*';
|
|
50
45
|
i += 2;
|
|
51
46
|
}
|