0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

[ci] format

This commit is contained in:
Matt Kane 2024-12-18 13:56:42 +00:00 committed by astrobot-houston
parent b4fec3c7d1
commit a94e309ebf
4 changed files with 8 additions and 11 deletions

View file

@ -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> | AstroMiddlewareInstance;
checkOrigin: boolean;
sessionConfig?: ResolvedSessionConfig<any>
sessionConfig?: ResolvedSessionConfig<any>;
};
export type SSRManifestI18n = {

View file

@ -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}');`,

View file

@ -1958,7 +1958,7 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
responsiveImages?: boolean;
/**
*
*
* @name experimental.session
* @type {SessionConfig}
* @version 5.0.0

View file

@ -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();