@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,559 @@
|
|
|
1
|
+
# SpecVerse Templates
|
|
2
|
+
|
|
3
|
+
This directory contains starter templates for different project types. Each template provides a complete, working specification and manifest configuration for specific use cases.
|
|
4
|
+
|
|
5
|
+
## Available Templates
|
|
6
|
+
|
|
7
|
+
### 1. Default Template (Fullstack Monorepo)
|
|
8
|
+
|
|
9
|
+
**Location**: `templates/default/`
|
|
10
|
+
|
|
11
|
+
**Use Case**: Full-stack applications with frontend and backend in a monorepo structure
|
|
12
|
+
|
|
13
|
+
**Architecture**:
|
|
14
|
+
- **Backend**: Fastify + Prisma + PostgreSQL
|
|
15
|
+
- **Frontend**: React + Vite + React Router + React Query
|
|
16
|
+
- **Structure**: npm workspaces with `backend/` and `frontend/` directories
|
|
17
|
+
- **Communication**: Frontend connects to local backend via environment variables
|
|
18
|
+
|
|
19
|
+
**Generated Structure**:
|
|
20
|
+
```
|
|
21
|
+
generated/code/
|
|
22
|
+
├── package.json # Root workspace configuration
|
|
23
|
+
├── backend/
|
|
24
|
+
│ ├── package.json # Backend dependencies
|
|
25
|
+
│ ├── tsconfig.json # Backend TypeScript config
|
|
26
|
+
│ ├── src/
|
|
27
|
+
│ │ ├── main.ts # Fastify server entry point
|
|
28
|
+
│ │ ├── routes/ # REST API routes
|
|
29
|
+
│ │ └── services/ # Business logic services
|
|
30
|
+
│ └── prisma/
|
|
31
|
+
│ └── schema.prisma # Database schema
|
|
32
|
+
└── frontend/
|
|
33
|
+
├── package.json # Frontend dependencies
|
|
34
|
+
├── tsconfig.json # Frontend TypeScript config
|
|
35
|
+
├── vite.config.ts # Vite configuration
|
|
36
|
+
├── index.html # HTML entry point
|
|
37
|
+
└── src/
|
|
38
|
+
├── main.tsx # React entry point
|
|
39
|
+
├── App.tsx # Root component with routing
|
|
40
|
+
└── components/ # React components from views
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Quick Start**:
|
|
44
|
+
```bash
|
|
45
|
+
# Initialize project
|
|
46
|
+
specverse init MyApp
|
|
47
|
+
|
|
48
|
+
# Or explicitly specify default template
|
|
49
|
+
specverse init MyApp --template default
|
|
50
|
+
|
|
51
|
+
# Navigate to project
|
|
52
|
+
cd MyApp
|
|
53
|
+
|
|
54
|
+
# Generate code
|
|
55
|
+
npm run realize:all
|
|
56
|
+
|
|
57
|
+
# Install dependencies
|
|
58
|
+
cd generated/code
|
|
59
|
+
npm install
|
|
60
|
+
|
|
61
|
+
# Setup database
|
|
62
|
+
npm run db:generate
|
|
63
|
+
npm run db:push
|
|
64
|
+
|
|
65
|
+
# Start development servers (both in parallel)
|
|
66
|
+
npm run dev
|
|
67
|
+
|
|
68
|
+
# Or start individually
|
|
69
|
+
npm run dev:backend # http://localhost:3000
|
|
70
|
+
npm run dev:frontend # http://localhost:5173
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Key Features**:
|
|
74
|
+
- Complete CURED operations for all models
|
|
75
|
+
- Automatic React Router setup from views
|
|
76
|
+
- React Query data fetching with caching
|
|
77
|
+
- TypeScript throughout
|
|
78
|
+
- Database migrations and seeding
|
|
79
|
+
- CORS configured for local development
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### 2. Backend-Only Template
|
|
84
|
+
|
|
85
|
+
**Location**: `templates/backend-only/`
|
|
86
|
+
|
|
87
|
+
**Use Case**: Microservices, API-only services, or when frontend is separate project
|
|
88
|
+
|
|
89
|
+
**Architecture**:
|
|
90
|
+
- **Backend**: Fastify + Prisma + PostgreSQL
|
|
91
|
+
- **Structure**: Standalone (all files in root, no subdirectories)
|
|
92
|
+
- **Deployment**: Can be deployed independently as microservice
|
|
93
|
+
- **CORS**: Configurable via environment variable for frontend integration
|
|
94
|
+
|
|
95
|
+
**Generated Structure**:
|
|
96
|
+
```
|
|
97
|
+
generated/code/
|
|
98
|
+
├── package.json # Standalone backend package
|
|
99
|
+
├── tsconfig.json # Backend TypeScript config
|
|
100
|
+
├── src/
|
|
101
|
+
│ ├── main.ts # Fastify server entry point
|
|
102
|
+
│ ├── routes/ # REST API routes
|
|
103
|
+
│ └── services/ # Business logic services
|
|
104
|
+
├── prisma/
|
|
105
|
+
│ └── schema.prisma # Database schema
|
|
106
|
+
└── .env.example # Environment variables template
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Quick Start**:
|
|
110
|
+
```bash
|
|
111
|
+
# Initialize backend-only project
|
|
112
|
+
specverse init MyAPI --template backend-only
|
|
113
|
+
|
|
114
|
+
# Navigate to project
|
|
115
|
+
cd MyAPI
|
|
116
|
+
|
|
117
|
+
# Generate code
|
|
118
|
+
npm run realize:all
|
|
119
|
+
|
|
120
|
+
# Install dependencies
|
|
121
|
+
cd generated/code
|
|
122
|
+
npm install
|
|
123
|
+
|
|
124
|
+
# Setup database
|
|
125
|
+
npm run db:generate
|
|
126
|
+
npm run db:push
|
|
127
|
+
|
|
128
|
+
# Start server
|
|
129
|
+
npm run dev # http://localhost:3000
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Configuration**:
|
|
133
|
+
```env
|
|
134
|
+
# .env file
|
|
135
|
+
DATABASE_URL=postgresql://user:password@localhost:5432/myapi
|
|
136
|
+
API_PORT=3000
|
|
137
|
+
API_HOST=0.0.0.0
|
|
138
|
+
CORS_ORIGINS=http://localhost:5173,https://your-frontend.com
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Key Features**:
|
|
142
|
+
- Complete REST API with CURED operations
|
|
143
|
+
- Standalone deployment structure
|
|
144
|
+
- Environment-based CORS configuration
|
|
145
|
+
- Optimized for microservices architecture
|
|
146
|
+
- No frontend dependencies
|
|
147
|
+
|
|
148
|
+
**Typical Use Cases**:
|
|
149
|
+
- Microservices in distributed systems
|
|
150
|
+
- API services for mobile apps
|
|
151
|
+
- Backend for JAMstack applications
|
|
152
|
+
- Standalone data services
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### 3. Frontend-Only Template
|
|
157
|
+
|
|
158
|
+
**Location**: `templates/frontend-only/`
|
|
159
|
+
|
|
160
|
+
**Use Case**: JAMstack applications, SPAs connecting to external APIs, frontend-first development
|
|
161
|
+
|
|
162
|
+
**Architecture**:
|
|
163
|
+
- **Frontend**: React + Vite + React Router + React Query
|
|
164
|
+
- **Structure**: Standalone (all files in root, no subdirectories)
|
|
165
|
+
- **API**: Connects to external API via environment variable
|
|
166
|
+
- **Deployment**: Static hosting (Vercel, Netlify, S3, etc.)
|
|
167
|
+
|
|
168
|
+
**Generated Structure**:
|
|
169
|
+
```
|
|
170
|
+
generated/code/
|
|
171
|
+
├── package.json # Standalone frontend package
|
|
172
|
+
├── tsconfig.json # Frontend TypeScript config
|
|
173
|
+
├── vite.config.ts # Vite configuration
|
|
174
|
+
├── index.html # HTML entry point
|
|
175
|
+
├── src/
|
|
176
|
+
│ ├── main.tsx # React entry point
|
|
177
|
+
│ ├── App.tsx # Root component with routing
|
|
178
|
+
│ ├── index.css # Global styles
|
|
179
|
+
│ └── components/ # React components from views
|
|
180
|
+
└── .env.example # Environment variables template
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Quick Start**:
|
|
184
|
+
```bash
|
|
185
|
+
# Initialize frontend-only project
|
|
186
|
+
specverse init MyFrontend --template frontend-only
|
|
187
|
+
|
|
188
|
+
# Navigate to project
|
|
189
|
+
cd MyFrontend
|
|
190
|
+
|
|
191
|
+
# Generate code
|
|
192
|
+
npm run realize:all
|
|
193
|
+
|
|
194
|
+
# Install dependencies
|
|
195
|
+
cd generated/code
|
|
196
|
+
npm install
|
|
197
|
+
|
|
198
|
+
# Configure API endpoint
|
|
199
|
+
cp .env.example .env
|
|
200
|
+
# Edit .env: VITE_API_BASE_URL=https://your-api.com
|
|
201
|
+
|
|
202
|
+
# Start dev server
|
|
203
|
+
npm run dev # http://localhost:5173
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Configuration**:
|
|
207
|
+
```env
|
|
208
|
+
# .env file
|
|
209
|
+
VITE_API_BASE_URL=https://api.example.com
|
|
210
|
+
VITE_API_PREFIX=/api
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Key Features**:
|
|
214
|
+
- React Router with auto-generated routes from views
|
|
215
|
+
- React Query for API data fetching and caching
|
|
216
|
+
- TypeScript type safety throughout
|
|
217
|
+
- Hot Module Replacement (HMR) with Vite
|
|
218
|
+
- Optimized production builds
|
|
219
|
+
- No backend dependencies
|
|
220
|
+
|
|
221
|
+
**Deployment Options**:
|
|
222
|
+
- **Vercel**: `vercel deploy`
|
|
223
|
+
- **Netlify**: `netlify deploy`
|
|
224
|
+
- **AWS S3 + CloudFront**: Static hosting
|
|
225
|
+
- **GitHub Pages**: Static site hosting
|
|
226
|
+
- **Any CDN**: Just serve the `dist/` folder
|
|
227
|
+
|
|
228
|
+
**Typical Use Cases**:
|
|
229
|
+
- JAMstack applications
|
|
230
|
+
- Frontend for existing APIs
|
|
231
|
+
- Static site generation
|
|
232
|
+
- Progressive Web Apps (PWAs)
|
|
233
|
+
- Prototyping with mock APIs
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Template Comparison
|
|
238
|
+
|
|
239
|
+
| Feature | Default (Fullstack) | Backend-Only | Frontend-Only |
|
|
240
|
+
|---------|-------------------|--------------|---------------|
|
|
241
|
+
| **Structure** | Monorepo (workspaces) | Standalone | Standalone |
|
|
242
|
+
| **Backend** | ✅ Fastify + Prisma | ✅ Fastify + Prisma | ❌ |
|
|
243
|
+
| **Frontend** | ✅ React + Vite | ❌ | ✅ React + Vite |
|
|
244
|
+
| **Database** | ✅ PostgreSQL | ✅ PostgreSQL | ❌ (External API) |
|
|
245
|
+
| **Deployment** | Full-stack hosting | Microservice/API | Static hosting |
|
|
246
|
+
| **Use Case** | Integrated apps | API services | JAMstack/SPAs |
|
|
247
|
+
| **npm Workspaces** | ✅ | ❌ | ❌ |
|
|
248
|
+
| **CORS Setup** | Auto-configured | Env variable | N/A (client-only) |
|
|
249
|
+
|
|
250
|
+
## Customizing Templates
|
|
251
|
+
|
|
252
|
+
### Modifying Specifications
|
|
253
|
+
|
|
254
|
+
Each template has a `specs/main.specly` file that you can customize:
|
|
255
|
+
|
|
256
|
+
```yaml
|
|
257
|
+
# Example: Add a new model
|
|
258
|
+
models:
|
|
259
|
+
Product:
|
|
260
|
+
attributes:
|
|
261
|
+
name: String required
|
|
262
|
+
price: Decimal required
|
|
263
|
+
|
|
264
|
+
# Add your own model
|
|
265
|
+
Order:
|
|
266
|
+
attributes:
|
|
267
|
+
orderNumber: String required unique
|
|
268
|
+
totalAmount: Decimal required
|
|
269
|
+
status: String values=["pending", "shipped", "delivered"]
|
|
270
|
+
relationships:
|
|
271
|
+
product: belongsTo Product
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
After modifying specs:
|
|
275
|
+
```bash
|
|
276
|
+
npm run realize:all # Regenerate code
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Customizing Instance Factories
|
|
280
|
+
|
|
281
|
+
Edit `manifests/implementation.yaml` to change technology choices:
|
|
282
|
+
|
|
283
|
+
```yaml
|
|
284
|
+
capabilityMappings:
|
|
285
|
+
# Change ORM
|
|
286
|
+
- capability: "orm.schema"
|
|
287
|
+
instanceFactory: "TypeORM" # Instead of PrismaORM
|
|
288
|
+
|
|
289
|
+
# Change API framework
|
|
290
|
+
- capability: "api.rest"
|
|
291
|
+
instanceFactory: "ExpressAPI" # Instead of FastifyAPI
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Output Structure Configuration
|
|
295
|
+
|
|
296
|
+
You can change between monorepo and standalone structures:
|
|
297
|
+
|
|
298
|
+
```yaml
|
|
299
|
+
configuration:
|
|
300
|
+
outputStructure: "standalone" # or "monorepo"
|
|
301
|
+
frontendDir: "." # or "frontend"
|
|
302
|
+
backendDir: "." # or "backend"
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Development Workflow
|
|
306
|
+
|
|
307
|
+
### Fullstack (Default Template)
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Terminal 1: Backend development
|
|
311
|
+
cd generated/code
|
|
312
|
+
npm run dev:backend
|
|
313
|
+
|
|
314
|
+
# Terminal 2: Frontend development
|
|
315
|
+
npm run dev:frontend
|
|
316
|
+
|
|
317
|
+
# Or run both together
|
|
318
|
+
npm run dev
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Backend-Only
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
cd generated/code
|
|
325
|
+
|
|
326
|
+
# Development
|
|
327
|
+
npm run dev
|
|
328
|
+
|
|
329
|
+
# Database operations
|
|
330
|
+
npm run db:generate # Generate Prisma client
|
|
331
|
+
npm run db:push # Push schema to database
|
|
332
|
+
npm run db:migrate # Create migration
|
|
333
|
+
npm run db:studio # Open Prisma Studio
|
|
334
|
+
|
|
335
|
+
# Testing
|
|
336
|
+
npm test
|
|
337
|
+
npm run test:watch
|
|
338
|
+
npm run test:coverage
|
|
339
|
+
|
|
340
|
+
# Production
|
|
341
|
+
npm run build
|
|
342
|
+
npm start
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Frontend-Only
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
cd generated/code
|
|
349
|
+
|
|
350
|
+
# Development
|
|
351
|
+
npm run dev
|
|
352
|
+
|
|
353
|
+
# Production build
|
|
354
|
+
npm run build
|
|
355
|
+
npm run preview # Preview production build
|
|
356
|
+
|
|
357
|
+
# Testing
|
|
358
|
+
npm run lint
|
|
359
|
+
npm run lint:fix
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## Environment Variables
|
|
363
|
+
|
|
364
|
+
### Default (Fullstack)
|
|
365
|
+
|
|
366
|
+
**Backend** (`backend/.env`):
|
|
367
|
+
```env
|
|
368
|
+
DATABASE_URL=postgresql://user:password@localhost:5432/myapp
|
|
369
|
+
API_PORT=3000
|
|
370
|
+
API_HOST=localhost
|
|
371
|
+
CORS_ORIGINS=http://localhost:5173
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
**Frontend** (`frontend/.env`):
|
|
375
|
+
```env
|
|
376
|
+
VITE_API_BASE_URL=http://localhost:3000
|
|
377
|
+
VITE_API_PREFIX=/api
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### Backend-Only
|
|
381
|
+
|
|
382
|
+
```env
|
|
383
|
+
DATABASE_URL=postgresql://user:password@localhost:5432/myapi
|
|
384
|
+
API_PORT=3000
|
|
385
|
+
API_HOST=0.0.0.0
|
|
386
|
+
CORS_ORIGINS=*
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Frontend-Only
|
|
390
|
+
|
|
391
|
+
```env
|
|
392
|
+
VITE_API_BASE_URL=https://api.example.com
|
|
393
|
+
VITE_API_PREFIX=/api
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
## Creating Custom Templates
|
|
397
|
+
|
|
398
|
+
To create your own template:
|
|
399
|
+
|
|
400
|
+
1. **Create directory structure**:
|
|
401
|
+
```bash
|
|
402
|
+
mkdir templates/my-template
|
|
403
|
+
mkdir templates/my-template/specs
|
|
404
|
+
mkdir templates/my-template/manifests
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
2. **Add specification** (`specs/main.specly`):
|
|
408
|
+
```yaml
|
|
409
|
+
components:
|
|
410
|
+
{{componentName}}:
|
|
411
|
+
version: "1.0.0"
|
|
412
|
+
models:
|
|
413
|
+
# Your models here
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
3. **Add manifest** (`manifests/implementation.yaml`):
|
|
417
|
+
```yaml
|
|
418
|
+
manifests:
|
|
419
|
+
{{projectNameKebab}}Implementation:
|
|
420
|
+
specVersion: "3.3.0"
|
|
421
|
+
configuration:
|
|
422
|
+
outputStructure: "standalone" # or "monorepo"
|
|
423
|
+
capabilityMappings:
|
|
424
|
+
# Your instance factory mappings
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
4. **Add documentation** (`README.md`, `CLAUDE.md`)
|
|
428
|
+
|
|
429
|
+
5. **Use your template**:
|
|
430
|
+
```bash
|
|
431
|
+
specverse init MyProject --template my-template
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## Troubleshooting
|
|
435
|
+
|
|
436
|
+
### Port Conflicts
|
|
437
|
+
|
|
438
|
+
**Backend port already in use**:
|
|
439
|
+
```bash
|
|
440
|
+
# Find process using port
|
|
441
|
+
lsof -i :3000
|
|
442
|
+
|
|
443
|
+
# Kill process
|
|
444
|
+
kill -9 <PID>
|
|
445
|
+
|
|
446
|
+
# Or change port in .env
|
|
447
|
+
API_PORT=3001
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**Frontend port already in use**:
|
|
451
|
+
```bash
|
|
452
|
+
# Vite will auto-increment to next available port (5174, 5175, etc.)
|
|
453
|
+
# Or specify in vite.config.ts
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### Database Connection Issues
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
# Check PostgreSQL is running
|
|
460
|
+
psql -U postgres
|
|
461
|
+
|
|
462
|
+
# Reset database
|
|
463
|
+
npm run db:push -- --force-reset
|
|
464
|
+
|
|
465
|
+
# View database
|
|
466
|
+
npm run db:studio
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### Module Resolution Issues
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
# Clear node_modules and reinstall
|
|
473
|
+
rm -rf node_modules package-lock.json
|
|
474
|
+
npm install
|
|
475
|
+
|
|
476
|
+
# For monorepo, also clear workspace caches
|
|
477
|
+
rm -rf backend/node_modules frontend/node_modules
|
|
478
|
+
npm install
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### TypeScript Errors
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# Regenerate types from Prisma schema
|
|
485
|
+
npm run db:generate
|
|
486
|
+
|
|
487
|
+
# Check TypeScript config
|
|
488
|
+
npm run typecheck
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
## Best Practices
|
|
492
|
+
|
|
493
|
+
### 1. Use Template Variables
|
|
494
|
+
|
|
495
|
+
Template placeholders are automatically replaced during `specverse init`:
|
|
496
|
+
- `{{componentName}}` → Component name (PascalCase)
|
|
497
|
+
- `{{projectName}}` → Project name (as provided)
|
|
498
|
+
- `{{projectNameKebab}}` → Project name (kebab-case)
|
|
499
|
+
|
|
500
|
+
### 2. Keep Specs Clean
|
|
501
|
+
|
|
502
|
+
Only define what's necessary in specs. The AI inference engine will generate:
|
|
503
|
+
- Controllers for models with API exposure
|
|
504
|
+
- Services with business logic
|
|
505
|
+
- Views for UI components
|
|
506
|
+
- CURED operations automatically
|
|
507
|
+
|
|
508
|
+
### 3. Use Environment Variables
|
|
509
|
+
|
|
510
|
+
Never hardcode:
|
|
511
|
+
- Database URLs
|
|
512
|
+
- API endpoints
|
|
513
|
+
- CORS origins
|
|
514
|
+
- Port numbers
|
|
515
|
+
|
|
516
|
+
Always use `.env` files with `.env.example` as template.
|
|
517
|
+
|
|
518
|
+
### 4. Follow Workspace Patterns
|
|
519
|
+
|
|
520
|
+
**Monorepo** (default template):
|
|
521
|
+
- Use workspace scripts: `npm run dev:backend`, `npm run dev:frontend`
|
|
522
|
+
- Shared dependencies at root level
|
|
523
|
+
- Independent configs per workspace
|
|
524
|
+
|
|
525
|
+
**Standalone** (backend-only, frontend-only):
|
|
526
|
+
- All dependencies in single package.json
|
|
527
|
+
- Simpler deployment
|
|
528
|
+
- Better for microservices/JAMstack
|
|
529
|
+
|
|
530
|
+
### 5. Regeneration Workflow
|
|
531
|
+
|
|
532
|
+
When updating specs:
|
|
533
|
+
```bash
|
|
534
|
+
# 1. Modify specs/main.specly
|
|
535
|
+
vim specs/main.specly
|
|
536
|
+
|
|
537
|
+
# 2. Regenerate code
|
|
538
|
+
npm run realize:all
|
|
539
|
+
|
|
540
|
+
# 3. Update database if models changed
|
|
541
|
+
cd generated/code
|
|
542
|
+
npm run db:generate
|
|
543
|
+
npm run db:push
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
---
|
|
547
|
+
|
|
548
|
+
## Additional Resources
|
|
549
|
+
|
|
550
|
+
- **SpecVerse Documentation**: https://docs.specverse.dev
|
|
551
|
+
- **Language Reference**: See `/Volumes/Dev24/GitHub/SpecVerse/specverse-lang/CLAUDE.md`
|
|
552
|
+
- **Instance Factories**: See `libs/instance-factories/` for available technologies
|
|
553
|
+
- **Examples**: See `examples/` for more complex specifications
|
|
554
|
+
|
|
555
|
+
## Support
|
|
556
|
+
|
|
557
|
+
- **Issues**: https://github.com/SpecVerse/specverse-lang/issues
|
|
558
|
+
- **Discussions**: https://github.com/SpecVerse/specverse-lang/discussions
|
|
559
|
+
- **Discord**: https://discord.gg/specverse
|