Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(templates): make TypeScript strict in website template #10587

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GermanJablo
Copy link
Contributor

updating pnpm-lock was necessary due to #10398

@@ -125,7 +125,7 @@ export const Pages: CollectionConfig<'pages'> = {
hooks: {
afterChange: [revalidatePage],
beforeChange: [populatePublishedAt],
beforeDelete: [revalidateDelete],
afterDelete: [revalidateDelete],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulpopus is this correct? beforeDelete doesn't have access to doc so ts complains. I don't know if it was working properly before this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think this fine if you've tested it works

@GermanJablo GermanJablo changed the title make TypeScript strict in website template chore(templates): make TypeScript strict in website template Jan 15, 2025
Copy link
Contributor

@paulpopus paulpopus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nitpick left, otherwise looks good! Thank you for your work on this.

After this merged you can trigger a template sync via actions -> "post-release-templates". It copies over files while bumping versions and whatever else

@@ -125,7 +125,7 @@ export const Pages: CollectionConfig<'pages'> = {
hooks: {
afterChange: [revalidatePage],
beforeChange: [populatePublishedAt],
beforeDelete: [revalidateDelete],
afterDelete: [revalidateDelete],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think this fine if you've tested it works

export async function generateMetadata({ params: paramsPromise }): Promise<Metadata> {
const { slug = 'home' } = await paramsPromise
export async function generateMetadata({ params }: Args): Promise<Metadata> {
const { slug = 'home' } = await params
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpick here, but we should consistently rename params to paramsPromise. Since it's a paradigm shift, it's better they understand this is a promise you need to await, for those learning nextjs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants