mirror of
https://github.com/withastro/astro.git
synced 2025-01-13 22:11:20 -05:00
[ci] format
This commit is contained in:
parent
b4fec3c7d1
commit
a94e309ebf
4 changed files with 8 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
||||||
import type { RoutingStrategies } from '../../i18n/utils.js';
|
import type { RoutingStrategies } from '../../i18n/utils.js';
|
||||||
import type { ComponentInstance, SerializedRouteData } from '../../types/astro.js';
|
import type { ComponentInstance, SerializedRouteData } from '../../types/astro.js';
|
||||||
import type { AstroMiddlewareInstance } from '../../types/public/common.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 {
|
import type {
|
||||||
RouteData,
|
RouteData,
|
||||||
SSRComponentMetadata,
|
SSRComponentMetadata,
|
||||||
|
@ -69,7 +69,7 @@ export type SSRManifest = {
|
||||||
i18n: SSRManifestI18n | undefined;
|
i18n: SSRManifestI18n | undefined;
|
||||||
middleware?: () => Promise<AstroMiddlewareInstance> | AstroMiddlewareInstance;
|
middleware?: () => Promise<AstroMiddlewareInstance> | AstroMiddlewareInstance;
|
||||||
checkOrigin: boolean;
|
checkOrigin: boolean;
|
||||||
sessionConfig?: ResolvedSessionConfig<any>
|
sessionConfig?: ResolvedSessionConfig<any>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SSRManifestI18n = {
|
export type SSRManifestI18n = {
|
||||||
|
|
|
@ -16,13 +16,13 @@ import { encodeKey } from '../../encryption.js';
|
||||||
import { fileExtension, joinPaths, prependForwardSlash } from '../../path.js';
|
import { fileExtension, joinPaths, prependForwardSlash } from '../../path.js';
|
||||||
import { DEFAULT_COMPONENTS } from '../../routing/default.js';
|
import { DEFAULT_COMPONENTS } from '../../routing/default.js';
|
||||||
import { serializeRouteData } from '../../routing/index.js';
|
import { serializeRouteData } from '../../routing/index.js';
|
||||||
|
import { resolveSessionDriver } from '../../session.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 { makePageDataKey } from './util.js';
|
import { makePageDataKey } from './util.js';
|
||||||
import { resolveSessionDriver } from '../../session.js';
|
|
||||||
|
|
||||||
const manifestReplace = '@@ASTRO_MANIFEST_REPLACE@@';
|
const manifestReplace = '@@ASTRO_MANIFEST_REPLACE@@';
|
||||||
const replaceExp = new RegExp(`['"]${manifestReplace}['"]`, 'g');
|
const replaceExp = new RegExp(`['"]${manifestReplace}['"]`, 'g');
|
||||||
|
@ -54,7 +54,9 @@ function vitePluginManifest(options: StaticBuildOptions, internals: BuildInterna
|
||||||
`import { _privateSetManifestDontUseThis } from 'astro:ssr-manifest'`,
|
`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 contents = [
|
||||||
`const manifest = _deserializeManifest('${manifestReplace}');`,
|
`const manifest = _deserializeManifest('${manifestReplace}');`,
|
||||||
|
|
|
@ -165,13 +165,8 @@ test('AstroSession - Data Persistence', async (t) => {
|
||||||
|
|
||||||
assert.equal(value, undefined);
|
assert.equal(value, undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test('AstroSession - Error Handling', async (t) => {
|
test('AstroSession - Error Handling', async (t) => {
|
||||||
await t.test('should throw error when setting invalid data', async () => {
|
await t.test('should throw error when setting invalid data', async () => {
|
||||||
const session = createSession();
|
const session = createSession();
|
||||||
|
|
Loading…
Add table
Reference in a new issue