@treeseed/core 0.10.18 → 0.10.19
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/templates.d.ts +2 -0
- package/dist/templates.js +15 -3
- package/package.json +2 -2
package/dist/templates.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TemplateLaunchRequirements } from '@treeseed/sdk/template-launch-requirements';
|
|
1
2
|
import type { CatalogItem, CatalogItemOfferMode } from '@treeseed/sdk/types';
|
|
2
3
|
export interface TemplateContentEntry {
|
|
3
4
|
id: string;
|
|
@@ -55,6 +56,7 @@ export interface TemplateSiteCard {
|
|
|
55
56
|
templateVersion?: string;
|
|
56
57
|
priceModel?: CatalogItemOfferMode | string;
|
|
57
58
|
source: 'catalog' | 'content';
|
|
59
|
+
launchRequirements?: TemplateLaunchRequirements;
|
|
58
60
|
}
|
|
59
61
|
export interface TemplateSiteDetail extends TemplateSiteCard {
|
|
60
62
|
description: string;
|
package/dist/templates.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getCollection } from "astro:content";
|
|
2
|
+
import { normalizeTemplateLaunchRequirements } from "@treeseed/sdk/template-launch-requirements";
|
|
2
3
|
import { RUNTIME_TENANT } from "./tenant/runtime-config.js";
|
|
3
4
|
import { siteModelRendered } from "./utils/site-models.js";
|
|
4
5
|
function sortTemplateCards(entries) {
|
|
@@ -27,6 +28,9 @@ function catalogNumber(metadata, key) {
|
|
|
27
28
|
const value = metadata?.[key];
|
|
28
29
|
return typeof value === "number" ? value : void 0;
|
|
29
30
|
}
|
|
31
|
+
function catalogLaunchRequirements(metadata, label) {
|
|
32
|
+
return normalizeTemplateLaunchRequirements(metadata?.launchRequirements, `${label} launchRequirements`);
|
|
33
|
+
}
|
|
30
34
|
function contentCardFromEntry(entry) {
|
|
31
35
|
if (entry.data.status !== "live") {
|
|
32
36
|
return null;
|
|
@@ -40,7 +44,8 @@ function contentCardFromEntry(entry) {
|
|
|
40
44
|
publisherName: entry.data.publisher.name,
|
|
41
45
|
templateVersion: entry.data.templateVersion,
|
|
42
46
|
priceModel: entry.data.offer?.priceModel,
|
|
43
|
-
source: "content"
|
|
47
|
+
source: "content",
|
|
48
|
+
launchRequirements: void 0
|
|
44
49
|
};
|
|
45
50
|
}
|
|
46
51
|
function detailFromContentEntry(entry) {
|
|
@@ -85,7 +90,8 @@ function cardFromCatalogItem(item) {
|
|
|
85
90
|
publisherName: catalogString(item.metadata, "publisherName") ?? item.teamId,
|
|
86
91
|
templateVersion: catalogString(item.metadata, "templateVersion"),
|
|
87
92
|
priceModel: item.offerMode,
|
|
88
|
-
source: "catalog"
|
|
93
|
+
source: "catalog",
|
|
94
|
+
launchRequirements: catalogLaunchRequirements(item.metadata, `catalog item ${item.slug}`)
|
|
89
95
|
};
|
|
90
96
|
}
|
|
91
97
|
function detailFromCatalogItem(item) {
|
|
@@ -139,7 +145,13 @@ async function listSiteTemplates(context = {}) {
|
|
|
139
145
|
}
|
|
140
146
|
for (const item of catalogItems) {
|
|
141
147
|
const card = cardFromCatalogItem(item);
|
|
142
|
-
|
|
148
|
+
const existing = cardsBySlug.get(card.slug);
|
|
149
|
+
if (existing) {
|
|
150
|
+
cardsBySlug.set(card.slug, {
|
|
151
|
+
...existing,
|
|
152
|
+
launchRequirements: existing.launchRequirements ?? card.launchRequirements
|
|
153
|
+
});
|
|
154
|
+
} else {
|
|
143
155
|
cardsBySlug.set(card.slug, card);
|
|
144
156
|
}
|
|
145
157
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/core",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.19",
|
|
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.25",
|
|
74
74
|
"astro": "^5.6.1",
|
|
75
75
|
"esbuild": "^0.28.0",
|
|
76
76
|
"katex": "^0.16.22",
|