* Every catalog-visible integration block must expose a `BlockMeta` entry in * `BLOCK_META_REGISTRY`. The integration detail pages * (`getTemplatesForBlock`/`getSuggestedSkillsForBlock`) and the landing catalog * read metas by block type; a `tools`-category block that ships in the toolbar * with
()
| 252 | * block (e.g. `github_v2`) passes via its base meta. |
| 253 | */ |
| 254 | function checkIntegrationMetaCoverage(): CheckResult { |
| 255 | const errors: string[] = [] |
| 256 | |
| 257 | for (const block of getAllBlocks()) { |
| 258 | const isCatalogIntegration = block.category === 'tools' && !block.hideFromToolbar |
| 259 | if (!isCatalogIntegration) continue |
| 260 | |
| 261 | if (!getBlockMeta(block.type)) { |
| 262 | errors.push( |
| 263 | `Block "${block.type}" is a catalog integration (category: 'tools', not hidden) but has no BlockMeta.\n` + |
| 264 | ` → Export a \`${block.type}\`-keyed \`{Service}BlockMeta\` (tags + templates + skills) from its block file\n` + |
| 265 | ' and register it in BLOCK_META_REGISTRY (apps/sim/blocks/registry-maps.ts), alphabetically.' |
| 266 | ) |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | if (errors.length === 0) { |
| 271 | return { kind: 'pass', message: 'Integration meta coverage check passed' } |
| 272 | } |
| 273 | return { kind: 'fail', errors } |
| 274 | } |
| 275 | |
| 276 | function reportResult(label: string, failureHeader: string, result: CheckResult): boolean { |
| 277 | if (result.kind === 'pass') { |
no test coverage detected