Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

feat(cli): add scaffold flag to template metadata (#1939)

rubyycheung101857d48983
diff --git a/packages/cli/src/api/template.mjs b/packages/cli/src/api/template.mjs
index 0072351ff1..19dda5046e 100644
--- a/packages/cli/src/api/template.mjs
+++ b/packages/cli/src/api/template.mjs
@@ -58,6 +58,7 @@ async function discoverPages() {
name: doc?.name || dir.name,
description: doc?.description || '',
isReady: doc?.isReady ?? true,
+ scaffold: doc?.scaffold ?? false,
filePath: path.join(dirPath, 'page.tsx'),
docPath: path.join(dirPath, 'template.doc.mjs'),
});
@@ -385,6 +386,7 @@ export async function template(name, options = {}) {
displayName: t.name,
description: t.description,
isReady: t.isReady,
+ scaffold: t.scaffold ?? false,
type: t.type,
})),
};
diff --git a/packages/cli/src/types/template.d.ts b/packages/cli/src/types/template.d.ts
index 6617858d11..cf913f6175 100644
--- a/packages/cli/src/types/template.d.ts
+++ b/packages/cli/src/types/template.d.ts
@@ -22,6 +22,7 @@ export interface TemplateListEntry {
name: string;
description: string;
isReady: boolean;
+ scaffold?: boolean;
}
/** xds --json template <name> */
diff --git a/packages/cli/templates/pages/blank/template.doc.mjs b/packages/cli/templates/pages/blank/template.doc.mjs
index c48ee435c7..3411db470a 100644
--- a/packages/cli/templates/pages/blank/template.doc.mjs
+++ b/packages/cli/templates/pages/blank/template.doc.mjs
@@ -4,4 +4,5 @@ export const doc = {
name: 'Blank Page',
description: 'Minimal page scaffold',
isReady: true,
+ scaffold: true,
};
diff --git a/packages/cli/templates/pages/table-grouped/template.doc.mjs b/packages/cli/templates/pages/table-grouped/template.doc.mjs
index 37796cfe23..1415ecba2f 100644
--- a/packages/cli/templates/pages/table-grouped/template.doc.mjs
+++ b/packages/cli/templates/pages/table-grouped/template.doc.mjs
@@ -3,5 +3,5 @@ export const doc = {
type: 'page',
name: 'Table (Grouped)',
description: 'Grouped data table with collapsible status sections, PowerSearch, and detail panel',
- isReady: true,
+ isReady: false,
};
diff --git a/packages/cli/templates/pages/table/template.doc.mjs b/packages/cli/templates/pages/table/template.doc.mjs
index 4c03b7504a..3b313b5197 100644
--- a/packages/cli/templates/pages/table/template.doc.mjs
+++ b/packages/cli/templates/pages/table/template.doc.mjs
@@ -3,5 +3,5 @@ export const doc = {
type: 'page',
name: 'Table',
description: 'Data table with actions',
- isReady: true,
+ isReady: false,
};
diff --git a/packages/core/src/docs-types.ts b/packages/core/src/docs-types.ts
index d39db54920..f8055c94b6 100644
--- a/packages/core/src/docs-types.ts
+++ b/packages/core/src/docs-types.ts
@@ -562,6 +562,11 @@ interface BaseTemplateDoc {
/** Whether this template is ready for use. Templates with
* isReady: false show as "(WIP)" in the gallery and CLI. */
isReady?: boolean;
+
+ /** Whether this template is a scaffolding tool only (e.g. blank page).
+ * Scaffold templates are available via the CLI but hidden from
+ * browsable template galleries like the craft browser. */
+ scaffold?: boolean;
}
export interface PageTemplateDoc extends BaseTemplateDoc {