Skip to content

Commit d3931c8

Browse files
authored
Merge branch 'main' into ts-strands-agents-integration
2 parents f6565a6 + ca04dcb commit d3931c8

10 files changed

Lines changed: 328 additions & 239 deletions

File tree

COMPONENT_REGISTRY.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,49 @@
22

33
Generated by `scripts/audit-components.mjs`. Run to update.
44

5-
**Coverage: 28/33 (85%)**
5+
**Coverage: 34/40 (85%)**
66

77
| Component | File Count | Strategy | Covered |
88
|-----------|------------|----------|---------|
9-
| `TabItem` | 44 | `tabitem` ||
10-
| `Tabs` | 43 | `tabs` ||
11-
| `ReleaseNoteHeader` | 41 | `release-note-header` ||
9+
| `TabItem` | 79 | `tabitem` ||
10+
| `Tabs` | 78 | `tabs` ||
11+
| `NoZoom` | 60 | `UNKNOWN` ||
12+
| `ReleaseNoteHeader` | 48 | `release-note-header` ||
1213
| `ViewSourceCodeNotice` | 24 | `view-source-code-notice` ||
1314
| `RelatedReadContainer` | 23 | `related-read-container` ||
1415
| `RelatedReadItem` | 20 | `related-read-item` ||
1516
| `SetupSteps` | 14 | `setup-steps` ||
1617
| `SetupStep` | 14 | `setup-step` ||
1718
| `CodeSnippet` | 14 | `code-snippet` ||
19+
| `PatternCards` | 13 | `cards` ||
1820
| `SdkTabs` | 8 | `sdk-tabs` ||
1921
| `CallToAction` | 8 | `call-to-action` ||
2022
| `CaptionedImage` | 7 | `captioned-image` ||
21-
| `IntegrationsGrid` | 5 | `integrations-grid` ||
23+
| `IntegrationsGrid` | 6 | `integrations-grid` ||
2224
| `ToolTipTerm` | 4 | `tooltip-term` ||
2325
| `JsonTable` | 3 | `json-table` ||
2426
| `AWSRegions` | 2 | `transclude` ||
2527
| `GCPRegions` | 2 | `transclude` ||
26-
| `PatternCards` | 2 | `cards` ||
2728
| `CustomRolePermissionsTable` | 1 | `transclude` ||
2829
| `InvitationContent` | 1 | `strip-block` ||
2930
| `RetrySimulator` | 1 | `strip-block` ||
31+
| `ServerlessWorkerDemo` | 1 | `strip-block` ||
32+
| `StandaloneActivityDemo` | 1 | `UNKNOWN` ||
3033
| `SayHelloWorkflow` | 1 | `UNKNOWN` ||
3134
| `ISayHelloNexusService` | 1 | `UNKNOWN` ||
3235
| `CallerWorkflow` | 1 | `UNKNOWN` ||
33-
| `StandaloneActivityDemo` | 1 | `UNKNOWN` ||
34-
| `SdkSvg` | 1 | `strip-block` ||
35-
| `SdkGuideLinks` | 1 | `UNKNOWN` ||
36-
| `ServerlessWorkerDemo` | 1 | `strip-block` ||
36+
| `SdkGuideLinks` | 1 | `sdk-guide-links` ||
3737
| `CloudRegionCount` | 1 | `strip-block` ||
38-
| `HomePageHero` | 1 | `home-page-hero` ||
38+
| `GuidesGrid` | 1 | `UNKNOWN` ||
39+
| `HeroWrapper` | 1 | `strip-tag` ||
40+
| `HeroHeader` | 1 | `strip-tag` ||
41+
| `HeroSection` | 1 | `strip-tag` ||
42+
| `HeroContent` | 1 | `strip-tag` ||
43+
| `HeroCta` | 1 | `strip-tag` ||
44+
| `HeroActions` | 1 | `strip-tag` ||
45+
| `ActionCard` | 1 | `hero-card` ||
46+
| `CommunityCards` | 1 | `strip-tag` ||
47+
| `CommunityCard` | 1 | `hero-card` ||
3948
| `OperationsTable` | 1 | `strip-block` ||
4049

4150
## Strategy Definitions

MARKDOWN_PIPELINE.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ docusaurus-plugin-llms ───────────────────
6969
| `scripts/mdx-to-md.mjs` | **The transformer.** Exports `transformMdx()` + parsing helpers and `COMPONENT_REGISTRY`. Zero-dependency ES module. |
7070
| `scripts/component-handlers/data-tables.mjs` | Handler for `<JsonTable>` — resolves a `static/json/*.json` file into a Markdown table. |
7171
| `scripts/component-handlers/integrations.mjs` | Handler for `<IntegrationsGrid>` — reads `src/components/IntegrationsGrid/integrations-data.json`, filters by the `defaultSdks` prop, and emits a Markdown list. |
72-
| `scripts/component-handlers/home-page-hero.mjs` | Handler for `<HomePageHero>` — emits the homepage hero's headline, intro, and link cards. Content is mirrored from the component (no shared data file). |
72+
| `scripts/component-handlers/hero.mjs` | Handler for the homepage hero cards (`<ActionCard>` / `<CommunityCard>`) — parses `title`/`href` props and children into a Markdown link-list item. Copy lives in `docs/index.mdx`; layout wrappers strip generically. |
7373
| `scripts/component-handlers/cards.mjs` | Handler for `<QuickstartCards>` / `<PatternCards>` — parses the inline `items={[{href,title,description}]}` prop into a Markdown link list. |
7474
| `scripts/audit-components.mjs` | Inventory/coverage tool. Scans all docs, reports per-component coverage, writes `COMPONENT_REGISTRY.md` at the repo root. |
7575
| `src/components/LLMActions/LLMActions.tsx` | On-page actions (Copy, View as Markdown, Open in ChatGPT/Claude). Points at the generated `/<path>.md` (not the raw MDX). |
@@ -118,7 +118,8 @@ Each component maps to a strategy in `COMPONENT_REGISTRY` (in `scripts/mdx-to-md
118118
| `SetupSteps` / `SetupStep` | `setup-steps` / `setup-step` | Prose children plus code extracted from the `code={…}` JSX prop |
119119
| `JsonTable` | `json-table` | Markdown table resolved from the referenced `static/json/*.json` |
120120
| `IntegrationsGrid` | `integrations-grid` | Markdown list resolved from `integrations-data.json`, filtered by the `defaultSdks` prop |
121-
| `HomePageHero` | `home-page-hero` | Homepage hero's headline, intro paragraphs, and link cards (content mirrored from the component) |
121+
| `ActionCard` / `CommunityCard` | `hero-card` | Homepage hero cards → `- [title](href): description` link-list item (copy authored in `docs/index.mdx`) |
122+
| `HeroWrapper`, `HeroHeader`, `HeroSection`, `HeroContent`, `HeroActions`, `HeroCta`, `CommunityCards` | `strip-tag` | Homepage hero layout wrappers — stripped to their inner Markdown (headline + intro prose) |
122123
| `QuickstartCards`, `PatternCards` | `cards` | Markdown link list parsed from the inline `items={[{href,title,description}]}` prop |
123124
| `ZoomPanPinch` | `transparent` | Wrapper stripped; inner content passed through |
124125
| `DocCardList`, `CardList`, `LandingCard`, `ThemedImage`, `SdkSvg`, `CloudRegionCount`, `RetrySimulator`, `ServerlessWorkerDemo`, `OperationsTable`, `InvitationContent` | `strip-block` | Removed entirely (visual/dynamic, no extractable text) |
@@ -144,24 +145,19 @@ transformer itself is safe from these — its detection is anchored to whole lin
144145
4. Run `node scripts/audit-components.mjs` to refresh coverage.
145146

146147
**Keep handlers and components in sync.** When a handler reproduces content or logic that also
147-
lives in the React component (data-driven components like `JsonTable`, `IntegrationsGrid`, or the
148-
content-mirroring `HomePageHero`), add a cross-reference comment in *both* files — a `⚠️ LLM
149-
MARKDOWN PIPELINE` comment in the component pointing at the handler, and a `Component:` line in
150-
the handler pointing back — so a future change to one prompts updating the other. Components
151-
transformed generically (e.g. `Tabs`, `CallToAction`) have no separate source of truth and don't
152-
need this.
148+
lives in the React component (data-driven components like `JsonTable` or `IntegrationsGrid`), add
149+
a cross-reference comment in *both* files — a `⚠️ LLM MARKDOWN PIPELINE` comment in the component
150+
pointing at the handler, and a `Component:` line in the handler pointing back — so a future change
151+
to one prompts updating the other. Components transformed generically (e.g. `Tabs`,
152+
`CallToAction`, and the homepage hero cards) have no separate source of truth and don't need this
153+
— the copy lives in the MDX and the handler reads it straight from the page.
153154

154155
### Known limitation: content/logic duplicated between components and handlers (follow-up)
155156

156157
A few handlers currently re-express something that also lives in the React component, which
157158
means two places to keep in sync. This is a known issue to be addressed in a follow-up; the
158159
cross-reference comments above are an interim guard, not the fix.
159160

160-
- **`HomePageHero` — duplicated content.** `scripts/component-handlers/home-page-hero.mjs` holds
161-
its own copy of the homepage hero's text (headline, intro paragraphs, action/community cards),
162-
duplicating `src/components/elements/HomePageHero.js`. The intended fix is to move that content
163-
into the page's source of truth — `docs/index.mdx` — and reduce the component to presentation
164-
(content via props/children), so the hero-specific handler can be removed entirely.
165161
- **`IntegrationsGrid` — duplicated logic.** The data is already shared
166162
(`integrations-data.json`), but the default-view filter/sort in
167163
`scripts/component-handlers/integrations.mjs` (`selectIntegrations`) mirrors the filtering in

docs/index.mdx

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,50 @@ hide_title: true
77
description: Official docs for Temporal, the open source Durable Execution platform for crash-proof applications. Guides, SDKs, and references for reliable workflows.
88
---
99

10-
import HomePageHero from '@site/src/components/elements/HomePageHero';
10+
import {
11+
HeroWrapper,
12+
HeroHeader,
13+
HeroSection,
14+
HeroContent,
15+
HeroHeadline,
16+
HeroActions,
17+
HeroCta,
18+
ActionCard,
19+
CommunityCards,
20+
CommunityCard,
21+
} from '@site/src/components';
1122

12-
<HomePageHero />
23+
<HeroWrapper>
24+
25+
<HeroHeader>Temporal Docs</HeroHeader>
26+
27+
<HeroSection>
28+
29+
<HeroContent>
30+
31+
<HeroHeadline>Build applications that never fail</HeroHeadline>
32+
33+
Temporal is an open-source platform for building reliable applications. Temporal delivers crash-proof execution by guaranteeing that applications resume exactly where they left off after crashes, network failures, or infrastructure outages, whether that happens seconds, days, or even years later.
34+
35+
Temporal enables developers to focus on building features that drive the business while ensuring that mission-critical processes such as order fulfillment, customer onboarding, and payment processing never fail or disappear, regardless of what goes wrong.
36+
37+
<HeroCta href="/quickstarts">Quickstart</HeroCta>
38+
39+
</HeroContent>
40+
41+
<HeroActions>
42+
<ActionCard href="/quickstarts" icon="bolt" iconAlt="Lightning icon" title="Quickstart">Setup your local and run a Hello World workflow.</ActionCard>
43+
<ActionCard href="/develop" icon="code" iconAlt="Code icon" title="Developer Guide">Dive into everything you need to know about building Temporal workflows.</ActionCard>
44+
<ActionCard href="/production-deployment" icon="rocket" iconAlt="Rocket icon" title="Deploy your Workflows">Deploy your Temporal Application to your environment. Self-Host the Temporal Service or use Temporal Cloud.</ActionCard>
45+
<ActionCard href="https://temporal.io/cloud" icon="cloud" iconAlt="Cloud icon" title="Get started for free with $1000 in credits"><span className="linkify">Sign up for Temporal Cloud</span> and let us host the Temporal Service for you.</ActionCard>
46+
</HeroActions>
47+
48+
</HeroSection>
49+
50+
<CommunityCards>
51+
<CommunityCard href="https://temporal.io/slack" icon="slack" iconAlt="Slack" title="Slack Community">Join us on <a href="https://temporal.io/slack">temporal.io/slack</a> and say hi or ask us a question.</CommunityCard>
52+
<CommunityCard href="https://community.temporal.io" icon="forum" iconAlt="Message" title="Developer Forum"><a href="https://community.temporal.io">Find out</a> if your question has already been asked.</CommunityCard>
53+
<CommunityCard href="https://learn.temporal.io/courses/" icon="learn" iconAlt="Education" title="Learn it all"><a href="https://learn.temporal.io/courses/">Master Temporal</a> with our courses and tutorials.</CommunityCard>
54+
</CommunityCards>
55+
56+
</HeroWrapper>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/**
2+
* component-handlers/hero.mjs
3+
*
4+
* Handler for the homepage hero cards (<ActionCard> / <CommunityCard>) used in
5+
* docs/index.mdx and rendered by src/components/elements/HomePageHero.js.
6+
*
7+
* The copy lives in the MDX itself: `title` and `href` are props on the tag and
8+
* the description is the element's children (which may contain inline links or
9+
* <span> markup). This handler parses one card element into a Markdown link-list
10+
* item: `- [title](href): description`.
11+
*
12+
* The layout wrappers (HeroWrapper, HeroSection, HeroContent, …) are handled by
13+
* the transformer's generic `strip-tag` strategy — they carry no copy of their
14+
* own, so there is nothing to resolve here.
15+
*/
16+
17+
/** Read a `name="..."`, `name='...'`, or `name={"..."}` prop from a tag string. */
18+
function getProp(tagStr, name) {
19+
const m =
20+
tagStr.match(new RegExp(`${name}=["']([^"']*)["']`)) ||
21+
tagStr.match(new RegExp(`${name}=\\{["'\`]([^"'\`]*)["'\`]\\}`));
22+
return m ? m[1] : "";
23+
}
24+
25+
/** Convert the inline children markup to plain Markdown. */
26+
function cleanInline(s) {
27+
return s
28+
// <a href="X">Y</a> → [Y](X)
29+
.replace(/<a\s+[^>]*href=["']([^"']+)["'][^>]*>([\s\S]*?)<\/a>/gi, "[$2]($1)")
30+
// drop any remaining inline HTML tags (e.g. <span class="linkify">)
31+
.replace(/<\/?[a-z][^>]*>/gi, "")
32+
.replace(/\s+/g, " ")
33+
.trim();
34+
}
35+
36+
/**
37+
* Parse a single hero card element string into its parts.
38+
* @param {string} elementStr e.g. `<ActionCard href="/x" title="Y">desc</ActionCard>`
39+
* @returns {{href: string, title: string, description: string}}
40+
*/
41+
export function parseHeroCard(elementStr) {
42+
const openEnd = elementStr.indexOf(">");
43+
const closeStart = elementStr.lastIndexOf("</");
44+
const openTag = elementStr.slice(0, openEnd + 1);
45+
const inner = openEnd >= 0 && closeStart > openEnd ? elementStr.slice(openEnd + 1, closeStart) : "";
46+
return {
47+
href: getProp(openTag, "href"),
48+
title: getProp(openTag, "title"),
49+
description: cleanInline(inner),
50+
};
51+
}
52+
53+
/**
54+
* Resolve a <HeroHeadline>…</HeroHeadline> element to a Markdown H1.
55+
* The homepage headline is a React-rendered <h1> (not a Markdown `#`) so it
56+
* skips the theme's h1 override; here we restore it as a heading for the .md.
57+
* @returns {string} `# text` (empty string if no text)
58+
*/
59+
export function heroHeadlineToMarkdown(elementStr) {
60+
const openEnd = elementStr.indexOf(">");
61+
const closeStart = elementStr.lastIndexOf("</");
62+
const text = openEnd >= 0 && closeStart > openEnd ? cleanInline(elementStr.slice(openEnd + 1, closeStart)) : "";
63+
return text ? `# ${text}` : "";
64+
}
65+
66+
/**
67+
* Resolve a hero card element to a Markdown link-list item.
68+
* @returns {string} `- [title](href): description` (empty string if no content)
69+
*/
70+
export function heroCardToMarkdown(elementStr) {
71+
const { href, title, description } = parseHeroCard(elementStr);
72+
if (!href && !title) return "";
73+
const label = title || href;
74+
let line = href ? `- [${label}](${href})` : `- ${label}`;
75+
if (description) line += `: ${description}`;
76+
return line;
77+
}

scripts/component-handlers/home-page-hero.mjs

Lines changed: 0 additions & 61 deletions
This file was deleted.

scripts/mdx-to-md.mjs

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
import { jsonTableToMarkdown } from "./component-handlers/data-tables.mjs";
3636
import { integrationsGridToMarkdown } from "./component-handlers/integrations.mjs";
37-
import { homePageHeroToMarkdown } from "./component-handlers/home-page-hero.mjs";
37+
import { heroCardToMarkdown, heroHeadlineToMarkdown } from "./component-handlers/hero.mjs";
3838
import { parseCardItems, cardsToMarkdown } from "./component-handlers/cards.mjs";
3939
import { FEATURE_RELEASE_TYPES } from "../src/constants/featureReleaseTypes.js";
4040
import { readFileSync, existsSync } from "fs";
@@ -69,8 +69,23 @@ export const COMPONENT_REGISTRY = {
6969
SetupStep: "setup-step",
7070
JsonTable: "json-table",
7171
IntegrationsGrid: "integrations-grid",
72-
HomePageHero: "home-page-hero",
7372
ViewSourceCodeNotice: "view-source-code-notice",
73+
74+
// Homepage hero (docs/index.mdx). Copy is authored in the MDX and composed
75+
// from presentational components in src/components/elements/HomePageHero.js.
76+
// Layout wrappers strip to their inner Markdown; the single-line HeroHeader /
77+
// HeroCta lines strip whole (their text is redundant with the title / first
78+
// action card); the cards resolve to Markdown link-list items.
79+
HeroWrapper: "strip-tag",
80+
HeroHeader: "strip-tag",
81+
HeroSection: "strip-tag",
82+
HeroContent: "strip-tag",
83+
HeroHeadline: "hero-headline",
84+
HeroActions: "strip-tag",
85+
HeroCta: "strip-tag",
86+
CommunityCards: "strip-tag",
87+
ActionCard: "hero-card",
88+
CommunityCard: "hero-card",
7489
DefinitionList: "strip-tag",
7590
DL: "strip-tag",
7691
DT: "strip-tag",
@@ -1167,12 +1182,37 @@ export function transformMdx(mdxContent, options = {}) {
11671182
continue;
11681183
}
11691184

1170-
// --- HomePageHero (self-closing) → hardcoded hero content ---
1171-
// See scripts/component-handlers/home-page-hero.mjs (kept in sync with
1172-
// src/components/elements/HomePageHero.js).
1173-
if (state === State.NORMAL && /^\s*<HomePageHero\b/.test(line)) {
1174-
outputLines.push(homePageHeroToMarkdown());
1175-
outputLines.push("");
1185+
// --- HeroHeadline → Markdown H1 ---
1186+
if (state === State.NORMAL && /^\s*<HeroHeadline\b/.test(line)) {
1187+
let el = line;
1188+
while (!/<\/HeroHeadline>/.test(el) && i + 1 < lines.length) {
1189+
i++;
1190+
el += "\n" + lines[i];
1191+
}
1192+
const md = heroHeadlineToMarkdown(el);
1193+
if (md) {
1194+
outputLines.push(md);
1195+
outputLines.push("");
1196+
}
1197+
continue;
1198+
}
1199+
1200+
// --- ActionCard / CommunityCard → Markdown link-list item ---
1201+
// The homepage hero cards (docs/index.mdx). Accumulate the whole element
1202+
// (usually a single line) and resolve title/href/description to a list item.
1203+
if (state === State.NORMAL && /^\s*<(ActionCard|CommunityCard)\b/.test(line)) {
1204+
const name = line.match(/^\s*<(ActionCard|CommunityCard)\b/)[1];
1205+
const closeRe = new RegExp(`</${name}>`);
1206+
let el = line;
1207+
while (!closeRe.test(el) && i + 1 < lines.length) {
1208+
i++;
1209+
el += "\n" + lines[i];
1210+
}
1211+
const md = heroCardToMarkdown(el);
1212+
if (md) {
1213+
outputLines.push(md);
1214+
outputLines.push("");
1215+
}
11761216
continue;
11771217
}
11781218

0 commit comments

Comments
 (0)