Skip to content

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

TypeScript

ci: typecheck template.doc.mjs files in CI (#1104)

Joey2531f987f325
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 53a83ac3c0..02b7e700c1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -67,6 +67,9 @@ jobs:
- name: Typecheck component docs
run: yarn workspace @xds/core typecheck:docs
+ - name: Typecheck template docs
+ run: yarn workspace @xds/cli typecheck:template-docs
+
# Build storybook + analyze components (parallel with test)
# Uploads storybook preview and analysis artifacts for downstream jobs
build:
diff --git a/packages/cli/package.json b/packages/cli/package.json
index f8b5d8c7ca..5c5b37a3ec 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -13,7 +13,8 @@
"docs"
],
"scripts": {
- "xds": "node bin/xds.mjs"
+ "xds": "node bin/xds.mjs",
+ "typecheck:template-docs": "tsc --project tsconfig.template-docs.json"
},
"dependencies": {
"@clack/prompts": "^0.9.1",
diff --git a/packages/cli/templates/demo-dashboard/template.doc.mjs b/packages/cli/templates/demo-dashboard/template.doc.mjs
index 98ac22431b..41c054497e 100644
--- a/packages/cli/templates/demo-dashboard/template.doc.mjs
+++ b/packages/cli/templates/demo-dashboard/template.doc.mjs
@@ -1,4 +1,4 @@
-/** @type {import('@xds/core').TemplateDoc} */
+/** @type {import('../../../core/src/docs-types').TemplateDoc} */
export const doc = {
name: 'Dashboard',
description: 'Analytics dashboard with KPI cards and a data table.',
diff --git a/packages/cli/tsconfig.template-docs.json b/packages/cli/tsconfig.template-docs.json
new file mode 100644
index 0000000000..cca45d9b49
--- /dev/null
+++ b/packages/cli/tsconfig.template-docs.json
@@ -0,0 +1,13 @@
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "rootDir": "../..",
+ "allowJs": true,
+ "checkJs": true,
+ "noEmit": true
+ },
+ "include": [
+ "templates/**/template.doc.mjs",
+ "../core/src/docs-types.ts"
+ ]
+}