Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and astrobot-houston committed Dec 27, 2023
1 parent 89a2a07 commit b8cc444
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export async function generateLookupMap({
collection,
slug,
lookupMap[collection]!.entries[slug],
rootRelativePath(root, filePath),
rootRelativePath(root, filePath)
),
hint:
slug !== generatedSlug
Expand Down
6 changes: 4 additions & 2 deletions packages/astro/src/core/errors/errors-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1293,11 +1293,13 @@ export const DuplicateContentEntrySlugError = {
name: 'DuplicateContentEntrySlugError',
title: 'Duplicate content entry slug.',
message: (collection: string, slug: string, preExisting: string, alsoFound: string) => {
return `**${collection}** contains multiple entries with the same slug: \`${slug}\`. ` +
return (
`**${collection}** contains multiple entries with the same slug: \`${slug}\`. ` +
`Slugs must be unique.\n\n` +
`Entries: \n` +
`- ${preExisting}\n` +
`- ${alsoFound}`;
`- ${alsoFound}`
);
},
} satisfies ErrorData;

Expand Down
10 changes: 7 additions & 3 deletions packages/astro/src/runtime/server/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function renderEndpoint(
const handler = mod[method] ?? mod['ALL'];
if (!ssr && ssr === false && method !== 'GET') {
logger.warn(
"router",
'router',
`${url.pathname} ${bold(
method
)} requests are not available for a static site. Update your config to \`output: 'server'\` or \`output: 'hybrid'\` to enable.`
Expand All @@ -26,8 +26,12 @@ export async function renderEndpoint(
logger.warn(
'router',
`No API Route handler exists for the method "${method}" for the route ${url.pathname}.\n` +
`Found handlers: ${Object.keys(mod).map(exp => JSON.stringify(exp)).join(', ')}\n` +
('all' in mod ? `One of the exported handlers is "all" (lowercase), did you mean to export 'ALL'?\n` : '')
`Found handlers: ${Object.keys(mod)
.map((exp) => JSON.stringify(exp))
.join(', ')}\n` +
('all' in mod
? `One of the exported handlers is "all" (lowercase), did you mean to export 'ALL'?\n`
: '')
);
// No handler found, so this should be a 404. Using a custom header
// to signal to the renderer that this is an internal 404 that should
Expand Down

0 comments on commit b8cc444

Please sign in to comment.