blank project
This commit is contained in:
19
node_modules/astro/dist/config/entrypoint.d.ts
generated
vendored
Normal file
19
node_modules/astro/dist/config/entrypoint.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { SharpImageServiceConfig } from '../assets/services/sharp.js';
|
||||
import type { ImageServiceConfig } from '../types/public/index.js';
|
||||
export { defineAstroFontProvider, fontProviders } from '../assets/fonts/providers/index.js';
|
||||
export type { AstroFontProvider } from '../assets/fonts/types.js';
|
||||
export { mergeConfig } from '../core/config/merge.js';
|
||||
export { validateConfig } from '../core/config/validate.js';
|
||||
export { envField } from '../env/config.js';
|
||||
export { defineConfig, getViteConfig } from './index.js';
|
||||
/**
|
||||
* Return the configuration needed to use the Sharp-based image service
|
||||
*/
|
||||
export declare function sharpImageService(config?: SharpImageServiceConfig): ImageServiceConfig;
|
||||
/**
|
||||
* Return the configuration needed to use the passthrough image service. This image services does not perform
|
||||
* any image transformations, and is mainly useful when your platform does not support other image services, or you are
|
||||
* not using Astro's built-in image processing.
|
||||
* See: https://docs.astro.build/en/guides/images/#configure-no-op-passthrough-service
|
||||
*/
|
||||
export declare function passthroughImageService(): ImageServiceConfig;
|
||||
28
node_modules/astro/dist/config/entrypoint.js
generated
vendored
Normal file
28
node_modules/astro/dist/config/entrypoint.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { defineAstroFontProvider, fontProviders } from "../assets/fonts/providers/index.js";
|
||||
import { mergeConfig } from "../core/config/merge.js";
|
||||
import { validateConfig } from "../core/config/validate.js";
|
||||
import { envField } from "../env/config.js";
|
||||
import { defineConfig, getViteConfig } from "./index.js";
|
||||
function sharpImageService(config = {}) {
|
||||
return {
|
||||
entrypoint: "astro/assets/services/sharp",
|
||||
config
|
||||
};
|
||||
}
|
||||
function passthroughImageService() {
|
||||
return {
|
||||
entrypoint: "astro/assets/services/noop",
|
||||
config: {}
|
||||
};
|
||||
}
|
||||
export {
|
||||
defineAstroFontProvider,
|
||||
defineConfig,
|
||||
envField,
|
||||
fontProviders,
|
||||
getViteConfig,
|
||||
mergeConfig,
|
||||
passthroughImageService,
|
||||
sharpImageService,
|
||||
validateConfig
|
||||
};
|
||||
11
node_modules/astro/dist/config/index.d.ts
generated
vendored
Normal file
11
node_modules/astro/dist/config/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { UserConfig as ViteUserConfig, UserConfigFn as ViteUserConfigFn } from 'vite';
|
||||
import type { AstroInlineConfig, AstroUserConfig, Locales, SessionDriverName } from '../types/public/config.js';
|
||||
/**
|
||||
* See the full Astro Configuration API Documentation
|
||||
* https://astro.build/config
|
||||
*/
|
||||
export declare function defineConfig<const TLocales extends Locales = never, const TDriver extends SessionDriverName = never>(config: AstroUserConfig<TLocales, TDriver>): AstroUserConfig<TLocales, TDriver>;
|
||||
/**
|
||||
* Use Astro to generate a fully resolved Vite config
|
||||
*/
|
||||
export declare function getViteConfig(userViteConfig: ViteUserConfig, inlineAstroConfig?: AstroInlineConfig): ViteUserConfigFn;
|
||||
48
node_modules/astro/dist/config/index.js
generated
vendored
Normal file
48
node_modules/astro/dist/config/index.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { createRoutesList } from "../core/routing/index.js";
|
||||
import { createDevelopmentManifest } from "../vite-plugin-astro-server/plugin.js";
|
||||
function defineConfig(config) {
|
||||
return config;
|
||||
}
|
||||
function getViteConfig(userViteConfig, inlineAstroConfig = {}) {
|
||||
return async ({ mode, command }) => {
|
||||
const cmd = command === "serve" ? "dev" : "build";
|
||||
const [
|
||||
fs,
|
||||
{ mergeConfig },
|
||||
{ createNodeLogger },
|
||||
{ resolveConfig, createSettings },
|
||||
{ createVite },
|
||||
{ runHookConfigSetup, runHookConfigDone },
|
||||
{ astroContentListenPlugin }
|
||||
] = await Promise.all([
|
||||
import("node:fs"),
|
||||
import("vite"),
|
||||
import("../core/config/logging.js"),
|
||||
import("../core/config/index.js"),
|
||||
import("../core/create-vite.js"),
|
||||
import("../integrations/hooks.js"),
|
||||
import("./vite-plugin-content-listen.js")
|
||||
]);
|
||||
const logger = createNodeLogger(inlineAstroConfig);
|
||||
const { astroConfig: config } = await resolveConfig(inlineAstroConfig, cmd);
|
||||
let settings = await createSettings(config, userViteConfig.root);
|
||||
settings = await runHookConfigSetup({ settings, command: cmd, logger });
|
||||
const routesList = await createRoutesList({ settings }, logger);
|
||||
const manifest = createDevelopmentManifest(settings);
|
||||
const viteConfig = await createVite(
|
||||
{
|
||||
plugins: config.legacy.collections ? [
|
||||
// Initialize the content listener
|
||||
astroContentListenPlugin({ settings, logger, fs })
|
||||
] : []
|
||||
},
|
||||
{ settings, command: cmd, logger, mode, sync: false, manifest, routesList }
|
||||
);
|
||||
await runHookConfigDone({ settings, logger });
|
||||
return mergeConfig(viteConfig, userViteConfig);
|
||||
};
|
||||
}
|
||||
export {
|
||||
defineConfig,
|
||||
getViteConfig
|
||||
};
|
||||
17
node_modules/astro/dist/config/vite-plugin-content-listen.d.ts
generated
vendored
Normal file
17
node_modules/astro/dist/config/vite-plugin-content-listen.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import type fsMod from 'node:fs';
|
||||
import type { Plugin } from 'vite';
|
||||
import type { Logger } from '../core/logger/core.js';
|
||||
import type { AstroSettings } from '../types/astro.js';
|
||||
/**
|
||||
* Listen for Astro content directory changes and generate types.
|
||||
*
|
||||
* This is a separate plugin for `getViteConfig` as the `attachContentServerListeners` API
|
||||
* needs to be called at different times in `astro dev` and `getViteConfig`. For `astro dev`,
|
||||
* it needs to be called after the Astro server is started (packages/astro/src/core/dev/dev.ts).
|
||||
* For `getViteConfig`, it needs to be called after the Vite server is started.
|
||||
*/
|
||||
export declare function astroContentListenPlugin({ settings, logger, fs, }: {
|
||||
settings: AstroSettings;
|
||||
logger: Logger;
|
||||
fs: typeof fsMod;
|
||||
}): Plugin;
|
||||
26
node_modules/astro/dist/config/vite-plugin-content-listen.js
generated
vendored
Normal file
26
node_modules/astro/dist/config/vite-plugin-content-listen.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { attachContentServerListeners } from "../content/server-listeners.js";
|
||||
function astroContentListenPlugin({
|
||||
settings,
|
||||
logger,
|
||||
fs
|
||||
}) {
|
||||
let server;
|
||||
return {
|
||||
name: "astro:content-listen",
|
||||
apply: "serve",
|
||||
configureServer(_server) {
|
||||
server = _server;
|
||||
},
|
||||
async buildStart() {
|
||||
await attachContentServerListeners({
|
||||
fs,
|
||||
settings,
|
||||
logger,
|
||||
viteServer: server
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
astroContentListenPlugin
|
||||
};
|
||||
Reference in New Issue
Block a user