Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev authored and astrobot-houston committed May 17, 2023
1 parent c6d7ebe commit 4264b7c
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 42 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/content/runtime.ts
Original file line number Diff line number Diff line change
@@ -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 { prependForwardSlash } from '../core/path.js';
import { ZodIssueCode, string as zodString, type z } from 'zod';
import {
createComponent,
createHeadAndContent,
Expand All @@ -12,7 +13,6 @@ import {
type AstroComponentFactory,
} from '../runtime/server/index.js';
import type { ContentLookupMap } from './utils.js';
import type { MarkdownHeading } from '@astrojs/markdown-remark';

type LazyImport = () => Promise<any>;
type GlobResult = Record<string, LazyImport>;
Expand Down
6 changes: 3 additions & 3 deletions packages/astro/src/content/template/virtual-mod.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import {
createCollectionToGlobResultMap,
createGetCollection,
createGetEntryBySlug,
createGetEntry,
createGetEntries,
createGetDataEntryById,
createGetEntries,
createGetEntry,
createGetEntryBySlug,
createReference,
} from 'astro/content/runtime';

Expand Down
18 changes: 9 additions & 9 deletions packages/astro/src/content/types-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ import * as path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { normalizePath, type ViteDevServer } from 'vite';
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 { isRelativePath } from '../core/path.js';
import { CONTENT_TYPES_FILE, VIRTUAL_MODULE_ID } from './consts.js';
import {
type ContentConfig,
type ContentObservable,
type ContentPaths,
getContentEntryConfigByExtMap,
getContentPaths,
getEntryType,
getContentEntryIdAndSlug,
getEntrySlug,
getEntryCollectionName,
getContentPaths,
getDataEntryExts,
getDataEntryId,
getEntryCollectionName,
getEntrySlug,
getEntryType,
reloadContentConfigObserver,
type ContentConfig,
type ContentObservable,
type ContentPaths,
} 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 RawContentEvent = { name: ChokidarEvent; entry: string };
Expand Down
6 changes: 3 additions & 3 deletions packages/astro/src/content/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fsMod from 'node:fs';
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
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 type {
AstroConfig,
Expand All @@ -14,10 +14,10 @@ import type {
} from '../@types/astro.js';
import { VALID_INPUT_FORMATS } from '../assets/consts.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 { createImage } from './runtime-assets.js';
import { formatYAMLException, isYAMLException } from '../core/errors/utils.js';

/**
* Amap from a collection + slug to the local file path.
Expand Down
16 changes: 8 additions & 8 deletions packages/astro/src/content/vite-plugin-content-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ import { AstroError } from '../core/errors/errors.js';
import { escapeViteEnvReferences, getFileInfo } from '../vite-plugin-utils/index.js';
import { CONTENT_FLAG, DATA_FLAG } from './consts.js';
import {
type ContentConfig,
type ContentPaths,
getContentEntryConfigByExtMap,
getContentEntryExts,
getContentEntryIdAndSlug,
getContentPaths,
getDataEntryExts,
getDataEntryId,
getEntryCollectionName,
getEntryData,
parseEntrySlug,
getContentEntryIdAndSlug,
getEntryType,
globalContentConfigObserver,
getContentEntryConfigByExtMap,
getEntryCollectionName,
getDataEntryExts,
hasContentFlag,
getDataEntryId,
parseEntrySlug,
reloadContentConfigObserver,
type ContentConfig,
type ContentPaths,
} from './utils.js';

function getContentRendererByViteId(
Expand Down
12 changes: 6 additions & 6 deletions packages/astro/src/content/vite-plugin-content-virtual-mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import { extname } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import type { Plugin } from 'vite';
import type { AstroSettings } from '../@types/astro.js';
import { rootRelativePath } from '../core/util.js';
import { AstroError, AstroErrorData } from '../core/errors/index.js';
import { rootRelativePath } from '../core/util.js';
import { VIRTUAL_MODULE_ID } from './consts.js';
import {
getContentEntryConfigByExtMap,
getDataEntryExts,
getContentEntryIdAndSlug,
getContentPaths,
getExtGlob,
getDataEntryExts,
getDataEntryId,
getEntryCollectionName,
getContentEntryIdAndSlug,
getEntrySlug,
getDataEntryId,
getEntryType,
type ContentPaths,
getExtGlob,
type ContentLookupMap,
type ContentPaths,
} from './utils.js';

interface AstroContentVirtualModPluginParams {
Expand Down
12 changes: 6 additions & 6 deletions packages/astro/src/core/config/settings.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import type { AstroConfig, AstroSettings, AstroUserConfig } from '../../@types/astro';
import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../constants.js';
import yaml from 'js-yaml';
import path from 'node:path';
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 { isHybridOutput } from '../../prerender/utils.js';
import { markdownContentEntryType } from '../../vite-plugin-markdown/content-entry-type.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 { AstroTimer } from './timer.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 {
const { contentDir } = getContentPaths(config);
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/errors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export {
AstroError,
CompilerError,
CSSError,
MarkdownError,
isAstroError,
MarkdownError,
} from './errors.js';
export { codeFrame } from './printer.js';
export { createSafeError, positionAt } from './utils.js';
4 changes: 2 additions & 2 deletions packages/astro/src/core/errors/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
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 { 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
Expand Down
3 changes: 1 addition & 2 deletions packages/astro/src/core/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import { runHookConfigSetup } from '../../integrations/index.js';
import { setUpEnvTs } from '../../vite-plugin-inject-env-ts/index.js';
import { getTimeStat } from '../build/util.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 { printHelp } from '../messages.js';
import { isAstroError } from '../errors/index.js';

export type ProcessExit = 0 | 1;

Expand Down

0 comments on commit 4264b7c

Please sign in to comment.