@auto-engineer/server-generator-apollo-emmett 1.110.3 → 1.110.5

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 (36) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +5 -5
  3. package/.turbo/turbo-type-check.log +1 -1
  4. package/CHANGELOG.md +54 -0
  5. package/dist/src/codegen/templates/command/decide.specs.ts +12 -8
  6. package/dist/src/codegen/templates/command/decide.specs.ts.ejs +6 -1
  7. package/dist/src/codegen/templates/command/decide.ts.ejs +3 -2
  8. package/dist/src/codegen/templates/command/evolve.specs.ts +5 -0
  9. package/dist/src/codegen/templates/command/evolve.ts.ejs +5 -0
  10. package/dist/src/codegen/templates/query/projection.specs.specs.ts +228 -5
  11. package/dist/src/codegen/templates/query/projection.specs.ts +24 -3
  12. package/dist/src/codegen/templates/query/projection.specs.ts.ejs +15 -5
  13. package/dist/src/codegen/templates/query/projection.ts.ejs +9 -3
  14. package/dist/src/codegen/templates/query/query.resolver.specs.ts +4 -4
  15. package/dist/src/codegen/templates/query/query.resolver.ts.ejs +1 -1
  16. package/dist/src/codegen/templates/react/react.specs.ts +7 -0
  17. package/dist/src/codegen/templates/react/react.ts.ejs +7 -0
  18. package/dist/src/codegen/templates/react/register.specs.ts +6 -0
  19. package/dist/src/codegen/templates/react/register.ts.ejs +6 -0
  20. package/ketchup-plan.md +5 -0
  21. package/package.json +4 -4
  22. package/src/codegen/templates/command/decide.specs.ts +12 -8
  23. package/src/codegen/templates/command/decide.specs.ts.ejs +6 -1
  24. package/src/codegen/templates/command/decide.ts.ejs +3 -2
  25. package/src/codegen/templates/command/evolve.specs.ts +5 -0
  26. package/src/codegen/templates/command/evolve.ts.ejs +5 -0
  27. package/src/codegen/templates/query/projection.specs.specs.ts +228 -5
  28. package/src/codegen/templates/query/projection.specs.ts +24 -3
  29. package/src/codegen/templates/query/projection.specs.ts.ejs +15 -5
  30. package/src/codegen/templates/query/projection.ts.ejs +9 -3
  31. package/src/codegen/templates/query/query.resolver.specs.ts +4 -4
  32. package/src/codegen/templates/query/query.resolver.ts.ejs +1 -1
  33. package/src/codegen/templates/react/react.specs.ts +7 -0
  34. package/src/codegen/templates/react/react.ts.ejs +7 -0
  35. package/src/codegen/templates/react/register.specs.ts +6 -0
  36. package/src/codegen/templates/react/register.ts.ejs +6 -0
@@ -132,6 +132,11 @@ case '<%= event.type %>': {
132
132
  * Preserve all import paths above — they are generated from the model.
133
133
  * ⚠️ `document` may be null (first event for this entity). Guard before accessing properties.
134
134
  *
135
+ * CONSTRAINTS:
136
+ * - NEVER use `as SomeType` type assertions. Declare typed variables instead: `const x: Type = value;`
137
+ * - Only reference event.data fields listed in the "Event fields:" line below.
138
+ * - Do NOT modify anything outside this case block: imports, type parameters, canHandle, collectionName, and getDocumentId are auto-generated.
139
+ *
135
140
  <% if (isSingleton) { -%>
136
141
  * **SINGLETON AGGREGATION PATTERN**
137
142
  *
@@ -188,11 +193,12 @@ case '<%= event.type %>': {
188
193
  * internalField: SomeType;
189
194
  * }
190
195
  *
191
- * 2. Cast document parameter to extended type:
196
+ * 2. Assign document to extended type:
192
197
  * const current: Internal<%= pascalCase(targetName || 'State') %> = document ?? { ...defaults };
193
198
  *
194
- * 3. Cast return values to extended type:
195
- * return { ...allFields, internalField } as Internal<%= pascalCase(targetName || 'State') %>;
199
+ * 3. Return via typed variable (preserves internal state for next event):
200
+ * const result: Internal<%= pascalCase(targetName || 'State') %> = { ...allFields, internalField };
201
+ * return result;
196
202
  *
197
203
  * This keeps internal state separate from the public GraphQL schema.
198
204
  <% } -%>
@@ -114,9 +114,9 @@ describe('query.resolver.ts.ejs', () => {
114
114
  return model.find((item) => {
115
115
  if (location !== undefined && item.location !== location) return false;
116
116
 
117
- // TODO: 'maxPrice' has no matching field on the state type — implement custom filter logic.
117
+ // NOTE: 'maxPrice' has no matching field on the state type — add custom filter logic if needed.
118
118
 
119
- // TODO: 'minGuests' has no matching field on the state type — implement custom filter logic.
119
+ // NOTE: 'minGuests' has no matching field on the state type — add custom filter logic if needed.
120
120
 
121
121
  return true;
122
122
  });
@@ -935,7 +935,7 @@ describe('query.resolver.ts.ejs', () => {
935
935
  // If this query should return a single item, switch to findOne().
936
936
 
937
937
  return model.find((item) => {
938
- // TODO: 'pantryId' has no matching field on the state type — implement custom filter logic.
938
+ // NOTE: 'pantryId' has no matching field on the state type — add custom filter logic if needed.
939
939
 
940
940
  return true;
941
941
  });
@@ -1177,7 +1177,7 @@ describe('query.resolver.ts.ejs', () => {
1177
1177
  // If this query should return a single item, switch to findOne().
1178
1178
 
1179
1179
  return model.find((item) => {
1180
- // TODO: 'pantryId' has no matching field on the state type — implement custom filter logic.
1180
+ // NOTE: 'pantryId' has no matching field on the state type — add custom filter logic if needed.
1181
1181
 
1182
1182
  return true;
1183
1183
  });
@@ -170,7 +170,7 @@ return model.find((<%= hasArgs ? 'item' : '_item' %>) => {
170
170
  if (stateFieldNames.has(arg.name)) { %>
171
171
  if (<%= arg.name %> !== undefined && item.<%= arg.name %> !== <%= arg.name %>) return false;
172
172
  <% } else { %>
173
- // TODO: '<%= arg.name %>' has no matching field on the state type — implement custom filter logic.
173
+ // NOTE: '<%= arg.name %>' has no matching field on the state type — add custom filter logic if needed.
174
174
  <% }
175
175
  }
176
176
  } %>
@@ -256,6 +256,13 @@ describe('handle.ts.ejs (react slice)', () => {
256
256
  * NEVER hardcode values copied from test assertions.
257
257
  *
258
258
  * Preserve all import paths above — they are generated from the model.
259
+ *
260
+ * CONSTRAINTS:
261
+ * - NEVER use \`as SomeType\` type assertions. Use typed variable declarations.
262
+ * - Only reference event.data fields listed in the "Event fields:" comment below. Check the type before accessing any field.
263
+ * - Do NOT modify the inMemoryReactor configuration, connectionOptions, import statements, or commandSender.send() call structure. Only fill in data fields marked TODO.
264
+ * - When event.data contains nested arrays/objects (e.g., exercises[].sets[]), iterate them to compute values. Do NOT cast arrays/objects to primitive types.
265
+ *
259
266
  * Add business logic (validation, conditional sends) as needed.
260
267
  */
261
268
 
@@ -60,6 +60,13 @@ const willHaveAggregateStream = states.some(state =>
60
60
  <% if (willHaveAggregateStream) { -%>
61
61
  * Do NOT modify or remove aggregateStream calls — they load required state.
62
62
  <% } -%>
63
+ *
64
+ * CONSTRAINTS:
65
+ * - NEVER use `as SomeType` type assertions. Use typed variable declarations.
66
+ * - Only reference event.data fields listed in the "Event fields:" comment below. Check the type before accessing any field.
67
+ * - Do NOT modify the inMemoryReactor configuration, connectionOptions, import statements, or commandSender.send() call structure. Only fill in data fields marked TODO.
68
+ * - When event.data contains nested arrays/objects (e.g., exercises[].sets[]), iterate them to compute values. Do NOT cast arrays/objects to primitive types.
69
+ *
63
70
  * Add business logic (validation, conditional sends) as needed.
64
71
  */
65
72
  <%
@@ -246,6 +246,12 @@ describe('register.ts.ejs (react slice)', () => {
246
246
  * evolve: (s: Record<string, unknown>, e: { type: string; data: Record<string, unknown> }) => ...
247
247
  * - NEVER hardcode values copied from test assertions.
248
248
  * - Preserve all import paths above — they are generated from the model.
249
+ *
250
+ * CONSTRAINTS:
251
+ * - NEVER use \`as SomeType\` type assertions. Use typed variable declarations.
252
+ * - Only reference fields that exist on the event type (BookingRequested). Check the import above.
253
+ * - Do NOT modify the messageBus.subscribe() call, function signature, or import statements.
254
+ * - When event.data contains nested arrays/objects, iterate them. Do NOT cast to primitive types.
249
255
  */
250
256
 
251
257
  // await messageBus.send({
@@ -38,6 +38,12 @@ async (event: <%= pascalCase(eventType) %>) => {
38
38
  * evolve: (s: Record<string, unknown>, e: { type: string; data: Record<string, unknown> }) => ...
39
39
  * - NEVER hardcode values copied from test assertions.
40
40
  * - Preserve all import paths above — they are generated from the model.
41
+ *
42
+ * CONSTRAINTS:
43
+ * - NEVER use `as SomeType` type assertions. Use typed variable declarations.
44
+ * - Only reference fields that exist on the event type (<%= pascalCase(eventType) %>). Check the import above.
45
+ * - Do NOT modify the messageBus.subscribe() call, function signature, or import statements.
46
+ * - When event.data contains nested arrays/objects, iterate them. Do NOT cast to primitive types.
41
47
  */
42
48
 
43
49
  // await messageBus.send({