diff --git a/sites/svelte.dev/scripts/type-gen/index.js b/sites/svelte.dev/scripts/type-gen/index.js index 7db962aff0..a9f49376b3 100644 --- a/sites/svelte.dev/scripts/type-gen/index.js +++ b/sites/svelte.dev/scripts/type-gen/index.js @@ -4,7 +4,7 @@ import prettier from 'prettier'; import ts from 'typescript'; import { get_bundled_types } from './compile-types.js'; -/** @typedef {{ name: string; comment: string; markdown: string; }} Extracted */ +/** @typedef {{ name: string; comment: string; markdown: string; snippet: string; children: Extracted[] }} Extracted */ /** @type {Array<{ name: string; comment: string; exports: Extracted[]; types: Extracted[]; exempt?: boolean; }>} */ const modules = []; @@ -337,6 +337,21 @@ $: { } } +// Remove $$_attributes from ActionReturn + +$: { + const module_with_ActionReturn = modules.find((m) => + m.types.find((t) => t.name === 'ActionReturn') + ); + + const new_children = + module_with_ActionReturn?.types[1].children.filter((c) => c.name !== '$$_attributes') || []; + + if (!module_with_ActionReturn) break $; + + module_with_ActionReturn.types[1].children = new_children; +} + try { fs.mkdirSync(new URL('../../src/lib/generated', import.meta.url), { recursive: true }); } catch {}