veryfront 0.1.177 → 0.1.178
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/esm/deno.js +1 -1
- package/esm/src/rendering/orchestrator/pipeline.d.ts +1 -0
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +29 -25
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
- package/src/deno.js +1 -1
- package/src/src/rendering/orchestrator/pipeline.ts +55 -33
- package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.js
CHANGED
|
@@ -75,6 +75,7 @@ export declare class RenderPipeline {
|
|
|
75
75
|
renderPage(slug: string, options?: RenderOptions): Promise<RenderResult>;
|
|
76
76
|
/** Resolve page data for SPA client-side navigation without rendering HTML. */
|
|
77
77
|
resolvePageData(slug: string, options?: RenderOptions): Promise<PageDataResponse>;
|
|
78
|
+
private extractMdxMetadata;
|
|
78
79
|
/**
|
|
79
80
|
* Build a cache key that is safe for multi-tenant + query-param aware caching.
|
|
80
81
|
* Returns null when request contains sensitive headers (Authorization/Cookie) and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC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EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IA+P9E,+EAA+E;IACzE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAsKzE,kBAAkB;IA2ChC;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;CAetB"}
|
|
@@ -411,31 +411,7 @@ export class RenderPipeline {
|
|
|
411
411
|
for (const [layoutId, props] of dataResolution.layoutProps.entries()) {
|
|
412
412
|
layoutProps[layoutId] = props;
|
|
413
413
|
}
|
|
414
|
-
|
|
415
|
-
let headings = [];
|
|
416
|
-
if (pageType === "mdx") {
|
|
417
|
-
try {
|
|
418
|
-
const bundleResult = await this.config.pageRenderer.preparePageBundles(pageInfo, slug, undefined, {
|
|
419
|
-
...options,
|
|
420
|
-
...(Object.keys(params).length > 0 ? { params } : {}),
|
|
421
|
-
});
|
|
422
|
-
if (bundleResult.pageBundle && "frontmatter" in bundleResult.pageBundle) {
|
|
423
|
-
frontmatter =
|
|
424
|
-
bundleResult.pageBundle.frontmatter ||
|
|
425
|
-
{};
|
|
426
|
-
}
|
|
427
|
-
if (bundleResult.pageBundle && "headings" in bundleResult.pageBundle) {
|
|
428
|
-
headings = bundleResult.pageBundle.headings || [];
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
catch (error) {
|
|
432
|
-
renderPipelineLog.error("Frontmatter/headings extraction failed", {
|
|
433
|
-
slug,
|
|
434
|
-
error: error instanceof Error ? error.message : String(error),
|
|
435
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
}
|
|
414
|
+
const { frontmatter, headings } = await this.extractMdxMetadata(pageType, pageInfo, slug, options, params);
|
|
439
415
|
const layouts = layoutResult.nestedLayouts
|
|
440
416
|
.filter((l) => l.componentPath || l.path)
|
|
441
417
|
.map((l) => ({
|
|
@@ -536,6 +512,34 @@ export class RenderPipeline {
|
|
|
536
512
|
cssError,
|
|
537
513
|
};
|
|
538
514
|
}
|
|
515
|
+
async extractMdxMetadata(pageType, pageInfo, slug, options, params) {
|
|
516
|
+
if (pageType !== "mdx") {
|
|
517
|
+
return { frontmatter: {}, headings: [] };
|
|
518
|
+
}
|
|
519
|
+
try {
|
|
520
|
+
const bundleResult = await this.config.pageRenderer.preparePageBundles(pageInfo, slug, undefined, {
|
|
521
|
+
...options,
|
|
522
|
+
...(Object.keys(params).length > 0 ? { params } : {}),
|
|
523
|
+
});
|
|
524
|
+
const pageBundle = bundleResult.pageBundle;
|
|
525
|
+
return {
|
|
526
|
+
frontmatter: pageBundle && "frontmatter" in pageBundle
|
|
527
|
+
? pageBundle.frontmatter || {}
|
|
528
|
+
: {},
|
|
529
|
+
headings: pageBundle && "headings" in pageBundle
|
|
530
|
+
? pageBundle.headings || []
|
|
531
|
+
: [],
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
catch (error) {
|
|
535
|
+
renderPipelineLog.error("Frontmatter/headings extraction failed", {
|
|
536
|
+
slug,
|
|
537
|
+
error: error instanceof Error ? error.message : String(error),
|
|
538
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
539
|
+
});
|
|
540
|
+
return { frontmatter: {}, headings: [] };
|
|
541
|
+
}
|
|
542
|
+
}
|
|
539
543
|
/**
|
|
540
544
|
* Build a cache key that is safe for multi-tenant + query-param aware caching.
|
|
541
545
|
* Returns null when request contains sensitive headers (Authorization/Cookie) and
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.178";
|
|
2
2
|
//# sourceMappingURL=version-constant.d.ts.map
|
package/package.json
CHANGED
package/src/deno.js
CHANGED
|
@@ -111,6 +111,11 @@ interface DataResolutionResult {
|
|
|
111
111
|
layoutProps: Map<string, Record<string, unknown>>;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
interface MdxMetadataResult {
|
|
115
|
+
frontmatter: Record<string, unknown>;
|
|
116
|
+
headings: Array<{ id: string; text: string; level: number }>;
|
|
117
|
+
}
|
|
118
|
+
|
|
114
119
|
interface FetchedDataResult {
|
|
115
120
|
type: "page" | "layout";
|
|
116
121
|
id: string;
|
|
@@ -660,39 +665,13 @@ export class RenderPipeline {
|
|
|
660
665
|
layoutProps[layoutId] = props;
|
|
661
666
|
}
|
|
662
667
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
undefined,
|
|
671
|
-
{
|
|
672
|
-
...options,
|
|
673
|
-
...(Object.keys(params).length > 0 ? { params } : {}),
|
|
674
|
-
},
|
|
675
|
-
);
|
|
676
|
-
|
|
677
|
-
if (bundleResult.pageBundle && "frontmatter" in bundleResult.pageBundle) {
|
|
678
|
-
frontmatter =
|
|
679
|
-
(bundleResult.pageBundle as { frontmatter?: Record<string, unknown> }).frontmatter ||
|
|
680
|
-
{};
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
if (bundleResult.pageBundle && "headings" in bundleResult.pageBundle) {
|
|
684
|
-
headings = (bundleResult.pageBundle as {
|
|
685
|
-
headings?: Array<{ id: string; text: string; level: number }>;
|
|
686
|
-
}).headings || [];
|
|
687
|
-
}
|
|
688
|
-
} catch (error) {
|
|
689
|
-
renderPipelineLog.error("Frontmatter/headings extraction failed", {
|
|
690
|
-
slug,
|
|
691
|
-
error: error instanceof Error ? error.message : String(error),
|
|
692
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
}
|
|
668
|
+
const { frontmatter, headings } = await this.extractMdxMetadata(
|
|
669
|
+
pageType,
|
|
670
|
+
pageInfo,
|
|
671
|
+
slug,
|
|
672
|
+
options,
|
|
673
|
+
params,
|
|
674
|
+
);
|
|
696
675
|
|
|
697
676
|
const layouts = layoutResult.nestedLayouts
|
|
698
677
|
.filter((l: LayoutItem) => l.componentPath || l.path)
|
|
@@ -816,6 +795,49 @@ export class RenderPipeline {
|
|
|
816
795
|
};
|
|
817
796
|
}
|
|
818
797
|
|
|
798
|
+
private async extractMdxMetadata(
|
|
799
|
+
pageType: PageDataResponse["pageType"],
|
|
800
|
+
pageInfo: Awaited<ReturnType<PageResolver["resolvePage"]>>,
|
|
801
|
+
slug: string,
|
|
802
|
+
options: RenderOptions | undefined,
|
|
803
|
+
params: Record<string, string | string[]>,
|
|
804
|
+
): Promise<MdxMetadataResult> {
|
|
805
|
+
if (pageType !== "mdx") {
|
|
806
|
+
return { frontmatter: {}, headings: [] };
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
try {
|
|
810
|
+
const bundleResult = await this.config.pageRenderer.preparePageBundles(
|
|
811
|
+
pageInfo,
|
|
812
|
+
slug,
|
|
813
|
+
undefined,
|
|
814
|
+
{
|
|
815
|
+
...options,
|
|
816
|
+
...(Object.keys(params).length > 0 ? { params } : {}),
|
|
817
|
+
},
|
|
818
|
+
);
|
|
819
|
+
|
|
820
|
+
const pageBundle = bundleResult.pageBundle;
|
|
821
|
+
return {
|
|
822
|
+
frontmatter: pageBundle && "frontmatter" in pageBundle
|
|
823
|
+
? (pageBundle as { frontmatter?: Record<string, unknown> }).frontmatter || {}
|
|
824
|
+
: {},
|
|
825
|
+
headings: pageBundle && "headings" in pageBundle
|
|
826
|
+
? (pageBundle as {
|
|
827
|
+
headings?: Array<{ id: string; text: string; level: number }>;
|
|
828
|
+
}).headings || []
|
|
829
|
+
: [],
|
|
830
|
+
};
|
|
831
|
+
} catch (error) {
|
|
832
|
+
renderPipelineLog.error("Frontmatter/headings extraction failed", {
|
|
833
|
+
slug,
|
|
834
|
+
error: error instanceof Error ? error.message : String(error),
|
|
835
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
836
|
+
});
|
|
837
|
+
return { frontmatter: {}, headings: [] };
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
|
|
819
841
|
/**
|
|
820
842
|
* Build a cache key that is safe for multi-tenant + query-param aware caching.
|
|
821
843
|
* Returns null when request contains sensitive headers (Authorization/Cookie) and
|