From 4b16e9ec9929269a16e7950d8fed78779149b0fc Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Tue, 10 Jan 2023 23:03:59 +0000 Subject: [PATCH] [ci] format --- examples/with-content/.astro/types.d.ts | 77 +++++++++---------- packages/astro/src/content/types-generator.ts | 2 - packages/astro/src/core/create-vite.ts | 2 +- .../src/vite-plugin-inject-env-ts/index.ts | 8 +- 4 files changed, 43 insertions(+), 46 deletions(-) diff --git a/examples/with-content/.astro/types.d.ts b/examples/with-content/.astro/types.d.ts index 37355d003481..33d0c7c32c86 100644 --- a/examples/with-content/.astro/types.d.ts +++ b/examples/with-content/.astro/types.d.ts @@ -55,45 +55,44 @@ declare module 'astro:content' { }; const entryMap: { - "blog": { -"first-post.md": { - id: "first-post.md", - slug: "first-post", - body: string, - collection: "blog", - data: InferEntrySchema<"blog"> -}, -"markdown-style-guide.md": { - id: "markdown-style-guide.md", - slug: "markdown-style-guide", - body: string, - collection: "blog", - data: InferEntrySchema<"blog"> -}, -"second-post.md": { - id: "second-post.md", - slug: "second-post", - body: string, - collection: "blog", - data: InferEntrySchema<"blog"> -}, -"third-post.md": { - id: "third-post.md", - slug: "third-post", - body: string, - collection: "blog", - data: InferEntrySchema<"blog"> -}, -"using-mdx.mdx": { - id: "using-mdx.mdx", - slug: "using-mdx", - body: string, - collection: "blog", - data: InferEntrySchema<"blog"> -}, -}, - + blog: { + 'first-post.md': { + id: 'first-post.md'; + slug: 'first-post'; + body: string; + collection: 'blog'; + data: InferEntrySchema<'blog'>; + }; + 'markdown-style-guide.md': { + id: 'markdown-style-guide.md'; + slug: 'markdown-style-guide'; + body: string; + collection: 'blog'; + data: InferEntrySchema<'blog'>; + }; + 'second-post.md': { + id: 'second-post.md'; + slug: 'second-post'; + body: string; + collection: 'blog'; + data: InferEntrySchema<'blog'>; + }; + 'third-post.md': { + id: 'third-post.md'; + slug: 'third-post'; + body: string; + collection: 'blog'; + data: InferEntrySchema<'blog'>; + }; + 'using-mdx.mdx': { + id: 'using-mdx.mdx'; + slug: 'using-mdx'; + body: string; + collection: 'blog'; + data: InferEntrySchema<'blog'>; + }; + }; }; - type ContentConfig = typeof import("../src/content/config"); + type ContentConfig = typeof import('../src/content/config'); } diff --git a/packages/astro/src/content/types-generator.ts b/packages/astro/src/content/types-generator.ts index 7133688bf64f..9df6bdb4482a 100644 --- a/packages/astro/src/content/types-generator.ts +++ b/packages/astro/src/content/types-generator.ts @@ -7,14 +7,12 @@ import { normalizePath } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import { info, LogOptions, warn } from '../core/logger/core.js'; import { appendForwardSlash, isRelativePath } from '../core/path.js'; -import { getEnvTsPath } from '../vite-plugin-inject-env-ts/index.js'; import { contentFileExts, CONTENT_TYPES_FILE } from './consts.js'; import { ContentConfig, ContentObservable, ContentPaths, getContentPaths, - getDotAstroTypeReference, getEntryInfo, loadContentConfig, NoCollectionError, diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index c61f04b3f2c1..05d591f423a3 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -17,6 +17,7 @@ import configAliasVitePlugin from '../vite-plugin-config-alias/index.js'; import envVitePlugin from '../vite-plugin-env/index.js'; import astroHeadPropagationPlugin from '../vite-plugin-head-propagation/index.js'; import htmlVitePlugin from '../vite-plugin-html/index.js'; +import { astroInjectEnvTsPlugin } from '../vite-plugin-inject-env-ts/index.js'; import astroIntegrationsContainerPlugin from '../vite-plugin-integrations-container/index.js'; import jsxVitePlugin from '../vite-plugin-jsx/index.js'; import astroLoadFallbackPlugin from '../vite-plugin-load-fallback/index.js'; @@ -24,7 +25,6 @@ import markdownVitePlugin from '../vite-plugin-markdown/index.js'; import astroScannerPlugin from '../vite-plugin-scanner/index.js'; import astroScriptsPlugin from '../vite-plugin-scripts/index.js'; import astroScriptsPageSSRPlugin from '../vite-plugin-scripts/page-ssr.js'; -import { astroInjectEnvTsPlugin } from '../vite-plugin-inject-env-ts/index.js'; interface CreateViteOptions { settings: AstroSettings; diff --git a/packages/astro/src/vite-plugin-inject-env-ts/index.ts b/packages/astro/src/vite-plugin-inject-env-ts/index.ts index 3440b3dc15db..0189de9b84a0 100644 --- a/packages/astro/src/vite-plugin-inject-env-ts/index.ts +++ b/packages/astro/src/vite-plugin-inject-env-ts/index.ts @@ -1,11 +1,11 @@ -import type { AstroSettings } from '../@types/astro.js'; +import { bold } from 'kleur/colors'; import type fsMod from 'node:fs'; -import { normalizePath, Plugin } from 'vite'; import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { normalizePath, Plugin } from 'vite'; +import type { AstroSettings } from '../@types/astro.js'; import { getContentPaths, getDotAstroTypeReference } from '../content/index.js'; import { info, LogOptions } from '../core/logger/core.js'; -import { fileURLToPath } from 'node:url'; -import { bold } from 'kleur/colors'; export function getEnvTsPath({ srcDir }: { srcDir: URL }) { return new URL('env.d.ts', srcDir);