@auto-engineer/server-generator-apollo-emmett 1.138.0 → 1.140.0
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +4 -4
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +39 -0
- package/DEBUG.md +4 -4
- package/dist/src/codegen/extract/data-sink.d.ts +2 -2
- package/dist/src/codegen/extract/data-sink.d.ts.map +1 -1
- package/dist/src/codegen/extract/data-sink.js +2 -2
- package/dist/src/codegen/extract/data-sink.js.map +1 -1
- package/dist/src/codegen/extract/events.d.ts +3 -3
- package/dist/src/codegen/extract/events.d.ts.map +1 -1
- package/dist/src/codegen/extract/events.js +11 -11
- package/dist/src/codegen/extract/events.js.map +1 -1
- package/dist/src/codegen/extract/gwt.d.ts +2 -2
- package/dist/src/codegen/extract/gwt.d.ts.map +1 -1
- package/dist/src/codegen/extract/gwt.js +2 -2
- package/dist/src/codegen/extract/gwt.js.map +1 -1
- package/dist/src/codegen/extract/imports.d.ts +4 -4
- package/dist/src/codegen/extract/imports.d.ts.map +1 -1
- package/dist/src/codegen/extract/imports.js +8 -8
- package/dist/src/codegen/extract/imports.js.map +1 -1
- package/dist/src/codegen/extract/messages.d.ts +2 -2
- package/dist/src/codegen/extract/messages.d.ts.map +1 -1
- package/dist/src/codegen/extract/messages.js +9 -9
- package/dist/src/codegen/extract/messages.js.map +1 -1
- package/dist/src/codegen/extract/projection.d.ts +7 -7
- package/dist/src/codegen/extract/projection.d.ts.map +1 -1
- package/dist/src/codegen/extract/projection.js +3 -3
- package/dist/src/codegen/extract/projection.js.map +1 -1
- package/dist/src/codegen/extract/query.d.ts +2 -2
- package/dist/src/codegen/extract/query.d.ts.map +1 -1
- package/dist/src/codegen/extract/query.js.map +1 -1
- package/dist/src/codegen/extract/slice-normalizer.d.ts +4 -4
- package/dist/src/codegen/extract/slice-normalizer.d.ts.map +1 -1
- package/dist/src/codegen/extract/slice-normalizer.js +7 -7
- package/dist/src/codegen/extract/slice-normalizer.js.map +1 -1
- package/dist/src/codegen/extract/states.d.ts +3 -3
- package/dist/src/codegen/extract/states.d.ts.map +1 -1
- package/dist/src/codegen/extract/states.js.map +1 -1
- package/dist/src/codegen/extract/step-converter.d.ts +7 -7
- package/dist/src/codegen/extract/step-converter.d.ts.map +1 -1
- package/dist/src/codegen/extract/step-converter.js +12 -12
- package/dist/src/codegen/extract/step-converter.js.map +1 -1
- package/dist/src/codegen/extract/step-types.d.ts +4 -4
- package/dist/src/codegen/extract/step-types.d.ts.map +1 -1
- package/dist/src/codegen/extract/step-types.js +1 -1
- package/dist/src/codegen/extract/step-types.js.map +1 -1
- package/dist/src/codegen/scaffoldFromSchema.d.ts +12 -12
- package/dist/src/codegen/scaffoldFromSchema.d.ts.map +1 -1
- package/dist/src/codegen/scaffoldFromSchema.js +113 -101
- package/dist/src/codegen/scaffoldFromSchema.js.map +1 -1
- package/dist/src/codegen/templates/command/commands.specs.ts +3 -3
- package/dist/src/codegen/templates/command/decide.specs.specs.ts +52 -52
- package/dist/src/codegen/templates/command/decide.specs.ts +12 -12
- package/dist/src/codegen/templates/command/decide.specs.ts.ejs +1 -1
- package/dist/src/codegen/templates/command/events.specs.ts +3 -3
- package/dist/src/codegen/templates/command/evolve.specs.ts +3 -3
- package/dist/src/codegen/templates/command/handle.specs.ts +13 -13
- package/dist/src/codegen/templates/command/mutation.resolver.specs.ts +19 -19
- package/dist/src/codegen/templates/command/register.specs.ts +3 -3
- package/dist/src/codegen/templates/command/state.specs.ts +3 -3
- package/dist/src/codegen/templates/query/events.specs.ts +4 -4
- package/dist/src/codegen/templates/query/projection.specs.specs.ts +60 -60
- package/dist/src/codegen/templates/query/projection.specs.ts +54 -29
- package/dist/src/codegen/templates/query/projection.specs.ts.ejs +2 -2
- package/dist/src/codegen/templates/query/query.resolver.specs.ts +63 -63
- package/dist/src/codegen/templates/query/query.resolver.ts.ejs +1 -1
- package/dist/src/codegen/templates/query/state.specs.ts +9 -9
- package/dist/src/codegen/templates/react/react.specs.specs.ts +15 -15
- package/dist/src/codegen/templates/react/react.specs.ts +16 -16
- package/dist/src/codegen/templates/react/react.specs.ts.ejs +9 -9
- package/dist/src/codegen/templates/react/react.ts.ejs +5 -5
- package/dist/src/codegen/templates/react/react.ts.specs.ts +33 -33
- package/dist/src/codegen/templates/react/register.specs.ts +7 -7
- package/dist/src/codegen/templates/react/register.ts.ejs +4 -4
- package/dist/src/codegen/test-data/specVariant1.d.ts.map +1 -1
- package/dist/src/codegen/test-data/specVariant1.js +3 -2
- package/dist/src/codegen/test-data/specVariant1.js.map +1 -1
- package/dist/src/codegen/types.d.ts +2 -2
- package/dist/src/codegen/types.d.ts.map +1 -1
- package/dist/src/commands/generate-server.d.ts +21 -21
- package/dist/src/commands/generate-server.d.ts.map +1 -1
- package/dist/src/commands/generate-server.js +81 -63
- package/dist/src/commands/generate-server.js.map +1 -1
- package/dist/src/commands/initialize-server.d.ts.map +1 -1
- package/dist/src/commands/initialize-server.js +2 -2
- package/dist/src/commands/initialize-server.js.map +1 -1
- package/dist/src/domain/flows/shared/types.d.ts +14 -0
- package/dist/src/domain/flows/shared/types.d.ts.map +1 -0
- package/dist/src/domain/flows/shared/types.js +2 -0
- package/dist/src/domain/flows/shared/types.js.map +1 -0
- package/dist/src/domain/flows/shared/types.ts +15 -0
- package/dist/src/domain/narratives/shared/types.d.ts +14 -0
- package/dist/src/domain/narratives/shared/types.d.ts.map +1 -0
- package/dist/src/domain/narratives/shared/types.js +2 -0
- package/dist/src/domain/narratives/shared/types.js.map +1 -0
- package/dist/src/domain/narratives/shared/types.ts +15 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/server.js +3 -3
- package/dist/src/server.js.map +1 -1
- package/dist/src/server.ts +3 -3
- package/dist/src/utils/loadRegisterFiles.d.ts +2 -2
- package/dist/src/utils/loadRegisterFiles.d.ts.map +1 -1
- package/dist/src/utils/loadRegisterFiles.js.map +1 -1
- package/dist/src/utils/loadRegisterFiles.ts +5 -5
- package/dist/src/utils/loadResolvers.js +1 -1
- package/dist/src/utils/loadResolvers.js.map +1 -1
- package/dist/src/utils/loadResolvers.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/codegen/extract/data-sink.ts +5 -5
- package/src/codegen/extract/events.ts +15 -15
- package/src/codegen/extract/gwt.ts +4 -4
- package/src/codegen/extract/imports.specs.ts +19 -19
- package/src/codegen/extract/imports.ts +13 -13
- package/src/codegen/extract/messages.specs.ts +30 -30
- package/src/codegen/extract/messages.ts +16 -16
- package/src/codegen/extract/projection.specs.ts +22 -22
- package/src/codegen/extract/projection.ts +9 -9
- package/src/codegen/extract/query.ts +2 -2
- package/src/codegen/extract/slice-normalizer.specs.ts +11 -11
- package/src/codegen/extract/slice-normalizer.ts +14 -14
- package/src/codegen/extract/states.ts +4 -4
- package/src/codegen/extract/step-converter.specs.ts +9 -9
- package/src/codegen/extract/step-converter.ts +15 -15
- package/src/codegen/extract/step-types.specs.ts +12 -12
- package/src/codegen/extract/step-types.ts +4 -4
- package/src/codegen/findEventSource.specs.ts +23 -23
- package/src/codegen/scaffoldErrors.specs.ts +4 -4
- package/src/codegen/scaffoldFromSchema.filter.specs.ts +32 -32
- package/src/codegen/scaffoldFromSchema.ts +146 -132
- package/src/codegen/templates/command/commands.specs.ts +3 -3
- package/src/codegen/templates/command/decide.specs.specs.ts +52 -52
- package/src/codegen/templates/command/decide.specs.ts +12 -12
- package/src/codegen/templates/command/decide.specs.ts.ejs +1 -1
- package/src/codegen/templates/command/events.specs.ts +3 -3
- package/src/codegen/templates/command/evolve.specs.ts +3 -3
- package/src/codegen/templates/command/handle.specs.ts +13 -13
- package/src/codegen/templates/command/mutation.resolver.specs.ts +19 -19
- package/src/codegen/templates/command/register.specs.ts +3 -3
- package/src/codegen/templates/command/state.specs.ts +3 -3
- package/src/codegen/templates/query/events.specs.ts +4 -4
- package/src/codegen/templates/query/projection.specs.specs.ts +60 -60
- package/src/codegen/templates/query/projection.specs.ts +54 -29
- package/src/codegen/templates/query/projection.specs.ts.ejs +2 -2
- package/src/codegen/templates/query/query.resolver.specs.ts +63 -63
- package/src/codegen/templates/query/query.resolver.ts.ejs +1 -1
- package/src/codegen/templates/query/state.specs.ts +9 -9
- package/src/codegen/templates/react/react.specs.specs.ts +15 -15
- package/src/codegen/templates/react/react.specs.ts +16 -16
- package/src/codegen/templates/react/react.specs.ts.ejs +9 -9
- package/src/codegen/templates/react/react.ts.ejs +5 -5
- package/src/codegen/templates/react/react.ts.specs.ts +33 -33
- package/src/codegen/templates/react/register.specs.ts +7 -7
- package/src/codegen/templates/react/register.ts.ejs +4 -4
- package/src/codegen/test-data/specVariant1.json +1 -1
- package/src/codegen/test-data/specVariant1.ts +3 -2
- package/src/codegen/test-data/specVariant2.json +1 -1
- package/src/codegen/types.ts +2 -2
- package/src/commands/generate-server.specs.ts +81 -79
- package/src/commands/generate-server.ts +110 -88
- package/src/commands/initialize-server.specs.ts +4 -4
- package/src/commands/initialize-server.ts +5 -2
- package/src/domain/flows/shared/types.ts +15 -0
- package/src/domain/narratives/shared/types.ts +15 -0
- package/src/index.ts +1 -1
- package/src/server.ts +3 -3
- package/src/utils/loadRegisterFiles.ts +5 -5
- package/src/utils/loadResolvers.ts +1 -1
|
@@ -6,10 +6,10 @@ describe('spec.ts.ejs', () => {
|
|
|
6
6
|
it('should generate a valid spec file', async () => {
|
|
7
7
|
const spec: SpecsSchema = {
|
|
8
8
|
variant: 'specs',
|
|
9
|
-
|
|
9
|
+
scenes: [
|
|
10
10
|
{
|
|
11
11
|
name: 'Host creates a listing',
|
|
12
|
-
|
|
12
|
+
moments: [
|
|
13
13
|
{
|
|
14
14
|
type: 'command',
|
|
15
15
|
name: 'Create listing',
|
|
@@ -96,7 +96,7 @@ describe('spec.ts.ejs', () => {
|
|
|
96
96
|
],
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
99
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
100
100
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
101
101
|
|
|
102
102
|
expect(specFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -157,10 +157,10 @@ describe('spec.ts.ejs', () => {
|
|
|
157
157
|
it('should include given events in the spec file when provided', async () => {
|
|
158
158
|
const spec: SpecsSchema = {
|
|
159
159
|
variant: 'specs',
|
|
160
|
-
|
|
160
|
+
scenes: [
|
|
161
161
|
{
|
|
162
162
|
name: 'Guest removes a listing',
|
|
163
|
-
|
|
163
|
+
moments: [
|
|
164
164
|
{
|
|
165
165
|
type: 'command',
|
|
166
166
|
name: 'Remove listing',
|
|
@@ -244,7 +244,7 @@ describe('spec.ts.ejs', () => {
|
|
|
244
244
|
],
|
|
245
245
|
};
|
|
246
246
|
|
|
247
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
247
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
248
248
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
249
249
|
|
|
250
250
|
expect(specFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -304,10 +304,10 @@ describe('spec.ts.ejs', () => {
|
|
|
304
304
|
it('should generate separate tests for multiple examples with different scenarios', async () => {
|
|
305
305
|
const spec: SpecsSchema = {
|
|
306
306
|
variant: 'specs',
|
|
307
|
-
|
|
307
|
+
scenes: [
|
|
308
308
|
{
|
|
309
309
|
name: 'Questionnaires',
|
|
310
|
-
|
|
310
|
+
moments: [
|
|
311
311
|
{
|
|
312
312
|
type: 'command',
|
|
313
313
|
name: 'submits a questionnaire answer',
|
|
@@ -439,7 +439,7 @@ describe('spec.ts.ejs', () => {
|
|
|
439
439
|
],
|
|
440
440
|
};
|
|
441
441
|
|
|
442
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
442
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
443
443
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
444
444
|
|
|
445
445
|
expect(specFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -528,10 +528,10 @@ describe('spec.ts.ejs', () => {
|
|
|
528
528
|
it('should render null for Date fields with null values', async () => {
|
|
529
529
|
const spec: SpecsSchema = {
|
|
530
530
|
variant: 'specs',
|
|
531
|
-
|
|
531
|
+
scenes: [
|
|
532
532
|
{
|
|
533
533
|
name: 'User starts a session',
|
|
534
|
-
|
|
534
|
+
moments: [
|
|
535
535
|
{
|
|
536
536
|
type: 'command',
|
|
537
537
|
name: 'Start session',
|
|
@@ -598,7 +598,7 @@ describe('spec.ts.ejs', () => {
|
|
|
598
598
|
],
|
|
599
599
|
};
|
|
600
600
|
|
|
601
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
601
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
602
602
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
603
603
|
const contents = specFile?.contents ?? '';
|
|
604
604
|
|
|
@@ -609,10 +609,10 @@ describe('spec.ts.ejs', () => {
|
|
|
609
609
|
it('should merge co-firing rules with same given+when into one test with combined events', async () => {
|
|
610
610
|
const spec: SpecsSchema = {
|
|
611
611
|
variant: 'specs',
|
|
612
|
-
|
|
612
|
+
scenes: [
|
|
613
613
|
{
|
|
614
|
-
name: 'Fitness
|
|
615
|
-
|
|
614
|
+
name: 'Fitness scene',
|
|
615
|
+
moments: [
|
|
616
616
|
{
|
|
617
617
|
type: 'command',
|
|
618
618
|
name: 'Submit workout',
|
|
@@ -702,7 +702,7 @@ describe('spec.ts.ejs', () => {
|
|
|
702
702
|
],
|
|
703
703
|
};
|
|
704
704
|
|
|
705
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
705
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
706
706
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
707
707
|
|
|
708
708
|
expect(specFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -761,10 +761,10 @@ describe('spec.ts.ejs', () => {
|
|
|
761
761
|
it('should include business rule descriptions in decide.ts implementation comments', async () => {
|
|
762
762
|
const spec: SpecsSchema = {
|
|
763
763
|
variant: 'specs',
|
|
764
|
-
|
|
764
|
+
scenes: [
|
|
765
765
|
{
|
|
766
|
-
name: 'Booking
|
|
767
|
-
|
|
766
|
+
name: 'Booking scene',
|
|
767
|
+
moments: [
|
|
768
768
|
{
|
|
769
769
|
type: 'command',
|
|
770
770
|
name: 'Approve booking',
|
|
@@ -819,7 +819,7 @@ describe('spec.ts.ejs', () => {
|
|
|
819
819
|
],
|
|
820
820
|
};
|
|
821
821
|
|
|
822
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
822
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
823
823
|
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
824
824
|
expect(decideFile?.contents).toBeDefined();
|
|
825
825
|
|
|
@@ -830,10 +830,10 @@ describe('spec.ts.ejs', () => {
|
|
|
830
830
|
it('should pin metadata.now when Then event has a derived ISO date not in command fields or Given', async () => {
|
|
831
831
|
const spec: SpecsSchema = {
|
|
832
832
|
variant: 'specs',
|
|
833
|
-
|
|
833
|
+
scenes: [
|
|
834
834
|
{
|
|
835
|
-
name: 'Record
|
|
836
|
-
|
|
835
|
+
name: 'Record scene',
|
|
836
|
+
moments: [
|
|
837
837
|
{
|
|
838
838
|
type: 'command',
|
|
839
839
|
name: 'Update record',
|
|
@@ -895,7 +895,7 @@ describe('spec.ts.ejs', () => {
|
|
|
895
895
|
],
|
|
896
896
|
};
|
|
897
897
|
|
|
898
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
898
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
899
899
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
900
900
|
|
|
901
901
|
expect(specFile?.contents).toContain("metadata: { now: new Date('2024-01-20') }");
|
|
@@ -904,10 +904,10 @@ describe('spec.ts.ejs', () => {
|
|
|
904
904
|
it('should keep new Date() when all date fields are in command schema', async () => {
|
|
905
905
|
const spec: SpecsSchema = {
|
|
906
906
|
variant: 'specs',
|
|
907
|
-
|
|
907
|
+
scenes: [
|
|
908
908
|
{
|
|
909
|
-
name: 'Schedule
|
|
910
|
-
|
|
909
|
+
name: 'Schedule scene',
|
|
910
|
+
moments: [
|
|
911
911
|
{
|
|
912
912
|
type: 'command',
|
|
913
913
|
name: 'Schedule event',
|
|
@@ -968,7 +968,7 @@ describe('spec.ts.ejs', () => {
|
|
|
968
968
|
],
|
|
969
969
|
};
|
|
970
970
|
|
|
971
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
971
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
972
972
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
973
973
|
|
|
974
974
|
expect(specFile?.contents).toContain('metadata: { now: new Date() }');
|
|
@@ -978,10 +978,10 @@ describe('spec.ts.ejs', () => {
|
|
|
978
978
|
it('should keep new Date() when date value also appears in Given events', async () => {
|
|
979
979
|
const spec: SpecsSchema = {
|
|
980
980
|
variant: 'specs',
|
|
981
|
-
|
|
981
|
+
scenes: [
|
|
982
982
|
{
|
|
983
|
-
name: 'Renewal
|
|
984
|
-
|
|
983
|
+
name: 'Renewal scene',
|
|
984
|
+
moments: [
|
|
985
985
|
{
|
|
986
986
|
type: 'command',
|
|
987
987
|
name: 'Renew subscription',
|
|
@@ -1053,7 +1053,7 @@ describe('spec.ts.ejs', () => {
|
|
|
1053
1053
|
],
|
|
1054
1054
|
};
|
|
1055
1055
|
|
|
1056
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
1056
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
1057
1057
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
1058
1058
|
|
|
1059
1059
|
expect(specFile?.contents).toContain('metadata: { now: new Date() }');
|
|
@@ -1063,10 +1063,10 @@ describe('spec.ts.ejs', () => {
|
|
|
1063
1063
|
it('should keep new Date() when multiple candidate dates create ambiguity', async () => {
|
|
1064
1064
|
const spec: SpecsSchema = {
|
|
1065
1065
|
variant: 'specs',
|
|
1066
|
-
|
|
1066
|
+
scenes: [
|
|
1067
1067
|
{
|
|
1068
|
-
name: 'Contract
|
|
1069
|
-
|
|
1068
|
+
name: 'Contract scene',
|
|
1069
|
+
moments: [
|
|
1070
1070
|
{
|
|
1071
1071
|
type: 'command',
|
|
1072
1072
|
name: 'Sign contract',
|
|
@@ -1125,7 +1125,7 @@ describe('spec.ts.ejs', () => {
|
|
|
1125
1125
|
],
|
|
1126
1126
|
};
|
|
1127
1127
|
|
|
1128
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
1128
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
1129
1129
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
1130
1130
|
|
|
1131
1131
|
expect(specFile?.contents).toContain('metadata: { now: new Date() }');
|
|
@@ -1136,10 +1136,10 @@ describe('spec.ts.ejs', () => {
|
|
|
1136
1136
|
it('should omit non-command fields from Then assertions (Emmett subset matching)', async () => {
|
|
1137
1137
|
const spec: SpecsSchema = {
|
|
1138
1138
|
variant: 'specs',
|
|
1139
|
-
|
|
1139
|
+
scenes: [
|
|
1140
1140
|
{
|
|
1141
|
-
name: 'Fitness
|
|
1142
|
-
|
|
1141
|
+
name: 'Fitness scene',
|
|
1142
|
+
moments: [
|
|
1143
1143
|
{
|
|
1144
1144
|
type: 'command',
|
|
1145
1145
|
name: 'Log workout',
|
|
@@ -1212,7 +1212,7 @@ describe('spec.ts.ejs', () => {
|
|
|
1212
1212
|
],
|
|
1213
1213
|
};
|
|
1214
1214
|
|
|
1215
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
1215
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
1216
1216
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
1217
1217
|
|
|
1218
1218
|
expect(specFile?.contents).not.toContain('workoutId:');
|
|
@@ -1228,10 +1228,10 @@ describe('spec.ts.ejs', () => {
|
|
|
1228
1228
|
it('should keep non-command fields whose key+value match a Given event', async () => {
|
|
1229
1229
|
const spec: SpecsSchema = {
|
|
1230
1230
|
variant: 'specs',
|
|
1231
|
-
|
|
1231
|
+
scenes: [
|
|
1232
1232
|
{
|
|
1233
|
-
name: 'Subscription
|
|
1234
|
-
|
|
1233
|
+
name: 'Subscription scene',
|
|
1234
|
+
moments: [
|
|
1235
1235
|
{
|
|
1236
1236
|
type: 'command',
|
|
1237
1237
|
name: 'Renew subscription',
|
|
@@ -1303,7 +1303,7 @@ describe('spec.ts.ejs', () => {
|
|
|
1303
1303
|
],
|
|
1304
1304
|
};
|
|
1305
1305
|
|
|
1306
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
1306
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
1307
1307
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
1308
1308
|
|
|
1309
1309
|
expect(specFile?.contents).toContain('totalPoints: 100');
|
|
@@ -1312,10 +1312,10 @@ describe('spec.ts.ejs', () => {
|
|
|
1312
1312
|
it('should list non-command fields in decide scaffold comments', async () => {
|
|
1313
1313
|
const spec: SpecsSchema = {
|
|
1314
1314
|
variant: 'specs',
|
|
1315
|
-
|
|
1315
|
+
scenes: [
|
|
1316
1316
|
{
|
|
1317
|
-
name: 'Fitness
|
|
1318
|
-
|
|
1317
|
+
name: 'Fitness scene',
|
|
1318
|
+
moments: [
|
|
1319
1319
|
{
|
|
1320
1320
|
type: 'command',
|
|
1321
1321
|
name: 'Log workout',
|
|
@@ -1377,7 +1377,7 @@ describe('spec.ts.ejs', () => {
|
|
|
1377
1377
|
],
|
|
1378
1378
|
};
|
|
1379
1379
|
|
|
1380
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
1380
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
1381
1381
|
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
1382
1382
|
|
|
1383
1383
|
expect(decideFile?.contents).toContain('REQUIRED: Your return value MUST include ALL fields');
|
|
@@ -1391,10 +1391,10 @@ describe('spec.ts.ejs', () => {
|
|
|
1391
1391
|
it('should not include "valid" qualifier in fallback test description', async () => {
|
|
1392
1392
|
const spec: SpecsSchema = {
|
|
1393
1393
|
variant: 'specs',
|
|
1394
|
-
|
|
1394
|
+
scenes: [
|
|
1395
1395
|
{
|
|
1396
|
-
name: 'order-
|
|
1397
|
-
|
|
1396
|
+
name: 'order-scene',
|
|
1397
|
+
moments: [
|
|
1398
1398
|
{
|
|
1399
1399
|
type: 'command',
|
|
1400
1400
|
name: 'place order',
|
|
@@ -1448,7 +1448,7 @@ describe('spec.ts.ejs', () => {
|
|
|
1448
1448
|
],
|
|
1449
1449
|
};
|
|
1450
1450
|
|
|
1451
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
1451
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
1452
1452
|
const specFile = plans.find((p) => p.outputPath.endsWith('specs.ts'));
|
|
1453
1453
|
|
|
1454
1454
|
expect(specFile?.contents).toContain('should emit OrderPlaced for PlaceOrder');
|
|
@@ -6,10 +6,10 @@ describe('decide.ts.ejs', () => {
|
|
|
6
6
|
it('should generate a valid decide file when both command and event exist', async () => {
|
|
7
7
|
const spec: SpecsSchema = {
|
|
8
8
|
variant: 'specs',
|
|
9
|
-
|
|
9
|
+
scenes: [
|
|
10
10
|
{
|
|
11
11
|
name: 'Host creates a listing',
|
|
12
|
-
|
|
12
|
+
moments: [
|
|
13
13
|
{
|
|
14
14
|
type: 'command',
|
|
15
15
|
name: 'Create listing',
|
|
@@ -77,7 +77,7 @@ describe('decide.ts.ejs', () => {
|
|
|
77
77
|
],
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
80
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
81
81
|
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
82
82
|
|
|
83
83
|
expect(decideFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -133,10 +133,10 @@ describe('decide.ts.ejs', () => {
|
|
|
133
133
|
it('should include implementation instructions when prior events are required', async () => {
|
|
134
134
|
const spec: SpecsSchema = {
|
|
135
135
|
variant: 'specs',
|
|
136
|
-
|
|
136
|
+
scenes: [
|
|
137
137
|
{
|
|
138
138
|
name: 'Host removes a listing',
|
|
139
|
-
|
|
139
|
+
moments: [
|
|
140
140
|
{
|
|
141
141
|
type: 'command',
|
|
142
142
|
name: 'Remove listing',
|
|
@@ -218,7 +218,7 @@ describe('decide.ts.ejs', () => {
|
|
|
218
218
|
],
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
221
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
222
222
|
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
223
223
|
|
|
224
224
|
expect(decideFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -280,10 +280,10 @@ describe('decide.ts.ejs', () => {
|
|
|
280
280
|
it('should generate a decide file that handles multiple GWTs including an error', async () => {
|
|
281
281
|
const spec: SpecsSchema = {
|
|
282
282
|
variant: 'specs',
|
|
283
|
-
|
|
283
|
+
scenes: [
|
|
284
284
|
{
|
|
285
285
|
name: 'Host creates a listing',
|
|
286
|
-
|
|
286
|
+
moments: [
|
|
287
287
|
{
|
|
288
288
|
type: 'command',
|
|
289
289
|
name: 'Create listing',
|
|
@@ -385,7 +385,7 @@ describe('decide.ts.ejs', () => {
|
|
|
385
385
|
],
|
|
386
386
|
};
|
|
387
387
|
|
|
388
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
388
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
389
389
|
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
390
390
|
|
|
391
391
|
expect(decideFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -445,10 +445,10 @@ describe('decide.ts.ejs', () => {
|
|
|
445
445
|
it('should include integration return type and usage in decide function', async () => {
|
|
446
446
|
const spec: SpecsSchema = {
|
|
447
447
|
variant: 'specs',
|
|
448
|
-
|
|
448
|
+
scenes: [
|
|
449
449
|
{
|
|
450
450
|
name: 'Assistant suggests items',
|
|
451
|
-
|
|
451
|
+
moments: [
|
|
452
452
|
{
|
|
453
453
|
type: 'command',
|
|
454
454
|
name: 'Suggest Items',
|
|
@@ -589,7 +589,7 @@ describe('decide.ts.ejs', () => {
|
|
|
589
589
|
],
|
|
590
590
|
};
|
|
591
591
|
|
|
592
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
592
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, spec.integrations);
|
|
593
593
|
const decideFile = plans.find((p) => p.outputPath.endsWith('decide.ts'));
|
|
594
594
|
|
|
595
595
|
expect(decideFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -4,7 +4,7 @@ const ruleGroups = new Map();
|
|
|
4
4
|
for (const commandName in gwtMapping) {
|
|
5
5
|
const cases = gwtMapping[commandName];
|
|
6
6
|
for (const gwt of cases) {
|
|
7
|
-
const ruleDescription = gwt.ruleDescription || `${
|
|
7
|
+
const ruleDescription = gwt.ruleDescription || `${sceneName} | ${momentName}`;
|
|
8
8
|
if (!ruleGroups.has(ruleDescription)) {
|
|
9
9
|
ruleGroups.set(ruleDescription, []);
|
|
10
10
|
}
|
|
@@ -6,10 +6,10 @@ describe('events.ts.ejs', () => {
|
|
|
6
6
|
it('should generate an event file', async () => {
|
|
7
7
|
const spec: SpecsSchema = {
|
|
8
8
|
variant: 'specs',
|
|
9
|
-
|
|
9
|
+
scenes: [
|
|
10
10
|
{
|
|
11
11
|
name: 'Host creates a listing',
|
|
12
|
-
|
|
12
|
+
moments: [
|
|
13
13
|
{
|
|
14
14
|
type: 'command',
|
|
15
15
|
name: 'Create listing',
|
|
@@ -98,7 +98,7 @@ describe('events.ts.ejs', () => {
|
|
|
98
98
|
],
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
101
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
102
102
|
const eventFile = plans.find((p) => p.outputPath.endsWith('events.ts'));
|
|
103
103
|
|
|
104
104
|
expect(eventFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -6,10 +6,10 @@ describe('evolve.ts.ejs', () => {
|
|
|
6
6
|
it('should generate a valid evolve file from event structure', async () => {
|
|
7
7
|
const spec: SpecsSchema = {
|
|
8
8
|
variant: 'specs',
|
|
9
|
-
|
|
9
|
+
scenes: [
|
|
10
10
|
{
|
|
11
11
|
name: 'Host creates a listing',
|
|
12
|
-
|
|
12
|
+
moments: [
|
|
13
13
|
{
|
|
14
14
|
type: 'command',
|
|
15
15
|
name: 'Create listing',
|
|
@@ -77,7 +77,7 @@ describe('evolve.ts.ejs', () => {
|
|
|
77
77
|
],
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
80
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
81
81
|
const evolveFile = plans.find((p) => p.outputPath.endsWith('evolve.ts'));
|
|
82
82
|
|
|
83
83
|
expect(evolveFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -6,10 +6,10 @@ describe('generateScaffoldFilePlans', () => {
|
|
|
6
6
|
it('should generate a valid handle file', async () => {
|
|
7
7
|
const spec: SpecsSchema = {
|
|
8
8
|
variant: 'specs',
|
|
9
|
-
|
|
9
|
+
scenes: [
|
|
10
10
|
{
|
|
11
11
|
name: 'Host creates a listing',
|
|
12
|
-
|
|
12
|
+
moments: [
|
|
13
13
|
{
|
|
14
14
|
type: 'command',
|
|
15
15
|
name: 'Create listing',
|
|
@@ -104,7 +104,7 @@ describe('generateScaffoldFilePlans', () => {
|
|
|
104
104
|
],
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
107
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
108
108
|
const handleFile = plans.find((p) => p.outputPath.endsWith('handle.ts'));
|
|
109
109
|
|
|
110
110
|
expect(handleFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -131,10 +131,10 @@ describe('generateScaffoldFilePlans', () => {
|
|
|
131
131
|
it('should generate a valid handle file with integration', async () => {
|
|
132
132
|
const spec: SpecsSchema = {
|
|
133
133
|
variant: 'specs',
|
|
134
|
-
|
|
134
|
+
scenes: [
|
|
135
135
|
{
|
|
136
136
|
name: 'Assistant suggests items',
|
|
137
|
-
|
|
137
|
+
moments: [
|
|
138
138
|
{
|
|
139
139
|
type: 'command',
|
|
140
140
|
name: 'Suggest Items',
|
|
@@ -276,10 +276,10 @@ describe('generateScaffoldFilePlans', () => {
|
|
|
276
276
|
};
|
|
277
277
|
|
|
278
278
|
const { plans } = await generateScaffoldFilePlans(
|
|
279
|
-
spec.
|
|
279
|
+
spec.scenes,
|
|
280
280
|
spec.messages,
|
|
281
281
|
spec.integrations,
|
|
282
|
-
'src/domain/
|
|
282
|
+
'src/domain/narratives',
|
|
283
283
|
);
|
|
284
284
|
const handleFile = plans.find((p) => p.outputPath.endsWith('handle.ts'));
|
|
285
285
|
|
|
@@ -334,10 +334,10 @@ describe('generateScaffoldFilePlans', () => {
|
|
|
334
334
|
it('should generate stream guard when not all commands share stream pattern fields', async () => {
|
|
335
335
|
const spec: SpecsSchema = {
|
|
336
336
|
variant: 'specs',
|
|
337
|
-
|
|
337
|
+
scenes: [
|
|
338
338
|
{
|
|
339
339
|
name: 'Member tracks workouts',
|
|
340
|
-
|
|
340
|
+
moments: [
|
|
341
341
|
{
|
|
342
342
|
type: 'command',
|
|
343
343
|
name: 'Track workouts',
|
|
@@ -446,7 +446,7 @@ describe('generateScaffoldFilePlans', () => {
|
|
|
446
446
|
],
|
|
447
447
|
};
|
|
448
448
|
|
|
449
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
449
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
450
450
|
const handleFile = plans.find((p) => p.outputPath.endsWith('handle.ts'));
|
|
451
451
|
|
|
452
452
|
expect(handleFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -480,10 +480,10 @@ describe('generateScaffoldFilePlans', () => {
|
|
|
480
480
|
it('should generate randomUUID for stream vars not in any command', async () => {
|
|
481
481
|
const spec: SpecsSchema = {
|
|
482
482
|
variant: 'specs',
|
|
483
|
-
|
|
483
|
+
scenes: [
|
|
484
484
|
{
|
|
485
485
|
name: 'Fitness tracker',
|
|
486
|
-
|
|
486
|
+
moments: [
|
|
487
487
|
{
|
|
488
488
|
type: 'command',
|
|
489
489
|
name: 'Log workout',
|
|
@@ -553,7 +553,7 @@ describe('generateScaffoldFilePlans', () => {
|
|
|
553
553
|
],
|
|
554
554
|
};
|
|
555
555
|
|
|
556
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
556
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
557
557
|
const handleFile = plans.find((p) => p.outputPath.endsWith('handle.ts'));
|
|
558
558
|
|
|
559
559
|
expect(handleFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -6,10 +6,10 @@ describe('mutation.resolver.ts.ejs', () => {
|
|
|
6
6
|
it('should generate a valid mutation resolver file', async () => {
|
|
7
7
|
const spec: SpecsSchema = {
|
|
8
8
|
variant: 'specs',
|
|
9
|
-
|
|
9
|
+
scenes: [
|
|
10
10
|
{
|
|
11
11
|
name: 'Host creates a listing',
|
|
12
|
-
|
|
12
|
+
moments: [
|
|
13
13
|
{
|
|
14
14
|
type: 'command',
|
|
15
15
|
name: 'Create listing',
|
|
@@ -77,7 +77,7 @@ describe('mutation.resolver.ts.ejs', () => {
|
|
|
77
77
|
],
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
80
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
81
81
|
const mutationFile = plans.find((p) => p.outputPath.endsWith('mutation.resolver.ts'));
|
|
82
82
|
|
|
83
83
|
expect(mutationFile?.contents).toMatchInlineSnapshot(`
|
|
@@ -139,10 +139,10 @@ describe('mutation.resolver.ts.ejs', () => {
|
|
|
139
139
|
it('should generate the mutation resolver for AnswerQuestion', async () => {
|
|
140
140
|
const spec: SpecsSchema = {
|
|
141
141
|
variant: 'specs',
|
|
142
|
-
|
|
142
|
+
scenes: [
|
|
143
143
|
{
|
|
144
144
|
name: 'Questionnaires',
|
|
145
|
-
|
|
145
|
+
moments: [
|
|
146
146
|
{
|
|
147
147
|
name: 'submits a questionnaire answer',
|
|
148
148
|
type: 'command',
|
|
@@ -225,7 +225,7 @@ describe('mutation.resolver.ts.ejs', () => {
|
|
|
225
225
|
integrations: [],
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
228
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
229
229
|
const mutationFile = plans.find(
|
|
230
230
|
(p) =>
|
|
231
231
|
p.outputPath.endsWith('mutation.resolver.ts') && p.contents.includes('export class AnswerQuestionResolver'),
|
|
@@ -272,10 +272,10 @@ describe('mutation.resolver.ts.ejs', () => {
|
|
|
272
272
|
it('generates nested input types for inline object arrays in a mutation', async () => {
|
|
273
273
|
const spec: SpecsSchema = {
|
|
274
274
|
variant: 'specs',
|
|
275
|
-
|
|
275
|
+
scenes: [
|
|
276
276
|
{
|
|
277
277
|
name: 'Cart',
|
|
278
|
-
|
|
278
|
+
moments: [
|
|
279
279
|
{
|
|
280
280
|
type: 'command',
|
|
281
281
|
name: 'Add items to cart',
|
|
@@ -325,7 +325,7 @@ describe('mutation.resolver.ts.ejs', () => {
|
|
|
325
325
|
],
|
|
326
326
|
};
|
|
327
327
|
|
|
328
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
328
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
329
329
|
const mutationFile = plans.find(
|
|
330
330
|
(p) =>
|
|
331
331
|
p.outputPath.endsWith('mutation.resolver.ts') && p.contents.includes('export class AddItemsToCartResolver'),
|
|
@@ -374,10 +374,10 @@ export class AddItemsToCartResolver {
|
|
|
374
374
|
it('should import Float when Float fields are used', async () => {
|
|
375
375
|
const spec: SpecsSchema = {
|
|
376
376
|
variant: 'specs',
|
|
377
|
-
|
|
377
|
+
scenes: [
|
|
378
378
|
{
|
|
379
|
-
name: 'product-
|
|
380
|
-
|
|
379
|
+
name: 'product-scene',
|
|
380
|
+
moments: [
|
|
381
381
|
{
|
|
382
382
|
type: 'command',
|
|
383
383
|
name: 'update-product-price',
|
|
@@ -431,7 +431,7 @@ export class AddItemsToCartResolver {
|
|
|
431
431
|
],
|
|
432
432
|
};
|
|
433
433
|
|
|
434
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
434
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
435
435
|
const mutationFile = plans.find((p) => p.outputPath.endsWith('mutation.resolver.ts'));
|
|
436
436
|
|
|
437
437
|
expect(mutationFile?.contents).toContain(
|
|
@@ -443,10 +443,10 @@ export class AddItemsToCartResolver {
|
|
|
443
443
|
it('should generate @InputType classes for referenced message types with Input suffix', async () => {
|
|
444
444
|
const spec: SpecsSchema = {
|
|
445
445
|
variant: 'specs',
|
|
446
|
-
|
|
446
|
+
scenes: [
|
|
447
447
|
{
|
|
448
448
|
name: 'Shopping',
|
|
449
|
-
|
|
449
|
+
moments: [
|
|
450
450
|
{
|
|
451
451
|
type: 'command',
|
|
452
452
|
name: 'Place order',
|
|
@@ -504,7 +504,7 @@ export class AddItemsToCartResolver {
|
|
|
504
504
|
],
|
|
505
505
|
};
|
|
506
506
|
|
|
507
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
507
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
508
508
|
const mutationFile = plans.find(
|
|
509
509
|
(p) => p.outputPath.endsWith('mutation.resolver.ts') && p.contents.includes('export class PlaceOrderResolver'),
|
|
510
510
|
);
|
|
@@ -552,10 +552,10 @@ export class AddItemsToCartResolver {
|
|
|
552
552
|
it('uses parsedRequest operationName when it differs from camelCase(cmd.type)', async () => {
|
|
553
553
|
const spec: SpecsSchema = {
|
|
554
554
|
variant: 'specs',
|
|
555
|
-
|
|
555
|
+
scenes: [
|
|
556
556
|
{
|
|
557
557
|
name: 'Questionnaires',
|
|
558
|
-
|
|
558
|
+
moments: [
|
|
559
559
|
{
|
|
560
560
|
name: 'submit answer',
|
|
561
561
|
type: 'command',
|
|
@@ -612,7 +612,7 @@ export class AddItemsToCartResolver {
|
|
|
612
612
|
],
|
|
613
613
|
};
|
|
614
614
|
|
|
615
|
-
const { plans } = await generateScaffoldFilePlans(spec.
|
|
615
|
+
const { plans } = await generateScaffoldFilePlans(spec.scenes, spec.messages, undefined, 'src/domain/narratives');
|
|
616
616
|
const mutationFile = plans.find(
|
|
617
617
|
(p) => p.outputPath.endsWith('mutation.resolver.ts') && p.contents.includes('export class SubmitAnswerResolver'),
|
|
618
618
|
);
|