Skip to content

Commit

Permalink
fix: move markdoc config to runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Aug 2, 2023
1 parent 90e33d2 commit 1395d0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 1 addition & 5 deletions packages/integrations/markdoc/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import type {
} from '@markdoc/markdoc';
import _Markdoc from '@markdoc/markdoc';
import type { AstroInstance } from 'astro';
import { assetsConfig } from './assets-config.js';
import { heading, setupHeadingConfig } from './heading-ids.js';
import { mergeConfig } from './runtime.js';
import { heading } from './heading-ids.js';
import { componentConfigSymbol } from './utils.js';

export type Render = ComponentConfig | AstroInstance['default'] | string;
Expand Down Expand Up @@ -53,5 +51,3 @@ export function component(pathnameOrPkgName: string, namedExport?: string): Comp
function isNpmPackageName(pathname: string) {
return !isRelativePath(pathname) && !pathname.startsWith('/');
}

export const baseConfig = mergeConfig(setupHeadingConfig(), assetsConfig);
6 changes: 5 additions & 1 deletion packages/integrations/markdoc/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ import Markdoc, {
} from '@markdoc/markdoc';
import type { AstroInstance } from 'astro';
import { createComponent, renderComponent } from 'astro/runtime/server/index.js';
import { baseConfig, type AstroMarkdocConfig } from './config.js';
import { type AstroMarkdocConfig } from './config.js';
import { setupHeadingConfig } from './heading-ids.js';
import { htmlTag } from './html/tagdefs/html.tag.js';
import type { MarkdocIntegrationOptions } from './options.js';
import { assetsConfig } from './runtime-assets-config.js';

export const baseConfig = mergeConfig(setupHeadingConfig(), assetsConfig);

/**
* Merge user config with default config and set up context (ex. heading ID slugger)
Expand Down

0 comments on commit 1395d0c

Please sign in to comment.