Skip to content

Commit 46fd2f5

Browse files
committed
relax unified processor types
1 parent 94ef63b commit 46fd2f5

File tree

4 files changed

+16
-49
lines changed

4 files changed

+16
-49
lines changed

.changeset/olive-results-open.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/contentlayer": patch
3+
---
4+
5+
relax unified processor types

packages/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"minimatch": "^10.0.1",
5353
"tsup": "^8.4.0",
5454
"typescript": "^5.8.3",
55-
"unified": "^11.0.5",
5655
"unist-util-remove": "^4.0.0",
5756
"vfile": "^6.0.3"
5857
}

packages/core/src/SourcePlugin.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { constTrue } from "effect/Function"
77
import * as Mailbox from "effect/Mailbox"
88
import type * as Scope from "effect/Scope"
99
import * as Stream from "effect/Stream"
10-
import type * as Unified from "unified"
1110
import * as Remove from "unist-util-remove"
1211
import type { VFile } from "vfile"
1312
import { ContentlayerError } from "./ContentlayerError.ts"
@@ -110,8 +109,8 @@ export const unified = <
110109
EX = never
111110
>(options: {
112111
readonly processor:
113-
| Unified.Processor<any, any, any, any, any>
114-
| Effect.Effect<Unified.Processor<any, any, any, any, any>, EX, Source.Source.Provided | Scope.Scope>
112+
| UnifiedProcessor
113+
| Effect.Effect<UnifiedProcessor, EX, Source.Source.Provided | Scope.Scope>
115114
readonly extractFields?: ((vfile: VFile) => Record<string, any>) | undefined
116115
}): <Meta, In, E>(
117116
source: Source.Source<Meta, In, E>
@@ -142,7 +141,15 @@ export const unified = <
142141
* @since 1.0.0
143142
* @category unified
144143
*/
145-
export const unifiedRemoveYaml: Unified.Plugin = () => (tree) => {
144+
export interface UnifiedProcessor {
145+
process(...args: ReadonlyArray<any>): Promise<any>
146+
}
147+
148+
/**
149+
* @since 1.0.0
150+
* @category unified
151+
*/
152+
export const unifiedRemoveYaml = () => (tree: any) => {
146153
Remove.remove(tree, "yaml")
147154
}
148155

pnpm-lock.yaml

Lines changed: 0 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)