@specverse/engine-realize 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/examples/09-api/ai-spec.yaml +194 -0
- package/assets/examples/09-api/converted.yaml +95 -0
- package/assets/examples/09-api/diagram-architecture.mmd +10 -0
- package/assets/examples/09-api/diagram-er.mmd +10 -0
- package/assets/examples/09-api/documentation.html +104 -0
- package/assets/examples/09-api/documentation.md +95 -0
- package/assets/examples/09-api/inferred-spec.yaml +420 -0
- package/assets/examples/09-api/openapi.json +61 -0
- package/assets/examples/10-api/README.md +216 -0
- package/assets/examples/10-api/ai-spec.yaml +194 -0
- package/assets/examples/10-api/converted.yaml +96 -0
- package/assets/examples/10-api/diagram-architecture.mmd +10 -0
- package/assets/examples/10-api/diagram-er.mmd +10 -0
- package/assets/examples/10-api/documentation.html +104 -0
- package/assets/examples/10-api/documentation.md +95 -0
- package/assets/examples/10-api/inferred-spec.yaml +7 -0
- package/assets/examples/10-api/metadata.yaml +89 -0
- package/assets/examples/10-api/openapi.json +61 -0
- package/assets/examples/10-api/package-integration-test.js +177 -0
- package/assets/examples/10-api/usage-example.js +323 -0
- package/assets/examples/10-api/usage-example.ts +363 -0
- package/assets/examples/10-api/workflow-test.js +113 -0
- package/assets/examples/manifests/01-simple-default-mappings.yaml +36 -0
- package/assets/examples/manifests/02-capability-mappings.yaml +55 -0
- package/assets/examples/manifests/03-hybrid-mappings.yaml +109 -0
- package/assets/examples/manifests/README.md +245 -0
- package/assets/examples/manifests/backend-only.yaml +43 -0
- package/assets/examples/manifests/blog-api.md +78 -0
- package/assets/examples/manifests/blog-api.specly +79 -0
- package/assets/examples/manifests/frontend-only.yaml +27 -0
- package/assets/examples/manifests/fullstack-app.yaml +44 -0
- package/assets/examples/manifests/fullstack-monorepo.yaml +62 -0
- package/assets/examples/validate-examples-with-expected-failures.cjs +328 -0
- package/assets/examples/validate-examples.cjs +225 -0
- package/assets/examples-decomposed/cloud-native-manifest.example.yaml +8 -0
- package/assets/examples-decomposed/cloud-native-manifest.md +379 -0
- package/assets/examples-decomposed/cloud-native-manifest.specly +60 -0
- package/assets/examples-decomposed/docker-compose-manifest.example.yaml +8 -0
- package/assets/examples-decomposed/docker-compose-manifest.md +326 -0
- package/assets/examples-decomposed/docker-compose-manifest.specly +40 -0
- package/assets/examples-decomposed/kubernetes-deployment-manifest.example.yaml +8 -0
- package/assets/examples-decomposed/kubernetes-deployment-manifest.md +237 -0
- package/assets/examples-decomposed/kubernetes-deployment-manifest.specly +41 -0
- package/assets/templates/README.md +559 -0
- package/assets/templates/TEMPLATE-ENHANCEMENTS-V33.md +462 -0
- package/assets/templates/backend-only/CLAUDE.md +73 -0
- package/assets/templates/backend-only/README.md +197 -0
- package/assets/templates/backend-only/deployments/README.md +149 -0
- package/assets/templates/backend-only/deployments/development.specly +53 -0
- package/assets/templates/backend-only/deployments/production.specly +87 -0
- package/assets/templates/backend-only/docs/README.md +50 -0
- package/assets/templates/backend-only/docs/api/README.md +7 -0
- package/assets/templates/backend-only/docs/diagrams/README.md +85 -0
- package/assets/templates/backend-only/docs/example-documentation-template.md +269 -0
- package/assets/templates/backend-only/docs/guides/README.md +15 -0
- package/assets/templates/backend-only/dot.env.example +18 -0
- package/assets/templates/backend-only/generated/README.md +56 -0
- package/assets/templates/backend-only/generated/code/integration-test.template.js +320 -0
- package/assets/templates/backend-only/generated/code/package.json.template +34 -0
- package/assets/templates/backend-only/generated/docs/README.md +49 -0
- package/assets/templates/backend-only/gitignore +54 -0
- package/assets/templates/backend-only/manifests/README.md +72 -0
- package/assets/templates/backend-only/manifests/docker-compose.specly +91 -0
- package/assets/templates/backend-only/manifests/implementation.yaml +100 -0
- package/assets/templates/backend-only/manifests/kubernetes.specly +140 -0
- package/assets/templates/backend-only/package.json +59 -0
- package/assets/templates/backend-only/scripts/test-all.sh +160 -0
- package/assets/templates/backend-only/scripts/test-generated-code.sh +165 -0
- package/assets/templates/backend-only/specs/main.specly +67 -0
- package/assets/templates/default/CLAUDE.md +141 -0
- package/assets/templates/default/README.md +404 -0
- package/assets/templates/default/deployments/README.md +149 -0
- package/assets/templates/default/deployments/development.specly +53 -0
- package/assets/templates/default/deployments/production.specly +87 -0
- package/assets/templates/default/docs/README.md +50 -0
- package/assets/templates/default/docs/api/README.md +7 -0
- package/assets/templates/default/docs/diagrams/README.md +85 -0
- package/assets/templates/default/docs/example-documentation-template.md +269 -0
- package/assets/templates/default/docs/guides/README.md +15 -0
- package/assets/templates/default/dot.env.example +18 -0
- package/assets/templates/default/generated/README.md +56 -0
- package/assets/templates/default/generated/code/integration-test.template.js +320 -0
- package/assets/templates/default/generated/code/package.json.template +34 -0
- package/assets/templates/default/generated/docs/README.md +49 -0
- package/assets/templates/default/gitignore +54 -0
- package/assets/templates/default/manifests/README.md +72 -0
- package/assets/templates/default/manifests/docker-compose.specly +91 -0
- package/assets/templates/default/manifests/implementation.yaml +176 -0
- package/assets/templates/default/manifests/kubernetes.specly +140 -0
- package/assets/templates/default/package.json +61 -0
- package/assets/templates/default/scripts/test-all.sh +160 -0
- package/assets/templates/default/scripts/test-generated-code.sh +165 -0
- package/assets/templates/default/specs/main.specly +67 -0
- package/assets/templates/frontend-only/CLAUDE.md +75 -0
- package/assets/templates/frontend-only/README.md +231 -0
- package/assets/templates/frontend-only/deployments/README.md +149 -0
- package/assets/templates/frontend-only/deployments/development.specly +53 -0
- package/assets/templates/frontend-only/deployments/production.specly +87 -0
- package/assets/templates/frontend-only/docs/README.md +50 -0
- package/assets/templates/frontend-only/docs/api/README.md +7 -0
- package/assets/templates/frontend-only/docs/diagrams/README.md +85 -0
- package/assets/templates/frontend-only/docs/example-documentation-template.md +269 -0
- package/assets/templates/frontend-only/docs/guides/README.md +15 -0
- package/assets/templates/frontend-only/dot.env.example +18 -0
- package/assets/templates/frontend-only/generated/README.md +56 -0
- package/assets/templates/frontend-only/generated/code/integration-test.template.js +320 -0
- package/assets/templates/frontend-only/generated/code/package.json.template +34 -0
- package/assets/templates/frontend-only/generated/docs/README.md +49 -0
- package/assets/templates/frontend-only/gitignore +54 -0
- package/assets/templates/frontend-only/manifests/README.md +72 -0
- package/assets/templates/frontend-only/manifests/docker-compose.specly +91 -0
- package/assets/templates/frontend-only/manifests/implementation.yaml +58 -0
- package/assets/templates/frontend-only/manifests/kubernetes.specly +140 -0
- package/assets/templates/frontend-only/package.json +59 -0
- package/assets/templates/frontend-only/scripts/test-all.sh +160 -0
- package/assets/templates/frontend-only/scripts/test-generated-code.sh +165 -0
- package/assets/templates/frontend-only/specs/main.specly +57 -0
- package/assets/templates/full-stack/AI-GUIDE.md +60 -0
- package/assets/templates/full-stack/CLAUDE.md +141 -0
- package/assets/templates/full-stack/README.md +382 -0
- package/assets/templates/full-stack/archive/AI-GUIDE-legacy.md +392 -0
- package/assets/templates/full-stack/deployments/README.md +149 -0
- package/assets/templates/full-stack/deployments/development.specly +53 -0
- package/assets/templates/full-stack/deployments/production.specly +87 -0
- package/assets/templates/full-stack/docs/README.md +51 -0
- package/assets/templates/full-stack/docs/api/README.md +7 -0
- package/assets/templates/full-stack/docs/diagrams/README.md +85 -0
- package/assets/templates/full-stack/docs/example-documentation-template.md +269 -0
- package/assets/templates/full-stack/docs/guides/README.md +15 -0
- package/assets/templates/full-stack/generated/README.md +56 -0
- package/assets/templates/full-stack/generated/code/integration-test.template.js +320 -0
- package/assets/templates/full-stack/generated/code/package.json.template +34 -0
- package/assets/templates/full-stack/generated/docs/README.md +49 -0
- package/assets/templates/full-stack/gitignore +54 -0
- package/assets/templates/full-stack/manifests/README.md +72 -0
- package/assets/templates/full-stack/manifests/docker-compose.specly +91 -0
- package/assets/templates/full-stack/manifests/implementation.yaml +155 -0
- package/assets/templates/full-stack/manifests/kubernetes.specly +140 -0
- package/assets/templates/full-stack/package.json +45 -0
- package/assets/templates/full-stack/scripts/test-all.sh +160 -0
- package/assets/templates/full-stack/scripts/test-generated-code.sh +165 -0
- package/assets/templates/full-stack/specs/example-v33.specly +297 -0
- package/assets/templates/full-stack/specs/main-simple.specly +73 -0
- package/assets/templates/full-stack/specs/main.specly +408 -0
- package/dist/engines/code-generator.d.ts +86 -0
- package/dist/engines/code-generator.d.ts.map +1 -0
- package/dist/engines/code-generator.js +159 -0
- package/dist/engines/code-generator.js.map +1 -0
- package/dist/engines/engine-registry.d.ts +94 -0
- package/dist/engines/engine-registry.d.ts.map +1 -0
- package/dist/engines/engine-registry.js +163 -0
- package/dist/engines/engine-registry.js.map +1 -0
- package/dist/engines/index.d.ts +10 -0
- package/dist/engines/index.d.ts.map +1 -0
- package/dist/engines/index.js +12 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/engines/typescript-engine.d.ts +74 -0
- package/dist/engines/typescript-engine.d.ts.map +1 -0
- package/dist/engines/typescript-engine.js +288 -0
- package/dist/engines/typescript-engine.js.map +1 -0
- package/dist/generators/index.d.ts +11 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +11 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +434 -0
- package/dist/index.js.map +1 -0
- package/dist/library/index.d.ts +12 -0
- package/dist/library/index.d.ts.map +1 -0
- package/dist/library/index.js +15 -0
- package/dist/library/index.js.map +1 -0
- package/dist/library/library.d.ts +132 -0
- package/dist/library/library.d.ts.map +1 -0
- package/dist/library/library.js +343 -0
- package/dist/library/library.js.map +1 -0
- package/dist/library/loader.d.ts +73 -0
- package/dist/library/loader.d.ts.map +1 -0
- package/dist/library/loader.js +150 -0
- package/dist/library/loader.js.map +1 -0
- package/dist/library/resolver.d.ts +104 -0
- package/dist/library/resolver.d.ts.map +1 -0
- package/dist/library/resolver.js +299 -0
- package/dist/library/resolver.js.map +1 -0
- package/dist/library/validator.d.ts +65 -0
- package/dist/library/validator.d.ts.map +1 -0
- package/dist/library/validator.js +203 -0
- package/dist/library/validator.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/instance-factory.d.ts +289 -0
- package/dist/types/instance-factory.d.ts.map +1 -0
- package/dist/types/instance-factory.js +8 -0
- package/dist/types/instance-factory.js.map +1 -0
- package/dist/types/unified-mappings.d.ts +163 -0
- package/dist/types/unified-mappings.d.ts.map +1 -0
- package/dist/types/unified-mappings.js +110 -0
- package/dist/types/unified-mappings.js.map +1 -0
- package/dist/utils/ai-spec-loader.d.ts +77 -0
- package/dist/utils/ai-spec-loader.d.ts.map +1 -0
- package/dist/utils/ai-spec-loader.js +138 -0
- package/dist/utils/ai-spec-loader.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/manifest-loader.d.ts +107 -0
- package/dist/utils/manifest-loader.d.ts.map +1 -0
- package/dist/utils/manifest-loader.js +168 -0
- package/dist/utils/manifest-loader.js.map +1 -0
- package/dist/utils/mapping-migration.d.ts +53 -0
- package/dist/utils/mapping-migration.d.ts.map +1 -0
- package/dist/utils/mapping-migration.js +194 -0
- package/dist/utils/mapping-migration.js.map +1 -0
- package/libs/instance-factories/CURVED-INTERFACE.md +278 -0
- package/libs/instance-factories/README.md +433 -0
- package/libs/instance-factories/applications/generic-app.yaml +52 -0
- package/libs/instance-factories/applications/react-app.yaml +186 -0
- package/libs/instance-factories/applications/templates/generic/backend-env-generator.ts +31 -0
- package/libs/instance-factories/applications/templates/generic/backend-package-json-generator.ts +80 -0
- package/libs/instance-factories/applications/templates/generic/backend-tsconfig-generator.ts +69 -0
- package/libs/instance-factories/applications/templates/generic/main-generator.ts +308 -0
- package/libs/instance-factories/applications/templates/react/_view-components-source.ts +555 -0
- package/libs/instance-factories/applications/templates/react/api-client-generator.ts +436 -0
- package/libs/instance-factories/applications/templates/react/api-types-generator.ts +153 -0
- package/libs/instance-factories/applications/templates/react/app-tsx-generator.ts +94 -0
- package/libs/instance-factories/applications/templates/react/env-example-generator.ts +24 -0
- package/libs/instance-factories/applications/templates/react/field-helpers-generator.ts +106 -0
- package/libs/instance-factories/applications/templates/react/gitignore-generator.ts +38 -0
- package/libs/instance-factories/applications/templates/react/index-css-generator.ts +85 -0
- package/libs/instance-factories/applications/templates/react/index-html-generator.ts +30 -0
- package/libs/instance-factories/applications/templates/react/main-tsx-generator.ts +34 -0
- package/libs/instance-factories/applications/templates/react/package-json-generator.ts +54 -0
- package/libs/instance-factories/applications/templates/react/pattern-adapter-generator.ts +179 -0
- package/libs/instance-factories/applications/templates/react/react-pattern-adapter.tsx +1347 -0
- package/libs/instance-factories/applications/templates/react/relationship-field-generator.ts +150 -0
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.ts +704 -0
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.ts +84 -0
- package/libs/instance-factories/applications/templates/react/tsconfig-generator.ts +35 -0
- package/libs/instance-factories/applications/templates/react/use-api-hooks-generator.ts +121 -0
- package/libs/instance-factories/applications/templates/react/view-dashboard-generator.ts +150 -0
- package/libs/instance-factories/applications/templates/react/view-detail-generator.ts +150 -0
- package/libs/instance-factories/applications/templates/react/view-form-generator.ts +362 -0
- package/libs/instance-factories/applications/templates/react/view-list-generator.ts +98 -0
- package/libs/instance-factories/applications/templates/react/view-router-generator.ts +89 -0
- package/libs/instance-factories/applications/templates/react/vite-config-generator.ts +49 -0
- package/libs/instance-factories/archived/fastify-prisma.yaml +104 -0
- package/libs/instance-factories/cli/commander-js.yaml +55 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.d.ts +12 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.d.ts.map +1 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.js +115 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.js.map +1 -0
- package/libs/instance-factories/cli/templates/commander/cli-entry-generator.ts +145 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.d.ts +14 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.d.ts.map +1 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.js +182 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.js.map +1 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.ts +992 -0
- package/libs/instance-factories/communication/event-emitter.yaml +56 -0
- package/libs/instance-factories/communication/rabbitmq-events.yaml +87 -0
- package/libs/instance-factories/communication/templates/eventemitter/bus-generator.ts +93 -0
- package/libs/instance-factories/communication/templates/eventemitter/publisher-generator.ts +117 -0
- package/libs/instance-factories/communication/templates/eventemitter/subscriber-generator.ts +101 -0
- package/libs/instance-factories/controllers/fastify.yaml +127 -0
- package/libs/instance-factories/controllers/templates/fastify/meta-routes-generator.ts +103 -0
- package/libs/instance-factories/controllers/templates/fastify/routes-generator.ts +389 -0
- package/libs/instance-factories/controllers/templates/fastify/server-generator.ts +76 -0
- package/libs/instance-factories/infrastructure/docker-k8s.yaml +61 -0
- package/libs/instance-factories/infrastructure/templates/docker-k8s/infrastructure-generator.ts +46 -0
- package/libs/instance-factories/orms/prisma.yaml +89 -0
- package/libs/instance-factories/orms/templates/prisma/schema-generator.ts +563 -0
- package/libs/instance-factories/orms/templates/prisma/services-generator.ts +408 -0
- package/libs/instance-factories/scaffolding/generic-scaffold.yaml +65 -0
- package/libs/instance-factories/scaffolding/templates/generic/env-example-generator.ts +73 -0
- package/libs/instance-factories/scaffolding/templates/generic/env-generator.ts +85 -0
- package/libs/instance-factories/scaffolding/templates/generic/gitignore-generator.ts +69 -0
- package/libs/instance-factories/scaffolding/templates/generic/package-json-generator.ts +176 -0
- package/libs/instance-factories/scaffolding/templates/generic/readme-generator.ts +207 -0
- package/libs/instance-factories/scaffolding/templates/generic/tsconfig-generator.ts +78 -0
- package/libs/instance-factories/scaffolding/templates/generic/tsconfig-react-generator.ts +41 -0
- package/libs/instance-factories/sdks/python-sdk.yaml +66 -0
- package/libs/instance-factories/sdks/templates/python/sdk-generator.ts +50 -0
- package/libs/instance-factories/sdks/templates/typescript/sdk-generator.ts +49 -0
- package/libs/instance-factories/sdks/typescript-sdk.yaml +59 -0
- package/libs/instance-factories/services/prisma-services.yaml +71 -0
- package/libs/instance-factories/services/templates/prisma/behavior-generator.ts +303 -0
- package/libs/instance-factories/services/templates/prisma/controller-generator.ts +532 -0
- package/libs/instance-factories/services/templates/prisma/service-generator.ts +315 -0
- package/libs/instance-factories/shared/path-resolver.ts +111 -0
- package/libs/instance-factories/storage/mongodb.yaml +79 -0
- package/libs/instance-factories/storage/postgresql.yaml +75 -0
- package/libs/instance-factories/storage/redis.yaml +79 -0
- package/libs/instance-factories/storage/templates/mongodb/config-generator.ts +15 -0
- package/libs/instance-factories/storage/templates/mongodb/docker-generator.ts +18 -0
- package/libs/instance-factories/storage/templates/postgresql/config-generator.ts +54 -0
- package/libs/instance-factories/storage/templates/postgresql/docker-generator.ts +55 -0
- package/libs/instance-factories/storage/templates/redis/config-generator.ts +16 -0
- package/libs/instance-factories/storage/templates/redis/docker-generator.ts +18 -0
- package/libs/instance-factories/test-generation.ts +192 -0
- package/libs/instance-factories/testing/templates/vitest/tests-generator.ts +51 -0
- package/libs/instance-factories/testing/vitest-tests.yaml +63 -0
- package/libs/instance-factories/tools/templates/mcp/mcp-server-generator.ts +136 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/DEPLOYMENT_GUIDE.md +630 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/HYBRID_RESOURCE_SYSTEM.md +330 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/deployments/EXTENSION_DEPLOYMENT.md +552 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/deployments/LOCAL_DEPLOYMENT.md +164 -0
- package/libs/instance-factories/tools/templates/mcp/static/docs/deployments/WEB_DEPLOYMENT.md +247 -0
- package/libs/instance-factories/tools/templates/mcp/static/package.json +92 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-enterprise.js +284 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-extension.js +139 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-local.js +74 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-web.js +156 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/copy-canonical-files.js +41 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/test-deployments.js +259 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/test-hybrid-resources.js +231 -0
- package/libs/instance-factories/tools/templates/mcp/static/scripts/test-hybrid-simple.js +196 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/controllers/MCPServerController.ts +293 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/events/EventEmitter.ts +90 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/index.ts +24 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/interfaces/ResourceProvider.ts +15 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/models/LibrarySuggestion.ts +106 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/models/SpecVerseResource.ts +75 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/server/mcp-server.ts +239 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/CLIProxyService.ts +1501 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/EmbeddedResourcesAdapter.ts +211 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/EntityModuleService.ts +308 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/HybridResourcesProvider.ts +210 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/LibraryToolsService.ts +356 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/OrchestratorBridge.ts +524 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/OrchestratorToolsService.ts +530 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/PromptToolsService.ts +594 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/services/ResourcesProviderService.ts +170 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/tests/unit/CLIProxyService.init.test.ts +544 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/tests/unit/CLIProxyService.test.ts +189 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/tests/unit/ResourcesProviderService.test.ts +89 -0
- package/libs/instance-factories/tools/templates/mcp/static/src/types/index.ts +110 -0
- package/libs/instance-factories/tools/templates/mcp/static/tsconfig.json +28 -0
- package/libs/instance-factories/tools/templates/vscode/static/extension.ts +1195 -0
- package/libs/instance-factories/tools/templates/vscode/static/language-configuration.json +34 -0
- package/libs/instance-factories/tools/templates/vscode/static/schemas/specverse-v3-schema.json +4279 -0
- package/libs/instance-factories/tools/templates/vscode/static/syntaxes/specverse.tmLanguage.json +138 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/README.md +74 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/complete-specverse-colors.json +122 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/specverse-basic-theme.json +65 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/specverse-complete-theme.json +123 -0
- package/libs/instance-factories/tools/templates/vscode/static/themes/specverse-theme-colors.json +64 -0
- package/libs/instance-factories/tools/templates/vscode/vscode-extension-generator.ts +214 -0
- package/libs/instance-factories/validation/templates/zod/validation-generator.ts +46 -0
- package/libs/instance-factories/validation/zod.yaml +56 -0
- package/libs/instance-factories/views/index.d.ts +13 -0
- package/libs/instance-factories/views/index.d.ts.map +1 -0
- package/libs/instance-factories/views/index.js +18 -0
- package/libs/instance-factories/views/index.js.map +1 -0
- package/libs/instance-factories/views/index.ts +45 -0
- package/libs/instance-factories/views/react-components.yaml +129 -0
- package/libs/instance-factories/views/templates/ARCHITECTURE.md +198 -0
- package/libs/instance-factories/views/templates/react/adapters/antd-adapter.ts +869 -0
- package/libs/instance-factories/views/templates/react/adapters/mui-adapter.ts +953 -0
- package/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.ts +806 -0
- package/libs/instance-factories/views/templates/react/app-generator.ts +55 -0
- package/libs/instance-factories/views/templates/react/components-generator.ts +391 -0
- package/libs/instance-factories/views/templates/react/forms-generator.ts +343 -0
- package/libs/instance-factories/views/templates/react/frontend-package-json-generator.ts +54 -0
- package/libs/instance-factories/views/templates/react/hooks-generator.ts +122 -0
- package/libs/instance-factories/views/templates/react/index-css-generator.ts +209 -0
- package/libs/instance-factories/views/templates/react/index-html-generator.ts +34 -0
- package/libs/instance-factories/views/templates/react/main-tsx-generator.ts +29 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts +152 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.js +398 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.js.map +1 -0
- package/libs/instance-factories/views/templates/react/react-component-generator.ts +533 -0
- package/libs/instance-factories/views/templates/react/router-generator.ts +197 -0
- package/libs/instance-factories/views/templates/react/router-generic-generator.ts +103 -0
- package/libs/instance-factories/views/templates/react/spec-json-generator.ts +17 -0
- package/libs/instance-factories/views/templates/react/types-generator.ts +76 -0
- package/libs/instance-factories/views/templates/react/views-metadata-generator.ts +42 -0
- package/libs/instance-factories/views/templates/react/vite-config-generator.ts +38 -0
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js.map +1 -0
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.ts +474 -0
- package/libs/instance-factories/views/templates/shared/__tests__/composite-patterns.test.ts +242 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts +77 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.js +47 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/adapter-types.ts +142 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts +63 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js +822 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.ts +908 -0
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts +247 -0
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/base-generator.js +363 -0
- package/libs/instance-factories/views/templates/shared/base-generator.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/base-generator.ts +608 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts +254 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.js +602 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/component-metadata.ts +803 -0
- package/libs/instance-factories/views/templates/shared/composite-pattern-types.ts +250 -0
- package/libs/instance-factories/views/templates/shared/composite-patterns.ts +535 -0
- package/libs/instance-factories/views/templates/shared/index.ts +68 -0
- package/libs/instance-factories/views/templates/shared/pattern-validator.ts +279 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts +149 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.js +580 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/property-mapper.ts +700 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts +143 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts.map +1 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js +420 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js.map +1 -0
- package/libs/instance-factories/views/templates/shared/syntax-mapper.ts +539 -0
- package/package.json +42 -0
- package/schema/SPECVERSE-SCHEMA.json +4274 -0
|
@@ -0,0 +1,803 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Metadata - Runtime Rendering Hints
|
|
3
|
+
*
|
|
4
|
+
* Provides metadata for runtime interpretation and dynamic rendering.
|
|
5
|
+
* Bridges the static atomic components registry with dynamic runtime engines.
|
|
6
|
+
*
|
|
7
|
+
* Used by:
|
|
8
|
+
* - app-demo runtime engine for dynamic component rendering
|
|
9
|
+
* - Documentation generation for component catalogs
|
|
10
|
+
* - AI-powered component suggestions
|
|
11
|
+
* - IDE tooling and autocomplete
|
|
12
|
+
*
|
|
13
|
+
* Architecture:
|
|
14
|
+
* - Enriches atomic component definitions with runtime hints
|
|
15
|
+
* - Provides property descriptions and validation rules
|
|
16
|
+
* - Includes rendering capabilities and constraints
|
|
17
|
+
* - Supports dynamic component discovery
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { ATOMIC_COMPONENTS_REGISTRY, AtomicComponentDefinition } from './atomic-components-registry.js';
|
|
21
|
+
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// Types
|
|
24
|
+
// ============================================================================
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Property metadata for runtime interpretation
|
|
28
|
+
*/
|
|
29
|
+
export interface PropertyMetadata {
|
|
30
|
+
name: string;
|
|
31
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'enum';
|
|
32
|
+
required: boolean;
|
|
33
|
+
default?: any;
|
|
34
|
+
description: string;
|
|
35
|
+
enumValues?: string[]; // For enum types
|
|
36
|
+
validation?: {
|
|
37
|
+
min?: number;
|
|
38
|
+
max?: number;
|
|
39
|
+
pattern?: string;
|
|
40
|
+
options?: string[];
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Common property that maps across frameworks
|
|
44
|
+
* (variant, size, color, position, orientation)
|
|
45
|
+
*/
|
|
46
|
+
isCommon?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Property affects layout/rendering significantly
|
|
49
|
+
*/
|
|
50
|
+
affectsLayout?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Event metadata for runtime interpretation
|
|
55
|
+
*/
|
|
56
|
+
export interface EventMetadata {
|
|
57
|
+
name: string;
|
|
58
|
+
description: string;
|
|
59
|
+
parameters?: {
|
|
60
|
+
name: string;
|
|
61
|
+
type: string;
|
|
62
|
+
description: string;
|
|
63
|
+
}[];
|
|
64
|
+
/**
|
|
65
|
+
* Event bubbles up to parent components
|
|
66
|
+
*/
|
|
67
|
+
bubbles?: boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Rendering capability metadata
|
|
72
|
+
*/
|
|
73
|
+
export interface RenderingCapability {
|
|
74
|
+
/**
|
|
75
|
+
* Component can contain children
|
|
76
|
+
*/
|
|
77
|
+
supportsChildren: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Component supports conditional rendering (v-if, *ngIf, etc.)
|
|
80
|
+
*/
|
|
81
|
+
supportsConditional: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Component supports list rendering (v-for, *ngFor, map, etc.)
|
|
84
|
+
*/
|
|
85
|
+
supportsList: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Component supports slots/content projection
|
|
88
|
+
*/
|
|
89
|
+
supportsSlots: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Maximum recommended nesting depth
|
|
92
|
+
*/
|
|
93
|
+
maxDepth?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Preferred position in component tree
|
|
96
|
+
*/
|
|
97
|
+
preferredPosition?: 'root' | 'container' | 'leaf' | 'any';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Accessibility metadata
|
|
102
|
+
*/
|
|
103
|
+
export interface AccessibilityMetadata {
|
|
104
|
+
/**
|
|
105
|
+
* ARIA role
|
|
106
|
+
*/
|
|
107
|
+
role?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Keyboard navigable
|
|
110
|
+
*/
|
|
111
|
+
keyboardNavigable: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Required ARIA attributes
|
|
114
|
+
*/
|
|
115
|
+
requiredAriaAttrs?: string[];
|
|
116
|
+
/**
|
|
117
|
+
* Screen reader description template
|
|
118
|
+
*/
|
|
119
|
+
screenReaderDescription?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Component state metadata
|
|
124
|
+
*/
|
|
125
|
+
export interface StateMetadata {
|
|
126
|
+
/**
|
|
127
|
+
* Component manages internal state
|
|
128
|
+
*/
|
|
129
|
+
hasInternalState: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* State properties managed by component
|
|
132
|
+
*/
|
|
133
|
+
stateProperties?: {
|
|
134
|
+
name: string;
|
|
135
|
+
type: string;
|
|
136
|
+
description: string;
|
|
137
|
+
defaultValue?: any;
|
|
138
|
+
}[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Complete component metadata for runtime
|
|
143
|
+
*/
|
|
144
|
+
export interface ComponentMetadata extends AtomicComponentDefinition {
|
|
145
|
+
/**
|
|
146
|
+
* Property definitions with validation
|
|
147
|
+
*/
|
|
148
|
+
propertyMetadata: PropertyMetadata[];
|
|
149
|
+
/**
|
|
150
|
+
* Event definitions
|
|
151
|
+
*/
|
|
152
|
+
eventMetadata?: EventMetadata[];
|
|
153
|
+
/**
|
|
154
|
+
* Rendering capabilities
|
|
155
|
+
*/
|
|
156
|
+
capabilities: RenderingCapability;
|
|
157
|
+
/**
|
|
158
|
+
* Accessibility information
|
|
159
|
+
*/
|
|
160
|
+
accessibility: AccessibilityMetadata;
|
|
161
|
+
/**
|
|
162
|
+
* State management information
|
|
163
|
+
*/
|
|
164
|
+
state: StateMetadata;
|
|
165
|
+
/**
|
|
166
|
+
* Related components (alternatives, compositions)
|
|
167
|
+
*/
|
|
168
|
+
related?: {
|
|
169
|
+
alternatives?: string[]; // Similar components
|
|
170
|
+
compositions?: string[]; // Components often used with this one
|
|
171
|
+
containers?: string[]; // Common parent containers
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Usage examples for runtime
|
|
175
|
+
*/
|
|
176
|
+
usageExamples?: {
|
|
177
|
+
title: string;
|
|
178
|
+
description: string;
|
|
179
|
+
code: string;
|
|
180
|
+
}[];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// ============================================================================
|
|
184
|
+
// Common Property Metadata
|
|
185
|
+
// ============================================================================
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Metadata for the 5 universal properties
|
|
189
|
+
*/
|
|
190
|
+
export const COMMON_PROPERTY_METADATA: Record<string, PropertyMetadata> = {
|
|
191
|
+
variant: {
|
|
192
|
+
name: 'variant',
|
|
193
|
+
type: 'enum',
|
|
194
|
+
required: false,
|
|
195
|
+
default: 'primary',
|
|
196
|
+
description: 'Visual style variant for the component',
|
|
197
|
+
enumValues: ['primary', 'secondary', 'destructive', 'ghost', 'outline'],
|
|
198
|
+
isCommon: true,
|
|
199
|
+
affectsLayout: false
|
|
200
|
+
},
|
|
201
|
+
size: {
|
|
202
|
+
name: 'size',
|
|
203
|
+
type: 'enum',
|
|
204
|
+
required: false,
|
|
205
|
+
default: 'medium',
|
|
206
|
+
description: 'Size of the component',
|
|
207
|
+
enumValues: ['small', 'medium', 'large'],
|
|
208
|
+
isCommon: true,
|
|
209
|
+
affectsLayout: true
|
|
210
|
+
},
|
|
211
|
+
color: {
|
|
212
|
+
name: 'color',
|
|
213
|
+
type: 'enum',
|
|
214
|
+
required: false,
|
|
215
|
+
default: 'primary',
|
|
216
|
+
description: 'Color scheme for the component',
|
|
217
|
+
enumValues: ['primary', 'success', 'warning', 'error', 'info'],
|
|
218
|
+
isCommon: true,
|
|
219
|
+
affectsLayout: false
|
|
220
|
+
},
|
|
221
|
+
position: {
|
|
222
|
+
name: 'position',
|
|
223
|
+
type: 'enum',
|
|
224
|
+
required: false,
|
|
225
|
+
default: 'top',
|
|
226
|
+
description: 'Position or alignment of the component',
|
|
227
|
+
enumValues: ['top', 'bottom', 'left', 'right'],
|
|
228
|
+
isCommon: true,
|
|
229
|
+
affectsLayout: true
|
|
230
|
+
},
|
|
231
|
+
orientation: {
|
|
232
|
+
name: 'orientation',
|
|
233
|
+
type: 'enum',
|
|
234
|
+
required: false,
|
|
235
|
+
default: 'horizontal',
|
|
236
|
+
description: 'Layout orientation of the component',
|
|
237
|
+
enumValues: ['horizontal', 'vertical'],
|
|
238
|
+
isCommon: true,
|
|
239
|
+
affectsLayout: true
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// ============================================================================
|
|
244
|
+
// Component-Specific Metadata Registry
|
|
245
|
+
// ============================================================================
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Enhanced metadata for all atomic components
|
|
249
|
+
*/
|
|
250
|
+
export const COMPONENT_METADATA_REGISTRY: Record<string, ComponentMetadata> = {
|
|
251
|
+
// Data Display Components
|
|
252
|
+
table: {
|
|
253
|
+
...ATOMIC_COMPONENTS_REGISTRY.table,
|
|
254
|
+
propertyMetadata: [
|
|
255
|
+
{
|
|
256
|
+
name: 'columns',
|
|
257
|
+
type: 'array',
|
|
258
|
+
required: true,
|
|
259
|
+
description: 'Column definitions for the table',
|
|
260
|
+
validation: { min: 1 }
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: 'dataSource',
|
|
264
|
+
type: 'string',
|
|
265
|
+
required: true,
|
|
266
|
+
description: 'Model array name for table data'
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'sortable',
|
|
270
|
+
type: 'boolean',
|
|
271
|
+
required: false,
|
|
272
|
+
default: false,
|
|
273
|
+
description: 'Enable column sorting',
|
|
274
|
+
affectsLayout: false
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: 'filterable',
|
|
278
|
+
type: 'boolean',
|
|
279
|
+
required: false,
|
|
280
|
+
default: false,
|
|
281
|
+
description: 'Enable filtering',
|
|
282
|
+
affectsLayout: true
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: 'pagination',
|
|
286
|
+
type: 'boolean',
|
|
287
|
+
required: false,
|
|
288
|
+
default: true,
|
|
289
|
+
description: 'Enable pagination',
|
|
290
|
+
affectsLayout: true
|
|
291
|
+
},
|
|
292
|
+
COMMON_PROPERTY_METADATA.size
|
|
293
|
+
],
|
|
294
|
+
eventMetadata: [
|
|
295
|
+
{
|
|
296
|
+
name: 'onRowClick',
|
|
297
|
+
description: 'Fired when a row is clicked',
|
|
298
|
+
parameters: [
|
|
299
|
+
{ name: 'row', type: 'object', description: 'Clicked row data' },
|
|
300
|
+
{ name: 'index', type: 'number', description: 'Row index' }
|
|
301
|
+
]
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: 'onSort',
|
|
305
|
+
description: 'Fired when column sort changes',
|
|
306
|
+
parameters: [
|
|
307
|
+
{ name: 'column', type: 'string', description: 'Column key' },
|
|
308
|
+
{ name: 'direction', type: 'string', description: 'Sort direction (asc/desc)' }
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
capabilities: {
|
|
313
|
+
supportsChildren: false,
|
|
314
|
+
supportsConditional: true,
|
|
315
|
+
supportsList: true,
|
|
316
|
+
supportsSlots: false,
|
|
317
|
+
maxDepth: 1,
|
|
318
|
+
preferredPosition: 'leaf'
|
|
319
|
+
},
|
|
320
|
+
accessibility: {
|
|
321
|
+
role: 'table',
|
|
322
|
+
keyboardNavigable: true,
|
|
323
|
+
requiredAriaAttrs: ['aria-label'],
|
|
324
|
+
screenReaderDescription: 'Data table with {columns.length} columns'
|
|
325
|
+
},
|
|
326
|
+
state: {
|
|
327
|
+
hasInternalState: true,
|
|
328
|
+
stateProperties: [
|
|
329
|
+
{ name: 'sortColumn', type: 'string', description: 'Currently sorted column' },
|
|
330
|
+
{ name: 'sortDirection', type: 'string', description: 'Sort direction (asc/desc)' },
|
|
331
|
+
{ name: 'currentPage', type: 'number', description: 'Current page number', defaultValue: 1 }
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
related: {
|
|
335
|
+
alternatives: ['list', 'grid'],
|
|
336
|
+
compositions: ['pagination', 'search'],
|
|
337
|
+
containers: ['card', 'container']
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
|
|
341
|
+
button: {
|
|
342
|
+
...ATOMIC_COMPONENTS_REGISTRY.button,
|
|
343
|
+
propertyMetadata: [
|
|
344
|
+
COMMON_PROPERTY_METADATA.variant,
|
|
345
|
+
COMMON_PROPERTY_METADATA.size,
|
|
346
|
+
{
|
|
347
|
+
name: 'disabled',
|
|
348
|
+
type: 'boolean',
|
|
349
|
+
required: false,
|
|
350
|
+
default: false,
|
|
351
|
+
description: 'Disable button interaction'
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: 'loading',
|
|
355
|
+
type: 'boolean',
|
|
356
|
+
required: false,
|
|
357
|
+
default: false,
|
|
358
|
+
description: 'Show loading state'
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: 'label',
|
|
362
|
+
type: 'string',
|
|
363
|
+
required: false,
|
|
364
|
+
description: 'Button text label'
|
|
365
|
+
}
|
|
366
|
+
],
|
|
367
|
+
eventMetadata: [
|
|
368
|
+
{
|
|
369
|
+
name: 'onClick',
|
|
370
|
+
description: 'Fired when button is clicked',
|
|
371
|
+
parameters: [
|
|
372
|
+
{ name: 'event', type: 'MouseEvent', description: 'Click event' }
|
|
373
|
+
],
|
|
374
|
+
bubbles: true
|
|
375
|
+
}
|
|
376
|
+
],
|
|
377
|
+
capabilities: {
|
|
378
|
+
supportsChildren: true,
|
|
379
|
+
supportsConditional: true,
|
|
380
|
+
supportsList: false,
|
|
381
|
+
supportsSlots: false,
|
|
382
|
+
maxDepth: 1,
|
|
383
|
+
preferredPosition: 'leaf'
|
|
384
|
+
},
|
|
385
|
+
accessibility: {
|
|
386
|
+
role: 'button',
|
|
387
|
+
keyboardNavigable: true,
|
|
388
|
+
requiredAriaAttrs: ['aria-label'],
|
|
389
|
+
screenReaderDescription: '{variant} button: {label}'
|
|
390
|
+
},
|
|
391
|
+
state: {
|
|
392
|
+
hasInternalState: false
|
|
393
|
+
},
|
|
394
|
+
related: {
|
|
395
|
+
alternatives: ['link', 'icon-button'],
|
|
396
|
+
compositions: ['icon', 'badge'],
|
|
397
|
+
containers: ['form', 'card', 'toolbar']
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
|
|
401
|
+
card: {
|
|
402
|
+
...ATOMIC_COMPONENTS_REGISTRY.card,
|
|
403
|
+
propertyMetadata: [
|
|
404
|
+
{
|
|
405
|
+
name: 'title',
|
|
406
|
+
type: 'string',
|
|
407
|
+
required: false,
|
|
408
|
+
description: 'Card title'
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: 'elevation',
|
|
412
|
+
type: 'enum',
|
|
413
|
+
required: false,
|
|
414
|
+
default: 'medium',
|
|
415
|
+
description: 'Shadow depth',
|
|
416
|
+
enumValues: ['none', 'low', 'medium', 'high']
|
|
417
|
+
},
|
|
418
|
+
COMMON_PROPERTY_METADATA.size
|
|
419
|
+
],
|
|
420
|
+
capabilities: {
|
|
421
|
+
supportsChildren: true,
|
|
422
|
+
supportsConditional: true,
|
|
423
|
+
supportsList: true,
|
|
424
|
+
supportsSlots: true,
|
|
425
|
+
maxDepth: 3,
|
|
426
|
+
preferredPosition: 'container'
|
|
427
|
+
},
|
|
428
|
+
accessibility: {
|
|
429
|
+
role: 'article',
|
|
430
|
+
keyboardNavigable: false,
|
|
431
|
+
screenReaderDescription: 'Card: {title}'
|
|
432
|
+
},
|
|
433
|
+
state: {
|
|
434
|
+
hasInternalState: false
|
|
435
|
+
},
|
|
436
|
+
related: {
|
|
437
|
+
alternatives: ['panel', 'container'],
|
|
438
|
+
compositions: ['button', 'image', 'text', 'list'],
|
|
439
|
+
containers: ['grid', 'container']
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
|
|
443
|
+
input: {
|
|
444
|
+
...ATOMIC_COMPONENTS_REGISTRY.input,
|
|
445
|
+
propertyMetadata: [
|
|
446
|
+
{
|
|
447
|
+
name: 'type',
|
|
448
|
+
type: 'enum',
|
|
449
|
+
required: false,
|
|
450
|
+
default: 'text',
|
|
451
|
+
description: 'Input type',
|
|
452
|
+
enumValues: ['text', 'email', 'password', 'number', 'tel', 'url']
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
name: 'placeholder',
|
|
456
|
+
type: 'string',
|
|
457
|
+
required: false,
|
|
458
|
+
description: 'Placeholder text'
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
name: 'required',
|
|
462
|
+
type: 'boolean',
|
|
463
|
+
required: false,
|
|
464
|
+
default: false,
|
|
465
|
+
description: 'Field is required'
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
name: 'disabled',
|
|
469
|
+
type: 'boolean',
|
|
470
|
+
required: false,
|
|
471
|
+
default: false,
|
|
472
|
+
description: 'Disable input'
|
|
473
|
+
},
|
|
474
|
+
COMMON_PROPERTY_METADATA.size,
|
|
475
|
+
{
|
|
476
|
+
name: 'variant',
|
|
477
|
+
type: 'enum',
|
|
478
|
+
required: false,
|
|
479
|
+
default: 'outlined',
|
|
480
|
+
description: 'Visual style variant',
|
|
481
|
+
enumValues: ['filled', 'outlined', 'standard'],
|
|
482
|
+
isCommon: true
|
|
483
|
+
}
|
|
484
|
+
],
|
|
485
|
+
eventMetadata: [
|
|
486
|
+
{
|
|
487
|
+
name: 'onChange',
|
|
488
|
+
description: 'Fired when input value changes',
|
|
489
|
+
parameters: [
|
|
490
|
+
{ name: 'value', type: 'string', description: 'New value' },
|
|
491
|
+
{ name: 'event', type: 'Event', description: 'Change event' }
|
|
492
|
+
]
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: 'onBlur',
|
|
496
|
+
description: 'Fired when input loses focus',
|
|
497
|
+
parameters: [
|
|
498
|
+
{ name: 'event', type: 'FocusEvent', description: 'Blur event' }
|
|
499
|
+
]
|
|
500
|
+
}
|
|
501
|
+
],
|
|
502
|
+
capabilities: {
|
|
503
|
+
supportsChildren: false,
|
|
504
|
+
supportsConditional: true,
|
|
505
|
+
supportsList: false,
|
|
506
|
+
supportsSlots: false,
|
|
507
|
+
maxDepth: 0,
|
|
508
|
+
preferredPosition: 'leaf'
|
|
509
|
+
},
|
|
510
|
+
accessibility: {
|
|
511
|
+
role: 'textbox',
|
|
512
|
+
keyboardNavigable: true,
|
|
513
|
+
requiredAriaAttrs: ['aria-label', 'aria-required'],
|
|
514
|
+
screenReaderDescription: '{type} input: {placeholder}'
|
|
515
|
+
},
|
|
516
|
+
state: {
|
|
517
|
+
hasInternalState: true,
|
|
518
|
+
stateProperties: [
|
|
519
|
+
{ name: 'value', type: 'string', description: 'Current input value', defaultValue: '' },
|
|
520
|
+
{ name: 'isFocused', type: 'boolean', description: 'Input has focus', defaultValue: false }
|
|
521
|
+
]
|
|
522
|
+
},
|
|
523
|
+
related: {
|
|
524
|
+
alternatives: ['textarea', 'select'],
|
|
525
|
+
compositions: ['label', 'validation-message'],
|
|
526
|
+
containers: ['form', 'form-field']
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
|
|
530
|
+
modal: {
|
|
531
|
+
...ATOMIC_COMPONENTS_REGISTRY.modal,
|
|
532
|
+
propertyMetadata: [
|
|
533
|
+
{
|
|
534
|
+
name: 'title',
|
|
535
|
+
type: 'string',
|
|
536
|
+
required: false,
|
|
537
|
+
description: 'Modal title'
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
name: 'open',
|
|
541
|
+
type: 'boolean',
|
|
542
|
+
required: true,
|
|
543
|
+
description: 'Modal visibility state'
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
name: 'closable',
|
|
547
|
+
type: 'boolean',
|
|
548
|
+
required: false,
|
|
549
|
+
default: true,
|
|
550
|
+
description: 'Show close button'
|
|
551
|
+
},
|
|
552
|
+
COMMON_PROPERTY_METADATA.size
|
|
553
|
+
],
|
|
554
|
+
eventMetadata: [
|
|
555
|
+
{
|
|
556
|
+
name: 'onClose',
|
|
557
|
+
description: 'Fired when modal is closed',
|
|
558
|
+
parameters: []
|
|
559
|
+
}
|
|
560
|
+
],
|
|
561
|
+
capabilities: {
|
|
562
|
+
supportsChildren: true,
|
|
563
|
+
supportsConditional: true,
|
|
564
|
+
supportsList: false,
|
|
565
|
+
supportsSlots: true,
|
|
566
|
+
maxDepth: 2,
|
|
567
|
+
preferredPosition: 'root'
|
|
568
|
+
},
|
|
569
|
+
accessibility: {
|
|
570
|
+
role: 'dialog',
|
|
571
|
+
keyboardNavigable: true,
|
|
572
|
+
requiredAriaAttrs: ['aria-modal', 'aria-labelledby'],
|
|
573
|
+
screenReaderDescription: 'Modal dialog: {title}'
|
|
574
|
+
},
|
|
575
|
+
state: {
|
|
576
|
+
hasInternalState: true,
|
|
577
|
+
stateProperties: [
|
|
578
|
+
{ name: 'open', type: 'boolean', description: 'Modal open state', defaultValue: false }
|
|
579
|
+
]
|
|
580
|
+
},
|
|
581
|
+
related: {
|
|
582
|
+
alternatives: ['drawer', 'popover'],
|
|
583
|
+
compositions: ['button', 'form', 'card'],
|
|
584
|
+
containers: ['root']
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
|
|
588
|
+
badge: {
|
|
589
|
+
...ATOMIC_COMPONENTS_REGISTRY.badge,
|
|
590
|
+
propertyMetadata: [
|
|
591
|
+
{
|
|
592
|
+
name: 'content',
|
|
593
|
+
type: 'string',
|
|
594
|
+
required: false,
|
|
595
|
+
description: 'Badge content/label'
|
|
596
|
+
},
|
|
597
|
+
COMMON_PROPERTY_METADATA.variant,
|
|
598
|
+
COMMON_PROPERTY_METADATA.color,
|
|
599
|
+
{
|
|
600
|
+
name: 'variant',
|
|
601
|
+
type: 'enum',
|
|
602
|
+
required: false,
|
|
603
|
+
default: 'standard',
|
|
604
|
+
description: 'Badge style',
|
|
605
|
+
enumValues: ['dot', 'standard'],
|
|
606
|
+
isCommon: true
|
|
607
|
+
}
|
|
608
|
+
],
|
|
609
|
+
capabilities: {
|
|
610
|
+
supportsChildren: false,
|
|
611
|
+
supportsConditional: true,
|
|
612
|
+
supportsList: false,
|
|
613
|
+
supportsSlots: false,
|
|
614
|
+
maxDepth: 0,
|
|
615
|
+
preferredPosition: 'leaf'
|
|
616
|
+
},
|
|
617
|
+
accessibility: {
|
|
618
|
+
role: 'status',
|
|
619
|
+
keyboardNavigable: false,
|
|
620
|
+
screenReaderDescription: 'Badge: {content}'
|
|
621
|
+
},
|
|
622
|
+
state: {
|
|
623
|
+
hasInternalState: false
|
|
624
|
+
},
|
|
625
|
+
related: {
|
|
626
|
+
alternatives: ['chip', 'tag'],
|
|
627
|
+
compositions: ['icon', 'avatar'],
|
|
628
|
+
containers: ['button', 'card']
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
// ============================================================================
|
|
634
|
+
// Helper Functions
|
|
635
|
+
// ============================================================================
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Get metadata for a component type
|
|
639
|
+
*
|
|
640
|
+
* @param componentType - Component type from atomic registry
|
|
641
|
+
* @returns Component metadata or undefined
|
|
642
|
+
*/
|
|
643
|
+
export function getComponentMetadata(componentType: string): ComponentMetadata | undefined {
|
|
644
|
+
return COMPONENT_METADATA_REGISTRY[componentType];
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Get all available component types with metadata
|
|
649
|
+
*
|
|
650
|
+
* @returns Array of component type names
|
|
651
|
+
*/
|
|
652
|
+
export function getAllComponentTypes(): string[] {
|
|
653
|
+
return Object.keys(COMPONENT_METADATA_REGISTRY);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Get components by category
|
|
658
|
+
*
|
|
659
|
+
* @param category - Component category
|
|
660
|
+
* @returns Array of component metadata
|
|
661
|
+
*/
|
|
662
|
+
export function getComponentsByCategory(
|
|
663
|
+
category: ComponentMetadata['category']
|
|
664
|
+
): ComponentMetadata[] {
|
|
665
|
+
return Object.values(COMPONENT_METADATA_REGISTRY).filter(
|
|
666
|
+
comp => comp.category === category
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Get components that can contain children
|
|
672
|
+
*
|
|
673
|
+
* @returns Array of container component metadata
|
|
674
|
+
*/
|
|
675
|
+
export function getContainerComponents(): ComponentMetadata[] {
|
|
676
|
+
return Object.values(COMPONENT_METADATA_REGISTRY).filter(
|
|
677
|
+
comp => comp.capabilities.supportsChildren
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Get leaf components (cannot contain children)
|
|
683
|
+
*
|
|
684
|
+
* @returns Array of leaf component metadata
|
|
685
|
+
*/
|
|
686
|
+
export function getLeafComponents(): ComponentMetadata[] {
|
|
687
|
+
return Object.values(COMPONENT_METADATA_REGISTRY).filter(
|
|
688
|
+
comp => !comp.capabilities.supportsChildren
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Check if a component supports a specific property
|
|
694
|
+
*
|
|
695
|
+
* @param componentType - Component type
|
|
696
|
+
* @param propertyName - Property name
|
|
697
|
+
* @returns True if property is supported
|
|
698
|
+
*/
|
|
699
|
+
export function supportsProperty(componentType: string, propertyName: string): boolean {
|
|
700
|
+
const metadata = getComponentMetadata(componentType);
|
|
701
|
+
if (!metadata) return false;
|
|
702
|
+
|
|
703
|
+
return metadata.propertyMetadata.some(prop => prop.name === propertyName);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* Get property metadata for a component
|
|
708
|
+
*
|
|
709
|
+
* @param componentType - Component type
|
|
710
|
+
* @param propertyName - Property name
|
|
711
|
+
* @returns Property metadata or undefined
|
|
712
|
+
*/
|
|
713
|
+
export function getPropertyMetadata(
|
|
714
|
+
componentType: string,
|
|
715
|
+
propertyName: string
|
|
716
|
+
): PropertyMetadata | undefined {
|
|
717
|
+
const metadata = getComponentMetadata(componentType);
|
|
718
|
+
if (!metadata) return undefined;
|
|
719
|
+
|
|
720
|
+
return metadata.propertyMetadata.find(prop => prop.name === propertyName);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Validate property value against metadata
|
|
725
|
+
*
|
|
726
|
+
* @param componentType - Component type
|
|
727
|
+
* @param propertyName - Property name
|
|
728
|
+
* @param value - Property value
|
|
729
|
+
* @returns Validation result with errors
|
|
730
|
+
*/
|
|
731
|
+
export function validatePropertyValue(
|
|
732
|
+
componentType: string,
|
|
733
|
+
propertyName: string,
|
|
734
|
+
value: any
|
|
735
|
+
): { valid: boolean; errors: string[] } {
|
|
736
|
+
const propMeta = getPropertyMetadata(componentType, propertyName);
|
|
737
|
+
if (!propMeta) {
|
|
738
|
+
return { valid: false, errors: [`Unknown property: ${propertyName}`] };
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
const errors: string[] = [];
|
|
742
|
+
|
|
743
|
+
// Type validation
|
|
744
|
+
if (propMeta.type === 'enum' && propMeta.enumValues) {
|
|
745
|
+
if (!propMeta.enumValues.includes(value)) {
|
|
746
|
+
errors.push(`Invalid enum value. Expected one of: ${propMeta.enumValues.join(', ')}`);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
// Validation rules
|
|
751
|
+
if (propMeta.validation) {
|
|
752
|
+
if (propMeta.validation.min !== undefined && value < propMeta.validation.min) {
|
|
753
|
+
errors.push(`Value must be >= ${propMeta.validation.min}`);
|
|
754
|
+
}
|
|
755
|
+
if (propMeta.validation.max !== undefined && value > propMeta.validation.max) {
|
|
756
|
+
errors.push(`Value must be <= ${propMeta.validation.max}`);
|
|
757
|
+
}
|
|
758
|
+
if (propMeta.validation.pattern && typeof value === 'string') {
|
|
759
|
+
const regex = new RegExp(propMeta.validation.pattern);
|
|
760
|
+
if (!regex.test(value)) {
|
|
761
|
+
errors.push(`Value must match pattern: ${propMeta.validation.pattern}`);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
return {
|
|
767
|
+
valid: errors.length === 0,
|
|
768
|
+
errors
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Get recommended components for composition
|
|
774
|
+
*
|
|
775
|
+
* @param componentType - Component type
|
|
776
|
+
* @returns Array of recommended component types
|
|
777
|
+
*/
|
|
778
|
+
export function getRecommendedCompositions(componentType: string): string[] {
|
|
779
|
+
const metadata = getComponentMetadata(componentType);
|
|
780
|
+
return metadata?.related?.compositions || [];
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* Check if two components can be nested
|
|
785
|
+
*
|
|
786
|
+
* @param parentType - Parent component type
|
|
787
|
+
* @param childType - Child component type
|
|
788
|
+
* @returns True if nesting is allowed
|
|
789
|
+
*/
|
|
790
|
+
export function canNest(parentType: string, childType: string): boolean {
|
|
791
|
+
const parentMeta = getComponentMetadata(parentType);
|
|
792
|
+
const childMeta = getComponentMetadata(childType);
|
|
793
|
+
|
|
794
|
+
if (!parentMeta || !childMeta) return false;
|
|
795
|
+
|
|
796
|
+
// Parent must support children
|
|
797
|
+
if (!parentMeta.capabilities.supportsChildren) return false;
|
|
798
|
+
|
|
799
|
+
// Check depth constraints
|
|
800
|
+
if (childMeta.capabilities.preferredPosition === 'root') return false;
|
|
801
|
+
|
|
802
|
+
return true;
|
|
803
|
+
}
|