Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump astrojs/check #6165

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import mdx from '@astrojs/mdx';
import preact from '@astrojs/preact';
import { defineConfig } from 'astro/config';
import { RemarkPlugin } from '@astrojs/markdown-remark';
import AutoImport from 'astro-auto-import';
import { astroExpressiveCode } from 'astro-expressive-code';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
import remarkSmartypants from 'remark-smartypants';
import { asideAutoImport, astroAsides } from './integrations/astro-asides';
import { youtubeAutoImport, astroYoutubeEmbeds } from './integrations/astro-youtube-embed';
import { ScalarApiReference } from './integrations/scalar-api-reference';
import { astroDocsExpressiveCode } from './integrations/expressive-code';
import { autolinkConfig } from './plugins/rehype-autolink-config';
import { rehypeOptimizeStatic } from './plugins/rehype-optimize-static';
import { rehypeTasklistEnhancer } from './plugins/rehype-tasklist-enhancer';
Expand All @@ -35,13 +35,15 @@ export default defineConfig({
AutoImport({
imports: [asideAutoImport, youtubeAutoImport],
}),
preact({
compat: true,
}),
astroAsides(),
astroYoutubeEmbeds(),
astroDocsExpressiveCode(),
mdx(),
astroExpressiveCode({
themes: ['slack-ochin', 'slack-dark'],
}),
mdx({
syntaxHighlight: 'shiki',
shikiConfig: { themes: {light:'slack-ochin', dark: 'slack-dark'}}
}),
react({
include: ['react-icons', 'Tables'],
}),
Expand All @@ -67,7 +69,7 @@ export default defineConfig({
remarkGraphvizPlugin(),
remarkAlgolia(),
[
remarkSmartypants,
remarkSmartypants as RemarkPlugin,
{
dashes: false,
},
Expand Down
4 changes: 2 additions & 2 deletions integrations/astro-asides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function remarkAsides(): unified.Plugin<[], mdast.Root> {
// title prop, and remove the paragraph from children.
let title: string | undefined;
remove(node, (child) => {
if (child.data?.directiveLabel) {
if ((child.data as { directiveLabel?: string })?.directiveLabel) {
if ('children' in child && 'value' in child.children[0]) {
title = child.children[0].value;
}
Expand All @@ -59,7 +59,7 @@ function remarkAsides(): unified.Plugin<[], mdast.Root> {
parent.children[index] = makeComponentNode(
AsideTagname,
{ attributes: { type, title } },
...node.children
...node.children as mdast.BlockContent[]
);
});
};
Expand Down
5 changes: 2 additions & 3 deletions integrations/astro-youtube-embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ export const youtubeAutoImport: Record<string, [string, string][]> = {
function remarkYoutubeEmbed(): unified.Plugin<[], mdast.Root> {
const transformer: unified.Transformer<mdast.Root> = (tree) => {
visit(tree, (node, index, parent) => {
// @ts-expect-error Possibly infinite type instantiation we can’t do anything about.
if (!parent || index === null || node.type !== 'leafDirective' || node.name !== 'youtube')
return;
let title: string | undefined;

remove(node, (child) => {
if (child.data?.directiveLabel) {
if ((child.data as { directiveLabel?: string })?.directiveLabel) {
if ('children' in child && 'value' in child.children[0]) {
title = child.children[0].value;
}
Expand All @@ -40,7 +39,7 @@ function remarkYoutubeEmbed(): unified.Plugin<[], mdast.Root> {
parent.children[index] = makeComponentNode(
YoutubeTagname,
{ attributes: { title, video: node.attributes.v } },
...node.children
...node.children as mdast.BlockContent[]
);
});
};
Expand Down
21 changes: 0 additions & 21 deletions integrations/expressive-code.ts

This file was deleted.

Loading
Loading