Skip to content

Commit d4ace32

Browse files
committed
Cleanup
1 parent 827e440 commit d4ace32

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

packages/docs-md/assets/TryItNow/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ export const TryItNow = ({
6666
options={{
6767
autoReload: false,
6868
autorun: false,
69-
activeFile: "index.tsx",
69+
activeFile: "index.ts",
7070
}}
7171
template="vanilla-ts"
7272
files={{
73-
"index.tsx": {
73+
"index.ts": {
7474
code:
7575
_enableUnsafeAutoImport && previousCodeAtomValue
7676
? previousCodeAtomValue
@@ -83,7 +83,7 @@ export const TryItNow = ({
8383
autoImportDependencies && _enableUnsafeAutoImport
8484
? { ...autoImportDependencies, ...externalDependencies }
8585
: externalDependencies,
86-
entry: "index.tsx",
86+
entry: "index.ts",
8787
}}
8888
theme="dark"
8989
>

packages/docs-md/src/generator/mdx/renderer.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,14 @@ sidebarTitle: ${this.escapeText(sidebarLabel)}
213213
title: string;
214214
embedName: string;
215215
}) {
216-
this.#includeSidebar = true;
217-
this.insertComponentImport("SideBarCta", "SideBar/index.tsx");
218-
this.insertComponentImport("SideBar", "SideBar/index.tsx");
216+
// If this is a circular import, skip processing sidebar
219217
if (!this.#insertEmbedImport(embedName)) {
220-
console.error(`Direct circular import detected, skipping sidebar link`);
218+
// TODO: add debug logging
221219
return;
222220
}
221+
this.#includeSidebar = true;
222+
this.insertComponentImport("SideBarCta", "SideBar/index.tsx");
223+
this.insertComponentImport("SideBar", "SideBar/index.tsx");
223224
this.#lines.push(
224225
`<p>
225226
<SideBarCta cta="${`View ${this.escapeText(title, { mdxOnly: true })}`}" title="${this.escapeText(title)}">

0 commit comments

Comments
 (0)