From a94e309ebf3b3259515a214c5f398a0287fc1d69 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 18 Dec 2024 13:56:42 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/app/types.ts | 4 ++-- packages/astro/src/core/build/plugins/plugin-manifest.ts | 8 +++++--- packages/astro/src/types/public/config.ts | 2 +- packages/astro/test/units/sessions/astro-session.test.js | 5 ----- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/astro/src/core/app/types.ts b/packages/astro/src/core/app/types.ts index d8f069c4e4..2b2b703784 100644 --- a/packages/astro/src/core/app/types.ts +++ b/packages/astro/src/core/app/types.ts @@ -1,7 +1,7 @@ import type { RoutingStrategies } from '../../i18n/utils.js'; import type { ComponentInstance, SerializedRouteData } from '../../types/astro.js'; import type { AstroMiddlewareInstance } from '../../types/public/common.js'; -import type { Locales, ResolvedSessionConfig, SessionConfig } from '../../types/public/config.js'; +import type { Locales, ResolvedSessionConfig, } from '../../types/public/config.js'; import type { RouteData, SSRComponentMetadata, @@ -69,7 +69,7 @@ export type SSRManifest = { i18n: SSRManifestI18n | undefined; middleware?: () => Promise | AstroMiddlewareInstance; checkOrigin: boolean; - sessionConfig?: ResolvedSessionConfig + sessionConfig?: ResolvedSessionConfig; }; export type SSRManifestI18n = { diff --git a/packages/astro/src/core/build/plugins/plugin-manifest.ts b/packages/astro/src/core/build/plugins/plugin-manifest.ts index 54a64bc9e3..14e0a08b45 100644 --- a/packages/astro/src/core/build/plugins/plugin-manifest.ts +++ b/packages/astro/src/core/build/plugins/plugin-manifest.ts @@ -16,13 +16,13 @@ import { encodeKey } from '../../encryption.js'; import { fileExtension, joinPaths, prependForwardSlash } from '../../path.js'; import { DEFAULT_COMPONENTS } from '../../routing/default.js'; import { serializeRouteData } from '../../routing/index.js'; +import { resolveSessionDriver } from '../../session.js'; import { addRollupInput } from '../add-rollup-input.js'; import { getOutFile, getOutFolder } from '../common.js'; import { type BuildInternals, cssOrder, mergeInlineCss } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin.js'; import type { StaticBuildOptions } from '../types.js'; import { makePageDataKey } from './util.js'; -import { resolveSessionDriver } from '../../session.js'; const manifestReplace = '@@ASTRO_MANIFEST_REPLACE@@'; const replaceExp = new RegExp(`['"]${manifestReplace}['"]`, 'g'); @@ -53,8 +53,10 @@ function vitePluginManifest(options: StaticBuildOptions, internals: BuildInterna `import { deserializeManifest as _deserializeManifest } from 'astro/app'`, `import { _privateSetManifestDontUseThis } from 'astro:ssr-manifest'`, ]; - - const resolvedDriver = await resolveSessionDriver(options.settings.config.experimental?.session?.driver); + + const resolvedDriver = await resolveSessionDriver( + options.settings.config.experimental?.session?.driver, + ); const contents = [ `const manifest = _deserializeManifest('${manifestReplace}');`, diff --git a/packages/astro/src/types/public/config.ts b/packages/astro/src/types/public/config.ts index 73bdb3002a..635e57798c 100644 --- a/packages/astro/src/types/public/config.ts +++ b/packages/astro/src/types/public/config.ts @@ -1958,7 +1958,7 @@ export interface ViteUserConfig extends OriginalViteUserConfig { responsiveImages?: boolean; /** - * + * * @name experimental.session * @type {SessionConfig} * @version 5.0.0 diff --git a/packages/astro/test/units/sessions/astro-session.test.js b/packages/astro/test/units/sessions/astro-session.test.js index 0bbefee735..95a8b84ef5 100644 --- a/packages/astro/test/units/sessions/astro-session.test.js +++ b/packages/astro/test/units/sessions/astro-session.test.js @@ -165,13 +165,8 @@ test('AstroSession - Data Persistence', async (t) => { assert.equal(value, undefined); }); - - - }); - - test('AstroSession - Error Handling', async (t) => { await t.test('should throw error when setting invalid data', async () => { const session = createSession();