From 6f67e600fcb6471e579498c14fdcae34b503a832 Mon Sep 17 00:00:00 2001 From: Pedro Monteagudo Date: Fri, 10 Feb 2023 18:01:51 +0100 Subject: [PATCH 1/2] remove change in type of original Options from remark-rehype --- .changeset/honest-files-talk.md | 5 +++++ packages/markdown/remark/src/types.ts | 11 ++--------- 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 .changeset/honest-files-talk.md diff --git a/.changeset/honest-files-talk.md b/.changeset/honest-files-talk.md new file mode 100644 index 000000000000..573a7fbc40e4 --- /dev/null +++ b/.changeset/honest-files-talk.md @@ -0,0 +1,5 @@ +--- +'@astrojs/markdown-remark': minor +--- + +remove change in type of original Options from remark-rehype diff --git a/packages/markdown/remark/src/types.ts b/packages/markdown/remark/src/types.ts index 413d99ca269e..860d57f74621 100644 --- a/packages/markdown/remark/src/types.ts +++ b/packages/markdown/remark/src/types.ts @@ -1,10 +1,6 @@ import type * as hast from 'hast'; import type * as mdast from 'mdast'; -import type { - all as Handlers, - one as Handler, - Options as RemarkRehypeOptions, -} from 'remark-rehype'; +import type { Options as RemarkRehypeOptions } from 'remark-rehype'; import type { ILanguageRegistration, IThemeRegistration, Theme } from 'shiki'; import type * as unified from 'unified'; import type { VFile } from 'vfile'; @@ -29,10 +25,7 @@ export type RehypePlugin = unified.Plugi export type RehypePlugins = (string | [string, any] | RehypePlugin | [RehypePlugin, any])[]; -export type RemarkRehype = Omit & { - handlers?: typeof Handlers; - handler?: typeof Handler; -}; +export type RemarkRehype = RemarkRehypeOptions export interface ShikiConfig { langs?: ILanguageRegistration[]; From 62078c41edf65c2ee1ea3599c99aad13a3dd5b86 Mon Sep 17 00:00:00 2001 From: Pedro Monteagudo Date: Wed, 8 Mar 2023 23:08:21 +0100 Subject: [PATCH 2/2] typescript bug workaround to fix build --- packages/astro/tsconfig.json | 3 ++- packages/markdown/remark/src/types.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/astro/tsconfig.json b/packages/astro/tsconfig.json index 23ac0c78b62b..8f840b25d036 100644 --- a/packages/astro/tsconfig.json +++ b/packages/astro/tsconfig.json @@ -6,6 +6,7 @@ "declarationDir": "./dist", "module": "ES2022", "outDir": "./dist", - "target": "ES2021" + "target": "ES2021", + "preserveSymlinks": true } } diff --git a/packages/markdown/remark/src/types.ts b/packages/markdown/remark/src/types.ts index 860d57f74621..e16c2c1a6542 100644 --- a/packages/markdown/remark/src/types.ts +++ b/packages/markdown/remark/src/types.ts @@ -25,7 +25,7 @@ export type RehypePlugin = unified.Plugi export type RehypePlugins = (string | [string, any] | RehypePlugin | [RehypePlugin, any])[]; -export type RemarkRehype = RemarkRehypeOptions +export type RemarkRehype = Omit export interface ShikiConfig { langs?: ILanguageRegistration[];