From 08cdd0919d3249a762822e4bba9e0c5d3966916c Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 27 Feb 2024 16:19:34 +0000 Subject: [PATCH] chore: import sort `astro` package (#10245) * chore: import sort source code, exception for the `astro` package * fix import sorting bug * chore: import sorting for the `astro` package --- biome.json | 2 +- .../astro/performance/content-benchmark.mjs | 4 ++-- .../performance/fixtures/md/astro.config.mjs | 2 +- .../fixtures/mdoc/astro.config.mjs | 2 +- .../performance/fixtures/mdx/astro.config.mjs | 2 +- packages/astro/src/@types/astro.ts | 4 ++-- packages/astro/src/assets/build/generate.ts | 6 ++--- packages/astro/src/assets/endpoint/generic.ts | 2 +- packages/astro/src/assets/endpoint/node.ts | 4 ++-- packages/astro/src/assets/internal.ts | 2 +- packages/astro/src/assets/services/noop.ts | 2 +- packages/astro/src/assets/services/sharp.ts | 4 ++-- packages/astro/src/assets/services/squoosh.ts | 4 ++-- packages/astro/src/assets/utils/metadata.ts | 2 +- .../astro/src/assets/utils/transformToPath.ts | 2 +- packages/astro/src/cli/add/index.ts | 10 ++++----- packages/astro/src/cli/check/index.ts | 2 +- packages/astro/src/cli/db/index.ts | 6 ++--- packages/astro/src/cli/flags.ts | 2 +- packages/astro/src/cli/info/index.ts | 6 ++--- packages/astro/src/cli/install-package.ts | 4 ++-- packages/astro/src/cli/preferences/index.ts | 14 ++++++------ packages/astro/src/content/runtime.ts | 2 +- .../astro/src/content/server-listeners.ts | 4 ++-- packages/astro/src/content/types-generator.ts | 12 +++++----- packages/astro/src/content/utils.ts | 6 ++--- .../src/content/vite-plugin-content-assets.ts | 2 +- .../content/vite-plugin-content-imports.ts | 4 ++-- .../vite-plugin-content-virtual-mod.ts | 4 ++-- packages/astro/src/core/app/common.ts | 2 +- packages/astro/src/core/app/index.ts | 20 ++++++++--------- packages/astro/src/core/app/node.ts | 8 +++---- packages/astro/src/core/app/types.ts | 4 ++-- packages/astro/src/core/base-pipeline.ts | 2 +- packages/astro/src/core/build/generate.ts | 12 +++++----- packages/astro/src/core/build/index.ts | 4 ++-- packages/astro/src/core/build/pipeline.ts | 2 +- .../src/core/build/plugins/plugin-content.ts | 4 ++-- .../src/core/build/plugins/plugin-css.ts | 2 +- .../src/core/build/plugins/plugin-manifest.ts | 8 +++---- .../src/core/build/plugins/plugin-pages.ts | 2 +- .../src/core/build/plugins/plugin-ssr.ts | 2 +- packages/astro/src/core/build/plugins/util.ts | 2 +- packages/astro/src/core/build/static-build.ts | 10 ++++----- .../astro/src/core/client-directive/build.ts | 2 +- packages/astro/src/core/compile/compile.ts | 4 ++-- packages/astro/src/core/compile/style.ts | 4 ++-- packages/astro/src/core/config/config.ts | 2 +- packages/astro/src/core/config/schema.ts | 2 +- packages/astro/src/core/config/settings.ts | 2 +- packages/astro/src/core/config/tsconfig.ts | 4 ++-- packages/astro/src/core/config/vite-load.ts | 2 +- packages/astro/src/core/dev/dev.ts | 6 ++--- packages/astro/src/core/endpoint/index.ts | 8 +++---- packages/astro/src/core/errors/dev/utils.ts | 4 ++-- packages/astro/src/core/logger/console.ts | 2 +- packages/astro/src/core/logger/node.ts | 4 ++-- packages/astro/src/core/logger/vite.ts | 4 ++-- packages/astro/src/core/middleware/index.ts | 8 +++---- .../src/core/middleware/loadMiddleware.ts | 4 ++-- packages/astro/src/core/preview/index.ts | 4 ++-- .../src/core/preview/static-preview-server.ts | 2 +- packages/astro/src/core/render-context.ts | 22 +++++++++---------- packages/astro/src/core/render/result.ts | 14 ++++++------ .../astro/src/core/routing/manifest/create.ts | 4 ++-- packages/astro/src/core/shiki.ts | 2 +- packages/astro/src/core/sync/index.ts | 8 +++---- packages/astro/src/i18n/middleware.ts | 4 ++-- packages/astro/src/integrations/index.ts | 2 +- packages/astro/src/jsx-runtime/index.ts | 2 +- packages/astro/src/preferences/store.ts | 4 ++-- .../runtime/client/dev-toolbar/apps/astro.ts | 2 +- .../client/dev-toolbar/apps/settings.ts | 2 +- .../src/runtime/client/dev-toolbar/toolbar.ts | 2 +- .../dev-toolbar/ui-library/highlight.ts | 2 +- .../client/dev-toolbar/ui-library/icon.ts | 2 +- .../client/dev-toolbar/ui-library/tooltip.ts | 2 +- packages/astro/src/runtime/server/endpoint.ts | 2 +- packages/astro/src/runtime/server/index.ts | 2 +- packages/astro/src/runtime/server/jsx.ts | 2 +- .../astro/src/runtime/server/render/any.ts | 2 +- .../src/runtime/server/render/astro/render.ts | 4 ++-- .../astro/src/runtime/server/render/common.ts | 4 ++-- .../src/runtime/server/render/component.ts | 10 ++++----- .../astro/src/runtime/server/render/page.ts | 4 ++-- .../astro/src/runtime/server/render/slot.ts | 2 +- packages/astro/src/runtime/server/scripts.ts | 2 +- .../astro/src/runtime/server/transition.ts | 2 +- packages/astro/src/virtual-modules/i18n.ts | 2 +- .../src/vite-plugin-astro-server/base.ts | 2 +- .../src/vite-plugin-astro-server/error.ts | 4 ++-- .../src/vite-plugin-astro-server/pipeline.ts | 14 ++++++------ .../src/vite-plugin-astro-server/plugin.ts | 12 +++++----- .../src/vite-plugin-astro-server/request.ts | 2 +- .../src/vite-plugin-astro-server/route.ts | 6 ++--- .../astro/src/vite-plugin-astro/compile.ts | 4 ++-- packages/astro/src/vite-plugin-astro/hmr.ts | 2 +- packages/astro/src/vite-plugin-astro/index.ts | 4 ++-- .../src/vite-plugin-config-alias/index.ts | 2 +- packages/astro/src/vite-plugin-env/index.ts | 4 ++-- .../src/vite-plugin-inject-env-ts/index.ts | 4 ++-- .../astro/src/vite-plugin-markdown/index.ts | 12 +++++----- packages/astro/src/vite-plugin-mdx/index.ts | 2 +- .../astro/src/vite-plugin-scanner/index.ts | 2 +- .../astro/src/vite-plugin-scripts/page-ssr.ts | 2 +- packages/astro/src/vite-plugin-utils/index.ts | 2 +- 106 files changed, 233 insertions(+), 233 deletions(-) diff --git a/biome.json b/biome.json index 8c370e91aeb7..e3cd21509b6b 100644 --- a/biome.json +++ b/biome.json @@ -2,7 +2,7 @@ "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", "files": { "include": ["test/**", "e2e/**", "packages/**"], - "ignore": ["vendor", "dist/**", "packages/astro/**"] + "ignore": ["vendor", "dist/**"] }, "organizeImports": { "enabled": true diff --git a/packages/astro/performance/content-benchmark.mjs b/packages/astro/performance/content-benchmark.mjs index ce391c35194c..bd362c807846 100644 --- a/packages/astro/performance/content-benchmark.mjs +++ b/packages/astro/performance/content-benchmark.mjs @@ -1,10 +1,10 @@ /* eslint-disable no-console */ import { fileURLToPath } from 'node:url'; +import { bold, cyan, dim } from 'kleur/colors'; +import yargs from 'yargs-parser'; import { loadFixture } from '../test/test-utils.js'; import { generatePosts } from './scripts/generate-posts.mjs'; -import yargs from 'yargs-parser'; -import { cyan, bold, dim } from 'kleur/colors'; // Skip nonessential remark / rehype plugins for a fair comparison. // This includes heading ID generation, syntax highlighting, GFM, and Smartypants. diff --git a/packages/astro/performance/fixtures/md/astro.config.mjs b/packages/astro/performance/fixtures/md/astro.config.mjs index 0af86d60325c..e66571b374d6 100644 --- a/packages/astro/performance/fixtures/md/astro.config.mjs +++ b/packages/astro/performance/fixtures/md/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import react from "@astrojs/react"; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/packages/astro/performance/fixtures/mdoc/astro.config.mjs b/packages/astro/performance/fixtures/mdoc/astro.config.mjs index aae6ad223686..8fddc3316541 100644 --- a/packages/astro/performance/fixtures/mdoc/astro.config.mjs +++ b/packages/astro/performance/fixtures/mdoc/astro.config.mjs @@ -1,6 +1,6 @@ -import { defineConfig } from 'astro/config'; import markdoc from "@astrojs/markdoc"; import react from "@astrojs/react"; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/packages/astro/performance/fixtures/mdx/astro.config.mjs b/packages/astro/performance/fixtures/mdx/astro.config.mjs index a063da817834..837043f23d23 100644 --- a/packages/astro/performance/fixtures/mdx/astro.config.mjs +++ b/packages/astro/performance/fixtures/mdx/astro.config.mjs @@ -1,6 +1,6 @@ -import { defineConfig } from 'astro/config'; import mdx from "@astrojs/mdx"; import react from "@astrojs/react"; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 3b1216de1e94..849ca79ec760 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -1,3 +1,5 @@ +import type { OutgoingHttpHeaders } from 'node:http'; +import type { AddressInfo } from 'node:net'; import type { MarkdownHeading, MarkdownMetadata, @@ -8,8 +10,6 @@ import type { ShikiConfig, } from '@astrojs/markdown-remark'; import type * as babel from '@babel/core'; -import type { OutgoingHttpHeaders } from 'node:http'; -import type { AddressInfo } from 'node:net'; import type * as rollup from 'rollup'; import type * as vite from 'vite'; import type { RemotePattern } from '../assets/utils/remotePattern.js'; diff --git a/packages/astro/src/assets/build/generate.ts b/packages/astro/src/assets/build/generate.ts index f106a56ccf5e..1c73c1592cd8 100644 --- a/packages/astro/src/assets/build/generate.ts +++ b/packages/astro/src/assets/build/generate.ts @@ -1,10 +1,10 @@ -import { dim, green } from 'kleur/colors'; import fs, { readFileSync } from 'node:fs'; import { basename, join } from 'node:path/posix'; +import { dim, green } from 'kleur/colors'; import type PQueue from 'p-queue'; import type { AstroConfig } from '../../@types/astro.js'; -import type { BuildPipeline } from '../../core/build/pipeline.js'; import { getOutDirWithinCwd } from '../../core/build/common.js'; +import type { BuildPipeline } from '../../core/build/pipeline.js'; import { getTimeStat } from '../../core/build/util.js'; import { AstroError } from '../../core/errors/errors.js'; import { AstroErrorData } from '../../core/errors/index.js'; @@ -16,7 +16,7 @@ import { getConfiguredImageService } from '../internal.js'; import type { LocalImageService } from '../services/service.js'; import type { AssetsGlobalStaticImagesList, ImageMetadata, ImageTransform } from '../types.js'; import { isESMImportedImage } from '../utils/imageKind.js'; -import { loadRemoteImage, type RemoteCacheEntry } from './remote.js'; +import { type RemoteCacheEntry, loadRemoteImage } from './remote.js'; interface GenerationDataUncached { cached: false; diff --git a/packages/astro/src/assets/endpoint/generic.ts b/packages/astro/src/assets/endpoint/generic.ts index 46c896a135a3..22b15446da75 100644 --- a/packages/astro/src/assets/endpoint/generic.ts +++ b/packages/astro/src/assets/endpoint/generic.ts @@ -3,9 +3,9 @@ import mime from 'mime/lite.js'; import type { APIRoute } from '../../@types/astro.js'; import { getConfiguredImageService } from '../internal.js'; import { etag } from '../utils/etag.js'; +import { isRemoteAllowed } from '../utils/remotePattern.js'; // @ts-expect-error import { imageConfig } from 'astro:assets'; -import { isRemoteAllowed } from '../utils/remotePattern.js'; async function loadRemoteImage(src: URL) { try { diff --git a/packages/astro/src/assets/endpoint/node.ts b/packages/astro/src/assets/endpoint/node.ts index ba0834acd808..cabf02a76e6b 100644 --- a/packages/astro/src/assets/endpoint/node.ts +++ b/packages/astro/src/assets/endpoint/node.ts @@ -1,13 +1,13 @@ +import os from 'os'; import { isRemotePath, removeQueryString } from '@astrojs/internal-helpers/path'; import { readFile } from 'fs/promises'; import mime from 'mime/lite.js'; -import os from 'os'; import type { APIRoute } from '../../@types/astro.js'; import { getConfiguredImageService } from '../internal.js'; import { etag } from '../utils/etag.js'; +import { isRemoteAllowed } from '../utils/remotePattern.js'; // @ts-expect-error import { assetsDir, imageConfig } from 'astro:assets'; -import { isRemoteAllowed } from '../utils/remotePattern.js'; function replaceFileSystemReferences(src: string) { return os.platform().includes('win32') ? src.replace(/^\/@fs\//, '') : src.replace(/^\/@fs/, ''); diff --git a/packages/astro/src/assets/internal.ts b/packages/astro/src/assets/internal.ts index 1c55c84d5053..4d29247a557c 100644 --- a/packages/astro/src/assets/internal.ts +++ b/packages/astro/src/assets/internal.ts @@ -1,7 +1,7 @@ import type { AstroConfig } from '../@types/astro.js'; import { AstroError, AstroErrorData } from '../core/errors/index.js'; import { DEFAULT_HASH_PROPS } from './consts.js'; -import { isLocalService, type ImageService } from './services/service.js'; +import { type ImageService, isLocalService } from './services/service.js'; import type { GetImageResult, ImageTransform, diff --git a/packages/astro/src/assets/services/noop.ts b/packages/astro/src/assets/services/noop.ts index fe6cc7c922e5..39d99af99479 100644 --- a/packages/astro/src/assets/services/noop.ts +++ b/packages/astro/src/assets/services/noop.ts @@ -1,4 +1,4 @@ -import { baseService, type LocalImageService } from './service.js'; +import { type LocalImageService, baseService } from './service.js'; // Empty service used for platforms that neither support Squoosh or Sharp. const noopService: LocalImageService = { diff --git a/packages/astro/src/assets/services/sharp.ts b/packages/astro/src/assets/services/sharp.ts index 5175bfb96b79..59a461c6eba7 100644 --- a/packages/astro/src/assets/services/sharp.ts +++ b/packages/astro/src/assets/services/sharp.ts @@ -2,10 +2,10 @@ import type { FormatEnum, SharpOptions } from 'sharp'; import { AstroError, AstroErrorData } from '../../core/errors/index.js'; import type { ImageOutputFormat, ImageQualityPreset } from '../types.js'; import { - baseService, - parseQuality, type BaseServiceTransform, type LocalImageService, + baseService, + parseQuality, } from './service.js'; export interface SharpImageServiceConfig { diff --git a/packages/astro/src/assets/services/squoosh.ts b/packages/astro/src/assets/services/squoosh.ts index 098b3a669eb6..ddadaabf38f3 100644 --- a/packages/astro/src/assets/services/squoosh.ts +++ b/packages/astro/src/assets/services/squoosh.ts @@ -3,10 +3,10 @@ import type { ImageOutputFormat, ImageQualityPreset } from '../types.js'; import { imageMetadata } from '../utils/metadata.js'; import { - baseService, - parseQuality, type BaseServiceTransform, type LocalImageService, + baseService, + parseQuality, } from './service.js'; import { processBuffer } from './vendor/squoosh/image-pool.js'; import type { Operation } from './vendor/squoosh/image.js'; diff --git a/packages/astro/src/assets/utils/metadata.ts b/packages/astro/src/assets/utils/metadata.ts index bf8dfb9b3767..953349eb523e 100644 --- a/packages/astro/src/assets/utils/metadata.ts +++ b/packages/astro/src/assets/utils/metadata.ts @@ -1,6 +1,6 @@ -import { lookup as probe } from '../utils/vendor/image-size/lookup.js'; import { AstroError, AstroErrorData } from '../../core/errors/index.js'; import type { ImageInputFormat, ImageMetadata } from '../types.js'; +import { lookup as probe } from '../utils/vendor/image-size/lookup.js'; export async function imageMetadata( data: Uint8Array, diff --git a/packages/astro/src/assets/utils/transformToPath.ts b/packages/astro/src/assets/utils/transformToPath.ts index dd8d17fbeaf3..0cac1a67151c 100644 --- a/packages/astro/src/assets/utils/transformToPath.ts +++ b/packages/astro/src/assets/utils/transformToPath.ts @@ -1,5 +1,5 @@ -import { deterministicString } from 'deterministic-object-hash'; import { basename, extname } from 'node:path'; +import { deterministicString } from 'deterministic-object-hash'; import { removeQueryString } from '../../core/path.js'; import { shorthash } from '../../runtime/server/shorthash.js'; import type { ImageTransform } from '../types.js'; diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts index 13782aaf1e38..4a027a4c8cec 100644 --- a/packages/astro/src/cli/add/index.ts +++ b/packages/astro/src/cli/add/index.ts @@ -1,14 +1,14 @@ +import fsMod, { existsSync, promises as fs } from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import boxen from 'boxen'; import { diffWords } from 'diff'; import { execa } from 'execa'; import { bold, cyan, dim, green, magenta, red, yellow } from 'kleur/colors'; -import fsMod, { existsSync, promises as fs } from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath, pathToFileURL } from 'node:url'; -import maxSatisfying from 'semver/ranges/max-satisfying.js'; import ora from 'ora'; import preferredPM from 'preferred-pm'; import prompts from 'prompts'; +import maxSatisfying from 'semver/ranges/max-satisfying.js'; import type yargs from 'yargs-parser'; import { loadTSConfig, @@ -18,9 +18,9 @@ import { } from '../../core/config/index.js'; import { defaultTSConfig, + type frameworkWithTSSettings, presets, updateTSConfigForFramework, - type frameworkWithTSSettings, } from '../../core/config/tsconfig.js'; import type { Logger } from '../../core/logger/core.js'; import * as msg from '../../core/messages.js'; diff --git a/packages/astro/src/cli/check/index.ts b/packages/astro/src/cli/check/index.ts index faf07b776b9f..721a0bf6911b 100644 --- a/packages/astro/src/cli/check/index.ts +++ b/packages/astro/src/cli/check/index.ts @@ -1,8 +1,8 @@ import path from 'node:path'; import type { Arguments } from 'yargs-parser'; +import { ensureProcessNodeEnv } from '../../core/util.js'; import { createLoggerFromFlags, flagsToAstroInlineConfig } from '../flags.js'; import { getPackage } from '../install-package.js'; -import { ensureProcessNodeEnv } from '../../core/util.js'; export async function check(flags: Arguments) { ensureProcessNodeEnv('production'); diff --git a/packages/astro/src/cli/db/index.ts b/packages/astro/src/cli/db/index.ts index 086a61026b75..d7ac76efe1b0 100644 --- a/packages/astro/src/cli/db/index.ts +++ b/packages/astro/src/cli/db/index.ts @@ -1,9 +1,9 @@ import type { Arguments } from 'yargs-parser'; -import { createLoggerFromFlags, flagsToAstroInlineConfig } from '../flags.js'; -import { getPackage } from '../install-package.js'; -import { resolveConfig } from '../../core/config/config.js'; import type { AstroConfig } from '../../@types/astro.js'; +import { resolveConfig } from '../../core/config/config.js'; import { apply as applyPolyfill } from '../../core/polyfill.js'; +import { createLoggerFromFlags, flagsToAstroInlineConfig } from '../flags.js'; +import { getPackage } from '../install-package.js'; type DBPackage = { cli: (args: { flags: Arguments; config: AstroConfig }) => unknown; diff --git a/packages/astro/src/cli/flags.ts b/packages/astro/src/cli/flags.ts index d61f1e66d7df..0af16806df44 100644 --- a/packages/astro/src/cli/flags.ts +++ b/packages/astro/src/cli/flags.ts @@ -1,6 +1,6 @@ import type { Arguments as Flags } from 'yargs-parser'; import type { AstroInlineConfig } from '../@types/astro.js'; -import { Logger, type LogOptions } from '../core/logger/core.js'; +import { type LogOptions, Logger } from '../core/logger/core.js'; import { nodeLogDestination } from '../core/logger/node.js'; export function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfig { diff --git a/packages/astro/src/cli/info/index.ts b/packages/astro/src/cli/info/index.ts index 8275d409caed..f7e8829a303b 100644 --- a/packages/astro/src/cli/info/index.ts +++ b/packages/astro/src/cli/info/index.ts @@ -1,14 +1,14 @@ -/* eslint-disable no-console */ -import * as colors from 'kleur/colors'; import { execSync } from 'node:child_process'; import { arch, platform } from 'node:os'; +/* eslint-disable no-console */ +import * as colors from 'kleur/colors'; import prompts from 'prompts'; import type yargs from 'yargs-parser'; import type { AstroConfig, AstroUserConfig } from '../../@types/astro.js'; import { resolveConfig } from '../../core/config/index.js'; import { ASTRO_VERSION } from '../../core/constants.js'; -import { flagsToAstroInlineConfig } from '../flags.js'; import { apply as applyPolyfill } from '../../core/polyfill.js'; +import { flagsToAstroInlineConfig } from '../flags.js'; interface InfoOptions { flags: yargs.Arguments; diff --git a/packages/astro/src/cli/install-package.ts b/packages/astro/src/cli/install-package.ts index b68e65d773bc..f4e43f968f7b 100644 --- a/packages/astro/src/cli/install-package.ts +++ b/packages/astro/src/cli/install-package.ts @@ -1,3 +1,5 @@ +import { createRequire } from 'node:module'; +import { sep } from 'node:path'; import boxen from 'boxen'; import { execa } from 'execa'; import { bold, cyan, dim, magenta } from 'kleur/colors'; @@ -6,8 +8,6 @@ import prompts from 'prompts'; import resolvePackage from 'resolve'; import whichPm from 'which-pm'; import { type Logger } from '../core/logger/core.js'; -import { createRequire } from 'node:module'; -import { sep } from 'node:path'; const require = createRequire(import.meta.url); type GetPackageOptions = { diff --git a/packages/astro/src/cli/preferences/index.ts b/packages/astro/src/cli/preferences/index.ts index 686e0854e685..046badf1aae7 100644 --- a/packages/astro/src/cli/preferences/index.ts +++ b/packages/astro/src/cli/preferences/index.ts @@ -2,21 +2,21 @@ import type yargs from 'yargs-parser'; import type { AstroSettings } from '../../@types/astro.js'; -import { bgGreen, black, bold, dim, yellow } from 'kleur/colors'; import { fileURLToPath } from 'node:url'; +import { bgGreen, black, bold, dim, yellow } from 'kleur/colors'; +import { formatWithOptions } from 'node:util'; import dlv from 'dlv'; +// @ts-expect-error flattie types are mispackaged +import { flattie } from 'flattie'; import { resolveConfig } from '../../core/config/config.js'; import { createSettings } from '../../core/config/settings.js'; +import { collectErrorMetadata } from '../../core/errors/dev/utils.js'; import * as msg from '../../core/messages.js'; +import { apply as applyPolyfill } from '../../core/polyfill.js'; import { DEFAULT_PREFERENCES } from '../../preferences/defaults.js'; -import { coerce, isValidKey, type PreferenceKey } from '../../preferences/index.js'; +import { type PreferenceKey, coerce, isValidKey } from '../../preferences/index.js'; import { createLoggerFromFlags, flagsToAstroInlineConfig } from '../flags.js'; -// @ts-expect-error flattie types are mispackaged -import { flattie } from 'flattie'; -import { formatWithOptions } from 'node:util'; -import { collectErrorMetadata } from '../../core/errors/dev/utils.js'; -import { apply as applyPolyfill } from '../../core/polyfill.js'; interface PreferencesOptions { flags: yargs.Arguments; diff --git a/packages/astro/src/content/runtime.ts b/packages/astro/src/content/runtime.ts index c2dd96349055..c2e8ba965203 100644 --- a/packages/astro/src/content/runtime.ts +++ b/packages/astro/src/content/runtime.ts @@ -3,6 +3,7 @@ import { ZodIssueCode, string as zodString } from 'zod'; import { AstroError, AstroErrorData } from '../core/errors/index.js'; import { prependForwardSlash } from '../core/path.js'; import { + type AstroComponentFactory, createComponent, createHeadAndContent, renderComponent, @@ -10,7 +11,6 @@ import { renderTemplate, renderUniqueStylesheet, unescapeHTML, - type AstroComponentFactory, } from '../runtime/server/index.js'; import type { ContentLookupMap } from './utils.js'; diff --git a/packages/astro/src/content/server-listeners.ts b/packages/astro/src/content/server-listeners.ts index 3ff3148cbdfc..590d6f8c1001 100644 --- a/packages/astro/src/content/server-listeners.ts +++ b/packages/astro/src/content/server-listeners.ts @@ -1,14 +1,14 @@ -import { bold, cyan, underline } from 'kleur/colors'; import type fsMod from 'node:fs'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; +import { bold, cyan, underline } from 'kleur/colors'; import type { ViteDevServer } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import { loadTSConfig } from '../core/config/tsconfig.js'; import type { Logger } from '../core/logger/core.js'; import { appendForwardSlash } from '../core/path.js'; import { createContentTypesGenerator } from './types-generator.js'; -import { getContentPaths, globalContentConfigObserver, type ContentPaths } from './utils.js'; +import { type ContentPaths, getContentPaths, globalContentConfigObserver } from './utils.js'; interface ContentServerListenerParams { fs: typeof fsMod; diff --git a/packages/astro/src/content/types-generator.ts b/packages/astro/src/content/types-generator.ts index a84e83fa9c7a..a16105ed7a24 100644 --- a/packages/astro/src/content/types-generator.ts +++ b/packages/astro/src/content/types-generator.ts @@ -1,9 +1,9 @@ -import glob from 'fast-glob'; -import { bold, cyan } from 'kleur/colors'; import type fsMod from 'node:fs'; import * as path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -import { normalizePath, type ViteDevServer } from 'vite'; +import glob from 'fast-glob'; +import { bold, cyan } from 'kleur/colors'; +import { type ViteDevServer, normalizePath } from 'vite'; import type { AstroSettings, ContentEntryType } from '../@types/astro.js'; import { AstroError } from '../core/errors/errors.js'; import { AstroErrorData } from '../core/errors/index.js'; @@ -11,6 +11,9 @@ import type { Logger } 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, getContentEntryIdAndSlug, getContentPaths, getDataEntryExts, @@ -20,9 +23,6 @@ import { getEntrySlug, getEntryType, reloadContentConfigObserver, - type ContentConfig, - type ContentObservable, - type ContentPaths, } from './utils.js'; type ChokidarEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'; diff --git a/packages/astro/src/content/utils.ts b/packages/astro/src/content/utils.ts index 94421cec4126..c84c0984d7b2 100644 --- a/packages/astro/src/content/utils.ts +++ b/packages/astro/src/content/utils.ts @@ -1,10 +1,10 @@ -import { slug as githubSlug } from 'github-slugger'; -import matter from 'gray-matter'; import fsMod from 'node:fs'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; +import { slug as githubSlug } from 'github-slugger'; +import matter from 'gray-matter'; import type { PluginContext } from 'rollup'; -import { normalizePath, type ViteDevServer } from 'vite'; +import { type ViteDevServer, normalizePath } from 'vite'; import { z } from 'zod'; import type { AstroConfig, diff --git a/packages/astro/src/content/vite-plugin-content-assets.ts b/packages/astro/src/content/vite-plugin-content-assets.ts index b985eb9a73fb..1087274980ba 100644 --- a/packages/astro/src/content/vite-plugin-content-assets.ts +++ b/packages/astro/src/content/vite-plugin-content-assets.ts @@ -3,7 +3,7 @@ import { pathToFileURL } from 'node:url'; import type { Plugin, Rollup } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import { moduleIsTopLevelPage, walkParentInfos } from '../core/build/graph.js'; -import { getPageDataByViteID, type BuildInternals } from '../core/build/internal.js'; +import { type BuildInternals, getPageDataByViteID } from '../core/build/internal.js'; import type { AstroBuildPlugin } from '../core/build/plugin.js'; import type { StaticBuildOptions } from '../core/build/types.js'; import type { ModuleLoader } from '../core/module-loader/loader.js'; diff --git a/packages/astro/src/content/vite-plugin-content-imports.ts b/packages/astro/src/content/vite-plugin-content-imports.ts index 36194e45ebba..be232eb07cf6 100644 --- a/packages/astro/src/content/vite-plugin-content-imports.ts +++ b/packages/astro/src/content/vite-plugin-content-imports.ts @@ -1,7 +1,7 @@ -import * as devalue from 'devalue'; import type fsMod from 'node:fs'; import { extname } from 'node:path'; import { pathToFileURL } from 'node:url'; +import * as devalue from 'devalue'; import type { PluginContext } from 'rollup'; import type { Plugin } from 'vite'; import type { @@ -18,6 +18,7 @@ import { AstroErrorData } from '../core/errors/index.js'; import { isServerLikeOutput } from '../prerender/utils.js'; import { CONTENT_FLAG, DATA_FLAG } from './consts.js'; import { + type ContentConfig, getContentEntryExts, getContentEntryIdAndSlug, getContentPaths, @@ -31,7 +32,6 @@ import { hasContentFlag, parseEntrySlug, reloadContentConfigObserver, - type ContentConfig, } from './utils.js'; function getContentRendererByViteId( diff --git a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts index 2fbe95eac064..918fa1705e8a 100644 --- a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts +++ b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts @@ -1,7 +1,7 @@ -import glob from 'fast-glob'; import nodeFs from 'node:fs'; import { extname } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; +import glob from 'fast-glob'; import pLimit from 'p-limit'; import { type Plugin } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; @@ -19,6 +19,7 @@ import { VIRTUAL_MODULE_ID, } from './consts.js'; import { + type ContentLookupMap, getContentEntryIdAndSlug, getContentPaths, getDataEntryExts, @@ -28,7 +29,6 @@ import { getEntrySlug, getEntryType, getExtGlob, - type ContentLookupMap, } from './utils.js'; interface AstroContentVirtualModPluginParams { diff --git a/packages/astro/src/core/app/common.ts b/packages/astro/src/core/app/common.ts index 188a8b599b06..a03debc46e3a 100644 --- a/packages/astro/src/core/app/common.ts +++ b/packages/astro/src/core/app/common.ts @@ -1,5 +1,5 @@ import { deserializeRouteData } from '../routing/manifest/serialization.js'; -import type { RouteInfo, SerializedSSRManifest, SSRManifest } from './types.js'; +import type { RouteInfo, SSRManifest, SerializedSSRManifest } from './types.js'; export function deserializeManifest(serializedManifest: SerializedSSRManifest): SSRManifest { const routes: RouteInfo[] = []; diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts index 74bd4ecbb6f6..2c334223fd0f 100644 --- a/packages/astro/src/core/app/index.ts +++ b/packages/astro/src/core/app/index.ts @@ -1,6 +1,15 @@ import type { ManifestData, RouteData, SSRManifest } from '../../@types/astro.js'; +import { normalizeTheLocale } from '../../i18n/index.js'; import type { SinglePageBuiltModule } from '../build/types.js'; +import { + REROUTABLE_STATUS_CODES, + REROUTE_DIRECTIVE_HEADER, + clientAddressSymbol, + clientLocalsSymbol, + responseSentSymbol, +} from '../constants.js'; import { getSetCookiesFromResponse } from '../cookies/index.js'; +import { AstroError, AstroErrorData } from '../errors/index.js'; import { consoleLogDestination } from '../logger/console.js'; import { AstroIntegrationLogger, Logger } from '../logger/core.js'; import { @@ -11,19 +20,10 @@ import { removeTrailingForwardSlash, } from '../path.js'; import { RedirectSinglePageBuiltModule } from '../redirects/index.js'; +import { RenderContext } from '../render-context.js'; import { createAssetLink } from '../render/ssr-element.js'; import { matchRoute } from '../routing/match.js'; import { AppPipeline } from './pipeline.js'; -import { normalizeTheLocale } from '../../i18n/index.js'; -import { RenderContext } from '../render-context.js'; -import { - clientAddressSymbol, - clientLocalsSymbol, - responseSentSymbol, - REROUTABLE_STATUS_CODES, - REROUTE_DIRECTIVE_HEADER, -} from '../constants.js'; -import { AstroError, AstroErrorData } from '../errors/index.js'; export { deserializeManifest } from './common.js'; export interface RenderOptions { diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts index 439d056da27e..0795c8dd6f3b 100644 --- a/packages/astro/src/core/app/node.ts +++ b/packages/astro/src/core/app/node.ts @@ -1,11 +1,11 @@ import fs from 'node:fs'; -import { App } from './index.js'; -import { deserializeManifest } from './common.js'; -import { createOutgoingHttpHeaders } from './createOutgoingHttpHeaders.js'; import type { IncomingMessage, ServerResponse } from 'node:http'; import type { RouteData } from '../../@types/astro.js'; +import { deserializeManifest } from './common.js'; +import { createOutgoingHttpHeaders } from './createOutgoingHttpHeaders.js'; +import { App } from './index.js'; import type { RenderOptions } from './index.js'; -import type { SerializedSSRManifest, SSRManifest } from './types.js'; +import type { SSRManifest, SerializedSSRManifest } from './types.js'; export { apply as applyPolyfills } from '../polyfill.js'; diff --git a/packages/astro/src/core/app/types.ts b/packages/astro/src/core/app/types.ts index 740165710cb0..83e385b9555d 100644 --- a/packages/astro/src/core/app/types.ts +++ b/packages/astro/src/core/app/types.ts @@ -2,13 +2,13 @@ import type { Locales, MiddlewareHandler, RouteData, - SerializedRouteData, SSRComponentMetadata, SSRLoadedRenderer, SSRResult, + SerializedRouteData, } from '../../@types/astro.js'; -import type { SinglePageBuiltModule } from '../build/types.js'; import type { RoutingStrategies } from '../../i18n/utils.js'; +import type { SinglePageBuiltModule } from '../build/types.js'; export type ComponentPath = string; diff --git a/packages/astro/src/core/base-pipeline.ts b/packages/astro/src/core/base-pipeline.ts index 139ee9485811..2d4a8277c9ac 100644 --- a/packages/astro/src/core/base-pipeline.ts +++ b/packages/astro/src/core/base-pipeline.ts @@ -6,9 +6,9 @@ import type { SSRManifest, SSRResult, } from '../@types/astro.js'; +import { createI18nMiddleware } from '../i18n/middleware.js'; import type { Logger } from './logger/core.js'; import { RouteCache } from './render/route-cache.js'; -import { createI18nMiddleware } from '../i18n/middleware.js'; /** * The `Pipeline` represents the static parts of rendering that do not change between requests. diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index e27f71fccd18..022261323543 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -1,7 +1,7 @@ -import { bgGreen, black, blue, bold, dim, green, magenta, red } from 'kleur/colors'; import fs from 'node:fs'; import os from 'node:os'; import { fileURLToPath } from 'node:url'; +import { bgGreen, black, blue, bold, dim, green, magenta, red } from 'kleur/colors'; import PQueue from 'p-queue'; import type { OutputAsset, OutputChunk } from 'rollup'; import type { @@ -21,7 +21,7 @@ import { getStaticImageList, prepareAssetsGenerationEnv, } from '../../assets/build/generate.js'; -import { hasPrerenderedPages, type BuildInternals } from '../../core/build/internal.js'; +import { type BuildInternals, hasPrerenderedPages } from '../../core/build/internal.js'; import { isRelativePath, joinPaths, @@ -29,9 +29,11 @@ import { removeLeadingForwardSlash, removeTrailingForwardSlash, } from '../../core/path.js'; +import { toRoutingStrategy } from '../../i18n/utils.js'; import { runHookBuildGenerated } from '../../integrations/index.js'; import { getOutputDirectory, isServerLikeOutput } from '../../prerender/utils.js'; import type { SSRManifestI18n } from '../app/types.js'; +import { NoPrerenderedRoutesWithDomains } from '../errors/errors-data.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; import { routeIsFallback } from '../redirects/helpers.js'; import { @@ -39,11 +41,11 @@ import { getRedirectLocationOrThrow, routeIsRedirect, } from '../redirects/index.js'; +import { RenderContext } from '../render-context.js'; import { callGetStaticPaths } from '../render/route-cache.js'; import { createRequest } from '../request.js'; import { matchRoute } from '../routing/match.js'; import { getOutputFilename } from '../util.js'; -import { BuildPipeline } from './pipeline.js'; import { getOutDirWithinCwd, getOutFile, getOutFolder } from './common.js'; import { cssOrder, @@ -51,6 +53,7 @@ import { getPageDataByComponent, mergeInlineCss, } from './internal.js'; +import { BuildPipeline } from './pipeline.js'; import type { PageBuildData, SinglePageBuiltModule, @@ -58,9 +61,6 @@ import type { StylesheetAsset, } from './types.js'; import { getTimeStat, shouldAppendForwardSlash } from './util.js'; -import { NoPrerenderedRoutesWithDomains } from '../errors/errors-data.js'; -import { RenderContext } from '../render-context.js'; -import { toRoutingStrategy } from '../../i18n/utils.js'; function createEntryURL(filePath: string, outFolder: URL) { return new URL('./' + filePath + `?time=${Date.now()}`, outFolder); diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index 7e245726a7a0..0ebf98edd46e 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -1,7 +1,7 @@ -import { blue, bold, green } from 'kleur/colors'; import fs from 'node:fs'; import { performance } from 'node:perf_hooks'; import { fileURLToPath } from 'node:url'; +import { blue, bold, green } from 'kleur/colors'; import type * as vite from 'vite'; import type { AstroConfig, @@ -28,11 +28,11 @@ import type { Logger } from '../logger/core.js'; import { levels, timerMessage } from '../logger/core.js'; import { apply as applyPolyfill } from '../polyfill.js'; import { createRouteManifest } from '../routing/index.js'; +import { ensureProcessNodeEnv } from '../util.js'; import { collectPagesData } from './page-data.js'; import { staticBuild, viteBuild } from './static-build.js'; import type { StaticBuildOptions } from './types.js'; import { getTimeStat } from './util.js'; -import { ensureProcessNodeEnv } from '../util.js'; export interface BuildOptions { /** diff --git a/packages/astro/src/core/build/pipeline.ts b/packages/astro/src/core/build/pipeline.ts index e6e51c87549c..6d018fd8a364 100644 --- a/packages/astro/src/core/build/pipeline.ts +++ b/packages/astro/src/core/build/pipeline.ts @@ -10,9 +10,9 @@ import { createStylesheetElementSet, } from '../render/ssr-element.js'; import { - getPageDataByComponent, type BuildInternals, cssOrder, + getPageDataByComponent, mergeInlineCss, } from './internal.js'; import { diff --git a/packages/astro/src/core/build/plugins/plugin-content.ts b/packages/astro/src/core/build/plugins/plugin-content.ts index a3a8a376aa81..f9c9ba7e4b5e 100644 --- a/packages/astro/src/core/build/plugins/plugin-content.ts +++ b/packages/astro/src/core/build/plugins/plugin-content.ts @@ -2,9 +2,9 @@ import { createHash } from 'node:crypto'; import fsMod from 'node:fs'; import { fileURLToPath } from 'node:url'; import pLimit from 'p-limit'; -import { normalizePath, type Plugin as VitePlugin } from 'vite'; +import { type Plugin as VitePlugin, normalizePath } from 'vite'; import { CONTENT_RENDER_FLAG, PROPAGATED_ASSET_FLAG } from '../../../content/consts.js'; -import { hasContentFlag, type ContentLookupMap } from '../../../content/utils.js'; +import { type ContentLookupMap, hasContentFlag } from '../../../content/utils.js'; import { generateContentEntryFile, generateLookupMap, diff --git a/packages/astro/src/core/build/plugins/plugin-css.ts b/packages/astro/src/core/build/plugins/plugin-css.ts index 432b73301cd0..12d84fd05918 100644 --- a/packages/astro/src/core/build/plugins/plugin-css.ts +++ b/packages/astro/src/core/build/plugins/plugin-css.ts @@ -1,5 +1,5 @@ import type { GetModuleInfo } from 'rollup'; -import type { BuildOptions, ResolvedConfig, Plugin as VitePlugin } from 'vite'; +import type { BuildOptions, Plugin as VitePlugin, ResolvedConfig } from 'vite'; import { isBuildableCSSRequest } from '../../../vite-plugin-astro-server/util.js'; import type { BuildInternals } from '../internal.js'; import type { AstroBuildPlugin, BuildTarget } from '../plugin.js'; diff --git a/packages/astro/src/core/build/plugins/plugin-manifest.ts b/packages/astro/src/core/build/plugins/plugin-manifest.ts index 35c3632d02db..3a03025a5791 100644 --- a/packages/astro/src/core/build/plugins/plugin-manifest.ts +++ b/packages/astro/src/core/build/plugins/plugin-manifest.ts @@ -1,7 +1,9 @@ -import glob from 'fast-glob'; import { fileURLToPath } from 'node:url'; +import glob from 'fast-glob'; import type { OutputChunk } from 'rollup'; import { type Plugin as VitePlugin } from 'vite'; +import { normalizeTheLocale } from '../../../i18n/index.js'; +import { toRoutingStrategy } from '../../../i18n/utils.js'; import { runHookBuildSsr } from '../../../integrations/index.js'; import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from '../../../vite-plugin-scripts/index.js'; import type { @@ -13,11 +15,9 @@ import { joinPaths, prependForwardSlash } from '../../path.js'; import { serializeRouteData } from '../../routing/index.js'; import { addRollupInput } from '../add-rollup-input.js'; import { getOutFile, getOutFolder } from '../common.js'; -import { cssOrder, mergeInlineCss, type BuildInternals } from '../internal.js'; +import { type BuildInternals, cssOrder, mergeInlineCss } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin.js'; import type { StaticBuildOptions } from '../types.js'; -import { normalizeTheLocale } from '../../../i18n/index.js'; -import { toRoutingStrategy } from '../../../i18n/utils.js'; const manifestReplace = '@@ASTRO_MANIFEST_REPLACE@@'; const replaceExp = new RegExp(`['"]${manifestReplace}['"]`, 'g'); diff --git a/packages/astro/src/core/build/plugins/plugin-pages.ts b/packages/astro/src/core/build/plugins/plugin-pages.ts index a7ccf44765c9..6ce5ce58cf5e 100644 --- a/packages/astro/src/core/build/plugins/plugin-pages.ts +++ b/packages/astro/src/core/build/plugins/plugin-pages.ts @@ -2,7 +2,7 @@ import { extname } from 'node:path'; import type { Plugin as VitePlugin } from 'vite'; import { routeIsRedirect } from '../../redirects/index.js'; import { addRollupInput } from '../add-rollup-input.js'; -import { eachPageFromAllPages, type BuildInternals } from '../internal.js'; +import { type BuildInternals, eachPageFromAllPages } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin.js'; import type { StaticBuildOptions } from '../types.js'; import { RENDERERS_MODULE_ID } from './plugin-renderers.js'; diff --git a/packages/astro/src/core/build/plugins/plugin-ssr.ts b/packages/astro/src/core/build/plugins/plugin-ssr.ts index df48374fdb01..5f32ea63b209 100644 --- a/packages/astro/src/core/build/plugins/plugin-ssr.ts +++ b/packages/astro/src/core/build/plugins/plugin-ssr.ts @@ -11,10 +11,10 @@ import { eachPageFromAllPages } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin.js'; import type { StaticBuildOptions } from '../types.js'; import { SSR_MANIFEST_VIRTUAL_MODULE_ID } from './plugin-manifest.js'; +import { MIDDLEWARE_MODULE_ID } from './plugin-middleware.js'; import { ASTRO_PAGE_MODULE_ID } from './plugin-pages.js'; import { RENDERERS_MODULE_ID } from './plugin-renderers.js'; import { getPathFromVirtualModulePageName, getVirtualModulePageNameFromPath } from './util.js'; -import { MIDDLEWARE_MODULE_ID } from './plugin-middleware.js'; export const SSR_VIRTUAL_MODULE_ID = '@astrojs-ssr-virtual-entry'; export const RESOLVED_SSR_VIRTUAL_MODULE_ID = '\0' + SSR_VIRTUAL_MODULE_ID; diff --git a/packages/astro/src/core/build/plugins/util.ts b/packages/astro/src/core/build/plugins/util.ts index 07b18a8870ce..84e6657b9e81 100644 --- a/packages/astro/src/core/build/plugins/util.ts +++ b/packages/astro/src/core/build/plugins/util.ts @@ -1,5 +1,5 @@ import { extname } from 'node:path'; -import type { BuildOptions, Rollup, Plugin as VitePlugin } from 'vite'; +import type { BuildOptions, Plugin as VitePlugin, Rollup } from 'vite'; // eslint-disable-next-line @typescript-eslint/ban-types type OutputOptionsHook = Extract; diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 0b5486d3b729..b81134edf065 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -1,18 +1,18 @@ +import fs from 'node:fs'; +import path, { extname } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import { teardown } from '@astrojs/compiler'; import * as eslexer from 'es-module-lexer'; import glob from 'fast-glob'; import { bgGreen, bgMagenta, black, green } from 'kleur/colors'; -import fs from 'node:fs'; -import path, { extname } from 'node:path'; -import { fileURLToPath, pathToFileURL } from 'node:url'; import * as vite from 'vite'; import type { RouteData } from '../../@types/astro.js'; import { PROPAGATED_ASSET_FLAG } from '../../content/consts.js'; import { hasAnyContentFlag } from '../../content/utils.js'; import { + type BuildInternals, createBuildInternals, eachPageData, - type BuildInternals, } from '../../core/build/internal.js'; import { emptyDir, removeEmptyDirs } from '../../core/fs/index.js'; import { appendForwardSlash, prependForwardSlash, removeFileExtension } from '../../core/path.js'; @@ -25,7 +25,7 @@ import { routeIsRedirect } from '../redirects/index.js'; import { getOutDirWithinCwd } from './common.js'; import { generatePages } from './generate.js'; import { trackPageData } from './internal.js'; -import { createPluginContainer, type AstroBuildPluginContainer } from './plugin.js'; +import { type AstroBuildPluginContainer, createPluginContainer } from './plugin.js'; import { registerAllPlugins } from './plugins/index.js'; import { RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID } from './plugins/plugin-manifest.js'; import { ASTRO_PAGE_RESOLVED_MODULE_ID } from './plugins/plugin-pages.js'; diff --git a/packages/astro/src/core/client-directive/build.ts b/packages/astro/src/core/client-directive/build.ts index 0af1979809aa..e618a9e8a9a3 100644 --- a/packages/astro/src/core/client-directive/build.ts +++ b/packages/astro/src/core/client-directive/build.ts @@ -1,5 +1,5 @@ -import { build } from 'esbuild'; import { fileURLToPath } from 'node:url'; +import { build } from 'esbuild'; /** * Build a client directive entrypoint into code that can directly run in a `