diff --git a/packages/builder/src/schemas.ts b/packages/builder/src/schemas.ts index 89803f4c4..bbfa9863c 100644 --- a/packages/builder/src/schemas.ts +++ b/packages/builder/src/schemas.ts @@ -880,29 +880,29 @@ export const chainDefinitionSchema = z 'Turns off inclusion of source code in packages. When set to true, Cannon cannot verify contracts on Etherscan. Defaults to false.' ) .optional(), + /** + * Description for the package + */ + description: z.string().describe('Description for the package').optional(), + /** + * Keywords for search indexing + */ + keywords: z.array(z.string()).describe('Keywords for search indexing').optional(), + /** + * Any deployers that could publish this package. Will be used for automatic version management. + */ + deployers: z + .array( + z.string().refine((val) => !!val.match(RegExp(/^0x[a-fA-F0-9]{40}$/, 'gm')), { + message: 'Invalid Ethereum address', + }) + ) + .describe('Any deployers that could publish this package. Will be used for automatic version management.') + .optional(), }) .merge( z .object({ - /** - * Description for the package - */ - description: z.string().describe('Description for the package'), - /** - * Keywords for search indexing - */ - keywords: z.array(z.string()).describe('Keywords for search indexing'), - /** - * Any deployers that could publish this package. Will be used for automatic version management. - */ - deployers: z - .array( - z.string().refine((val) => !!val.match(RegExp(/^0x[a-fA-F0-9]{40}$/, 'gm')), { - message: 'Invalid Ethereum address', - }) - ) - .optional() - .describe('Any deployers that could publish this package. Will be used for automatic version management.'), /** * Object that allows the definition of values for use in next operations * ```toml diff --git a/packages/website/src/features/Docs/DocsCannonfilesPage.tsx b/packages/website/src/features/Docs/DocsCannonfilesPage.tsx index 6a866914c..dd4e1c54f 100644 --- a/packages/website/src/features/Docs/DocsCannonfilesPage.tsx +++ b/packages/website/src/features/Docs/DocsCannonfilesPage.tsx @@ -1,5 +1,6 @@ 'use client'; +import { CommandPreview } from '@/components/CommandPreview'; import { CustomSpinner } from '@/components/CustomSpinner'; import { useCannonfileSpecs } from '@/hooks/cannonfileSpecs'; import { @@ -121,31 +122,11 @@ const deploymentDataExample = { }, miscUrl: 'ipfs://Qm...', }; -interface CustomLinkProps { - href: string; - children: React.ReactNode; -} - -const CustomLink: FC = ({ href, children }) => ( - - {children} - -); interface LinkItem { href: string; text: string; + monospace?: boolean; } interface SectionProps { @@ -167,9 +148,22 @@ const Section: FC = ({ title, links }) => ( {links.map((link, index) => ( - + {link.text} - + ))} @@ -246,10 +240,11 @@ const DocsCannonfilesPage: FC = () => { >
key) .filter( (key) => @@ -258,7 +253,8 @@ const DocsCannonfilesPage: FC = () => { ) .map((key) => ({ href: `#${key}`, - text: key as string, + text: `[${key}.*]`, + monospace: true, })), ]} /> @@ -424,47 +420,66 @@ const DocsCannonfilesPage: FC = () => { + + + Utilities + + # + + + + + Viem.sh + {' '} + utility functions are available inside interpolation values, + e.g.: + + "]'} + /> + {Array.from(cannonfileSpecs) .sort((a, b) => { const aDeprecated = cannonfileSpecs?.get(a[0])?.deprecated @@ -480,7 +495,7 @@ const DocsCannonfilesPage: FC = () => { - {key} + [{key}.*] (); - const metadataKeys = ['name', 'preset', 'version', 'description', 'keywords', 'privateSourceCode']; + const metadataKeys = ['name', 'preset', 'version', 'description', 'keywords', 'privateSourceCode', 'deployers']; const metadataSpecs: Spec[] = []; for (const key of metadataKeys) { metadataSpecs.push(await getSpec(chainDefinitionJsonSchema, key)); } + result.set('metadata', { - description: 'Provide metadata for your Cannonfile.', + description: 'Provide metadata for your Cannonfile. These are the top-most attributes on your Cannonfile.', specs: metadataSpecs, });