-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/next-config-client-reference' of https://github.co…
…m/withastro/astro into feat/next-config-client-reference
- Loading branch information
Showing
76 changed files
with
444 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Updates error messages that assume content collections are located in `src/content/` with more generic language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,47 @@ | ||
import type { AstroSettings } from '../../types/astro.js'; | ||
import { resolveInjectedRoute } from '../../core/routing/manifest/create.js'; | ||
import type { AstroSettings, ManifestData } from '../../types/astro.js'; | ||
import type { RouteData } from '../../types/public/internal.js'; | ||
|
||
export function injectImageEndpoint(settings: AstroSettings, mode: 'dev' | 'build') { | ||
export function injectImageEndpoint( | ||
settings: AstroSettings, | ||
manifest: ManifestData, | ||
mode: 'dev' | 'build', | ||
cwd?: string, | ||
) { | ||
manifest.routes.push(getImageEndpointData(settings, mode, cwd)); | ||
} | ||
|
||
export function ensureImageEndpointRoute( | ||
settings: AstroSettings, | ||
manifest: ManifestData, | ||
mode: 'dev' | 'build', | ||
cwd?: string, | ||
) { | ||
if (!manifest.routes.some((route) => route.route === '/_image')) { | ||
manifest.routes.push(getImageEndpointData(settings, mode, cwd)); | ||
} | ||
} | ||
|
||
function getImageEndpointData( | ||
settings: AstroSettings, | ||
mode: 'dev' | 'build', | ||
cwd?: string, | ||
): RouteData { | ||
const endpointEntrypoint = | ||
settings.config.image.endpoint ?? | ||
(mode === 'dev' ? 'astro/assets/endpoint/node' : 'astro/assets/endpoint/generic'); | ||
|
||
settings.injectedRoutes.push({ | ||
pattern: '/_image', | ||
entrypoint: endpointEntrypoint, | ||
return { | ||
type: 'endpoint', | ||
isIndex: false, | ||
route: '/_image', | ||
pattern: /^\/_image$/, | ||
segments: [[{ content: '_image', dynamic: false, spread: false }]], | ||
params: [], | ||
component: resolveInjectedRoute(endpointEntrypoint, settings.config.root, cwd).component, | ||
generate: () => '', | ||
pathname: '/_image', | ||
prerender: false, | ||
}); | ||
|
||
return settings; | ||
fallbackRoutes: [], | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.