diff --git a/apps/docs/features/docs/Troubleshooting.script.mjs b/apps/docs/features/docs/Troubleshooting.script.mjs index 932def8cc23..698525aaea3 100644 --- a/apps/docs/features/docs/Troubleshooting.script.mjs +++ b/apps/docs/features/docs/Troubleshooting.script.mjs @@ -1,3 +1,5 @@ +// @ts-check + /* eslint-disable turbo/no-undeclared-env-vars */ /** @@ -42,7 +44,7 @@ const REPOSITORY_NAME = 'supabase' */ let octokitInstance /** - * @type {SupabaseClient} + * @type {import('@supabase/supabase-js').SupabaseClient} */ let supabaseAdminClient @@ -64,8 +66,8 @@ function octokit() { export function supabaseAdmin() { if (!supabaseAdminClient) { supabaseAdminClient = createClient( - process.env.NEXT_PUBLIC_SUPABASE_URL, - process.env.SUPABASE_SECRET_KEY + /** @type {string} */ (process.env.NEXT_PUBLIC_SUPABASE_URL), + /** @type {string} */ (process.env.SUPABASE_SECRET_KEY) ) } @@ -252,7 +254,7 @@ async function updateChecksumIfNeeded(entry) { * @param {TroubleshootingEntry} entry */ function addCanonicalUrl(entry) { - const docsUrl = 'https://supabase.com/docs/guides/troubleshooting/' + getArticleSlug(entry.data) + const docsUrl = 'https://supabase.com/docs/guides/troubleshooting/' + getArticleSlug(entry) const content = `_This is a copy of a troubleshooting article on Supabase's docs site. It may be missing some details from the original. View the [original article](${docsUrl})._\n\n` + entry.contentWithoutJsx diff --git a/apps/docs/features/docs/Troubleshooting.utils.common.mjs b/apps/docs/features/docs/Troubleshooting.utils.common.mjs index 5be6cdd0677..12c275a08e0 100644 --- a/apps/docs/features/docs/Troubleshooting.utils.common.mjs +++ b/apps/docs/features/docs/Troubleshooting.utils.common.mjs @@ -1,3 +1,5 @@ +// @ts-check + /** * This file is for utils needed in both the Next.js app build and the * troubleshooting sync script. Because of unsolved problems with imports, the @@ -98,16 +100,13 @@ export const TroubleshootingSchema = z }) .strict() -/* +/** * @param {unknown} troubleshootingMetadata */ function validateTroubleshootingMetadata(troubleshootingMetadata) { return TroubleshootingSchema.safeParse(troubleshootingMetadata) } -/* - * @returns {Promise} - */ export async function getAllTroubleshootingEntriesInternal() { const troubleshootingDirectoryContents = await readdir(TROUBLESHOOTING_DIRECTORY, { recursive: true, @@ -172,7 +171,7 @@ export async function getAllTroubleshootingEntriesInternal() { } }) - return (await Promise.all(troubleshootingFiles)).filter(Boolean) + return (await Promise.all(troubleshootingFiles)).filter((x) => x != null) } /**