[ci] format

This commit is contained in:
matthewp 2022-07-21 17:48:45 +00:00 committed by fredkbot
parent ddefb172f6
commit 81758f1c1e
7 changed files with 17 additions and 16 deletions

View file

@ -5,5 +5,5 @@ import preact from '@astrojs/preact';
export default defineConfig({ export default defineConfig({
// Enable the Preact integration to support Preact JSX components. // Enable the Preact integration to support Preact JSX components.
integrations: [preact()], integrations: [preact()],
site: `http://astro.build` site: `http://astro.build`,
}); });

View file

@ -4,5 +4,5 @@ import preact from '@astrojs/preact';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
integrations: [preact()], integrations: [preact()],
site: `http://astro.build` site: `http://astro.build`,
}); });

View file

@ -10,5 +10,5 @@ export default defineConfig({
// Enable React for the Algolia search component. // Enable React for the Algolia search component.
react(), react(),
], ],
site: `http://astro.build` site: `http://astro.build`,
}); });

View file

@ -85,10 +85,10 @@ export interface BuildConfig {
* [Astro reference](https://docs.astro.build/reference/api-reference/#astro-global) * [Astro reference](https://docs.astro.build/reference/api-reference/#astro-global)
*/ */
export interface AstroGlobal extends AstroGlobalPartial { export interface AstroGlobal extends AstroGlobalPartial {
/** /**
* Canonical URL of the current page. * Canonical URL of the current page.
* @deprecated Use `Astro.url` instead. * @deprecated Use `Astro.url` instead.
* *
* Example: * Example:
* ```astro * ```astro
* --- * ---
@ -102,9 +102,9 @@ export interface AstroGlobal extends AstroGlobalPartial {
*/ */
clientAddress: string; clientAddress: string;
/** /**
* A full URL object of the request URL. * A full URL object of the request URL.
* Equivalent to: `new URL(Astro.request.url)` * Equivalent to: `new URL(Astro.request.url)`
* *
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#url) * [Astro reference](https://docs.astro.build/en/reference/api-reference/#url)
*/ */
url: URL; url: URL;

View file

@ -3,7 +3,6 @@ import { bold } from 'kleur/colors';
import type { import type {
AstroGlobal, AstroGlobal,
AstroGlobalPartial, AstroGlobalPartial,
Page,
Params, Params,
Props, Props,
RuntimeMode, RuntimeMode,
@ -215,12 +214,11 @@ ${extra}`
} as unknown as AstroGlobal; } as unknown as AstroGlobal;
Object.defineProperty(Astro, 'canonicalURL', { Object.defineProperty(Astro, 'canonicalURL', {
get: function() { get: function () {
warn(args.logging, warn(
args.logging,
'deprecation', 'deprecation',
`${bold( `${bold('Astro.canonicalURL')} is deprecated! Use \`Astro.url\` instead.
'Astro.canonicalURL'
)} is deprecated! Use \`Astro.url\` instead.
Example: Example:
--- ---

View file

@ -1,4 +1,3 @@
import npath from 'path-browserify';
import type { ModuleNode, ViteDevServer } from 'vite'; import type { ModuleNode, ViteDevServer } from 'vite';
import type { Metadata } from '../../runtime/server/metadata.js'; import type { Metadata } from '../../runtime/server/metadata.js';

View file

@ -1,7 +1,7 @@
import type { AstroConfig } from '../@types/astro';
import * as path from 'path'; import * as path from 'path';
import * as tsr from 'tsconfig-resolver'; import * as tsr from 'tsconfig-resolver';
import * as url from 'url'; import * as url from 'url';
import type { AstroConfig } from '../@types/astro';
import type * as vite from 'vite'; import type * as vite from 'vite';
@ -87,7 +87,11 @@ const getConfigAlias = (cwd: string | undefined): Alias[] | null => {
}; };
/** Returns a Vite plugin used to alias pathes from tsconfig.json and jsconfig.json. */ /** Returns a Vite plugin used to alias pathes from tsconfig.json and jsconfig.json. */
export default function configAliasVitePlugin({ config: astroConfig }: { config: AstroConfig }): vite.PluginOption { export default function configAliasVitePlugin({
config: astroConfig,
}: {
config: AstroConfig;
}): vite.PluginOption {
/** Aliases from the tsconfig.json or jsconfig.json configuration. */ /** Aliases from the tsconfig.json or jsconfig.json configuration. */
const configAlias = getConfigAlias(astroConfig.root && url.fileURLToPath(astroConfig.root)); const configAlias = getConfigAlias(astroConfig.root && url.fileURLToPath(astroConfig.root));