summaryrefslogtreecommitdiff
path: root/packages/astro/src/content/vite-plugin-content-virtual-mod.ts
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2023-05-30 16:18:20 -0400
committerGravatar GitHub <noreply@github.com> 2023-05-30 16:18:20 -0400
commitbef3a75dbc48d584daff9f7f3d5a8937b0356170 (patch)
tree536921af91ee7864192369e39be6f99eed134741 /packages/astro/src/content/vite-plugin-content-virtual-mod.ts
parentc7897f20a9d6e04f9cdee9a0f7e48e59adf1e59a (diff)
downloadastro-bef3a75dbc48d584daff9f7f3d5a8937b0356170.tar.gz
astro-bef3a75dbc48d584daff9f7f3d5a8937b0356170.tar.zst
astro-bef3a75dbc48d584daff9f7f3d5a8937b0356170.zip
Markdoc - remove `$entry` variable (#7244)
* refactor: remove entry prop from `getRenderModule()` * refactor: remove `$entry` from markdoc * test: update entry-prop -> variables test * refactor: unify `getEntryConfigByExt` * chore: clean up shared content / data get logic * docs: update `$entry` recommendation * chore: rename entry-prop -> variables * chore: changeset * chore: missed a spot
Diffstat (limited to 'packages/astro/src/content/vite-plugin-content-virtual-mod.ts')
-rw-r--r--packages/astro/src/content/vite-plugin-content-virtual-mod.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts
index 71d41751e..9b0a1becc 100644
--- a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts
+++ b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts
@@ -4,12 +4,12 @@ import { extname } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import pLimit from 'p-limit';
import type { Plugin } from 'vite';
-import type { AstroSettings } from '../@types/astro.js';
+import type { AstroSettings, ContentEntryType } from '../@types/astro.js';
import { AstroError, AstroErrorData } from '../core/errors/index.js';
import { rootRelativePath } from '../core/util.js';
import { VIRTUAL_MODULE_ID } from './consts.js';
import {
- getContentEntryConfigByExtMap,
+ getEntryConfigByExtMap,
getContentEntryIdAndSlug,
getContentPaths,
getDataEntryExts,
@@ -32,7 +32,7 @@ export function astroContentVirtualModPlugin({
const contentPaths = getContentPaths(settings.config);
const relContentDir = rootRelativePath(settings.config.root, contentPaths.contentDir);
- const contentEntryConfigByExt = getContentEntryConfigByExtMap(settings);
+ const contentEntryConfigByExt = getEntryConfigByExtMap(settings.contentEntryTypes);
const contentEntryExts = [...contentEntryConfigByExt.keys()];
const dataEntryExts = getDataEntryExts(settings);
@@ -92,7 +92,7 @@ export async function getStringifiedLookupMap({
root,
fs,
}: {
- contentEntryConfigByExt: ReturnType<typeof getContentEntryConfigByExtMap>;
+ contentEntryConfigByExt: Map<string, ContentEntryType>;
dataEntryExts: string[];
contentPaths: Pick<ContentPaths, 'contentDir' | 'config'>;
root: URL;