0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

[ci] format

This commit is contained in:
Zhang Zhipeng 2024-03-08 13:11:08 +00:00 committed by astrobot-houston
parent 1ea0a25b94
commit b44f830a0e
6 changed files with 10 additions and 10 deletions

View file

@ -13,7 +13,7 @@ import type * as babel from '@babel/core';
import type * as rollup from 'rollup'; import type * as rollup from 'rollup';
import type * as vite from 'vite'; import type * as vite from 'vite';
import type { RemotePattern } from '../assets/utils/remotePattern.js'; import type { RemotePattern } from '../assets/utils/remotePattern.js';
import type { SerializedSSRManifest, AssetsPrefix } from '../core/app/types.js'; import type { AssetsPrefix, SerializedSSRManifest } from '../core/app/types.js';
import type { PageBuildData } from '../core/build/types.js'; import type { PageBuildData } from '../core/build/types.js';
import type { AstroConfigType } from '../core/config/index.js'; import type { AstroConfigType } from '../core/config/index.js';
import type { AstroTimer } from '../core/config/timer.js'; import type { AstroTimer } from '../core/config/timer.js';

View file

@ -1,7 +1,7 @@
import { extname } from 'node:path';
import MagicString from 'magic-string'; import MagicString from 'magic-string';
import type * as vite from 'vite'; import type * as vite from 'vite';
import { normalizePath } from 'vite'; import { normalizePath } from 'vite';
import { extname } from 'node:path';
import type { AstroPluginOptions, ImageTransform } from '../@types/astro.js'; import type { AstroPluginOptions, ImageTransform } from '../@types/astro.js';
import { extendManualChunks } from '../core/build/plugins/util.js'; import { extendManualChunks } from '../core/build/plugins/util.js';
import { AstroError, AstroErrorData } from '../core/errors/index.js'; import { AstroError, AstroErrorData } from '../core/errors/index.js';
@ -14,10 +14,10 @@ import {
import { isServerLikeOutput } from '../prerender/utils.js'; import { isServerLikeOutput } from '../prerender/utils.js';
import { VALID_INPUT_FORMATS, VIRTUAL_MODULE_ID, VIRTUAL_SERVICE_ID } from './consts.js'; import { VALID_INPUT_FORMATS, VIRTUAL_MODULE_ID, VIRTUAL_SERVICE_ID } from './consts.js';
import { emitESMImage } from './utils/emitAsset.js'; import { emitESMImage } from './utils/emitAsset.js';
import { getAssetsPrefix } from './utils/getAssetsPrefix.js';
import { isESMImportedImage } from './utils/imageKind.js'; import { isESMImportedImage } from './utils/imageKind.js';
import { getProxyCode } from './utils/proxy.js'; import { getProxyCode } from './utils/proxy.js';
import { hashTransform, propsToFilename } from './utils/transformToPath.js'; import { hashTransform, propsToFilename } from './utils/transformToPath.js';
import { getAssetsPrefix } from './utils/getAssetsPrefix.js';
const resolvedVirtualModuleId = '\0' + VIRTUAL_MODULE_ID; const resolvedVirtualModuleId = '\0' + VIRTUAL_MODULE_ID;

View file

@ -2,6 +2,7 @@ import { extname } from 'node:path';
import { pathToFileURL } from 'node:url'; import { pathToFileURL } from 'node:url';
import type { Plugin, Rollup } from 'vite'; import type { Plugin, Rollup } from 'vite';
import type { AstroSettings, SSRElement } from '../@types/astro.js'; import type { AstroSettings, SSRElement } from '../@types/astro.js';
import { getAssetsPrefix } from '../assets/utils/getAssetsPrefix.js';
import { moduleIsTopLevelPage, walkParentInfos } from '../core/build/graph.js'; import { moduleIsTopLevelPage, walkParentInfos } from '../core/build/graph.js';
import { type BuildInternals, getPageDataByViteID } from '../core/build/internal.js'; import { type BuildInternals, getPageDataByViteID } from '../core/build/internal.js';
import type { AstroBuildPlugin } from '../core/build/plugin.js'; import type { AstroBuildPlugin } from '../core/build/plugin.js';
@ -19,7 +20,6 @@ import {
STYLES_PLACEHOLDER, STYLES_PLACEHOLDER,
} from './consts.js'; } from './consts.js';
import { hasContentFlag } from './utils.js'; import { hasContentFlag } from './utils.js';
import { getAssetsPrefix } from '../assets/utils/getAssetsPrefix.js';
export function astroContentAssetPropagationPlugin({ export function astroContentAssetPropagationPlugin({
mode, mode,

View file

@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url';
import glob from 'fast-glob'; import glob from 'fast-glob';
import type { OutputChunk } from 'rollup'; import type { OutputChunk } from 'rollup';
import { type Plugin as VitePlugin } from 'vite'; import { type Plugin as VitePlugin } from 'vite';
import { getAssetsPrefix } from '../../../assets/utils/getAssetsPrefix.js';
import { normalizeTheLocale } from '../../../i18n/index.js'; import { normalizeTheLocale } from '../../../i18n/index.js';
import { toRoutingStrategy } from '../../../i18n/utils.js'; import { toRoutingStrategy } from '../../../i18n/utils.js';
import { runHookBuildSsr } from '../../../integrations/index.js'; import { runHookBuildSsr } from '../../../integrations/index.js';
@ -11,14 +12,13 @@ import type {
SerializedRouteInfo, SerializedRouteInfo,
SerializedSSRManifest, SerializedSSRManifest,
} from '../../app/types.js'; } from '../../app/types.js';
import { joinPaths, prependForwardSlash, fileExtension } from '../../path.js'; import { fileExtension, joinPaths, prependForwardSlash } from '../../path.js';
import { serializeRouteData } from '../../routing/index.js'; import { serializeRouteData } from '../../routing/index.js';
import { addRollupInput } from '../add-rollup-input.js'; import { addRollupInput } from '../add-rollup-input.js';
import { getOutFile, getOutFolder } from '../common.js'; import { getOutFile, getOutFolder } from '../common.js';
import { type BuildInternals, cssOrder, mergeInlineCss } from '../internal.js'; import { type BuildInternals, cssOrder, mergeInlineCss } from '../internal.js';
import type { AstroBuildPlugin } from '../plugin.js'; import type { AstroBuildPlugin } from '../plugin.js';
import type { StaticBuildOptions } from '../types.js'; import type { StaticBuildOptions } from '../types.js';
import { getAssetsPrefix } from '../../../assets/utils/getAssetsPrefix.js';
const manifestReplace = '@@ASTRO_MANIFEST_REPLACE@@'; const manifestReplace = '@@ASTRO_MANIFEST_REPLACE@@';
const replaceExp = new RegExp(`['"]${manifestReplace}['"]`, 'g'); const replaceExp = new RegExp(`['"]${manifestReplace}['"]`, 'g');

View file

@ -4,6 +4,7 @@ import glob from 'fast-glob';
import * as vite from 'vite'; import * as vite from 'vite';
import { crawlFrameworkPkgs } from 'vitefu'; import { crawlFrameworkPkgs } from 'vitefu';
import type { AstroSettings } from '../@types/astro.js'; import type { AstroSettings } from '../@types/astro.js';
import { getAssetsPrefix } from '../assets/utils/getAssetsPrefix.js';
import astroAssetsPlugin from '../assets/vite-plugin-assets.js'; import astroAssetsPlugin from '../assets/vite-plugin-assets.js';
import { import {
astroContentAssetPropagationPlugin, astroContentAssetPropagationPlugin,
@ -36,7 +37,6 @@ import { createViteLogger } from './logger/vite.js';
import { vitePluginMiddleware } from './middleware/vite-plugin.js'; import { vitePluginMiddleware } from './middleware/vite-plugin.js';
import { joinPaths } from './path.js'; import { joinPaths } from './path.js';
import { isObject } from './util.js'; import { isObject } from './util.js';
import { getAssetsPrefix } from '../assets/utils/getAssetsPrefix.js';
interface CreateViteOptions { interface CreateViteOptions {
settings: AstroSettings; settings: AstroSettings;

View file

@ -1,7 +1,7 @@
import type { SSRElement, AssetsPrefix } from '../../@types/astro.js'; import type { AssetsPrefix, SSRElement } from '../../@types/astro.js';
import { getAssetsPrefix } from '../../assets/utils/getAssetsPrefix.js';
import { fileExtension, joinPaths, prependForwardSlash, slash } from '../../core/path.js'; import { fileExtension, joinPaths, prependForwardSlash, slash } from '../../core/path.js';
import type { StylesheetAsset } from '../app/types.js'; import type { StylesheetAsset } from '../app/types.js';
import { getAssetsPrefix } from '../../assets/utils/getAssetsPrefix.js';
export function createAssetLink(href: string, base?: string, assetsPrefix?: AssetsPrefix): string { export function createAssetLink(href: string, base?: string, assetsPrefix?: AssetsPrefix): string {
if (assetsPrefix) { if (assetsPrefix) {