create-auto-app 0.2.3 → 0.8.4
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/README.md +197 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/templates/.gitkeep +0 -0
- package/templates/shopping-app/.context/schema.json +389 -218
- package/templates/shopping-app/.context/server/.context/auto-ia-scheme.json +79 -0
- package/templates/shopping-app/.context/server/server/package.json +26 -0
- package/templates/shopping-app/.context/server/server/scripts/generate-schema.ts +34 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/commands.ts +8 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/decide.specs.ts +46 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/decide.ts +33 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/events.ts +10 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/evolve.ts +28 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/handle.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/mutation.resolver.ts +25 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/register.ts +7 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/state.ts +47 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/react.specs.ts +51 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/react.ts +43 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/register.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/react.specs.ts +51 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/react.ts +43 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/register.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/commands.ts +8 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/decide.specs.ts +38 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/decide.ts +33 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/events.ts +10 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/evolve.ts +28 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/handle.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/mutation.resolver.ts +25 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/register.ts +7 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/state.ts +47 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/commands.ts +8 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/decide.specs.ts +101 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/decide.ts +42 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/events.ts +9 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/evolve.ts +28 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/handle.ts +52 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/mutation.resolver.ts +25 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/register.ts +7 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/state.ts +47 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/commands.ts +8 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.specs.ts +101 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.ts +43 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/events.ts +9 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/evolve.ts +28 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/handle.ts +52 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/mutation.resolver.ts +25 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/register.ts +7 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/state.ts +47 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.specs.ts +56 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.ts +24 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/query.resolver.ts +56 -0
- package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/state.ts +4 -0
- package/templates/shopping-app/.context/server/server/src/domain/shared/ReadModel.ts +26 -0
- package/templates/shopping-app/{server/src/domain/shared/index.d.ts → .context/server/server/src/domain/shared/index.ts} +0 -1
- package/templates/shopping-app/{server/src/domain/shared/reactorSpecification.js → .context/server/server/src/domain/shared/reactorSpecification.ts} +116 -22
- package/templates/shopping-app/.context/server/server/src/domain/shared/sendCommand.ts +21 -0
- package/templates/shopping-app/{server/src/domain/shared/types.d.ts → .context/server/server/src/domain/shared/types.ts} +17 -5
- package/templates/shopping-app/.context/server/server/src/server.ts +43 -0
- package/templates/shopping-app/{server/src/utils/index.d.ts → .context/server/server/src/utils/index.ts} +0 -1
- package/templates/shopping-app/{server/src/utils/loadProjections.js → .context/server/server/src/utils/loadProjections.ts} +11 -6
- package/templates/shopping-app/.context/server/server/src/utils/loadRegisterFiles.ts +41 -0
- package/templates/shopping-app/{server/src/utils/loadResolvers.js → .context/server/server/src/utils/loadResolvers.ts} +16 -7
- package/templates/shopping-app/.context/server/server/tsconfig.json +13 -0
- package/templates/shopping-app/.context/server/server/vitest.config.ts +7 -0
- package/templates/shopping-app/auto.config.ts +78 -45
- package/templates/shopping-app/client/package.json +4 -4
- package/templates/shopping-app/client/src/App.tsx +13 -13
- package/templates/shopping-app/client/src/components/molecules/QuantitySelector.tsx +4 -4
- package/templates/shopping-app/client/src/components/molecules/ShoppingCriteriaForm.tsx +4 -4
- package/templates/shopping-app/client/src/components/molecules/SuggestedItemCard.tsx +6 -6
- package/templates/shopping-app/client/src/components/organisms/AssistantChatInterface.tsx +3 -3
- package/templates/shopping-app/client/src/components/organisms/PageHeader.tsx +2 -3
- package/templates/shopping-app/client/src/components/organisms/SuggestedItemsList.tsx +3 -3
- package/templates/shopping-app/client/src/index.css +10 -14
- package/templates/shopping-app/client/src/pages/AssistantChatPage.tsx +4 -4
- package/templates/shopping-app/client/src/pages/SuggestedItemsPage.tsx +4 -4
- package/templates/shopping-app/example-integrations/ai-chat-completion/package.json +5 -6
- package/templates/shopping-app/example-integrations/ai-chat-completion/src/ai-integration.ts +2 -2
- package/templates/shopping-app/example-integrations/cart/package.json +5 -6
- package/templates/shopping-app/example-integrations/cart-api/package.json +3 -3
- package/templates/shopping-app/example-integrations/product-catalogue/package.json +5 -5
- package/templates/shopping-app/example-integrations/product-catalogue/src/product-catalogue-integration.ts +3 -128
- package/templates/shopping-app/example-integrations/product-catalogue-api/package.json +3 -3
- package/templates/shopping-app/flows/shopping-assistant.flow.ts +195 -196
- package/templates/shopping-app/package.json +16 -11
- package/templates/shopping-app/server/package.json +4 -4
- package/templates/shopping-app/server/src/integrations/ai-integration.ts +2 -2
- package/templates/shopping-app/tsconfig.json +2 -2
- package/templates/shopping-app/.env +0 -8
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-format.log +0 -12
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-lint.log +0 -4
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-test.log +0 -12
- package/templates/shopping-app/example-integrations/ai-chat-completion/.turbo/turbo-type-check.log +0 -5
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.d.ts +0 -23
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.js +0 -41
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/ai-integration.js.map +0 -1
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.js +0 -2
- package/templates/shopping-app/example-integrations/ai-chat-completion/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/eslint +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/jiti +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/msw +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/vite +0 -21
- package/templates/shopping-app/example-integrations/ai-chat-completion/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-format.log +0 -12
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-lint.log +0 -5
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-test.log +0 -12
- package/templates/shopping-app/example-integrations/cart/.turbo/turbo-type-check.log +0 -5
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.d.ts +0 -30
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.js +0 -134
- package/templates/shopping-app/example-integrations/cart/dist/cart-integration.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.d.ts +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.js +0 -149
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/client.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.d.ts +0 -8
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.js +0 -6
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.d.ts +0 -123
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.d.ts +0 -46
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.js +0 -285
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client/utils.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.d.ts +0 -13
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.js +0 -6
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/client.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.d.ts +0 -19
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.js +0 -15
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/auth.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.d.ts +0 -18
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.js +0 -58
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/bodySerializer.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.d.ts +0 -34
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.js +0 -89
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/params.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.d.ts +0 -34
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.js +0 -115
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/pathSerializer.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.d.ts +0 -79
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/core/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.js +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.d.ts +0 -158
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.d.ts +0 -382
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.js +0 -68
- package/templates/shopping-app/example-integrations/cart/dist/generated/cart/zod.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/cart/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart/dist/index.js +0 -2
- package/templates/shopping-app/example-integrations/cart/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/eslint +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/jiti +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/msw +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/cart/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-format.log +0 -10
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-lint.log +0 -4
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-test.log +0 -12
- package/templates/shopping-app/example-integrations/cart-api/.turbo/turbo-type-check.log +0 -4
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.d.ts +0 -18
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.js +0 -28
- package/templates/shopping-app/example-integrations/cart-api/dist/data/cart.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/index.d.ts +0 -4
- package/templates/shopping-app/example-integrations/cart-api/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/index.js +0 -49
- package/templates/shopping-app/example-integrations/cart-api/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.d.ts +0 -4
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.js +0 -261
- package/templates/shopping-app/example-integrations/cart-api/dist/routes/cart.js.map +0 -1
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/nodemon +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/swagger-jsdoc +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-cwd +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-esm +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-script +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-node-transpile-only +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/ts-script +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/tsx +0 -21
- package/templates/shopping-app/example-integrations/cart-api/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-format.log +0 -12
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-lint.log +0 -5
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-test.log +0 -12
- package/templates/shopping-app/example-integrations/product-catalogue/.turbo/turbo-type-check.log +0 -5
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.d.ts +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.js +0 -149
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/client.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.d.ts +0 -8
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.js +0 -6
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.d.ts +0 -123
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.d.ts +0 -46
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.js +0 -285
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client/utils.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.d.ts +0 -13
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.js +0 -6
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/client.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.d.ts +0 -19
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.js +0 -15
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/auth.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.d.ts +0 -18
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.js +0 -58
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/bodySerializer.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.d.ts +0 -34
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.js +0 -89
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/params.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.d.ts +0 -34
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.js +0 -115
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/pathSerializer.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.d.ts +0 -79
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/core/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.js +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.d.ts +0 -115
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.js +0 -3
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/types.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.d.ts +0 -206
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.js +0 -53
- package/templates/shopping-app/example-integrations/product-catalogue/dist/generated/product-catalog/zod.gen.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.d.ts +0 -2
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.js +0 -2
- package/templates/shopping-app/example-integrations/product-catalogue/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.d.ts +0 -32
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.js +0 -163
- package/templates/shopping-app/example-integrations/product-catalogue/dist/product-catalogue-integration.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/eslint +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/jiti +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/msw +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-build.log +0 -4
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-format.log +0 -10
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-lint.log +0 -5
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-test.log +0 -13
- package/templates/shopping-app/example-integrations/product-catalogue-api/.turbo/turbo-type-check.log +0 -5
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.d.ts +0 -10
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.js +0 -75
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/data/products.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.d.ts +0 -4
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.js +0 -49
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/index.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.d.ts +0 -4
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.d.ts.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.js +0 -170
- package/templates/shopping-app/example-integrations/product-catalogue-api/dist/routes/products.js.map +0 -1
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/nodemon +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/swagger-jsdoc +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-cwd +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-esm +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-script +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-node-transpile-only +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/ts-script +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsc +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsserver +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/tsx +0 -21
- package/templates/shopping-app/example-integrations/product-catalogue-api/node_modules/.bin/vitest +0 -21
- package/templates/shopping-app/pnpm-workspace.yaml +0 -2
- package/templates/shopping-app/server/src/domain/shared/ReadModel.d.ts +0 -10
- package/templates/shopping-app/server/src/domain/shared/ReadModel.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/ReadModel.js +0 -19
- package/templates/shopping-app/server/src/domain/shared/ReadModel.js.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/index.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/index.js +0 -5
- package/templates/shopping-app/server/src/domain/shared/index.js.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.d.ts +0 -56
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.js.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/sendCommand.d.ts +0 -7
- package/templates/shopping-app/server/src/domain/shared/sendCommand.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/sendCommand.js +0 -16
- package/templates/shopping-app/server/src/domain/shared/sendCommand.js.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/types.d.ts.map +0 -1
- package/templates/shopping-app/server/src/domain/shared/types.js +0 -40
- package/templates/shopping-app/server/src/domain/shared/types.js.map +0 -1
- package/templates/shopping-app/server/src/utils/index.d.ts.map +0 -1
- package/templates/shopping-app/server/src/utils/index.js +0 -4
- package/templates/shopping-app/server/src/utils/index.js.map +0 -1
- package/templates/shopping-app/server/src/utils/loadProjections.d.ts +0 -3
- package/templates/shopping-app/server/src/utils/loadProjections.d.ts.map +0 -1
- package/templates/shopping-app/server/src/utils/loadProjections.js.map +0 -1
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.d.ts +0 -6
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.d.ts.map +0 -1
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.js +0 -26
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.js.map +0 -1
- package/templates/shopping-app/server/src/utils/loadResolvers.d.ts +0 -5
- package/templates/shopping-app/server/src/utils/loadResolvers.d.ts.map +0 -1
- package/templates/shopping-app/server/src/utils/loadResolvers.js.map +0 -1
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { CommandSender, InMemoryEventStore } from '@event-driven-io/emmett';
|
|
2
|
+
import { Field, ObjectType } from 'type-graphql';
|
|
3
|
+
|
|
2
4
|
export interface ReactorContext {
|
|
3
5
|
eventStore: InMemoryEventStore;
|
|
4
6
|
commandSender: CommandSender;
|
|
5
7
|
[key: string]: unknown;
|
|
6
8
|
}
|
|
9
|
+
|
|
7
10
|
export interface GraphQLContext {
|
|
8
11
|
eventStore: InMemoryEventStore;
|
|
9
12
|
messageBus: CommandSender;
|
|
10
13
|
}
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
|
|
15
|
+
@ObjectType()
|
|
16
|
+
export class MutationError {
|
|
17
|
+
@Field(() => String)
|
|
18
|
+
type!: string;
|
|
19
|
+
|
|
20
|
+
@Field(() => String, { nullable: true })
|
|
13
21
|
message?: string;
|
|
14
22
|
}
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
|
|
24
|
+
@ObjectType()
|
|
25
|
+
export class MutationResponse {
|
|
26
|
+
@Field(() => Boolean)
|
|
27
|
+
success!: boolean;
|
|
28
|
+
|
|
29
|
+
@Field(() => MutationError, { nullable: true })
|
|
17
30
|
error?: MutationError;
|
|
18
31
|
}
|
|
19
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { ApolloServer } from 'apollo-server';
|
|
3
|
+
import { buildSchema } from 'type-graphql';
|
|
4
|
+
import { loadProjections, loadRegisterFiles, loadResolvers } from './utils';
|
|
5
|
+
import {
|
|
6
|
+
getInMemoryEventStore,
|
|
7
|
+
getInMemoryMessageBus,
|
|
8
|
+
projections,
|
|
9
|
+
forwardToMessageBus,
|
|
10
|
+
} from '@event-driven-io/emmett';
|
|
11
|
+
|
|
12
|
+
async function start() {
|
|
13
|
+
const loadedProjections = await loadProjections('src/domain/flows/**/projection.{ts,js}');
|
|
14
|
+
const registrations = await loadRegisterFiles('src/domain/flows/**/register.{ts,js}');
|
|
15
|
+
|
|
16
|
+
const messageBus = getInMemoryMessageBus();
|
|
17
|
+
|
|
18
|
+
const eventStore = getInMemoryEventStore({
|
|
19
|
+
projections: projections.inline(loadedProjections),
|
|
20
|
+
hooks: {
|
|
21
|
+
onAfterCommit: forwardToMessageBus(messageBus),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
await Promise.all(registrations.map((r) => r.register(messageBus, eventStore)));
|
|
26
|
+
|
|
27
|
+
const resolvers = await loadResolvers('src/domain/flows/**/*.resolver.{ts,js}');
|
|
28
|
+
const schema = await buildSchema({
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
resolvers: resolvers as unknown as [(...args: any[]) => any, ...Array<(...args: any[]) => any>],
|
|
31
|
+
});
|
|
32
|
+
const server = new ApolloServer({
|
|
33
|
+
schema,
|
|
34
|
+
context: () => ({
|
|
35
|
+
eventStore,
|
|
36
|
+
messageBus,
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
const { url } = await server.listen({ port: 4000 });
|
|
40
|
+
console.log(`🚀 GraphQL server ready at ${url}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
void start();
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import fg from 'fast-glob';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
|
|
3
|
+
import type { ProjectionDefinition } from '@event-driven-io/emmett';
|
|
4
|
+
|
|
5
|
+
export async function loadProjections(source: string): Promise<ProjectionDefinition[]> {
|
|
4
6
|
const files = await fg(source, { absolute: true });
|
|
7
|
+
|
|
5
8
|
const modules = await Promise.all(
|
|
6
9
|
files.map(async (file) => {
|
|
7
|
-
const mod = await import(pathToFileUrl(file).href);
|
|
10
|
+
const mod: unknown = await import(pathToFileUrl(file).href);
|
|
11
|
+
|
|
8
12
|
if (typeof mod === 'object' && mod !== null && 'projection' in mod) {
|
|
9
|
-
const projectionModule = mod;
|
|
13
|
+
const projectionModule = mod as { projection?: ProjectionDefinition };
|
|
10
14
|
if (projectionModule.projection == null) {
|
|
11
15
|
console.warn(`⚠️ Projection file "${file}" does not export "projection"`);
|
|
12
16
|
}
|
|
@@ -16,10 +20,11 @@ export async function loadProjections(source) {
|
|
|
16
20
|
return undefined;
|
|
17
21
|
}),
|
|
18
22
|
);
|
|
19
|
-
|
|
23
|
+
|
|
24
|
+
return modules.filter((p): p is ProjectionDefinition => p != null);
|
|
20
25
|
}
|
|
21
|
-
|
|
26
|
+
|
|
27
|
+
function pathToFileUrl(filePath: string): URL {
|
|
22
28
|
const resolved = path.resolve(filePath);
|
|
23
29
|
return new URL(`file://${resolved}`);
|
|
24
30
|
}
|
|
25
|
-
//# sourceMappingURL=loadProjections.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import fg from 'fast-glob';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import type { CommandProcessor, EventStore } from '@event-driven-io/emmett';
|
|
4
|
+
|
|
5
|
+
export interface SliceRegistration {
|
|
6
|
+
register: (messageBus: CommandProcessor, eventStore: EventStore) => Promise<unknown> | void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function loadRegisterFiles(source: string): Promise<SliceRegistration[]> {
|
|
10
|
+
const files = await fg(source, { absolute: true });
|
|
11
|
+
|
|
12
|
+
const modules = await Promise.all(
|
|
13
|
+
files.map(async (file) => {
|
|
14
|
+
try {
|
|
15
|
+
const mod: unknown = await import(pathToFileUrl(file).href);
|
|
16
|
+
|
|
17
|
+
if (
|
|
18
|
+
typeof mod === 'object' &&
|
|
19
|
+
mod !== null &&
|
|
20
|
+
'register' in mod &&
|
|
21
|
+
typeof (mod as SliceRegistration).register === 'function'
|
|
22
|
+
) {
|
|
23
|
+
return mod as SliceRegistration;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
console.warn('⚠️ Skipping invalid register.ts at', file);
|
|
27
|
+
return null;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error('❌ Failed to import', file, ':', error);
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return modules.filter((m): m is SliceRegistration => m !== null);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function pathToFileUrl(filePath: string): URL {
|
|
39
|
+
const resolved = path.resolve(filePath);
|
|
40
|
+
return new URL(`file://${resolved}`);
|
|
41
|
+
}
|
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
import fg from 'fast-glob';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
export interface Resolver {
|
|
4
|
+
(...args: unknown[]): unknown;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export async function loadResolvers(source: string): Promise<Resolver[]> {
|
|
3
8
|
const files = await fg(source, {
|
|
4
9
|
absolute: true,
|
|
5
10
|
});
|
|
6
|
-
const modules = await Promise.all(files.map((file) => import(file)));
|
|
7
|
-
const allResolvers = [];
|
|
11
|
+
const modules: unknown[] = await Promise.all(files.map((file) => import(file)));
|
|
12
|
+
const allResolvers: Resolver[] = [];
|
|
13
|
+
|
|
8
14
|
for (const mod of modules) {
|
|
9
15
|
if (typeof mod !== 'object' || mod === null) {
|
|
10
16
|
continue;
|
|
11
17
|
}
|
|
18
|
+
|
|
12
19
|
for (const key of Object.keys(mod)) {
|
|
13
|
-
const exported = mod[key];
|
|
20
|
+
const exported = (mod as Record<string, unknown>)[key];
|
|
21
|
+
|
|
14
22
|
if (typeof exported === 'function') {
|
|
15
|
-
allResolvers.push(exported);
|
|
23
|
+
allResolvers.push(exported as Resolver);
|
|
16
24
|
}
|
|
25
|
+
|
|
17
26
|
if (Array.isArray(exported) && exported.every((r) => typeof r === 'function')) {
|
|
18
|
-
allResolvers.push(...exported);
|
|
27
|
+
allResolvers.push(...(exported as Resolver[]));
|
|
19
28
|
}
|
|
20
29
|
}
|
|
21
30
|
}
|
|
31
|
+
|
|
22
32
|
if (allResolvers.length === 0) {
|
|
23
33
|
throw new Error('❌ No resolvers found for any slices.');
|
|
24
34
|
}
|
|
25
35
|
return allResolvers;
|
|
26
36
|
}
|
|
27
|
-
//# sourceMappingURL=loadResolvers.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"emitDecoratorMetadata": true,
|
|
9
|
+
"experimentalDecorators": true
|
|
10
|
+
},
|
|
11
|
+
"include": ["src/**/*", "vitest.config.ts"],
|
|
12
|
+
"exclude": ["dist", "node_modules"]
|
|
13
|
+
}
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
import { on, dispatch, fold } from '@auto-engineer/cli';
|
|
2
2
|
import type { Command, Event } from '@auto-engineer/message-bus';
|
|
3
3
|
import { type ExportSchemaCommand, type SchemaExportedEvent, type SchemaExportFailedEvent } from '@auto-engineer/flow';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import {
|
|
5
|
+
type GenerateServerCommand,
|
|
6
|
+
type ServerGeneratedEvent,
|
|
7
|
+
type ServerGenerationFailedEvent,
|
|
8
|
+
} from '@auto-engineer/server-generator-apollo-emmett';
|
|
9
|
+
import {
|
|
10
|
+
type ImplementServerCommand,
|
|
11
|
+
type ServerImplementedEvent,
|
|
12
|
+
type ServerImplementationFailedEvent,
|
|
13
|
+
} from '@auto-engineer/server-implementer';
|
|
14
|
+
import {
|
|
15
|
+
type CheckTypesCommand,
|
|
16
|
+
type TypeCheckPassedEvent,
|
|
17
|
+
type TypeCheckFailedEvent,
|
|
18
|
+
CheckTestsCommand,
|
|
19
|
+
CheckLintCommand,
|
|
20
|
+
} from '@auto-engineer/server-checks';
|
|
7
21
|
import { CheckClientCommand } from '@auto-engineer/frontend-checks';
|
|
8
|
-
import {
|
|
9
|
-
|
|
22
|
+
import {
|
|
23
|
+
type GenerateIACommand,
|
|
24
|
+
type IAGeneratedEvent,
|
|
25
|
+
type IAGenerationFailedEvent,
|
|
26
|
+
} from '@auto-engineer/information-architect';
|
|
27
|
+
import {
|
|
28
|
+
type ImplementClientCommand,
|
|
29
|
+
type ClientImplementedEvent,
|
|
30
|
+
type ClientImplementationFailedEvent,
|
|
31
|
+
} from '@auto-engineer/frontend-implementer';
|
|
10
32
|
|
|
11
33
|
// Plugin configuration
|
|
12
34
|
export default {
|
|
@@ -52,57 +74,68 @@ const pipelineStatus = fold<string, Event>(
|
|
|
52
74
|
default:
|
|
53
75
|
return state;
|
|
54
76
|
}
|
|
55
|
-
}
|
|
77
|
+
},
|
|
56
78
|
);
|
|
57
79
|
|
|
58
80
|
// State: Track last error
|
|
59
|
-
const lastError = fold<any, Event>(
|
|
60
|
-
'
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
timestamp: new Date().toISOString(),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
return state;
|
|
81
|
+
const lastError = fold<any, Event>('*', (state = null, event) => {
|
|
82
|
+
if (event.type.endsWith('Failed') || event.type.endsWith('Error')) {
|
|
83
|
+
return {
|
|
84
|
+
type: event.type,
|
|
85
|
+
data: event.data,
|
|
86
|
+
timestamp: new Date().toISOString(),
|
|
87
|
+
};
|
|
70
88
|
}
|
|
71
|
-
|
|
89
|
+
return state;
|
|
90
|
+
});
|
|
72
91
|
|
|
73
92
|
// State: Track completed operations
|
|
74
|
-
const completedOperations = fold<string[], Event>(
|
|
75
|
-
'
|
|
76
|
-
|
|
77
|
-
if (event.type.endsWith('Passed') || event.type.endsWith('Generated') || event.type.endsWith('Implemented')) {
|
|
78
|
-
return [...state, event.type];
|
|
79
|
-
}
|
|
80
|
-
return state;
|
|
93
|
+
const completedOperations = fold<string[], Event>('*', (state = [], event) => {
|
|
94
|
+
if (event.type.endsWith('Passed') || event.type.endsWith('Generated') || event.type.endsWith('Implemented')) {
|
|
95
|
+
return [...state, event.type];
|
|
81
96
|
}
|
|
82
|
-
|
|
97
|
+
return state;
|
|
98
|
+
});
|
|
83
99
|
|
|
84
|
-
on<SchemaExportedEvent>('SchemaExported', (event) =>
|
|
85
|
-
{
|
|
86
|
-
|
|
100
|
+
on<SchemaExportedEvent>('SchemaExported', (event) =>
|
|
101
|
+
dispatch<GenerateServerCommand>({
|
|
102
|
+
type: 'GenerateServer',
|
|
103
|
+
data: { schemaPath: event.data.outputPath, destination: event.data.outputPath.replace('/schema.json', '/server') },
|
|
104
|
+
}),
|
|
105
|
+
);
|
|
87
106
|
|
|
88
|
-
on<ServerGeneratedEvent>('ServerGenerated', (event) =>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
107
|
+
on<ServerGeneratedEvent>('ServerGenerated', (event) =>
|
|
108
|
+
dispatch.parallel<ImplementServerCommand | GenerateIACommand>([
|
|
109
|
+
{ type: 'ImplementServer', data: { serverDirectory: event.data.serverDir } },
|
|
110
|
+
{
|
|
111
|
+
type: 'GenerateIA',
|
|
112
|
+
data: { outputDir: event.data.destination + '/.context', flowFiles: [event.data.schemaPath] },
|
|
113
|
+
},
|
|
114
|
+
]),
|
|
115
|
+
);
|
|
92
116
|
|
|
93
|
-
on<ServerImplementedEvent>('ServerImplemented', (event) =>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
117
|
+
// on<ServerImplementedEvent>('ServerImplemented', (event) =>
|
|
118
|
+
// dispatch.parallel<CheckTypesCommand | CheckTestsCommand | CheckLintCommand>([
|
|
119
|
+
// { type: 'CheckTypes', data: { targetDirectory: event.data.serverDirectory, scope: 'project' } },
|
|
120
|
+
// { type: 'CheckTests', data: { targetDirectory: event.data.serverDirectory, scope: 'project' } },
|
|
121
|
+
// { type: 'CheckLint', data: { targetDirectory: event.data.serverDirectory, scope: 'project' } },
|
|
122
|
+
// ]),
|
|
123
|
+
// );
|
|
98
124
|
|
|
99
|
-
on<IAGeneratedEvent>('IAGenerated', (event) =>
|
|
100
|
-
|
|
101
|
-
|
|
125
|
+
// on<IAGeneratedEvent>('IAGenerated', (event) =>
|
|
126
|
+
// dispatch<ImplementClientCommand>({
|
|
127
|
+
// type: 'ImplementClient',
|
|
128
|
+
// data: {
|
|
129
|
+
// projectDir: event.data.outputDir.replace('/.context', '/client'),
|
|
130
|
+
// iaSchemeDir: event.data.outputDir,
|
|
131
|
+
// designSystemPath: './.context/design-system.md',
|
|
132
|
+
// },
|
|
133
|
+
// }),
|
|
134
|
+
// );
|
|
102
135
|
|
|
103
|
-
on<ClientImplementedEvent>('ClientImplemented', (event) =>
|
|
104
|
-
|
|
105
|
-
)
|
|
136
|
+
// on<ClientImplementedEvent>('ClientImplemented', (event) =>
|
|
137
|
+
// dispatch<CheckClientCommand>({ type: 'CheckClient', data: { clientDirectory: './client', skipBrowserChecks: true } }),
|
|
138
|
+
// );
|
|
106
139
|
|
|
107
140
|
// on<ClientImplementationFailedEvent>('ClientImplementationFailed', (event) =>
|
|
108
141
|
// dispatch<ImplementClientCommand>({
|
|
@@ -143,4 +176,4 @@ on<ClientImplementedEvent>('ClientImplemented', (event) => dispatch<CheckClientC
|
|
|
143
176
|
// // Reset retry count on success
|
|
144
177
|
// on<TypeCheckPassedEvent>('TypeCheckPassed', () => {
|
|
145
178
|
// retryCount = 0;
|
|
146
|
-
// });
|
|
179
|
+
// });
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"lint": "eslint .",
|
|
12
12
|
"preview": "vite preview",
|
|
13
13
|
"codegen": "graphql-codegen --config codegen.ts",
|
|
14
|
-
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../../.prettierignore",
|
|
14
|
+
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../../.prettierignore --log-level warn",
|
|
15
15
|
"type:check": "tsc --noEmit",
|
|
16
16
|
"type-check": "tsc --noEmit",
|
|
17
17
|
"lint:fix": "eslint .",
|
|
18
|
-
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../../.prettierignore",
|
|
18
|
+
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../../.prettierignore --log-level warn",
|
|
19
19
|
"auto-configure": "tsx auto-configure.ts"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@apollo/client": "^3.13.8",
|
|
23
|
-
"@auto-engineer/ai-gateway": "
|
|
24
|
-
"@auto-engineer/frontend-generator-react-graphql": "
|
|
23
|
+
"@auto-engineer/ai-gateway": "workspace:*",
|
|
24
|
+
"@auto-engineer/frontend-generator-react-graphql": "workspace:*",
|
|
25
25
|
"@hookform/resolvers": "^3.10.0",
|
|
26
26
|
"@radix-ui/react-accordion": "^1.2.11",
|
|
27
27
|
"@radix-ui/react-alert-dialog": "^1.1.14",
|
|
@@ -3,18 +3,18 @@ import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
|
|
3
3
|
import { apolloClient } from '@/apolloClient';
|
|
4
4
|
import { Index } from '@/pages/Index';
|
|
5
5
|
import { NotFound } from '@/pages/NotFound';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { AssistantChatPage } from '@/pages/AssistantChatPage';
|
|
7
|
+
import { SuggestedItemsPage } from '@/pages/SuggestedItemsPage';
|
|
8
8
|
|
|
9
9
|
export const App = () => (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
);
|
|
10
|
+
<ApolloProvider client={apolloClient}>
|
|
11
|
+
<BrowserRouter>
|
|
12
|
+
<Routes>
|
|
13
|
+
<Route path="/" element={<Index />} />
|
|
14
|
+
<Route path="/" element={<AssistantChatPage />} />
|
|
15
|
+
<Route path="/suggested-items/:sessionId" element={<SuggestedItemsPage />} />
|
|
16
|
+
<Route path="*" element={<NotFound />} />
|
|
17
|
+
</Routes>
|
|
18
|
+
</BrowserRouter>
|
|
19
|
+
</ApolloProvider>
|
|
20
|
+
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TextField } from '@/components/atoms/textfield';
|
|
2
|
+
import { IconButton } from '@/components/atoms/iconbutton';
|
|
3
3
|
|
|
4
4
|
// Component for adjusting item quantities
|
|
5
5
|
|
|
6
6
|
export function QuantitySelector() {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
return <div />;
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TextField } from '@/components/atoms/textfield';
|
|
2
|
+
import { Button } from '@/components/atoms/button';
|
|
3
3
|
|
|
4
4
|
// Form for entering shopping criteria with examples and submission
|
|
5
5
|
|
|
6
6
|
export function ShoppingCriteriaForm() {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
return <div />;
|
|
8
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Card } from '@/components/atoms/card';
|
|
2
|
+
import { CardHeader } from '@/components/atoms/cardheader';
|
|
3
|
+
import { TextField } from '@/components/atoms/textfield';
|
|
4
|
+
import { Button } from '@/components/atoms/button';
|
|
5
5
|
|
|
6
6
|
// Card displaying a suggested item with quantity selector and reason
|
|
7
7
|
|
|
8
8
|
export function SuggestedItemCard() {
|
|
9
|
-
|
|
10
|
-
}
|
|
9
|
+
return <div />;
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShoppingCriteriaForm } from
|
|
1
|
+
import { ShoppingCriteriaForm } from '@/components/molecules/ShoppingCriteriaForm';
|
|
2
2
|
|
|
3
3
|
// Main interface for entering shopping criteria and starting a session
|
|
4
4
|
// Specs:
|
|
@@ -10,5 +10,5 @@ import { ShoppingCriteriaForm } from "@/components/molecules/ShoppingCriteriaFor
|
|
|
10
10
|
// - show the header on top of the page
|
|
11
11
|
|
|
12
12
|
export function AssistantChatInterface() {
|
|
13
|
-
|
|
14
|
-
}
|
|
13
|
+
return <div />;
|
|
14
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SuggestedItemCard } from
|
|
1
|
+
import { SuggestedItemCard } from '@/components/molecules/SuggestedItemCard';
|
|
2
2
|
|
|
3
3
|
// Display suggested items with selection and cart functionality
|
|
4
4
|
// Specs:
|
|
@@ -11,5 +11,5 @@ import { SuggestedItemCard } from "@/components/molecules/SuggestedItemCard";
|
|
|
11
11
|
// - provide feedback when items are added
|
|
12
12
|
|
|
13
13
|
export function SuggestedItemsList() {
|
|
14
|
-
|
|
15
|
-
}
|
|
14
|
+
return <div />;
|
|
15
|
+
}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
@tailwind utilities;
|
|
4
4
|
|
|
5
5
|
@layer base {
|
|
6
|
-
:root {
|
|
7
|
-
|
|
6
|
+
:root {
|
|
8
7
|
--radius: 0.5rem;
|
|
9
8
|
|
|
10
9
|
--background: 0 0% 100%;
|
|
@@ -70,11 +69,9 @@
|
|
|
70
69
|
--sidebar-border: 240 6% 90%;
|
|
71
70
|
|
|
72
71
|
--sidebar-ring: 240 6% 10%;
|
|
72
|
+
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.dark {
|
|
77
|
-
|
|
74
|
+
.dark {
|
|
78
75
|
--background: 240 6% 10%;
|
|
79
76
|
|
|
80
77
|
--foreground: 0 0% 98%;
|
|
@@ -138,16 +135,15 @@
|
|
|
138
135
|
--sidebar-border: 240 5% 34%;
|
|
139
136
|
|
|
140
137
|
--sidebar-ring: 240 5% 84%;
|
|
141
|
-
|
|
142
|
-
}
|
|
138
|
+
}
|
|
143
139
|
}
|
|
144
140
|
|
|
145
141
|
@layer base {
|
|
146
|
-
* {
|
|
147
|
-
@apply border-border;
|
|
148
|
-
}
|
|
142
|
+
* {
|
|
143
|
+
@apply border-border;
|
|
144
|
+
}
|
|
149
145
|
|
|
150
|
-
body {
|
|
151
|
-
@apply bg-background text-foreground;
|
|
152
|
-
}
|
|
146
|
+
body {
|
|
147
|
+
@apply bg-background text-foreground;
|
|
148
|
+
}
|
|
153
149
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PageHeader } from
|
|
2
|
-
import { AssistantChatInterface } from
|
|
1
|
+
import { PageHeader } from '@/components/organisms/PageHeader';
|
|
2
|
+
import { AssistantChatInterface } from '@/components/organisms/AssistantChatInterface';
|
|
3
3
|
|
|
4
4
|
// Main page where users enter shopping criteria
|
|
5
5
|
|
|
6
6
|
export function AssistantChatPage() {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
return <div />;
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PageHeader } from
|
|
2
|
-
import { SuggestedItemsList } from
|
|
1
|
+
import { PageHeader } from '@/components/organisms/PageHeader';
|
|
2
|
+
import { SuggestedItemsList } from '@/components/organisms/SuggestedItemsList';
|
|
3
3
|
|
|
4
4
|
// Page displaying AI-suggested items for the shopping criteria
|
|
5
5
|
|
|
6
6
|
export function SuggestedItemsPage() {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
return <div />;
|
|
8
|
+
}
|
|
@@ -5,18 +5,17 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@auto-engineer/flow": "
|
|
9
|
-
"@auto-engineer/ai-gateway": "
|
|
8
|
+
"@auto-engineer/flow": "workspace:*",
|
|
9
|
+
"@auto-engineer/ai-gateway": "workspace:*"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
13
|
-
"
|
|
14
|
-
"test": "vitest run",
|
|
13
|
+
"test": "vitest run --reporter=dot",
|
|
15
14
|
"lint": "eslint 'src/**/*.ts' --max-warnings 0 --config ./eslint.config.ts",
|
|
16
15
|
"type-check": "tsc --noEmit",
|
|
17
|
-
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore",
|
|
16
|
+
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
18
17
|
"lint:fix": "eslint 'src/**/*.ts' --fix --config ./eslint.config.ts",
|
|
19
|
-
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore"
|
|
18
|
+
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn"
|
|
20
19
|
},
|
|
21
20
|
"publishConfig": {
|
|
22
21
|
"access": "public"
|
package/templates/shopping-app/example-integrations/ai-chat-completion/src/ai-integration.ts
CHANGED
|
@@ -52,7 +52,7 @@ export const AI: Integration<'ai', Record<string, never>, AICommands> = {
|
|
|
52
52
|
const schema = getSchemaByName(schemaName);
|
|
53
53
|
|
|
54
54
|
if (schema) {
|
|
55
|
-
return await generateStructuredDataWithAI(fullPrompt,
|
|
55
|
+
return await generateStructuredDataWithAI(fullPrompt, undefined, {
|
|
56
56
|
schema: schema as z.ZodSchema<T>,
|
|
57
57
|
schemaName,
|
|
58
58
|
schemaDescription: `AI output matching schema '${schemaName}'`,
|
|
@@ -60,7 +60,7 @@ export const AI: Integration<'ai', Record<string, never>, AICommands> = {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
const raw = await generateTextWithAI(fullPrompt,
|
|
63
|
+
const raw = await generateTextWithAI(fullPrompt, undefined, {
|
|
64
64
|
includeTools: true,
|
|
65
65
|
});
|
|
66
66
|
|