[ci] format
This commit is contained in:
parent
c6d7ebefdd
commit
4264b7c564
10 changed files with 45 additions and 46 deletions
|
@ -1,6 +1,7 @@
|
||||||
|
import type { MarkdownHeading } from '@astrojs/markdown-remark';
|
||||||
|
import { string as zodString, ZodIssueCode } from 'zod';
|
||||||
import { AstroError, AstroErrorData } from '../core/errors/index.js';
|
import { AstroError, AstroErrorData } from '../core/errors/index.js';
|
||||||
import { prependForwardSlash } from '../core/path.js';
|
import { prependForwardSlash } from '../core/path.js';
|
||||||
import { ZodIssueCode, string as zodString, type z } from 'zod';
|
|
||||||
import {
|
import {
|
||||||
createComponent,
|
createComponent,
|
||||||
createHeadAndContent,
|
createHeadAndContent,
|
||||||
|
@ -12,7 +13,6 @@ import {
|
||||||
type AstroComponentFactory,
|
type AstroComponentFactory,
|
||||||
} from '../runtime/server/index.js';
|
} from '../runtime/server/index.js';
|
||||||
import type { ContentLookupMap } from './utils.js';
|
import type { ContentLookupMap } from './utils.js';
|
||||||
import type { MarkdownHeading } from '@astrojs/markdown-remark';
|
|
||||||
|
|
||||||
type LazyImport = () => Promise<any>;
|
type LazyImport = () => Promise<any>;
|
||||||
type GlobResult = Record<string, LazyImport>;
|
type GlobResult = Record<string, LazyImport>;
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
import {
|
import {
|
||||||
createCollectionToGlobResultMap,
|
createCollectionToGlobResultMap,
|
||||||
createGetCollection,
|
createGetCollection,
|
||||||
createGetEntryBySlug,
|
|
||||||
createGetEntry,
|
|
||||||
createGetEntries,
|
|
||||||
createGetDataEntryById,
|
createGetDataEntryById,
|
||||||
|
createGetEntries,
|
||||||
|
createGetEntry,
|
||||||
|
createGetEntryBySlug,
|
||||||
createReference,
|
createReference,
|
||||||
} from 'astro/content/runtime';
|
} from 'astro/content/runtime';
|
||||||
|
|
||||||
|
|
|
@ -5,25 +5,25 @@ import * as path from 'node:path';
|
||||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||||
import { normalizePath, type ViteDevServer } from 'vite';
|
import { normalizePath, type ViteDevServer } from 'vite';
|
||||||
import type { AstroSettings, ContentEntryType } from '../@types/astro.js';
|
import type { AstroSettings, ContentEntryType } from '../@types/astro.js';
|
||||||
|
import { AstroErrorData } from '../core/errors/errors-data.js';
|
||||||
|
import { AstroError } from '../core/errors/errors.js';
|
||||||
import { info, warn, type LogOptions } from '../core/logger/core.js';
|
import { info, warn, type LogOptions } from '../core/logger/core.js';
|
||||||
import { isRelativePath } from '../core/path.js';
|
import { isRelativePath } from '../core/path.js';
|
||||||
import { CONTENT_TYPES_FILE, VIRTUAL_MODULE_ID } from './consts.js';
|
import { CONTENT_TYPES_FILE, VIRTUAL_MODULE_ID } from './consts.js';
|
||||||
import {
|
import {
|
||||||
|
getContentEntryConfigByExtMap,
|
||||||
|
getContentEntryIdAndSlug,
|
||||||
|
getContentPaths,
|
||||||
|
getDataEntryExts,
|
||||||
|
getDataEntryId,
|
||||||
|
getEntryCollectionName,
|
||||||
|
getEntrySlug,
|
||||||
|
getEntryType,
|
||||||
|
reloadContentConfigObserver,
|
||||||
type ContentConfig,
|
type ContentConfig,
|
||||||
type ContentObservable,
|
type ContentObservable,
|
||||||
type ContentPaths,
|
type ContentPaths,
|
||||||
getContentEntryConfigByExtMap,
|
|
||||||
getContentPaths,
|
|
||||||
getEntryType,
|
|
||||||
getContentEntryIdAndSlug,
|
|
||||||
getEntrySlug,
|
|
||||||
getEntryCollectionName,
|
|
||||||
getDataEntryExts,
|
|
||||||
getDataEntryId,
|
|
||||||
reloadContentConfigObserver,
|
|
||||||
} from './utils.js';
|
} from './utils.js';
|
||||||
import { AstroError } from '../core/errors/errors.js';
|
|
||||||
import { AstroErrorData } from '../core/errors/errors-data.js';
|
|
||||||
|
|
||||||
type ChokidarEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir';
|
type ChokidarEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir';
|
||||||
type RawContentEvent = { name: ChokidarEvent; entry: string };
|
type RawContentEvent = { name: ChokidarEvent; entry: string };
|
||||||
|
|
|
@ -4,7 +4,7 @@ import fsMod from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||||
import type { PluginContext } from 'rollup';
|
import type { PluginContext } from 'rollup';
|
||||||
import { normalizePath, type ErrorPayload as ViteErrorPayload, type ViteDevServer } from 'vite';
|
import { normalizePath, type ViteDevServer } from 'vite';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import type {
|
import type {
|
||||||
AstroConfig,
|
AstroConfig,
|
||||||
|
@ -14,10 +14,10 @@ import type {
|
||||||
} from '../@types/astro.js';
|
} from '../@types/astro.js';
|
||||||
import { VALID_INPUT_FORMATS } from '../assets/consts.js';
|
import { VALID_INPUT_FORMATS } from '../assets/consts.js';
|
||||||
import { AstroError, AstroErrorData } from '../core/errors/index.js';
|
import { AstroError, AstroErrorData } from '../core/errors/index.js';
|
||||||
import { CONTENT_TYPES_FILE, CONTENT_FLAGS } from './consts.js';
|
import { formatYAMLException, isYAMLException } from '../core/errors/utils.js';
|
||||||
|
import { CONTENT_FLAGS, CONTENT_TYPES_FILE } from './consts.js';
|
||||||
import { errorMap } from './error-map.js';
|
import { errorMap } from './error-map.js';
|
||||||
import { createImage } from './runtime-assets.js';
|
import { createImage } from './runtime-assets.js';
|
||||||
import { formatYAMLException, isYAMLException } from '../core/errors/utils.js';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Amap from a collection + slug to the local file path.
|
* Amap from a collection + slug to the local file path.
|
||||||
|
|
|
@ -16,21 +16,21 @@ import { AstroError } from '../core/errors/errors.js';
|
||||||
import { escapeViteEnvReferences, getFileInfo } from '../vite-plugin-utils/index.js';
|
import { escapeViteEnvReferences, getFileInfo } from '../vite-plugin-utils/index.js';
|
||||||
import { CONTENT_FLAG, DATA_FLAG } from './consts.js';
|
import { CONTENT_FLAG, DATA_FLAG } from './consts.js';
|
||||||
import {
|
import {
|
||||||
type ContentConfig,
|
getContentEntryConfigByExtMap,
|
||||||
type ContentPaths,
|
|
||||||
getContentEntryExts,
|
getContentEntryExts,
|
||||||
getContentPaths,
|
|
||||||
getEntryData,
|
|
||||||
parseEntrySlug,
|
|
||||||
getContentEntryIdAndSlug,
|
getContentEntryIdAndSlug,
|
||||||
|
getContentPaths,
|
||||||
|
getDataEntryExts,
|
||||||
|
getDataEntryId,
|
||||||
|
getEntryCollectionName,
|
||||||
|
getEntryData,
|
||||||
getEntryType,
|
getEntryType,
|
||||||
globalContentConfigObserver,
|
globalContentConfigObserver,
|
||||||
getContentEntryConfigByExtMap,
|
|
||||||
getEntryCollectionName,
|
|
||||||
getDataEntryExts,
|
|
||||||
hasContentFlag,
|
hasContentFlag,
|
||||||
getDataEntryId,
|
parseEntrySlug,
|
||||||
reloadContentConfigObserver,
|
reloadContentConfigObserver,
|
||||||
|
type ContentConfig,
|
||||||
|
type ContentPaths,
|
||||||
} from './utils.js';
|
} from './utils.js';
|
||||||
|
|
||||||
function getContentRendererByViteId(
|
function getContentRendererByViteId(
|
||||||
|
|
|
@ -4,21 +4,21 @@ import { extname } from 'node:path';
|
||||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||||
import type { Plugin } from 'vite';
|
import type { Plugin } from 'vite';
|
||||||
import type { AstroSettings } from '../@types/astro.js';
|
import type { AstroSettings } from '../@types/astro.js';
|
||||||
import { rootRelativePath } from '../core/util.js';
|
|
||||||
import { AstroError, AstroErrorData } from '../core/errors/index.js';
|
import { AstroError, AstroErrorData } from '../core/errors/index.js';
|
||||||
|
import { rootRelativePath } from '../core/util.js';
|
||||||
import { VIRTUAL_MODULE_ID } from './consts.js';
|
import { VIRTUAL_MODULE_ID } from './consts.js';
|
||||||
import {
|
import {
|
||||||
getContentEntryConfigByExtMap,
|
getContentEntryConfigByExtMap,
|
||||||
getDataEntryExts,
|
|
||||||
getContentPaths,
|
|
||||||
getExtGlob,
|
|
||||||
getEntryCollectionName,
|
|
||||||
getContentEntryIdAndSlug,
|
getContentEntryIdAndSlug,
|
||||||
getEntrySlug,
|
getContentPaths,
|
||||||
|
getDataEntryExts,
|
||||||
getDataEntryId,
|
getDataEntryId,
|
||||||
|
getEntryCollectionName,
|
||||||
|
getEntrySlug,
|
||||||
getEntryType,
|
getEntryType,
|
||||||
type ContentPaths,
|
getExtGlob,
|
||||||
type ContentLookupMap,
|
type ContentLookupMap,
|
||||||
|
type ContentPaths,
|
||||||
} from './utils.js';
|
} from './utils.js';
|
||||||
|
|
||||||
interface AstroContentVirtualModPluginParams {
|
interface AstroContentVirtualModPluginParams {
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
import type { AstroConfig, AstroSettings, AstroUserConfig } from '../../@types/astro';
|
import yaml from 'js-yaml';
|
||||||
import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../constants.js';
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { fileURLToPath, pathToFileURL } from 'url';
|
import { fileURLToPath, pathToFileURL } from 'url';
|
||||||
|
import type { AstroConfig, AstroSettings, AstroUserConfig } from '../../@types/astro';
|
||||||
|
import { getContentPaths } from '../../content/index.js';
|
||||||
import jsxRenderer from '../../jsx/renderer.js';
|
import jsxRenderer from '../../jsx/renderer.js';
|
||||||
import { isHybridOutput } from '../../prerender/utils.js';
|
import { isHybridOutput } from '../../prerender/utils.js';
|
||||||
import { markdownContentEntryType } from '../../vite-plugin-markdown/content-entry-type.js';
|
import { markdownContentEntryType } from '../../vite-plugin-markdown/content-entry-type.js';
|
||||||
import { getDefaultClientDirectives } from '../client-directive/index.js';
|
import { getDefaultClientDirectives } from '../client-directive/index.js';
|
||||||
|
import { AstroError, AstroErrorData } from '../errors/index.js';
|
||||||
|
import { formatYAMLException, isYAMLException } from '../errors/utils.js';
|
||||||
|
import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../constants.js';
|
||||||
import { createDefaultDevConfig } from './config.js';
|
import { createDefaultDevConfig } from './config.js';
|
||||||
import { AstroTimer } from './timer.js';
|
import { AstroTimer } from './timer.js';
|
||||||
import { loadTSConfig } from './tsconfig.js';
|
import { loadTSConfig } from './tsconfig.js';
|
||||||
import yaml from 'js-yaml';
|
|
||||||
import { formatYAMLException, isYAMLException } from '../errors/utils.js';
|
|
||||||
import { AstroError, AstroErrorData } from '../errors/index.js';
|
|
||||||
import { getContentPaths } from '../../content/index.js';
|
|
||||||
|
|
||||||
export function createBaseSettings(config: AstroConfig): AstroSettings {
|
export function createBaseSettings(config: AstroConfig): AstroSettings {
|
||||||
const { contentDir } = getContentPaths(config);
|
const { contentDir } = getContentPaths(config);
|
||||||
|
|
|
@ -5,8 +5,8 @@ export {
|
||||||
AstroError,
|
AstroError,
|
||||||
CompilerError,
|
CompilerError,
|
||||||
CSSError,
|
CSSError,
|
||||||
MarkdownError,
|
|
||||||
isAstroError,
|
isAstroError,
|
||||||
|
MarkdownError,
|
||||||
} from './errors.js';
|
} from './errors.js';
|
||||||
export { codeFrame } from './printer.js';
|
export { codeFrame } from './printer.js';
|
||||||
export { createSafeError, positionAt } from './utils.js';
|
export { createSafeError, positionAt } from './utils.js';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import type { DiagnosticCode } from '@astrojs/compiler/shared/diagnostics.js';
|
import type { DiagnosticCode } from '@astrojs/compiler/shared/diagnostics.js';
|
||||||
import type { SSRError } from '../../@types/astro.js';
|
|
||||||
import { AstroErrorData, type AstroErrorCodes, type ErrorData } from './errors-data.js';
|
|
||||||
import type { YAMLException } from 'js-yaml';
|
import type { YAMLException } from 'js-yaml';
|
||||||
import type { ErrorPayload as ViteErrorPayload } from 'vite';
|
import type { ErrorPayload as ViteErrorPayload } from 'vite';
|
||||||
|
import type { SSRError } from '../../@types/astro.js';
|
||||||
|
import { AstroErrorData, type AstroErrorCodes, type ErrorData } from './errors-data.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the line and character based on the offset
|
* Get the line and character based on the offset
|
||||||
|
|
|
@ -10,10 +10,9 @@ import { runHookConfigSetup } from '../../integrations/index.js';
|
||||||
import { setUpEnvTs } from '../../vite-plugin-inject-env-ts/index.js';
|
import { setUpEnvTs } from '../../vite-plugin-inject-env-ts/index.js';
|
||||||
import { getTimeStat } from '../build/util.js';
|
import { getTimeStat } from '../build/util.js';
|
||||||
import { createVite } from '../create-vite.js';
|
import { createVite } from '../create-vite.js';
|
||||||
import { AstroError, AstroErrorData, createSafeError } from '../errors/index.js';
|
import { AstroError, AstroErrorData, createSafeError, isAstroError } from '../errors/index.js';
|
||||||
import { info, type LogOptions } from '../logger/core.js';
|
import { info, type LogOptions } from '../logger/core.js';
|
||||||
import { printHelp } from '../messages.js';
|
import { printHelp } from '../messages.js';
|
||||||
import { isAstroError } from '../errors/index.js';
|
|
||||||
|
|
||||||
export type ProcessExit = 0 | 1;
|
export type ProcessExit = 0 | 1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue