diff --git a/packages/core/package.json b/packages/core/package.json index 8d39039..1f2ba0b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -24,6 +24,9 @@ "effect": "^3.10.2", "esbuild": "^0.24.0", "glob": "^11.0.0", + "rehype-format": "^5.0.1", + "rehype-stringify": "^10.0.1", + "remark-rehype": "^11.1.1", "unified": "^11.0.5", "unist": "^0.0.1" }, @@ -33,6 +36,7 @@ "remark-frontmatter": "^5.0.0", "remark-parse": "^11.0.0", "remark-parse-frontmatter": "^1.0.3", - "remark-stringify": "^11.0.0" + "remark-stringify": "^11.0.0", + "vfile": "^6.0.3" } } diff --git a/packages/core/src/ConfigBuilder.ts b/packages/core/src/ConfigBuilder.ts index 487f255..65eda73 100644 --- a/packages/core/src/ConfigBuilder.ts +++ b/packages/core/src/ConfigBuilder.ts @@ -74,7 +74,8 @@ export const make = Effect.gen(function*() { return { config: config.changes.pipe( - Stream.filterMap(identity) + Stream.filterMap(identity), + Stream.debounce("200 millis") ) } as const }) diff --git a/packages/core/src/DocumentBuilder.ts b/packages/core/src/DocumentBuilder.ts index f6bf635..9ba9613 100644 --- a/packages/core/src/DocumentBuilder.ts +++ b/packages/core/src/DocumentBuilder.ts @@ -5,20 +5,36 @@ import * as Console from "effect/Console" import * as Context from "effect/Context" import * as Effect from "effect/Effect" import * as Layer from "effect/Layer" +import * as Schema from "effect/Schema" import * as Stream from "effect/Stream" import { ConfigBuilder } from "./ConfigBuilder.js" +import type * as Document from "./Document.js" +import type * as Source from "./Source.js" const make = Effect.gen(function*() { const config = yield* ConfigBuilder const documents = config.config.pipe( - Stream.flatMap((config) => Stream.fromIterable(config.documents)), - Stream.bindTo("document"), - Stream.bind("source", ({ document }) => - document.source.pipe( - Stream.catchAllCause((cause) => Stream.drain(Effect.logError(cause))) - ) as Stream.Stream>), - Stream.runForEach((_) => Console.dir(_.source, { depth: null })), + Stream.flatMap((config) => + Stream.fromIterable(config.documents).pipe( + Stream.bindTo("document"), + Stream.let("decodeFields", ({ document }) => Schema.decodeUnknown(Schema.Struct(document.fields))), + Stream.bind("output", ({ document }) => + document.source.pipe( + Stream.catchAllCause((cause) => Stream.drain(Effect.logError(cause))) + ) as Stream.Stream>), + Stream.bind("fields", ({ decodeFields, document, output }) => + decodeFields(output.fields).pipe( + Effect.flatMap((fields) => resolveComputedFields({ document, output, fields })) + ), { concurrency: "unbounded" }), + Stream.runForEach((_) => + Console.dir({ + fields: _.fields + }, { depth: null }) + ), + Effect.catchAllCause(Effect.logError) + ), { switch: true }), + Stream.runDrain, Effect.forkScoped ) @@ -39,3 +55,30 @@ export class DocumentBuilder extends Context.Tag("@effect/contentlayer-core/Docu Layer.provide(ConfigBuilder.Live) ) } + +const resolveComputedFields = (options: { + readonly document: Document.Document + readonly output: Source.Output + readonly fields: Record +}) => + Effect.reduce( + options.document.computedFields, + options.fields, + (fields, group) => + Effect.forEach( + group, + (field) => + field.resolve(fields, options.output.context).pipe( + Effect.tap(Schema.validate(field.schema)) + ), + { concurrency: group.length } + ).pipe( + Effect.map((values) => { + const newFields = { ...fields } + for (let index = 0; index < group.length; index++) { + newFields[group[index].name] = values[index] + } + return newFields + }) + ) + ) diff --git a/packages/core/src/Source.ts b/packages/core/src/Source.ts index 532386d..9477625 100644 --- a/packages/core/src/Source.ts +++ b/packages/core/src/Source.ts @@ -4,6 +4,7 @@ import type * as CommandExecutor from "@effect/platform/CommandExecutor" import * as FileSystem from "@effect/platform/FileSystem" import * as Path from "@effect/platform/Path" +import * as Context from "effect/Context" import * as Data from "effect/Data" import * as Effect from "effect/Effect" import * as Stream from "effect/Stream" @@ -14,7 +15,7 @@ import { ContentlayerError } from "./ContentlayerError.js" * @since 1.0.0 * @category models */ -export interface Source extends Stream.Stream, E, Source.Provided> {} +export interface Source extends Stream.Stream, ContentlayerError, Source.Provided> {} /** * @since 1.0.0 @@ -25,13 +26,19 @@ export declare namespace Source { * @since 1.0.0 * @category models */ - export type Any = Source | Source + export type Any = Source /** * @since 1.0.0 * @category models */ - export type Meta = A extends Source ? Meta : never + export type Meta = A extends Source ? Meta : never + + /** + * @since 1.0.0 + * @category models + */ + export type MetaContext = A extends Source ? Context.Context : never /** * @since 1.0.0 @@ -61,13 +68,23 @@ export class Output extends Data.Class<{ readonly content: Effect.Effect readonly contentUint8Array: Effect.Effect readonly fields: Record - readonly meta: Meta + readonly context: Context.Context }> { /** * @since 1.0.0 */ readonly [OutputTypeId]: OutputTypeId = OutputTypeId + /** + * @since 1.0.0 + */ + addMeta(tag: Context.Tag, value: S): Output { + return new Output({ + ...this, + context: Context.add(this.context, tag, value) + }) + } + /** * @since 1.0.0 */ @@ -99,10 +116,13 @@ export class Output extends Data.Class<{ * @since 1.0.0 * @category file system */ -export interface FileSystemMeta extends Path.Path.Parsed { - readonly path: string - readonly name: string -} +class FileSystemMeta extends Context.Tag("@effect/contentlayer-core/Source/FileSystemMeta")< + FileSystemMeta, + Path.Path.Parsed & { + readonly path: string + readonly name: string + } +>() {} /** * @since 1.0.0 @@ -110,7 +130,7 @@ export interface FileSystemMeta extends Path.Path.Parsed { */ export const fileSystem = (options: { readonly paths: ReadonlyArray -}): Source => +}): Source => Effect.gen(function*() { const fs = yield* FileSystem.FileSystem const path_ = yield* Path.Path @@ -131,11 +151,11 @@ export const fileSystem = (options: { stream: Stream.orDie(fs.stream(path)), content: Effect.orDie(fs.readFileString(path)), contentUint8Array: Effect.orDie(fs.readFile(path)), - meta: { + context: FileSystemMeta.context({ ...path_.parse(path), path, name: path_.basename(path) - }, + }), fields: {} }) diff --git a/packages/core/src/SourcePlugin.ts b/packages/core/src/SourcePlugin.ts index 745443b..f53939e 100644 --- a/packages/core/src/SourcePlugin.ts +++ b/packages/core/src/SourcePlugin.ts @@ -1,17 +1,31 @@ /** * @since 1.0.0 */ +import * as Context from "effect/Context" import * as Effect from "effect/Effect" import * as Stream from "effect/Stream" +import rehypeFormat from "rehype-format" +import rehypeStringify from "rehype-stringify" import remarkFrontmatter from "remark-frontmatter" import remarkParse from "remark-parse" import remarkParseFrontmatter from "remark-parse-frontmatter" +import remarkRehype from "remark-rehype" import remarkStringify from "remark-stringify" import * as Unified from "unified" import type * as Unist from "unist" +import type { VFile } from "vfile" import { ContentlayerError } from "./ContentlayerError.js" import type * as Source from "./Source.js" +/** + * @since 1.0.0 + * @category unified + */ +export class UnifiedOutput extends Context.Tag("@effect/contentlayer-core/SourcePlugin/UnifiedOutput")< + UnifiedOutput, + VFile +>() {} + /** * @since 1.0.0 * @category unified @@ -21,18 +35,18 @@ export const unified = < HeadTree extends Unist.Node, TailTree extends Unist.Node, CompileTree extends Unist.Node, - Out extends Unified.CompileResults, - EX = never + Out extends Unified.CompileResults >(options: { readonly processor: | Unified.Processor - | Effect.Effect, EX, Source.Source.Provided> - readonly metadata: (_: Record) => Record + | Effect.Effect< + Unified.Processor, + ContentlayerError, + Source.Source.Provided + > + readonly extractFields: (vfile: VFile) => Record }) => -(source: Source.Source): Source.Source< - In, - EX | InErr | ContentlayerError -> => +(source: Source.Source): Source.Source => (Effect.isEffect(options.processor) ? options.processor : Effect.succeed(options.processor)).pipe( Effect.map((processor) => source.pipe( @@ -49,10 +63,9 @@ export const unified = < }) }), Effect.map((vfile) => - output.addFields({ - body: vfile.value, - ...options.metadata(vfile.data) - }) + output + .addMeta(UnifiedOutput, vfile) + .addFields(options.extractFields(vfile)) ) ) ) @@ -71,5 +84,29 @@ export const unifiedRemark = unified({ .use(remarkStringify) .use(remarkFrontmatter) .use(remarkParseFrontmatter), - metadata: (data) => data.frontmatter ?? {} + extractFields: (vfile) => ({ + ...vfile.data, + ...vfile.data?.frontmatter as any, + body: vfile.value + }) +}) + +/** + * @since 1.0.0 + * @category unified + */ +export const unifiedRemarkRehype = unified({ + processor: Unified.unified() + .use(remarkParse) + .use(remarkStringify) + .use(remarkFrontmatter) + .use(remarkParseFrontmatter) + .use(remarkRehype) + .use(rehypeFormat) + .use(rehypeStringify), + extractFields: (vfile) => ({ + ...vfile.data, + ...vfile.data?.frontmatter as any, + body: vfile.value + }) }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 471cddf..6abce1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,6 +164,15 @@ importers: glob: specifier: ^11.0.0 version: 11.0.0 + rehype-format: + specifier: ^5.0.1 + version: 5.0.1 + rehype-stringify: + specifier: ^10.0.1 + version: 10.0.1 + remark-rehype: + specifier: ^11.1.1 + version: 11.1.1 unified: specifier: ^11.0.5 version: 11.0.5 @@ -189,6 +198,9 @@ importers: remark-stringify: specifier: ^11.0.0 version: 11.0.0 + vfile: + specifier: ^6.0.3 + version: 6.0.3 packages: @@ -1305,6 +1317,9 @@ packages: '@types/glob@7.1.3': resolution: {integrity: sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==} + '@types/hast@3.0.4': + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} @@ -1709,6 +1724,9 @@ packages: caniuse-lite@1.0.30001669: resolution: {integrity: sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==} + ccount@2.0.1: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + chai@5.1.2: resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} engines: {node: '>=12'} @@ -1721,9 +1739,15 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + character-entities-html4@2.1.0: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + character-entities-legacy@1.1.4: resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} + character-entities-legacy@3.0.0: + resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + character-entities@1.2.4: resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} @@ -1781,6 +1805,9 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + comma-separated-tokens@2.0.3: + resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + commander@12.1.0: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} @@ -2193,6 +2220,7 @@ packages: eslint@8.57.1: resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true espree@9.6.1: @@ -2488,6 +2516,33 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + hast-util-embedded@3.0.0: + resolution: {integrity: sha512-naH8sld4Pe2ep03qqULEtvYr7EjrLK2QHY8KJR6RJkTUjPGObe1vnx585uzem2hGra+s1q08DZZpfgDVYRbaXA==} + + hast-util-format@1.1.0: + resolution: {integrity: sha512-yY1UDz6bC9rDvCWHpx12aIBGRG7krurX0p0Fm6pT547LwDIZZiNr8a+IHDogorAdreULSEzP82Nlv5SZkHZcjA==} + + hast-util-has-property@3.0.0: + resolution: {integrity: sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA==} + + hast-util-is-body-ok-link@3.0.1: + resolution: {integrity: sha512-0qpnzOBLztXHbHQenVB8uNuxTnm/QBFUOmdOSsEn7GnBtyY07+ENTWVFBAnXd/zEgd9/SUG3lRY7hSIBWRgGpQ==} + + hast-util-is-element@3.0.0: + resolution: {integrity: sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==} + + hast-util-minify-whitespace@1.0.1: + resolution: {integrity: sha512-L96fPOVpnclQE0xzdWb/D12VT5FabA7SnZOUMtL1DbXmYiHJMXZvFkIZfiMmTCNJHUeO2K9UYNXoVyfz+QHuOw==} + + hast-util-phrasing@3.0.1: + resolution: {integrity: sha512-6h60VfI3uBQUxHqTyMymMZnEbNl1XmEGtOxxKYL7stY2o601COo62AWAYBQR9lZbYXYSBoxag8UpPRXK+9fqSQ==} + + hast-util-to-html@9.0.3: + resolution: {integrity: sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==} + + hast-util-whitespace@3.0.0: + resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + headers-polyfill@4.0.3: resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} @@ -2497,6 +2552,12 @@ packages: html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + html-void-elements@3.0.0: + resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==} + + html-whitespace-sensitive-tag-names@3.0.1: + resolution: {integrity: sha512-q+310vW8zmymYHALr1da4HyXUQ0zgiIwIicEfotYPWGN0OJVEN/58IJ3A4GBYcEq3LGAZqKb+ugvP0GNB9CEAA==} + human-id@1.0.2: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} @@ -2943,6 +3004,9 @@ packages: mdast-util-phrasing@4.1.0: resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + mdast-util-to-hast@13.2.0: + resolution: {integrity: sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==} + mdast-util-to-markdown@2.1.0: resolution: {integrity: sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==} @@ -3369,6 +3433,9 @@ packages: process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + property-information@6.5.0: + resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} + pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} @@ -3435,6 +3502,12 @@ packages: resolution: {integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==} engines: {node: '>= 0.4'} + rehype-format@5.0.1: + resolution: {integrity: sha512-zvmVru9uB0josBVpr946OR8ui7nJEdzZobwLOOqHb/OOD88W0Vk2SqLwoVOj0fM6IPCCO6TaV9CvQvJMWwukFQ==} + + rehype-stringify@10.0.1: + resolution: {integrity: sha512-k9ecfXHmIPuFVI61B9DeLPN0qFHfawM6RsuX48hoqlaKSF61RskNjSm1lI8PhBEM0MRdLxVVm4WmTqJQccH9mA==} + remark-frontmatter@5.0.0: resolution: {integrity: sha512-XTFYvNASMe5iPN0719nPrdItC9aU0ssC4v14mH1BCi1u0n1gAocqcujWUrByftZTbLhRtiKRyjYTSIOcr69UVQ==} @@ -3445,6 +3518,9 @@ packages: remark-parse@11.0.0: resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} + remark-rehype@11.1.1: + resolution: {integrity: sha512-g/osARvjkBXb6Wo0XvAeXQohVta8i84ACbenPpoSsxTOQH/Ae0/RGP4WZgnMH5pMLpsj4FG7OHmcIcXxpza8eQ==} + remark-stringify@11.0.0: resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} @@ -3633,6 +3709,9 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + space-separated-tokens@2.0.2: + resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} + spawndamnit@2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} @@ -3696,6 +3775,9 @@ packages: string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + stringify-entities@4.0.4: + resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} + stringify-object@3.3.0: resolution: {integrity: sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==} engines: {node: '>=4'} @@ -3812,6 +3894,9 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + trim-lines@3.0.1: + resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} + trough@2.2.0: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} @@ -3926,6 +4011,9 @@ packages: unist-util-is@6.0.0: resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} + unist-util-position@5.0.0: + resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} @@ -5196,6 +5284,10 @@ snapshots: '@types/minimatch': 5.1.2 '@types/node': 22.7.9 + '@types/hast@3.0.4': + dependencies: + '@types/unist': 3.0.3 + '@types/istanbul-lib-coverage@2.0.6': {} '@types/istanbul-lib-report@3.0.3': @@ -5683,6 +5775,8 @@ snapshots: caniuse-lite@1.0.30001669: {} + ccount@2.0.1: {} + chai@5.1.2: dependencies: assertion-error: 2.0.1 @@ -5702,8 +5796,12 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 + character-entities-html4@2.1.0: {} + character-entities-legacy@1.1.4: {} + character-entities-legacy@3.0.0: {} + character-entities@1.2.4: {} character-entities@2.0.2: {} @@ -5757,6 +5855,8 @@ snapshots: color-name@1.1.4: {} + comma-separated-tokens@2.0.3: {} + commander@12.1.0: {} commander@2.20.3: {} @@ -6659,12 +6759,77 @@ snapshots: dependencies: function-bind: 1.1.2 + hast-util-embedded@3.0.0: + dependencies: + '@types/hast': 3.0.4 + hast-util-is-element: 3.0.0 + + hast-util-format@1.1.0: + dependencies: + '@types/hast': 3.0.4 + hast-util-embedded: 3.0.0 + hast-util-minify-whitespace: 1.0.1 + hast-util-phrasing: 3.0.1 + hast-util-whitespace: 3.0.0 + html-whitespace-sensitive-tag-names: 3.0.1 + unist-util-visit-parents: 6.0.1 + + hast-util-has-property@3.0.0: + dependencies: + '@types/hast': 3.0.4 + + hast-util-is-body-ok-link@3.0.1: + dependencies: + '@types/hast': 3.0.4 + + hast-util-is-element@3.0.0: + dependencies: + '@types/hast': 3.0.4 + + hast-util-minify-whitespace@1.0.1: + dependencies: + '@types/hast': 3.0.4 + hast-util-embedded: 3.0.0 + hast-util-is-element: 3.0.0 + hast-util-whitespace: 3.0.0 + unist-util-is: 6.0.0 + + hast-util-phrasing@3.0.1: + dependencies: + '@types/hast': 3.0.4 + hast-util-embedded: 3.0.0 + hast-util-has-property: 3.0.0 + hast-util-is-body-ok-link: 3.0.1 + hast-util-is-element: 3.0.0 + + hast-util-to-html@9.0.3: + dependencies: + '@types/hast': 3.0.4 + '@types/unist': 3.0.3 + ccount: 2.0.1 + comma-separated-tokens: 2.0.3 + hast-util-whitespace: 3.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.2.0 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + stringify-entities: 4.0.4 + zwitch: 2.0.4 + + hast-util-whitespace@3.0.0: + dependencies: + '@types/hast': 3.0.4 + headers-polyfill@4.0.3: {} hosted-git-info@2.8.9: {} html-escaper@2.0.2: {} + html-void-elements@3.0.0: {} + + html-whitespace-sensitive-tag-names@3.0.1: {} + human-id@1.0.2: {} iconv-lite@0.4.24: @@ -7126,6 +7291,18 @@ snapshots: '@types/mdast': 4.0.4 unist-util-is: 6.0.0 + mdast-util-to-hast@13.2.0: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@ungap/structured-clone': 1.2.0 + devlop: 1.1.0 + micromark-util-sanitize-uri: 2.0.0 + trim-lines: 3.0.1 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + mdast-util-to-markdown@2.1.0: dependencies: '@types/mdast': 4.0.4 @@ -7647,6 +7824,8 @@ snapshots: process-nextick-args@2.0.1: {} + property-information@6.5.0: {} + pseudomap@1.0.2: {} psl@1.9.0: {} @@ -7728,6 +7907,17 @@ snapshots: es-errors: 1.3.0 set-function-name: 2.0.2 + rehype-format@5.0.1: + dependencies: + '@types/hast': 3.0.4 + hast-util-format: 1.1.0 + + rehype-stringify@10.0.1: + dependencies: + '@types/hast': 3.0.4 + hast-util-to-html: 9.0.3 + unified: 11.0.5 + remark-frontmatter@5.0.0: dependencies: '@types/mdast': 4.0.4 @@ -7752,6 +7942,14 @@ snapshots: transitivePeerDependencies: - supports-color + remark-rehype@11.1.1: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + mdast-util-to-hast: 13.2.0 + unified: 11.0.5 + vfile: 6.0.3 + remark-stringify@11.0.0: dependencies: '@types/mdast': 4.0.4 @@ -7941,6 +8139,8 @@ snapshots: source-map@0.6.1: {} + space-separated-tokens@2.0.2: {} + spawndamnit@2.0.0: dependencies: cross-spawn: 5.1.0 @@ -8017,6 +8217,11 @@ snapshots: dependencies: safe-buffer: 5.2.1 + stringify-entities@4.0.4: + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + stringify-object@3.3.0: dependencies: get-own-enumerable-property-symbols: 3.0.2 @@ -8115,6 +8320,8 @@ snapshots: tr46@0.0.3: {} + trim-lines@3.0.1: {} + trough@2.2.0: {} ts-api-utils@1.3.0(typescript@5.6.3): @@ -8256,6 +8463,10 @@ snapshots: dependencies: '@types/unist': 3.0.3 + unist-util-position@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-stringify-position@2.0.3: dependencies: '@types/unist': 2.0.11