Overview
Add integrations section to site config schema to support pro package integrations (OpenAPI, GraphQL, etc.).
Motivation
The prebuild plugin system is now in place (PR #237). We need to validate integration configs in stackwright.yml so users get helpful errors instead of silent failures.
Acceptance Criteria
Implementation Details
1. Add integration schema to types package
File: packages/types/src/schemas/site-config.ts
import { z } from 'zod';
// Integration base schema
const integrationBaseSchema = z.object({
type: z.enum(['openapi', 'graphql', 'rest']),
name: z.string().min(1, 'Integration name is required'),
}).passthrough(); // Allow additional properties for integration-specific config
// Add to siteConfigSchema:
export const siteConfigSchema = z.object({
theme: themeSchema,
appBar: appBarSchema.optional(),
footer: footerSchema.optional(),
integrations: z.array(integrationBaseSchema).optional(),
// ... rest of schema
});
2. Add TypeScript types
File: packages/types/src/types/site-config.ts
export interface IntegrationConfig {
type: 'openapi' | 'graphql' | 'rest';
name: string;
[key: string]: unknown; // Additional integration-specific properties
}
export interface SiteConfig {
theme: ThemeConfig;
appBar?: AppBarConfig;
footer?: FooterConfig;
integrations?: IntegrationConfig[];
// ... rest of interface
}
3. Add tests
File: packages/types/test/site-config.test.ts
Test cases for valid integrations, invalid types, missing names, and additional properties.
Files to Modify
packages/types/src/schemas/site-config.ts
packages/types/src/types/site-config.ts
packages/types/test/site-config.test.ts
Related
- Foundation for @stackwright-pro/openapi integration
- Enables future integration types (GraphQL, REST, CMS, etc.)
Estimated Time
1-2 hours
Overview
Add
integrationssection to site config schema to support pro package integrations (OpenAPI, GraphQL, etc.).Motivation
The prebuild plugin system is now in place (PR #237). We need to validate integration configs in
stackwright.ymlso users get helpful errors instead of silent failures.Acceptance Criteria
integrationsfield tositeConfigSchemain@stackwright/typestype,name, and additional propertiesopenapi,graphql,rest)Implementation Details
1. Add integration schema to types package
File:
packages/types/src/schemas/site-config.ts2. Add TypeScript types
File:
packages/types/src/types/site-config.ts3. Add tests
File:
packages/types/test/site-config.test.tsTest cases for valid integrations, invalid types, missing names, and additional properties.
Files to Modify
packages/types/src/schemas/site-config.tspackages/types/src/types/site-config.tspackages/types/test/site-config.test.tsRelated
Estimated Time
1-2 hours