@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,328 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SpecVerse v3.1 Enhanced Examples Validation Harness with Expected Failures Support
|
|
5
|
+
*
|
|
6
|
+
* Validates and processes all .specly examples and test files
|
|
7
|
+
* Uses expected-failures.json to distinguish expected vs unexpected failures
|
|
8
|
+
*
|
|
9
|
+
* Usage: Run from project root directory
|
|
10
|
+
* node examples/validate-examples-with-expected-failures.cjs
|
|
11
|
+
*
|
|
12
|
+
* Features:
|
|
13
|
+
* - Comprehensive validation (examples + tests directories)
|
|
14
|
+
* - Expected failures management system
|
|
15
|
+
* - 3-phase validation with failure categorization
|
|
16
|
+
* - Integration with test suite expected failures
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const fs = require('fs');
|
|
20
|
+
const path = require('path');
|
|
21
|
+
const { execSync } = require('child_process');
|
|
22
|
+
const ExpectedFailuresManager = require('../tests/expected-failures.cjs');
|
|
23
|
+
|
|
24
|
+
// ANSI Colors for better output
|
|
25
|
+
const colors = {
|
|
26
|
+
blue: '\x1b[1m\x1b[34m',
|
|
27
|
+
green: '\x1b[32m',
|
|
28
|
+
red: '\x1b[31m',
|
|
29
|
+
yellow: '\x1b[33m',
|
|
30
|
+
orange: '\x1b[38;5;208m',
|
|
31
|
+
reset: '\x1b[0m',
|
|
32
|
+
bold: '\x1b[1m'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
class EnhancedExamplesValidator {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.results = {
|
|
38
|
+
validation: { passed: 0, expectedFailures: 0, unexpectedFailures: 0, errors: [] },
|
|
39
|
+
processing: { passed: 0, expectedFailures: 0, unexpectedFailures: 0, errors: [] },
|
|
40
|
+
yamlValidation: { passed: 0, expectedFailures: 0, unexpectedFailures: 0, errors: [] }
|
|
41
|
+
};
|
|
42
|
+
this.cliPath = './dist/cli/specverse-cli.js';
|
|
43
|
+
this.expectedFailures = new ExpectedFailuresManager();
|
|
44
|
+
this.allTestedFiles = new Set();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
log(message, color = '') {
|
|
48
|
+
console.log(`${color}${message}${colors.reset}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
findSpeclyFiles() {
|
|
52
|
+
const speclyFiles = [];
|
|
53
|
+
|
|
54
|
+
function scanDirectory(dir) {
|
|
55
|
+
const items = fs.readdirSync(dir);
|
|
56
|
+
|
|
57
|
+
for (const item of items) {
|
|
58
|
+
const fullPath = path.join(dir, item);
|
|
59
|
+
const stat = fs.statSync(fullPath);
|
|
60
|
+
|
|
61
|
+
if (stat.isDirectory() && !item.startsWith('.') && item !== 'diagrams' && item !== 'docs' && item !== 'metadata' && item !== 'common' && item !== 'archive' && item !== 'templates') {
|
|
62
|
+
scanDirectory(fullPath);
|
|
63
|
+
} else if (item.endsWith('.specly') && !fullPath.includes('/archive/')) {
|
|
64
|
+
// Skip any .specly files that are in archive directories at any level
|
|
65
|
+
speclyFiles.push(fullPath);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Scan examples directory and test directories
|
|
71
|
+
// Note: Excluding templates as they contain {{variables}} that are invalid until processed
|
|
72
|
+
const searchPaths = [
|
|
73
|
+
'examples',
|
|
74
|
+
'tests'
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
searchPaths.forEach(searchPath => {
|
|
78
|
+
if (fs.existsSync(searchPath)) {
|
|
79
|
+
scanDirectory(searchPath);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return speclyFiles.sort();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
handleValidationResult(filePath, success, error = null) {
|
|
87
|
+
const relativePath = path.relative('.', filePath);
|
|
88
|
+
this.allTestedFiles.add(relativePath);
|
|
89
|
+
|
|
90
|
+
if (success) {
|
|
91
|
+
this.log(`✅ ${path.basename(filePath)} validation passed`, colors.green);
|
|
92
|
+
this.results.validation.passed++;
|
|
93
|
+
} else {
|
|
94
|
+
const isExpected = this.expectedFailures.isExpectedFailure(relativePath);
|
|
95
|
+
|
|
96
|
+
if (isExpected) {
|
|
97
|
+
const reason = this.expectedFailures.getExpectedFailureReason(relativePath);
|
|
98
|
+
this.log(`⚠️ ${path.basename(filePath)} validation failed (EXPECTED: ${reason.category})`, colors.orange);
|
|
99
|
+
this.results.validation.expectedFailures++;
|
|
100
|
+
} else {
|
|
101
|
+
this.log(`❌ ${path.basename(filePath)} validation failed (UNEXPECTED!)`, colors.red);
|
|
102
|
+
this.results.validation.unexpectedFailures++;
|
|
103
|
+
if (error) {
|
|
104
|
+
this.log(` Error: ${error}`, colors.red);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
this.results.validation.errors.push({
|
|
109
|
+
file: relativePath,
|
|
110
|
+
error: error,
|
|
111
|
+
expected: isExpected
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
handleProcessingResult(filePath, success, error = null) {
|
|
117
|
+
const relativePath = path.relative('.', filePath);
|
|
118
|
+
|
|
119
|
+
if (success) {
|
|
120
|
+
this.log(`✅ ${path.basename(filePath)} processing succeeded`, colors.green);
|
|
121
|
+
this.results.processing.passed++;
|
|
122
|
+
} else {
|
|
123
|
+
const isExpected = this.expectedFailures.isExpectedFailure(relativePath);
|
|
124
|
+
|
|
125
|
+
if (isExpected) {
|
|
126
|
+
const reason = this.expectedFailures.getExpectedFailureReason(relativePath);
|
|
127
|
+
this.log(`⚠️ ${path.basename(filePath)} processing failed (EXPECTED: ${reason.category})`, colors.orange);
|
|
128
|
+
this.results.processing.expectedFailures++;
|
|
129
|
+
} else {
|
|
130
|
+
this.log(`❌ ${path.basename(filePath)} processing failed (UNEXPECTED!)`, colors.red);
|
|
131
|
+
this.results.processing.unexpectedFailures++;
|
|
132
|
+
if (error && error.length > 200) {
|
|
133
|
+
// Truncate very long errors
|
|
134
|
+
error = error.substring(0, 200) + '...';
|
|
135
|
+
}
|
|
136
|
+
if (error) {
|
|
137
|
+
this.log(`❌ Processing failed:\n ${error}`, colors.red);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
this.results.processing.errors.push({
|
|
142
|
+
file: relativePath,
|
|
143
|
+
error: error,
|
|
144
|
+
expected: isExpected
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
validateSpeclyFile(filePath) {
|
|
150
|
+
this.log(`🧪 Validating ${path.basename(filePath)}`, colors.blue);
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
execSync(`node ${this.cliPath} validate "${filePath}"`, {
|
|
154
|
+
stdio: 'pipe',
|
|
155
|
+
timeout: 10000
|
|
156
|
+
});
|
|
157
|
+
this.handleValidationResult(filePath, true);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
this.handleValidationResult(filePath, false, error.message);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
processSpeclyFile(filePath) {
|
|
164
|
+
const fileName = path.basename(filePath, '.specly');
|
|
165
|
+
const outputPath = `/tmp/example-${fileName}.yaml`;
|
|
166
|
+
|
|
167
|
+
this.log(`🧪 Processing ${path.basename(filePath)} → .yaml`, colors.blue);
|
|
168
|
+
|
|
169
|
+
try {
|
|
170
|
+
const result = execSync(`node ${this.cliPath} gen yaml "${filePath}" -o "${outputPath}"`, {
|
|
171
|
+
stdio: 'pipe',
|
|
172
|
+
timeout: 15000,
|
|
173
|
+
encoding: 'utf8'
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// Check if output file was created and has content
|
|
177
|
+
if (fs.existsSync(outputPath)) {
|
|
178
|
+
const content = fs.readFileSync(outputPath, 'utf8').trim();
|
|
179
|
+
if (content.length > 10) { // Minimal content check
|
|
180
|
+
this.handleProcessingResult(filePath, true);
|
|
181
|
+
|
|
182
|
+
// Validate the generated YAML
|
|
183
|
+
this.validateGeneratedYaml(outputPath, fileName);
|
|
184
|
+
} else {
|
|
185
|
+
this.handleProcessingResult(filePath, false, "Generated YAML is empty or minimal");
|
|
186
|
+
}
|
|
187
|
+
} else {
|
|
188
|
+
this.handleProcessingResult(filePath, false, "No output file generated");
|
|
189
|
+
}
|
|
190
|
+
} catch (error) {
|
|
191
|
+
this.handleProcessingResult(filePath, false, error.message);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
validateGeneratedYaml(yamlPath, baseName) {
|
|
196
|
+
this.log(`🧪 Validating generated ${path.basename(yamlPath)}`, colors.blue);
|
|
197
|
+
|
|
198
|
+
try {
|
|
199
|
+
execSync(`node ${this.cliPath} validate "${yamlPath}"`, {
|
|
200
|
+
stdio: 'pipe',
|
|
201
|
+
timeout: 10000
|
|
202
|
+
});
|
|
203
|
+
this.log(`✅ Generated ${path.basename(yamlPath)} validation passed`, colors.green);
|
|
204
|
+
this.results.yamlValidation.passed++;
|
|
205
|
+
} catch (error) {
|
|
206
|
+
this.log(`❌ Generated ${path.basename(yamlPath)} validation failed`, colors.red);
|
|
207
|
+
this.results.yamlValidation.unexpectedFailures++;
|
|
208
|
+
this.results.yamlValidation.errors.push({
|
|
209
|
+
file: yamlPath,
|
|
210
|
+
error: error.message,
|
|
211
|
+
expected: false
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Clean up
|
|
216
|
+
try {
|
|
217
|
+
fs.unlinkSync(yamlPath);
|
|
218
|
+
} catch (e) {
|
|
219
|
+
// Ignore cleanup errors
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
printSummary() {
|
|
224
|
+
this.log('', '');
|
|
225
|
+
this.log('📊 Enhanced Test Results Summary', colors.bold + colors.blue);
|
|
226
|
+
|
|
227
|
+
const phases = [
|
|
228
|
+
{ name: 'Phase 1: .specly Validation', results: this.results.validation },
|
|
229
|
+
{ name: 'Phase 2: .specly → .yaml Processing', results: this.results.processing },
|
|
230
|
+
{ name: 'Phase 3: Generated .yaml Validation', results: this.results.yamlValidation }
|
|
231
|
+
];
|
|
232
|
+
|
|
233
|
+
let totalPassed = 0;
|
|
234
|
+
let totalExpected = 0;
|
|
235
|
+
let totalUnexpected = 0;
|
|
236
|
+
|
|
237
|
+
phases.forEach(phase => {
|
|
238
|
+
const r = phase.results;
|
|
239
|
+
totalPassed += r.passed;
|
|
240
|
+
totalExpected += r.expectedFailures;
|
|
241
|
+
totalUnexpected += r.unexpectedFailures;
|
|
242
|
+
|
|
243
|
+
this.log(`\n${phase.name}:`, colors.bold);
|
|
244
|
+
this.log(` ✅ Passed: ${r.passed}`, colors.green);
|
|
245
|
+
if (r.expectedFailures > 0) {
|
|
246
|
+
this.log(` ⚠️ Expected Failures: ${r.expectedFailures}`, colors.orange);
|
|
247
|
+
}
|
|
248
|
+
if (r.unexpectedFailures > 0) {
|
|
249
|
+
this.log(` ❌ Unexpected Failures: ${r.unexpectedFailures}`, colors.red);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// Overall summary
|
|
254
|
+
this.log('\n=== OVERALL SUMMARY ===', colors.bold);
|
|
255
|
+
this.log(`Total Tests: ${totalPassed + totalExpected + totalUnexpected}`);
|
|
256
|
+
this.log(`✅ Passed: ${totalPassed}`, colors.green);
|
|
257
|
+
this.log(`⚠️ Expected Failures: ${totalExpected}`, colors.orange);
|
|
258
|
+
this.log(`❌ Unexpected Failures: ${totalUnexpected}`, colors.red);
|
|
259
|
+
|
|
260
|
+
// Generate expected failures report
|
|
261
|
+
const allActualFailures = [
|
|
262
|
+
...this.results.validation.errors.filter(e => !e.expected).map(e => e.file),
|
|
263
|
+
...this.results.processing.errors.filter(e => !e.expected).map(e => e.file),
|
|
264
|
+
...this.results.yamlValidation.errors.filter(e => !e.expected).map(e => e.file)
|
|
265
|
+
];
|
|
266
|
+
|
|
267
|
+
const analysis = this.expectedFailures.generateReport(
|
|
268
|
+
allActualFailures,
|
|
269
|
+
totalPassed + totalExpected + totalUnexpected
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
this.log(analysis.report, '');
|
|
273
|
+
|
|
274
|
+
// Return success status
|
|
275
|
+
return {
|
|
276
|
+
success: analysis.isHealthy,
|
|
277
|
+
summary: analysis.summary,
|
|
278
|
+
hasUnexpectedFailures: totalUnexpected > 0
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
async run() {
|
|
283
|
+
this.log('🚀 SpecVerse v3.1 Enhanced Examples Validation Harness', colors.bold + colors.blue);
|
|
284
|
+
this.log('Validating .specly examples with expected failures support\\n', '');
|
|
285
|
+
|
|
286
|
+
const speclyFiles = this.findSpeclyFiles();
|
|
287
|
+
this.log(`📁 Found ${speclyFiles.length} .specly example files\\n`, colors.blue);
|
|
288
|
+
|
|
289
|
+
// Phase 1: Validation
|
|
290
|
+
this.log('Phase 1: .specly File Validation', colors.bold + colors.blue);
|
|
291
|
+
for (const file of speclyFiles) {
|
|
292
|
+
this.validateSpeclyFile(file);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Phase 2: Processing (only for files that passed validation OR are expected to pass processing)
|
|
296
|
+
this.log('\\nPhase 2: .specly → .yaml Processing', colors.bold + colors.blue);
|
|
297
|
+
const validFiles = speclyFiles.filter(file => {
|
|
298
|
+
const relativePath = path.relative('.', file);
|
|
299
|
+
const validationError = this.results.validation.errors.find(e => e.file === relativePath);
|
|
300
|
+
return !validationError || validationError.expected;
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
for (const file of validFiles) {
|
|
304
|
+
// Only process if validation passed OR it's an expected validation failure
|
|
305
|
+
const relativePath = path.relative('.', file);
|
|
306
|
+
const validationFailed = this.results.validation.errors.some(e => e.file === relativePath);
|
|
307
|
+
|
|
308
|
+
if (!validationFailed || this.expectedFailures.isExpectedFailure(relativePath)) {
|
|
309
|
+
this.processSpeclyFile(file);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return this.printSummary();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Run if called directly
|
|
318
|
+
if (require.main === module) {
|
|
319
|
+
const validator = new EnhancedExamplesValidator();
|
|
320
|
+
validator.run().then(result => {
|
|
321
|
+
process.exit(result.hasUnexpectedFailures ? 1 : 0);
|
|
322
|
+
}).catch(error => {
|
|
323
|
+
console.error('Fatal error:', error);
|
|
324
|
+
process.exit(1);
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
module.exports = EnhancedExamplesValidator;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SpecVerse v3.1 Examples Validation Harness (Basic)
|
|
5
|
+
*
|
|
6
|
+
* Validates and processes all .specly examples in the examples directory
|
|
7
|
+
*
|
|
8
|
+
* Usage: Run from examples/ directory
|
|
9
|
+
* cd examples && node validate-examples.cjs
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - Simple 3-phase validation (specly → yaml → validation)
|
|
13
|
+
* - No expected failures handling
|
|
14
|
+
* - Focused on examples directory only
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const fs = require('fs');
|
|
18
|
+
const path = require('path');
|
|
19
|
+
const { execSync } = require('child_process');
|
|
20
|
+
|
|
21
|
+
// ANSI Colors for better output
|
|
22
|
+
const colors = {
|
|
23
|
+
blue: '\x1b[1m\x1b[34m',
|
|
24
|
+
green: '\x1b[32m',
|
|
25
|
+
red: '\x1b[31m',
|
|
26
|
+
yellow: '\x1b[33m',
|
|
27
|
+
reset: '\x1b[0m',
|
|
28
|
+
bold: '\x1b[1m'
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
class ExamplesValidator {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.results = {
|
|
34
|
+
validation: { passed: 0, failed: 0, errors: [] },
|
|
35
|
+
processing: { passed: 0, failed: 0, errors: [] },
|
|
36
|
+
yamlValidation: { passed: 0, failed: 0, errors: [] }
|
|
37
|
+
};
|
|
38
|
+
this.cliPath = '../dist/cli/specverse-cli.js';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
log(message, color = '') {
|
|
42
|
+
console.log(`${color}${message}${colors.reset}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
findSpeclyFiles() {
|
|
46
|
+
const speclyFiles = [];
|
|
47
|
+
|
|
48
|
+
function scanDirectory(dir) {
|
|
49
|
+
const items = fs.readdirSync(dir);
|
|
50
|
+
|
|
51
|
+
for (const item of items) {
|
|
52
|
+
const fullPath = path.join(dir, item);
|
|
53
|
+
const stat = fs.statSync(fullPath);
|
|
54
|
+
|
|
55
|
+
if (stat.isDirectory() && !item.startsWith('.') && item !== 'diagrams' && item !== 'docs' && item !== 'metadata' && item !== 'common') {
|
|
56
|
+
scanDirectory(fullPath);
|
|
57
|
+
} else if (item.endsWith('.specly')) {
|
|
58
|
+
speclyFiles.push(fullPath);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
scanDirectory('.');
|
|
64
|
+
return speclyFiles.sort();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async validateSpeclyFile(filePath) {
|
|
68
|
+
try {
|
|
69
|
+
const cmd = `node ${this.cliPath} validate "${filePath}"`;
|
|
70
|
+
execSync(cmd, { stdio: 'pipe' });
|
|
71
|
+
this.results.validation.passed++;
|
|
72
|
+
this.log(`✅ ${path.basename(filePath)} validation passed`, colors.green);
|
|
73
|
+
return true;
|
|
74
|
+
} catch (error) {
|
|
75
|
+
this.results.validation.failed++;
|
|
76
|
+
this.results.validation.errors.push({
|
|
77
|
+
file: filePath,
|
|
78
|
+
error: error.message,
|
|
79
|
+
type: '.specly validation'
|
|
80
|
+
});
|
|
81
|
+
this.log(`❌ ${path.basename(filePath)} validation failed`, colors.red);
|
|
82
|
+
this.log(` Error: ${error.message.split('\\n')[0]}`, '');
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async processSpeclyFile(filePath) {
|
|
88
|
+
try {
|
|
89
|
+
const outputPath = `/tmp/example-${path.basename(filePath, '.specly')}.yaml`;
|
|
90
|
+
const cmd = `node ${this.cliPath} gen yaml "${filePath}" -o "${outputPath}"`;
|
|
91
|
+
execSync(cmd, { stdio: 'pipe' });
|
|
92
|
+
|
|
93
|
+
// Check if output file was created and has content
|
|
94
|
+
if (fs.existsSync(outputPath)) {
|
|
95
|
+
const content = fs.readFileSync(outputPath, 'utf8');
|
|
96
|
+
if (content.trim().length > 50) { // More than just empty structure
|
|
97
|
+
this.results.processing.passed++;
|
|
98
|
+
this.log(`✅ ${path.basename(filePath)} processing succeeded`, colors.green);
|
|
99
|
+
return { success: true, outputPath };
|
|
100
|
+
} else {
|
|
101
|
+
throw new Error('Generated YAML is empty or minimal');
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
throw new Error('Output file was not created');
|
|
105
|
+
}
|
|
106
|
+
} catch (error) {
|
|
107
|
+
this.results.processing.failed++;
|
|
108
|
+
this.results.processing.errors.push({
|
|
109
|
+
file: filePath,
|
|
110
|
+
error: error.message,
|
|
111
|
+
type: '.specly → .yaml processing'
|
|
112
|
+
});
|
|
113
|
+
this.log(`❌ ${path.basename(filePath)} processing failed`, colors.red);
|
|
114
|
+
this.log(` Error: ${error.message.split('\\n')[0]}`, '');
|
|
115
|
+
return { success: false };
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async validateYamlFile(filePath) {
|
|
120
|
+
try {
|
|
121
|
+
const cmd = `node ${this.cliPath} validate "${filePath}"`;
|
|
122
|
+
execSync(cmd, { stdio: 'pipe' });
|
|
123
|
+
this.results.yamlValidation.passed++;
|
|
124
|
+
this.log(`✅ Generated ${path.basename(filePath)} validation passed`, colors.green);
|
|
125
|
+
return true;
|
|
126
|
+
} catch (error) {
|
|
127
|
+
this.results.yamlValidation.failed++;
|
|
128
|
+
this.results.yamlValidation.errors.push({
|
|
129
|
+
file: filePath,
|
|
130
|
+
error: error.message,
|
|
131
|
+
type: 'Generated .yaml validation'
|
|
132
|
+
});
|
|
133
|
+
this.log(`❌ Generated ${path.basename(filePath)} validation failed`, colors.red);
|
|
134
|
+
this.log(` Error: ${error.message.split('\\n')[0]}`, '');
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
printSummary() {
|
|
140
|
+
const total = this.results.validation.passed + this.results.validation.failed;
|
|
141
|
+
const validationRate = total > 0 ? ((this.results.validation.passed / total) * 100).toFixed(1) : 0;
|
|
142
|
+
const processingRate = total > 0 ? ((this.results.processing.passed / total) * 100).toFixed(1) : 0;
|
|
143
|
+
const yamlRate = this.results.processing.passed > 0 ?
|
|
144
|
+
((this.results.yamlValidation.passed / this.results.processing.passed) * 100).toFixed(1) : 0;
|
|
145
|
+
|
|
146
|
+
this.log('\\n🏆 Examples Validation Summary', colors.blue);
|
|
147
|
+
this.log(`Total Examples: ${total}`);
|
|
148
|
+
this.log(`✅ Specly Validation: ${this.results.validation.passed}/${total} (${validationRate}%)`, colors.green);
|
|
149
|
+
this.log(`✅ Processing: ${this.results.processing.passed}/${total} (${processingRate}%)`, colors.green);
|
|
150
|
+
this.log(`✅ Generated YAML Validation: ${this.results.yamlValidation.passed}/${this.results.processing.passed} (${yamlRate}%)`, colors.green);
|
|
151
|
+
|
|
152
|
+
const overallPassed = Math.min(this.results.validation.passed, this.results.processing.passed, this.results.yamlValidation.passed);
|
|
153
|
+
const overallRate = total > 0 ? ((overallPassed / total) * 100).toFixed(1) : 0;
|
|
154
|
+
|
|
155
|
+
this.log(`\\n🎯 Overall Success Rate: ${overallRate}%`, overallRate >= 90 ? colors.green : overallRate >= 70 ? colors.yellow : colors.red);
|
|
156
|
+
|
|
157
|
+
if (this.results.validation.errors.length > 0 ||
|
|
158
|
+
this.results.processing.errors.length > 0 ||
|
|
159
|
+
this.results.yamlValidation.errors.length > 0) {
|
|
160
|
+
this.log('\\n❌ Failed Examples Details', colors.red);
|
|
161
|
+
let errorIndex = 1;
|
|
162
|
+
|
|
163
|
+
for (const error of [...this.results.validation.errors, ...this.results.processing.errors, ...this.results.yamlValidation.errors]) {
|
|
164
|
+
this.log(`${errorIndex}. ${error.type}`, colors.red);
|
|
165
|
+
this.log(` File: ${error.file}`, '');
|
|
166
|
+
this.log(` Error: ${error.error.split('\\n')[0]}`, '');
|
|
167
|
+
this.log('');
|
|
168
|
+
errorIndex++;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
this.log('\\n🔧 Recommended Actions', colors.blue);
|
|
173
|
+
if (overallRate < 50) {
|
|
174
|
+
this.log('1. Update examples to v3.1 container format (components: structure)');
|
|
175
|
+
this.log('2. Fix data types (Text → String, etc.)');
|
|
176
|
+
this.log('3. Update import/export syntax to match v3.1 schema');
|
|
177
|
+
} else if (overallRate < 90) {
|
|
178
|
+
this.log('1. Fix specific validation errors shown above');
|
|
179
|
+
this.log('2. Ensure all examples use current v3.1 conventions');
|
|
180
|
+
} else {
|
|
181
|
+
this.log('1. Examples are in excellent shape!');
|
|
182
|
+
this.log('2. Consider adding more complex examples or edge cases');
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
async run() {
|
|
187
|
+
this.log('🚀 SpecVerse v3.1 Examples Validation Harness', colors.blue);
|
|
188
|
+
this.log('Validating .specly examples → processing → validating generated YAML\\n');
|
|
189
|
+
|
|
190
|
+
const speclyFiles = this.findSpeclyFiles();
|
|
191
|
+
|
|
192
|
+
if (speclyFiles.length === 0) {
|
|
193
|
+
this.log('❌ No .specly files found in examples directory', colors.red);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
this.log(`📁 Found ${speclyFiles.length} .specly example files\\n`);
|
|
198
|
+
|
|
199
|
+
// Phase 1: Validate all .specly files
|
|
200
|
+
this.log('Phase 1: .specly File Validation', colors.blue);
|
|
201
|
+
for (const file of speclyFiles) {
|
|
202
|
+
this.log(`🧪 Validating ${path.basename(file)}`);
|
|
203
|
+
await this.validateSpeclyFile(file);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Phase 2: Process .specly → .yaml
|
|
207
|
+
this.log('\\nPhase 2: .specly → .yaml Processing', colors.blue);
|
|
208
|
+
for (const file of speclyFiles) {
|
|
209
|
+
this.log(`🧪 Processing ${path.basename(file)} → .yaml`);
|
|
210
|
+
const result = await this.processSpeclyFile(file);
|
|
211
|
+
|
|
212
|
+
// Phase 3: Validate generated YAML (only if processing succeeded)
|
|
213
|
+
if (result.success) {
|
|
214
|
+
this.log(`🧪 Validating generated ${path.basename(result.outputPath)}`);
|
|
215
|
+
await this.validateYamlFile(result.outputPath);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
this.printSummary();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Run the validator
|
|
224
|
+
const validator = new ExamplesValidator();
|
|
225
|
+
validator.run().catch(console.error);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
title: "Cloud Native Deployment Manifest"
|
|
2
|
+
description: "Cloud-native implementation manifest for AWS EKS deployment"
|
|
3
|
+
difficulty: advanced
|
|
4
|
+
concepts: [manifests, aws, cloud-native, deployment]
|
|
5
|
+
prerequisites: []
|
|
6
|
+
category: deploy
|
|
7
|
+
order: 5
|
|
8
|
+
companionFiles: [cloud-native-manifest.md]
|