@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,278 @@
|
|
|
1
|
+
# CURVED Interface Standard
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
**CURVED** is the standard interface that all SpecVerse business logic controllers must implement. It defines the complete set of operations for managing domain models.
|
|
6
|
+
|
|
7
|
+
## CURVED Operations
|
|
8
|
+
|
|
9
|
+
| Letter | Operation | Description | Required |
|
|
10
|
+
|--------|-----------|-------------|----------|
|
|
11
|
+
| **C** | Create | Create a new entity | Yes |
|
|
12
|
+
| **U** | Update | Update an existing entity | Yes |
|
|
13
|
+
| **R** | Retrieve | Retrieve entity (single + list) | Yes |
|
|
14
|
+
| **V** | Validate | Validate data before operations | Yes |
|
|
15
|
+
| **E** | Evolve | Lifecycle-aware state transitions | Yes |
|
|
16
|
+
| **D** | Delete | Delete an entity | Yes |
|
|
17
|
+
|
|
18
|
+
## TypeScript Interface
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
/**
|
|
22
|
+
* Standard CURVED interface for all service controllers
|
|
23
|
+
* All business logic controllers must implement this interface
|
|
24
|
+
*/
|
|
25
|
+
interface CurvedController<T> {
|
|
26
|
+
// C - Create
|
|
27
|
+
create(data: any): Promise<T>;
|
|
28
|
+
|
|
29
|
+
// U - Update
|
|
30
|
+
update(id: string, data: any): Promise<T>;
|
|
31
|
+
|
|
32
|
+
// R - Retrieve (single)
|
|
33
|
+
retrieve(id: string): Promise<T>;
|
|
34
|
+
|
|
35
|
+
// R - Retrieve (list)
|
|
36
|
+
retrieveAll(options?: RetrieveOptions): Promise<T[]>;
|
|
37
|
+
|
|
38
|
+
// V - Validate
|
|
39
|
+
validate(
|
|
40
|
+
data: any,
|
|
41
|
+
context: { operation: 'create' | 'update' | 'evolve' }
|
|
42
|
+
): ValidationResult;
|
|
43
|
+
|
|
44
|
+
// E - Evolve (lifecycle-aware updates)
|
|
45
|
+
evolve(id: string, data: any): Promise<T>;
|
|
46
|
+
|
|
47
|
+
// D - Delete
|
|
48
|
+
delete(id: string): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface RetrieveOptions {
|
|
52
|
+
skip?: number;
|
|
53
|
+
take?: number;
|
|
54
|
+
where?: Record<string, any>;
|
|
55
|
+
orderBy?: Record<string, 'asc' | 'desc'>;
|
|
56
|
+
include?: string[];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface ValidationResult {
|
|
60
|
+
valid: boolean;
|
|
61
|
+
errors: string[];
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Architecture Layers
|
|
66
|
+
|
|
67
|
+
### 1. Controllers (Model-specific)
|
|
68
|
+
- **Must implement**: Full CURVED interface
|
|
69
|
+
- **Examples**: `UserController`, `ProjectController`, `TaskController`
|
|
70
|
+
- **Location**: `src/controllers/`
|
|
71
|
+
- **Generated by**: Service factories (PrismaServices, TypeORMServices, etc.)
|
|
72
|
+
- **Additional**: Can have custom actions beyond CURVED
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
# In SpecVerse spec
|
|
76
|
+
controllers:
|
|
77
|
+
UserController:
|
|
78
|
+
model: User
|
|
79
|
+
curved: # ← CURVED operations
|
|
80
|
+
create: {}
|
|
81
|
+
update: {}
|
|
82
|
+
retrieve: {}
|
|
83
|
+
validate: {}
|
|
84
|
+
evolve: {}
|
|
85
|
+
delete: {}
|
|
86
|
+
actions: # ← Custom actions (beyond CURVED)
|
|
87
|
+
resetPassword: {}
|
|
88
|
+
verifyEmail: {}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 2. Services (Abstract business logic)
|
|
92
|
+
- **Must implement**: Custom operations (NOT CURVED)
|
|
93
|
+
- **Examples**: `NotificationService`, `TaskAssignmentService`
|
|
94
|
+
- **Location**: `src/services/`
|
|
95
|
+
- **Generated by**: Service factories (PrismaServices, etc.)
|
|
96
|
+
- **Operations**: Custom business logic operations
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
# In SpecVerse spec
|
|
100
|
+
services:
|
|
101
|
+
NotificationService:
|
|
102
|
+
operations: # ← Custom operations (NOT CURVED)
|
|
103
|
+
sendWelcomeEmail: {}
|
|
104
|
+
sendPasswordReset: {}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 3. Storage/ORM Layer
|
|
108
|
+
- **Must support**: CURVED primitives
|
|
109
|
+
- **Examples**: Prisma client, TypeORM repositories, Mongoose models
|
|
110
|
+
- **Location**: ORM-specific (e.g., `prisma/schema.prisma`)
|
|
111
|
+
- **Generated by**: ORM factories (PrismaORM, TypeORM, Mongoose)
|
|
112
|
+
- **Provides**: Database access methods that enable CURVED operations
|
|
113
|
+
|
|
114
|
+
## Implementation Requirements
|
|
115
|
+
|
|
116
|
+
### All Service Factories Must:
|
|
117
|
+
|
|
118
|
+
1. **Generate controllers** that implement the full CURVED interface
|
|
119
|
+
2. **Support all CURVED operations** for every model
|
|
120
|
+
3. **Provide consistent signatures** across different ORMs
|
|
121
|
+
4. **Include validation** as part of the CURVED interface
|
|
122
|
+
5. **Support evolve** for lifecycle-aware updates
|
|
123
|
+
|
|
124
|
+
### Example Implementations:
|
|
125
|
+
|
|
126
|
+
#### PrismaServices
|
|
127
|
+
- Uses: `@prisma/client`
|
|
128
|
+
- Controllers: `src/controllers/{Model}Controller.ts`
|
|
129
|
+
- Pattern: Class-based with Prisma client calls
|
|
130
|
+
|
|
131
|
+
#### TypeORMServices (future)
|
|
132
|
+
- Uses: `typeorm` repositories
|
|
133
|
+
- Controllers: `src/controllers/{Model}Controller.ts`
|
|
134
|
+
- Pattern: Class-based with TypeORM repository calls
|
|
135
|
+
|
|
136
|
+
#### MongooseServices (future)
|
|
137
|
+
- Uses: `mongoose` models
|
|
138
|
+
- Controllers: `src/controllers/{Model}Controller.ts`
|
|
139
|
+
- Pattern: Class-based with Mongoose model calls
|
|
140
|
+
|
|
141
|
+
## Data Flow
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
API Layer (Fastify/SOAP/GraphQL)
|
|
145
|
+
↓ calls
|
|
146
|
+
├─→ Controllers (CURVED + actions)
|
|
147
|
+
│ ↓ calls
|
|
148
|
+
│ Storage/ORM (CURVED primitives)
|
|
149
|
+
│ ↓
|
|
150
|
+
│ Database
|
|
151
|
+
│
|
|
152
|
+
└─→ Services (custom operations)
|
|
153
|
+
↓ can call
|
|
154
|
+
├─→ Controllers (CURVED)
|
|
155
|
+
└─→ Storage/ORM (directly)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Key points:**
|
|
159
|
+
- API layer can call **both** Controllers and Services
|
|
160
|
+
- Services can call Controllers OR ORM directly
|
|
161
|
+
- Controllers always call ORM/Storage layer
|
|
162
|
+
|
|
163
|
+
## Validation in CURVED
|
|
164
|
+
|
|
165
|
+
The **V** (Validate) operation is special:
|
|
166
|
+
|
|
167
|
+
### Internal Validation
|
|
168
|
+
All CURVED operations internally call `validate()` before execution:
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
async create(data: any): Promise<T> {
|
|
172
|
+
// Internal validation
|
|
173
|
+
const validation = this.validate(data, { operation: 'create' });
|
|
174
|
+
if (!validation.valid) {
|
|
175
|
+
throw new Error(`Validation failed: ${validation.errors.join(', ')}`);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Proceed with creation
|
|
179
|
+
return await this.orm.create(data);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### External Validation
|
|
184
|
+
The validate operation can also be exposed as an API endpoint for dry-run validation:
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
// POST /api/users/validate
|
|
188
|
+
{
|
|
189
|
+
"data": { "email": "invalid", "name": "John" },
|
|
190
|
+
"operation": "create"
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Response
|
|
194
|
+
{
|
|
195
|
+
"valid": false,
|
|
196
|
+
"errors": ["email must be a valid email address"]
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Evolve vs Update
|
|
201
|
+
|
|
202
|
+
### Update
|
|
203
|
+
Standard field updates without lifecycle validation:
|
|
204
|
+
```typescript
|
|
205
|
+
// Update any field
|
|
206
|
+
await userController.update(userId, { name: 'New Name', email: 'new@email.com' });
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Evolve
|
|
210
|
+
Lifecycle-aware state transitions with validation:
|
|
211
|
+
```typescript
|
|
212
|
+
// Evolve through lifecycle states
|
|
213
|
+
await taskController.evolve(taskId, {
|
|
214
|
+
status: 'in_progress' // Must follow lifecycle: todo → in_progress
|
|
215
|
+
});
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Extension Points
|
|
219
|
+
|
|
220
|
+
While CURVED defines the core interface, controllers can extend it with:
|
|
221
|
+
|
|
222
|
+
1. **Custom Actions** - Additional operations specific to the model
|
|
223
|
+
2. **Event Publishing** - Emit events after CURVED operations
|
|
224
|
+
3. **Hooks** - Before/after hooks for operations
|
|
225
|
+
4. **Caching** - Add caching layer for retrieve operations
|
|
226
|
+
5. **Authorization** - Add permission checks before operations
|
|
227
|
+
|
|
228
|
+
## Testing CURVED Implementations
|
|
229
|
+
|
|
230
|
+
All service factories should provide tests verifying:
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
describe('CurvedController', () => {
|
|
234
|
+
it('implements create operation', async () => {
|
|
235
|
+
const result = await controller.create(validData);
|
|
236
|
+
expect(result).toBeDefined();
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it('implements update operation', async () => {
|
|
240
|
+
const result = await controller.update(id, updateData);
|
|
241
|
+
expect(result).toBeDefined();
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it('implements retrieve operation', async () => {
|
|
245
|
+
const result = await controller.retrieve(id);
|
|
246
|
+
expect(result).toBeDefined();
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it('implements retrieveAll operation', async () => {
|
|
250
|
+
const result = await controller.retrieveAll();
|
|
251
|
+
expect(Array.isArray(result)).toBe(true);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it('implements validate operation', async () => {
|
|
255
|
+
const result = controller.validate(data, { operation: 'create' });
|
|
256
|
+
expect(result).toHaveProperty('valid');
|
|
257
|
+
expect(result).toHaveProperty('errors');
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
it('implements evolve operation', async () => {
|
|
261
|
+
const result = await controller.evolve(id, evolveData);
|
|
262
|
+
expect(result).toBeDefined();
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it('implements delete operation', async () => {
|
|
266
|
+
await expect(controller.delete(id)).resolves.not.toThrow();
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Summary
|
|
272
|
+
|
|
273
|
+
**CURVED is the universal interface for all SpecVerse business logic controllers:**
|
|
274
|
+
- Ensures consistency across different ORMs (Prisma, TypeORM, Mongoose)
|
|
275
|
+
- Enables protocol-agnostic API layers (REST, SOAP, GraphQL, gRPC)
|
|
276
|
+
- Provides complete lifecycle management (Create, Update, Retrieve, Validate, Evolve, Delete)
|
|
277
|
+
- Separates concerns between Controllers (model-specific) and Services (abstract)
|
|
278
|
+
- Supports extension while maintaining core interface compatibility
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
# SpecVerse v3.3 Implementation Types System
|
|
2
|
+
|
|
3
|
+
**Revolutionary manifest-driven code generation with reusable implementation libraries**
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Implementation Types System separates **WHAT** (component specification) from **WHERE** (deployment topology) and **HOW** (technology implementation), enabling:
|
|
8
|
+
|
|
9
|
+
- 📦 **Reusable Tech Stacks** - Share implementation patterns across projects
|
|
10
|
+
- 🔄 **Technology Flexibility** - Swap implementations without changing specs
|
|
11
|
+
- 🚀 **Rapid Development** - Generate production-ready code in seconds
|
|
12
|
+
- 🌍 **Community-Driven** - Build and share implementation libraries
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
### 1. Define Your Implementation Type
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
# libs/instance-factories/backend/fastify-prisma.yaml
|
|
20
|
+
name: FastifyPrismaAPI
|
|
21
|
+
version: "1.0.0"
|
|
22
|
+
type: api-server
|
|
23
|
+
|
|
24
|
+
capabilities:
|
|
25
|
+
provides:
|
|
26
|
+
- "api.rest"
|
|
27
|
+
- "api.rest.crud"
|
|
28
|
+
requires: []
|
|
29
|
+
|
|
30
|
+
technology:
|
|
31
|
+
runtime: "node"
|
|
32
|
+
framework: "fastify"
|
|
33
|
+
orm: "prisma"
|
|
34
|
+
|
|
35
|
+
codeTemplates:
|
|
36
|
+
routes:
|
|
37
|
+
engine: typescript
|
|
38
|
+
generator: "libs/instance-factories/backend/templates/fastify/routes-generator.ts"
|
|
39
|
+
outputPattern: "routes/{controller}.ts"
|
|
40
|
+
|
|
41
|
+
services:
|
|
42
|
+
engine: typescript
|
|
43
|
+
generator: "libs/instance-factories/backend/templates/prisma/services-generator.ts"
|
|
44
|
+
outputPattern: "services/{model}.service.ts"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 2. Create Your Manifest
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
# manifest.yaml
|
|
51
|
+
specVersion: "3.3.0"
|
|
52
|
+
version: "1.0.0"
|
|
53
|
+
name: "my-api-project"
|
|
54
|
+
|
|
55
|
+
implementationTypes:
|
|
56
|
+
- name: "FastifyPrismaAPI"
|
|
57
|
+
source: "libs/instance-factories/backend/fastify-prisma.yaml"
|
|
58
|
+
version: "1.0.0"
|
|
59
|
+
|
|
60
|
+
capabilityMappings:
|
|
61
|
+
- capability: "api.rest"
|
|
62
|
+
implementationType: "FastifyPrismaAPI"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. Define Your Spec with Deployment
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
# spec.specly
|
|
69
|
+
components:
|
|
70
|
+
MyAPI:
|
|
71
|
+
version: "1.0.0"
|
|
72
|
+
models:
|
|
73
|
+
User:
|
|
74
|
+
attributes:
|
|
75
|
+
id: UUID required
|
|
76
|
+
name: String required
|
|
77
|
+
email: String required
|
|
78
|
+
|
|
79
|
+
deployments:
|
|
80
|
+
production:
|
|
81
|
+
version: "1.0.0"
|
|
82
|
+
environment: production
|
|
83
|
+
instances:
|
|
84
|
+
apiServer:
|
|
85
|
+
type: api-server
|
|
86
|
+
advertises: ["api.rest"]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 4. Generate Code
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
specverse realize all spec.specly -m manifest.yaml -o generated/
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Architecture
|
|
96
|
+
|
|
97
|
+
### Three-Layer System
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
┌─────────────────────────┐
|
|
101
|
+
│ SPECIFICATION │ Define WHAT you need
|
|
102
|
+
│ (spec.specly) │
|
|
103
|
+
└───────────┬─────────────┘
|
|
104
|
+
│
|
|
105
|
+
↓
|
|
106
|
+
┌─────────────────────────┐
|
|
107
|
+
│ DEPLOYMENT │ Define WHERE it runs
|
|
108
|
+
│ (in spec) │
|
|
109
|
+
└───────────┬─────────────┘
|
|
110
|
+
│
|
|
111
|
+
↓
|
|
112
|
+
┌─────────────────────────┐
|
|
113
|
+
│ MANIFEST │ Map HOW to implement
|
|
114
|
+
│ (manifest.yaml) │
|
|
115
|
+
└───────────┬─────────────┘
|
|
116
|
+
│
|
|
117
|
+
↓
|
|
118
|
+
┌─────────────────────────┐
|
|
119
|
+
│ IMPLEMENTATION TYPE │ Defines tech stack
|
|
120
|
+
│ (fastify-prisma.yaml) │
|
|
121
|
+
└───────────┬─────────────┘
|
|
122
|
+
│
|
|
123
|
+
↓
|
|
124
|
+
┌─────────────────────────┐
|
|
125
|
+
│ GENERATED CODE │ Production-ready code
|
|
126
|
+
└─────────────────────────┘
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Implementation Type Structure
|
|
130
|
+
|
|
131
|
+
### Required Fields
|
|
132
|
+
|
|
133
|
+
```yaml
|
|
134
|
+
name: String # Unique name (e.g., "FastifyPrismaAPI")
|
|
135
|
+
version: String # Semantic version (e.g., "1.0.0")
|
|
136
|
+
type: String # Type category (api-server, database, etc.)
|
|
137
|
+
description: String # Human-readable description
|
|
138
|
+
|
|
139
|
+
compatibility:
|
|
140
|
+
specverse: String # Compatible SpecVerse version (e.g., "^3.3.0")
|
|
141
|
+
node: String # Required Node.js version (optional)
|
|
142
|
+
|
|
143
|
+
capabilities:
|
|
144
|
+
provides: String[] # Capabilities this implementation provides
|
|
145
|
+
requires: String[] # Capabilities this implementation needs
|
|
146
|
+
|
|
147
|
+
technology:
|
|
148
|
+
runtime: String # Runtime environment (node, deno, browser)
|
|
149
|
+
language: String # Programming language (typescript, javascript)
|
|
150
|
+
framework: String # Primary framework (fastify, express, react)
|
|
151
|
+
|
|
152
|
+
dependencies:
|
|
153
|
+
runtime: Array # Runtime dependencies
|
|
154
|
+
- name: String
|
|
155
|
+
version: String
|
|
156
|
+
dev: Array # Dev dependencies
|
|
157
|
+
- name: String
|
|
158
|
+
version: String
|
|
159
|
+
|
|
160
|
+
codeTemplates:
|
|
161
|
+
[name]: Object # Named code templates
|
|
162
|
+
engine: String # "typescript" | "handlebars" | "ai"
|
|
163
|
+
generator: String # Path to generator function
|
|
164
|
+
outputPattern: String # Output file pattern with variables
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Capability Patterns
|
|
168
|
+
|
|
169
|
+
Capabilities follow a hierarchical pattern:
|
|
170
|
+
|
|
171
|
+
- `api.rest` - Basic REST API
|
|
172
|
+
- `api.rest.crud` - REST API with CRUD operations
|
|
173
|
+
- `api.graphql` - GraphQL API
|
|
174
|
+
- `storage.database` - Generic database
|
|
175
|
+
- `storage.prisma` - Prisma ORM
|
|
176
|
+
- `storage.typeorm` - TypeORM
|
|
177
|
+
- `cache.redis` - Redis caching
|
|
178
|
+
- `queue.rabbitmq` - RabbitMQ messaging
|
|
179
|
+
|
|
180
|
+
## Template Generators
|
|
181
|
+
|
|
182
|
+
### TypeScript Generator Example
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
// templates/fastify/routes-generator.ts
|
|
186
|
+
import type { TemplateContext } from '../../../src/realize/types/index.js';
|
|
187
|
+
|
|
188
|
+
export default function generateFastifyRoutes(context: TemplateContext): string {
|
|
189
|
+
const { controller, model } = context;
|
|
190
|
+
|
|
191
|
+
return `
|
|
192
|
+
import { FastifyInstance } from 'fastify';
|
|
193
|
+
import { ${model.name}Service } from '../services/${model.name}.service.js';
|
|
194
|
+
|
|
195
|
+
export default async function ${controller.name}Routes(
|
|
196
|
+
fastify: FastifyInstance
|
|
197
|
+
) {
|
|
198
|
+
const service = new ${model.name}Service(fastify.prisma);
|
|
199
|
+
|
|
200
|
+
// Create
|
|
201
|
+
fastify.post('/', async (request, reply) => {
|
|
202
|
+
const result = await service.create(request.body);
|
|
203
|
+
return reply.status(201).send(result);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// Retrieve
|
|
207
|
+
fastify.get('/:id', async (request, reply) => {
|
|
208
|
+
const { id } = request.params as { id: string };
|
|
209
|
+
const result = await service.retrieve(id);
|
|
210
|
+
return reply.send(result);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
`;
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Template Context
|
|
218
|
+
|
|
219
|
+
The `TemplateContext` provides:
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
{
|
|
223
|
+
spec: AIOptimizedSpec; // Full specification
|
|
224
|
+
model?: any; // Current model
|
|
225
|
+
controller?: any; // Current controller
|
|
226
|
+
service?: any; // Current service
|
|
227
|
+
implType: ImplementationType; // Implementation type
|
|
228
|
+
instance: any; // Deployment instance
|
|
229
|
+
[key: string]: any; // Additional context
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Manifest Format
|
|
234
|
+
|
|
235
|
+
### v3.3 Manifest
|
|
236
|
+
|
|
237
|
+
```yaml
|
|
238
|
+
specVersion: "3.3.0" # Required: SpecVerse version
|
|
239
|
+
version: "1.0.0" # Required: Manifest version
|
|
240
|
+
name: "project-name" # Required: Project name
|
|
241
|
+
|
|
242
|
+
implementationTypes: # Array of implementation type references
|
|
243
|
+
- name: "FastifyPrismaAPI"
|
|
244
|
+
source: "path/to/fastify-prisma.yaml"
|
|
245
|
+
version: "1.0.0"
|
|
246
|
+
|
|
247
|
+
capabilityMappings: # Array of capability → implementation mappings
|
|
248
|
+
- capability: "api.rest"
|
|
249
|
+
implementationType: "FastifyPrismaAPI"
|
|
250
|
+
- capability: "storage.database"
|
|
251
|
+
implementationType: "PostgreSQLDatabase"
|
|
252
|
+
|
|
253
|
+
configuration: # Global configuration (optional)
|
|
254
|
+
environment: production
|
|
255
|
+
logLevel: info
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Creating New Implementation Types
|
|
259
|
+
|
|
260
|
+
### Step 1: Define Technology Stack
|
|
261
|
+
|
|
262
|
+
Identify:
|
|
263
|
+
- Framework and libraries
|
|
264
|
+
- Dependencies and versions
|
|
265
|
+
- Capabilities provided/required
|
|
266
|
+
- Code templates needed
|
|
267
|
+
|
|
268
|
+
### Step 2: Create YAML Definition
|
|
269
|
+
|
|
270
|
+
```yaml
|
|
271
|
+
name: YourImplementation
|
|
272
|
+
version: "1.0.0"
|
|
273
|
+
type: api-server
|
|
274
|
+
# ... (see structure above)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Step 3: Write Template Generators
|
|
278
|
+
|
|
279
|
+
Create TypeScript functions that generate code:
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
export default function generateYourCode(context: TemplateContext): string {
|
|
283
|
+
// Generate code based on context
|
|
284
|
+
return generatedCode;
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Step 4: Test
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Test your implementation type
|
|
292
|
+
npx tsx libs/instance-factories/test-v33-generation.ts
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Examples
|
|
296
|
+
|
|
297
|
+
### Available Implementation Types
|
|
298
|
+
|
|
299
|
+
- **FastifyPrismaAPI** (`backend/fastify-prisma.yaml`)
|
|
300
|
+
- Fastify web server
|
|
301
|
+
- Prisma ORM
|
|
302
|
+
- Zod validation
|
|
303
|
+
- JWT authentication
|
|
304
|
+
- Provides: `api.rest`, `api.rest.crud`
|
|
305
|
+
|
|
306
|
+
### Example Manifests
|
|
307
|
+
|
|
308
|
+
- **fastify-prisma-manifest.yaml** - Full-stack API with Fastify + Prisma
|
|
309
|
+
|
|
310
|
+
## CLI Integration
|
|
311
|
+
|
|
312
|
+
### Generate Code with v3.3
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
# Realize all code types
|
|
316
|
+
specverse realize all spec.specly -m manifest.yaml -o generated/
|
|
317
|
+
|
|
318
|
+
# Realize specific types
|
|
319
|
+
specverse realize routes spec.specly -m manifest.yaml -o generated/routes
|
|
320
|
+
specverse realize services spec.specly -m manifest.yaml -o generated/services
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Development
|
|
324
|
+
|
|
325
|
+
### Project Structure
|
|
326
|
+
|
|
327
|
+
```
|
|
328
|
+
libs/instance-factories/
|
|
329
|
+
├── README.md # This file
|
|
330
|
+
├── backend/
|
|
331
|
+
│ ├── fastify-prisma.yaml # Implementation type definition
|
|
332
|
+
│ └── templates/
|
|
333
|
+
│ ├── fastify/
|
|
334
|
+
│ │ └── routes-generator.ts
|
|
335
|
+
│ └── prisma/
|
|
336
|
+
│ ├── services-generator.ts
|
|
337
|
+
│ └── schema-generator.ts
|
|
338
|
+
├── test-v33-generation.ts # End-to-end test
|
|
339
|
+
└── examples/ # Example specs and manifests
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Testing
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
# Run end-to-end test
|
|
346
|
+
npx tsx libs/instance-factories/test-v33-generation.ts
|
|
347
|
+
|
|
348
|
+
# Run with custom spec
|
|
349
|
+
npx tsx libs/instance-factories/test-v33-generation.ts path/to/spec.specly
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
## Best Practices
|
|
353
|
+
|
|
354
|
+
### Implementation Types
|
|
355
|
+
|
|
356
|
+
1. **Single Responsibility** - Each implementation type should have one clear purpose
|
|
357
|
+
2. **Version Carefully** - Use semantic versioning for compatibility
|
|
358
|
+
3. **Document Capabilities** - Clearly define what capabilities are provided
|
|
359
|
+
4. **Test Thoroughly** - Test all templates with various specs
|
|
360
|
+
|
|
361
|
+
### Manifests
|
|
362
|
+
|
|
363
|
+
1. **Explicit Mappings** - Map all used capabilities explicitly
|
|
364
|
+
2. **Version Lock** - Specify exact versions for reproducibility
|
|
365
|
+
3. **Environment-Specific** - Use different manifests for dev/prod
|
|
366
|
+
4. **Validate** - Always validate manifests before deployment
|
|
367
|
+
|
|
368
|
+
### Templates
|
|
369
|
+
|
|
370
|
+
1. **Type Safety** - Use TypeScript for template generators
|
|
371
|
+
2. **Error Handling** - Handle missing context gracefully
|
|
372
|
+
3. **Formatting** - Generate clean, formatted code
|
|
373
|
+
4. **Comments** - Add helpful comments to generated code
|
|
374
|
+
|
|
375
|
+
## Troubleshooting
|
|
376
|
+
|
|
377
|
+
### Common Issues
|
|
378
|
+
|
|
379
|
+
**Implementation type not found**
|
|
380
|
+
```
|
|
381
|
+
Solution: Check the source path in manifestation implementationTypes
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**Capability not resolved**
|
|
385
|
+
```
|
|
386
|
+
Solution: Ensure capability mapping exists in manifest
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**Template generator fails**
|
|
390
|
+
```
|
|
391
|
+
Solution: Check template path is correct and generator exports default function
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Generated code has errors**
|
|
395
|
+
```
|
|
396
|
+
Solution: Verify template context has all required data
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
## Contributing
|
|
400
|
+
|
|
401
|
+
We welcome contributions of new implementation types!
|
|
402
|
+
|
|
403
|
+
### Guidelines
|
|
404
|
+
|
|
405
|
+
1. Follow the structure defined in this README
|
|
406
|
+
2. Include comprehensive tests
|
|
407
|
+
3. Document all capabilities clearly
|
|
408
|
+
4. Provide example manifests
|
|
409
|
+
5. Use TypeScript for generators
|
|
410
|
+
|
|
411
|
+
### Submission Process
|
|
412
|
+
|
|
413
|
+
1. Create implementation type YAML
|
|
414
|
+
2. Write template generators
|
|
415
|
+
3. Test end-to-end
|
|
416
|
+
4. Submit pull request with documentation
|
|
417
|
+
|
|
418
|
+
## Resources
|
|
419
|
+
|
|
420
|
+
- **Implementation Plan**: `docs/implementation-plans/v3.3-implementation/IMPLEMENTATION-TYPES-SYSTEM-PLAN.md`
|
|
421
|
+
- **Schema**: `schema/IMPLEMENTATION-TYPE-SCHEMA.json`
|
|
422
|
+
- **Examples**: `examples/v33-test/`
|
|
423
|
+
- **Core Types**: `src/realize/types/implementation-type.ts`
|
|
424
|
+
|
|
425
|
+
## License
|
|
426
|
+
|
|
427
|
+
MIT License - see LICENSE file for details
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
**Status**: ✅ Production Ready (v3.3.0)
|
|
432
|
+
|
|
433
|
+
Built with ❤️ by the SpecVerse Team
|