refactor: move internals -> content dir

This commit is contained in:
bholmesdev 2022-10-24 11:29:50 -04:00
parent 47645d8dfd
commit 9854fdec24
6 changed files with 5 additions and 5 deletions

View file

@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { getErrorMsg, parseEntryData } from 'astro/content-internals'; import { getErrorMsg, parseEntryData } from 'astro/content/internals';
const defaultSchemaFileResolved = { schema: { parse: (mod) => mod } }; const defaultSchemaFileResolved = { schema: { parse: (mod) => mod } };
/** Used to stub out `schemaMap` entries that don't have a `~schema.ts` file */ /** Used to stub out `schemaMap` entries that don't have a `~schema.ts` file */

View file

@ -42,7 +42,7 @@
"types": "./config.d.ts", "types": "./config.d.ts",
"default": "./config.mjs" "default": "./config.mjs"
}, },
"./content-internals": "./dist/content-internals/index.js", "./content/internals": "./dist/content/internals.js",
"./app": "./dist/core/app/index.js", "./app": "./dist/core/app/index.js",
"./app/node": "./dist/core/app/node.js", "./app/node": "./dist/core/app/node.js",
"./client/*": "./dist/runtime/client/*", "./client/*": "./dist/runtime/client/*",

View file

@ -14,7 +14,7 @@ type Dirs = {
generatedInputDir: URL; generatedInputDir: URL;
}; };
const CONTENT_BASE = 'content'; const CONTENT_BASE = 'content-generated';
const CONTENT_FILE = CONTENT_BASE + '.mjs'; const CONTENT_FILE = CONTENT_BASE + '.mjs';
const CONTENT_TYPES_FILE = CONTENT_BASE + '.d.ts'; const CONTENT_TYPES_FILE = CONTENT_BASE + '.d.ts';
@ -29,7 +29,7 @@ export function astroContentPlugin({
const dirs: Dirs = { const dirs: Dirs = {
cacheDir: new URL('./.astro/', root), cacheDir: new URL('./.astro/', root),
contentDir: new URL('./content/', srcDir), contentDir: new URL('./content/', srcDir),
generatedInputDir: new URL('../../content-reference/', import.meta.url), generatedInputDir: new URL('../../', import.meta.url),
}; };
let contentDirExists = false; let contentDirExists = false;

View file

@ -20,7 +20,7 @@ import astroScriptsPlugin from '../vite-plugin-scripts/index.js';
import astroScriptsPageSSRPlugin from '../vite-plugin-scripts/page-ssr.js'; import astroScriptsPageSSRPlugin from '../vite-plugin-scripts/page-ssr.js';
import { createCustomViteLogger } from './errors/dev/index.js'; import { createCustomViteLogger } from './errors/dev/index.js';
import { resolveDependency } from './util.js'; import { resolveDependency } from './util.js';
import { astroContentPlugin } from '../vite-plugin-content/index.js'; import { astroContentPlugin } from '../content/vite-plugin.js';
interface CreateViteOptions { interface CreateViteOptions {
settings: AstroSettings; settings: AstroSettings;