Skip to content

Commit

Permalink
fix: docs site typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Apr 30, 2024
1 parent ae883a8 commit 2846a13
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/hungry-feet-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@clarigen/cli': patch
'@clarigen/core': patch
---

Fixed a type issue when an NFT's key was a tuple
5 changes: 5 additions & 0 deletions .changeset/warm-deers-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clarigen/boot': patch
---

Added a new `@clarigen/boot` package for boot contract types.
11 changes: 10 additions & 1 deletion docs-site/contentlayer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ import path from 'path';
import { rehypePlugins, remarkPlugins } from './src/lib/mdx-utils';
import { extractTocHeadings } from './src/lib/remark-extract-toc';

const Toc = defineNestedType(() => ({
name: 'Toc',
fields: {
value: { type: 'string' },
url: { type: 'string' },
depth: { type: 'number' },
},
}));

/** @type {import('contentlayer/source-files').ComputedFields} */
const computedFields = {
slug: {
Expand All @@ -32,7 +41,7 @@ const computedFields = {
type: 'string',
resolve: doc => doc._raw.flattenedPath.split('/').slice(1).join('/'),
},
toc: { type: 'string', resolve: doc => extractTocHeadings(doc.body.raw) },
toc: { type: 'list', of: Toc, resolve: doc => extractTocHeadings(doc.body.raw) },
// url: { type: 'string', resolve: post => `/docs/${post._raw.flattenedPath}` },
};

Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const DocsPage = ({ params }: DocPageProps) => {
</div>
<aside className="fixed top-14 z-30 -ml-2 hidden h-[calc(100vh-3.5rem)] w-full shrink-0 overflow-x-auto p-4 lg:sticky lg:block">
<ScrollArea className="h-full">
<DocToc toc={post.toc as unknown as Toc} />
<DocToc toc={post.toc as Toc} />
</ScrollArea>
</aside>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs-site/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Image from 'next/image';
import { Text } from '@components/text';
import { allPosts, allExamples } from 'contentlayer/generated';
import { allExamples } from 'contentlayer/generated';
import {
PageActions,
PageHeader,
Expand Down
1 change: 1 addition & 0 deletions docs-site/src/lib/mdx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export async function compileMdx(markdown: string) {
const result = await bundleMDX({
source: markdown,
mdxOptions: options => {
// @ts-ignore
options.remarkPlugins = [...(options.remarkPlugins ?? []), ...remarkPlugins];
// @ts-ignore
options.rehypePlugins = [...(options.rehypePlugins ?? []), ...rehypePlugins];
Expand Down
2 changes: 1 addition & 1 deletion docs-site/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
".contentlayer/generated",
"contentlayer.config.js"
],
"exclude": ["node_modules"]
"exclude": ["node_modules", ".next"]
}

0 comments on commit 2846a13

Please sign in to comment.