create-auto-app 0.3.0 → 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.
Files changed (40) hide show
  1. package/README.md +197 -0
  2. package/package.json +2 -3
  3. package/templates/shopping-app/.context/schema.json +426 -215
  4. package/templates/shopping-app/.context/server/.context/auto-ia-scheme.json +79 -0
  5. package/templates/shopping-app/.context/server/server/package.json +1 -1
  6. package/templates/shopping-app/.context/server/server/scripts/generate-schema.ts +1 -1
  7. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/decide.specs.ts +1 -1
  8. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/react.specs.ts +51 -0
  9. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/react.ts +43 -0
  10. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session/register.ts +24 -0
  11. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/react.specs.ts +1 -1
  12. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/decide.specs.ts +1 -1
  13. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/commands.ts +8 -0
  14. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/decide.specs.ts +101 -0
  15. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/decide.ts +42 -0
  16. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/events.ts +9 -0
  17. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/evolve.ts +28 -0
  18. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/handle.ts +52 -0
  19. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/mutation.resolver.ts +25 -0
  20. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/register.ts +7 -0
  21. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria/state.ts +47 -0
  22. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.specs.ts +41 -1
  23. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.ts +9 -1
  24. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/handle.ts +4 -1
  25. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.specs.ts +3 -41
  26. package/templates/shopping-app/.context/server/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.ts +2 -15
  27. package/templates/shopping-app/auto.config.ts +20 -20
  28. package/templates/shopping-app/client/package.json +4 -4
  29. package/templates/shopping-app/example-integrations/ai-chat-completion/package.json +5 -6
  30. package/templates/shopping-app/example-integrations/ai-chat-completion/src/ai-integration.ts +2 -2
  31. package/templates/shopping-app/example-integrations/cart/package.json +5 -6
  32. package/templates/shopping-app/example-integrations/cart-api/package.json +3 -3
  33. package/templates/shopping-app/example-integrations/product-catalogue/package.json +5 -5
  34. package/templates/shopping-app/example-integrations/product-catalogue/src/product-catalogue-integration.ts +0 -132
  35. package/templates/shopping-app/example-integrations/product-catalogue-api/package.json +3 -3
  36. package/templates/shopping-app/flows/shopping-assistant.flow.ts +195 -195
  37. package/templates/shopping-app/package.json +3 -1
  38. package/templates/shopping-app/server/package.json +3 -3
  39. package/templates/shopping-app/server/src/integrations/ai-integration.ts +2 -2
  40. package/templates/shopping-app/tsconfig.json +2 -2
package/README.md ADDED
@@ -0,0 +1,197 @@
1
+ # @auto-engineer/create-auto-app
2
+
3
+ A CLI tool for creating new Auto Engineer applications with minimal configuration. This package scaffolds complete project structures, including templates, dependencies, and configuration for the Auto Engineer ecosystem.
4
+
5
+ ## Installation
6
+
7
+ Install the `create-auto-app` package globally to use it as a CLI tool:
8
+
9
+ ```bash
10
+ npm install -g create-auto-app
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Run the CLI to create a new Auto Engineer project:
16
+
17
+ ```bash
18
+ create-auto-app my-auto-app
19
+ ```
20
+
21
+ This will prompt you to configure your project interactively. Alternatively, you can specify options directly:
22
+
23
+ ```bash
24
+ create-auto-app my-auto-app --template=shopping-app --preset=full --use-pnpm --install
25
+ ```
26
+
27
+ ### Options
28
+
29
+ - `[project-name]`: Name of the project directory (use "." for current directory)
30
+ - `-t, --template <template>`: Project template (e.g., `shopping-app`, default: `shopping-app`)
31
+ - `-p, --preset <preset>`: Package preset (`minimal` or `full`, default: `full`)
32
+ - `--no-install`: Skip dependency installation
33
+ - `--use-npm`: Use npm as the package manager
34
+ - `--use-yarn`: Use yarn as the package manager
35
+ - `--use-pnpm`: Use pnpm as the package manager
36
+
37
+ ## What does this package do?
38
+
39
+ The `create-auto-app` CLI scaffolds new Auto Engineer projects with pre-configured templates or presets. It sets up project structure, installs dependencies, and configures the Auto Engineer CLI with the necessary plugins for building event-driven applications.
40
+
41
+ ## Key Features
42
+
43
+ ### Project Scaffolding
44
+
45
+ - Creates project directories with a consistent structure
46
+ - Generates `package.json` with appropriate dependencies
47
+ - Sets up `auto.config.ts` for Auto Engineer CLI plugins
48
+ - Includes `.gitignore` and basic `README.md`
49
+
50
+ ### Template Support
51
+
52
+ - **Shopping App Template**: A full e-commerce example with client and server components
53
+ - Customizable through command-line options or interactive prompts
54
+
55
+ ### Preset Options
56
+
57
+ - **Minimal Preset**: Includes essential packages (`@auto-engineer/flow`, `@auto-engineer/server-generator-apollo-emmett`)
58
+ - **Full Preset**: Includes all Auto Engineer plugins for a complete setup
59
+
60
+ ### Package Manager Support
61
+
62
+ - Automatically detects preferred package manager (`npm`, `yarn`, or `pnpm`)
63
+ - Allows explicit selection via command-line flags
64
+ - Installs dependencies in monorepo or standalone projects
65
+
66
+ ### Dependency Management
67
+
68
+ - Fetches latest versions of Auto Engineer packages
69
+ - Updates `package.json` files with correct versions
70
+ - Supports monorepo setups with `pnpm-workspace.yaml`
71
+
72
+ ## Generated Project Structure
73
+
74
+ For the `shopping-app` template:
75
+
76
+ ```
77
+ my-auto-app/
78
+ ├── client/ # Frontend application
79
+ ├── server/ # Backend application
80
+ ├── flows/ # Flow specifications
81
+ ├── .context/ # Context files
82
+ ├── auto.config.ts # Auto Engineer CLI configuration
83
+ ├── package.json # Root package configuration
84
+ ├── pnpm-workspace.yaml # Monorepo workspace configuration
85
+ ├── .gitignore # Git ignore file
86
+ └── README.md # Project documentation
87
+ ```
88
+
89
+ For minimal/full preset:
90
+
91
+ ```
92
+ my-auto-app/
93
+ ├── flows/ # Flow specifications
94
+ ├── .context/ # Context files
95
+ ├── auto.config.ts # Auto Engineer CLI configuration
96
+ ├── package.json # Project dependencies
97
+ ├── .gitignore # Git ignore file
98
+ └── README.md # Project documentation
99
+ ```
100
+
101
+ ## Getting Started
102
+
103
+ 1. **Create a new project**:
104
+
105
+ ```bash
106
+ create-auto-app my-auto-app
107
+ ```
108
+
109
+ 2. **Follow the interactive prompts** to select:
110
+ - Project name
111
+ - Setup type (template, minimal, or full)
112
+ - Whether to install dependencies
113
+
114
+ 3. **Navigate to the project directory**:
115
+
116
+ ```bash
117
+ cd my-auto-app
118
+ ```
119
+
120
+ 4. **Install dependencies** (if not done during creation):
121
+
122
+ ```bash
123
+ npm install
124
+ ```
125
+
126
+ 5. **Start development**:
127
+
128
+ ```bash
129
+ npm run start
130
+ ```
131
+
132
+ ## Available Commands (in generated project)
133
+
134
+ - `auto generate:server`: Generate server from flows
135
+ - `auto generate:client`: Generate client application
136
+ - `auto check:frontend`: Run frontend checks
137
+ - `auto check:server`: Run server checks
138
+
139
+ ## Integration with Auto Engineer Ecosystem
140
+
141
+ The generated project integrates with the following Auto Engineer plugins (depending on preset):
142
+
143
+ - **@auto-engineer/flow**: Define business flows
144
+ - **@auto-engineer/server-generator-apollo-emmett**: Generate GraphQL servers
145
+ - **@auto-engineer/frontend-generator-react-graphql**: Generate React clients
146
+ - **@auto-engineer/server-implementer**: AI-powered server implementation
147
+ - **@auto-engineer/frontend-implementer**: AI-powered frontend implementation
148
+ - **@auto-engineer/server-checks**: Server validation
149
+ - **@auto-engineer/frontend-checks**: Frontend validation
150
+ - **@auto-engineer/design-system-importer**: Design system integration
151
+ - **@auto-engineer/information-architect**: Information architecture generation
152
+ - **@auto-engineer/message-bus**: Event-driven communication
153
+
154
+ ## Example Workflow
155
+
156
+ ```bash
157
+ # Create a project with the shopping-app template
158
+ create-auto-app my-shop --template=shopping-app --use-pnpm
159
+
160
+ # Navigate to the project
161
+ cd my-shop
162
+
163
+ # Install dependencies (if not already installed)
164
+ pnpm install
165
+
166
+ # Start development
167
+ pnpm run start
168
+ ```
169
+
170
+ ## Configuration
171
+
172
+ The CLI generates an `auto.config.ts` file with the appropriate plugins based on the selected preset or template:
173
+
174
+ ```typescript
175
+ export default {
176
+ plugins: [
177
+ '@auto-engineer/flow',
178
+ '@auto-engineer/server-generator-apollo-emmett',
179
+ // ... other plugins based on preset
180
+ ],
181
+ };
182
+ ```
183
+
184
+ ## Quality Assurance
185
+
186
+ - **Type Safety**: Generates TypeScript-compatible projects
187
+ - **Dependency Management**: Ensures latest package versions
188
+ - **Error Handling**: User-friendly prompts for directory conflicts
189
+ - **Monorepo Support**: Configures `pnpm-workspace.yaml` for multi-package projects
190
+
191
+ ## Changelog
192
+
193
+ See CHANGELOG.md for version history and updates.
194
+
195
+ ## Learn More
196
+
197
+ Visit the Auto Engineer Documentation for more details on the Auto Engineer ecosystem.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-auto-app",
3
- "version": "0.3.0",
3
+ "version": "0.8.4",
4
4
  "description": "Create Auto Engineer apps with no configuration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,9 +41,8 @@
41
41
  "scripts": {
42
42
  "copy-templates": "rm -rf templates/shopping-app && rsync -av --exclude='node_modules' --exclude='.turbo' --exclude='dist' --exclude='build' ../../examples/shopping-app/ templates/shopping-app/",
43
43
  "build": "npm run copy-templates && tsc && chmod +x dist/index.js",
44
- "dev": "tsc --watch",
45
44
  "type-check": "tsc --noEmit",
46
45
  "lint": "eslint 'src/**/*.ts' --max-warnings 0 --config ../../eslint.config.ts --ignore-pattern 'templates/**'",
47
- "format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore"
46
+ "format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn"
48
47
  }
49
48
  }