Repository: withastro/astro
File: packages/astro/src/core/build/generate.ts (TypeScript)

Code before:
	actions: SSRActions,
	key: Promise<CryptoKey>,
): Promise<SSRManifest> {
	let i18nManifest: SSRManifestI18n | undefined = undefined;
	let csp: SSRManifestCSP | undefined = undefined;

	if (settings.config.i18n) {
		i18nManifest = {
			fallback: settings.config.i18n.fallback,
			fallbackType: toFallbackType(settings.config.i18n.routing),
			strategy: toRoutingStrategy(settings.config.i18n.routing, settings.config.i18n.domains),
			defaultLocale: settings.config.i18n.defaultLocale,
			locales: settings.config.i18n.locales,
			domainLookupTable: {},
		};
	}

	if (shouldTrackCspHashes(settings.config)) {
		const algorithm = getAlgorithm(settings.config);
		const clientScriptHashes = await trackScriptHashes(internals, settings, algorithm);
		const clientStyleHashes = await trackStyleHashes(internals, settings, algorithm);

		csp = {
			clientStyleHashes,
			clientScriptHashes,
			shouldInjectCspMetaTags: shouldTrackCspHashes(settings.config),
			algorithm
		};
	}
	return {
		hrefRoot: settings.config.root.toString(),
		srcDir: settings.config.srcDir,
		buildClientDir: settings.config.build.client,
		buildServerDir: settings.config.build.server,
		publicDir: settings.config.publicDir,
		outDir: settings.config.outDir,
		cacheDir: settings.config.cacheDir,
		trailingSlash: settings.config.trailingSlash,
		assets: new Set(),
		entryModules: Object.fromEntries(internals.entrySpecifierToBundleMap.entries()),
		inlinedScripts: internals.inlinedScripts,
		routes: [],
		adapterName: '',
		clientDirectives: settings.clientDirectives,
		compressHTML: settings.config.compressHTML,
		renderers,
		base: settings.config.base,
		userAssetsBase: settings.config?.vite?.base,
		assetsPrefix: settings.config.build.assetsPrefix,
		site: settings.config.site,
		componentMetadata: internals.componentMetadata,

Review comment (suggestion):
I don't think it makes sense to have this flag as part of the SSRManifestCSP, since this manifest is only created if `shouldTrackCspHashes(settings.config)`

Code after:
	actions: SSRActions,
	key: Promise<CryptoKey>,
): Promise<SSRManifest> {
	let i18nManifest: SSRManifestI18n | undefined = undefined;
	let csp: SSRManifestCSP | undefined = undefined;

	if (settings.config.i18n) {
		i18nManifest = {
			fallback: settings.config.i18n.fallback,
			fallbackType: toFallbackType(settings.config.i18n.routing),
			strategy: toRoutingStrategy(settings.config.i18n.routing, settings.config.i18n.domains),
			defaultLocale: settings.config.i18n.defaultLocale,
			locales: settings.config.i18n.locales,
			domainLookupTable: {},
		};
	}

	if (shouldTrackCspHashes(settings.config)) {
		const algorithm = getAlgorithm(settings.config);
		const clientScriptHashes = await trackScriptHashes(internals, settings, algorithm);
		const clientStyleHashes = await trackStyleHashes(internals, settings, algorithm);

		csp = {
			clientStyleHashes,
			clientScriptHashes,
			algorithm,
		};
	}
	return {
		hrefRoot: settings.config.root.toString(),
		srcDir: settings.config.srcDir,
		buildClientDir: settings.config.build.client,
		buildServerDir: settings.config.build.server,
		publicDir: settings.config.publicDir,
		outDir: settings.config.outDir,
		cacheDir: settings.config.cacheDir,
		trailingSlash: settings.config.trailingSlash,
		assets: new Set(),
		entryModules: Object.fromEntries(internals.entrySpecifierToBundleMap.entries()),
		inlinedScripts: internals.inlinedScripts,
		routes: [],
		adapterName: '',
		clientDirectives: settings.clientDirectives,
		compressHTML: settings.config.compressHTML,
		renderers,
		base: settings.config.base,
		userAssetsBase: settings.config?.vite?.base,
		assetsPrefix: settings.config.build.assetsPrefix,
		site: settings.config.site,
		componentMetadata: internals.componentMetadata,
		i18n: i18nManifest,