@treeseed/core 0.10.21 → 0.10.22
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/content.js +1 -0
- package/dist/templates.d.ts +2 -0
- package/dist/templates.js +8 -6
- package/package.json +2 -2
package/dist/content.js
CHANGED
|
@@ -411,6 +411,7 @@ function createTreeseedCollections(tenantConfig, { docsLoader, docsSchema }) {
|
|
|
411
411
|
});
|
|
412
412
|
const templateProductSchema = z.object({
|
|
413
413
|
slug: z.string(),
|
|
414
|
+
sourceRef: z.string().optional(),
|
|
414
415
|
title: z.string(),
|
|
415
416
|
description: z.string(),
|
|
416
417
|
summary: z.string(),
|
package/dist/templates.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface TemplateContentEntry {
|
|
|
4
4
|
id: string;
|
|
5
5
|
data: {
|
|
6
6
|
slug: string;
|
|
7
|
+
sourceRef?: string;
|
|
7
8
|
title: string;
|
|
8
9
|
summary: string;
|
|
9
10
|
description: string;
|
|
@@ -48,6 +49,7 @@ export interface TemplateCatalogProvider {
|
|
|
48
49
|
}
|
|
49
50
|
export interface TemplateSiteCard {
|
|
50
51
|
slug: string;
|
|
52
|
+
sourceRef: string;
|
|
51
53
|
title: string;
|
|
52
54
|
summary: string;
|
|
53
55
|
category: string;
|
package/dist/templates.js
CHANGED
|
@@ -37,6 +37,7 @@ function contentCardFromEntry(entry) {
|
|
|
37
37
|
}
|
|
38
38
|
return {
|
|
39
39
|
slug: entry.data.slug,
|
|
40
|
+
sourceRef: entry.data.sourceRef ?? entry.data.slug,
|
|
40
41
|
title: entry.data.title,
|
|
41
42
|
summary: entry.data.summary,
|
|
42
43
|
category: entry.data.category,
|
|
@@ -83,6 +84,7 @@ function detailFromContentEntry(entry) {
|
|
|
83
84
|
function cardFromCatalogItem(item) {
|
|
84
85
|
return {
|
|
85
86
|
slug: item.slug,
|
|
87
|
+
sourceRef: catalogString(item.metadata, "sourceRef") ?? item.slug,
|
|
86
88
|
title: item.title,
|
|
87
89
|
summary: item.summary ?? "",
|
|
88
90
|
category: catalogString(item.metadata, "category") ?? "Template",
|
|
@@ -136,28 +138,28 @@ async function listSiteTemplates(context = {}) {
|
|
|
136
138
|
}
|
|
137
139
|
const catalogItems = context.catalogProvider && typeof context.catalogProvider.listItems === "function" ? await context.catalogProvider.listItems({ locals: context.locals }) : [];
|
|
138
140
|
const localEntries = await listLocalTemplateEntries(context.listLocalEntries);
|
|
139
|
-
const
|
|
141
|
+
const cardsBySourceRef = /* @__PURE__ */ new Map();
|
|
140
142
|
for (const entry of localEntries) {
|
|
141
143
|
const card = contentCardFromEntry(entry);
|
|
142
144
|
if (card) {
|
|
143
|
-
|
|
145
|
+
cardsBySourceRef.set(card.sourceRef, card);
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
for (const item of catalogItems) {
|
|
147
149
|
const card = cardFromCatalogItem(item);
|
|
148
|
-
const existing =
|
|
150
|
+
const existing = cardsBySourceRef.get(card.sourceRef);
|
|
149
151
|
if (existing) {
|
|
150
|
-
|
|
152
|
+
cardsBySourceRef.set(card.sourceRef, {
|
|
151
153
|
...existing,
|
|
152
154
|
launchRequirements: existing.launchRequirements ?? card.launchRequirements
|
|
153
155
|
});
|
|
154
156
|
} else {
|
|
155
|
-
|
|
157
|
+
cardsBySourceRef.set(card.sourceRef, card);
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
160
|
return {
|
|
159
161
|
rendered: true,
|
|
160
|
-
items: sortTemplateCards([...
|
|
162
|
+
items: sortTemplateCards([...cardsBySourceRef.values()])
|
|
161
163
|
};
|
|
162
164
|
}
|
|
163
165
|
async function resolveSiteTemplate(slug, context = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/core",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.22",
|
|
4
4
|
"description": "Treeseed web framework package for Astro/Starlight site runtimes.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@astrojs/sitemap": "3.7.0",
|
|
71
71
|
"@astrojs/starlight": "0.37.6",
|
|
72
72
|
"@tailwindcss/vite": "^4.1.4",
|
|
73
|
-
"@treeseed/sdk": "github:treeseed-ai/sdk#0.10.
|
|
73
|
+
"@treeseed/sdk": "github:treeseed-ai/sdk#0.10.28",
|
|
74
74
|
"astro": "^5.6.1",
|
|
75
75
|
"esbuild": "^0.28.0",
|
|
76
76
|
"katex": "^0.16.22",
|