Skip to content

Commit

Permalink
Fix/markdoc assets (#7706)
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh authored Jul 18, 2023
1 parent a77741d commit 4f6b5ae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/smart-hairs-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@astrojs/markdoc': patch
'astro': patch
---

Fix Markdoc integration not being able to import `emitESMImage` from Astro
1 change: 1 addition & 0 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"./components": "./components/index.ts",
"./components/*": "./components/*",
"./assets": "./dist/assets/index.js",
"./assets/utils": "./dist/assets/utils/index.js",
"./assets/image-endpoint": "./dist/assets/image-endpoint.js",
"./assets/services/sharp": "./dist/assets/services/sharp.js",
"./assets/services/squoosh": "./dist/assets/services/squoosh.js",
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/assets/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { emitESMImage } from './emitAsset.js';
6 changes: 3 additions & 3 deletions packages/integrations/markdoc/src/content-entry-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import type { ErrorPayload as ViteErrorPayload } from 'vite';
import type { ComponentConfig } from './config.js';
import { isComponentConfig, isValidUrl, MarkdocError, prependForwardSlash } from './utils.js';
// @ts-expect-error Cannot find module 'astro/assets' or its corresponding type declarations.
import { emitESMImage } from 'astro/assets';
import { MarkdocError, isComponentConfig, isValidUrl, prependForwardSlash } from './utils.js';
// @ts-expect-error Cannot get the types here without `moduleResolution: 'nodenext'`
import { emitESMImage } from 'astro/assets/utils';
import path from 'node:path';
import type * as rollup from 'rollup';
import type { MarkdocConfigResult } from './load-config.js';
Expand Down

0 comments on commit 4f6b5ae

Please sign in to comment.