Skip to content

Commit

Permalink
WIP comment out stuff for test generation to work. DO NOT PUSH THIS C…
Browse files Browse the repository at this point in the history
…OMMIT INTO MAIN
  • Loading branch information
bofalke committed Oct 5, 2023
1 parent 787a428 commit 718a517
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
4 changes: 2 additions & 2 deletions packages/cody/codyconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ module.exports = {
*/
onAggregate,
// onBoundedContext,
onCommand,
// onCommand,
onDocument,
onEvent,
// onEvent,
onFeature,
// onFreeText: onFreeTextHook,
// onExternalSystem: onExternalSystemHook,
Expand Down
50 changes: 25 additions & 25 deletions packages/cody/src/lib/hooks/on-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,31 @@ export const onCommand: CodyHook<Context> = async (command: Node, ctx: Context)

const {tree} = ctx;

generateFiles(tree, __dirname + '/command-files/shared', ctx.sharedSrc, {
'tmpl': '',
'service': serviceNames.fileName,
// Please note: The order of substitutions is important here, because ProophBoardInfo contains "aggregateName"
// but it's a combined name of Service.Aggregate. The template itself requires "aggregateName" without Service
// which is defined below and therefor has precedence over the variable from ProophBoardInfo
...withErrorCheck(updateProophBoardInfo, [command, ctx, tree]),
serviceNames,
isAggregateCommand,
newAggregate: meta.newAggregate,
aggregateName: nodeNameToPascalCase(aggregate),
aggregateIdentifier: aggregateStateMeta.identifier,
toJSON,
...cmdNames,
schema,
uiSchema,
dependencies,
deleteState,
deleteHistory,
});

withErrorCheck(register, [command, ctx, tree]);
await asyncWithErrorCheck(upsertCommandComponent, [command, ctx, tree]);

await formatFiles(tree);
// generateFiles(tree, __dirname + '/command-files/shared', ctx.sharedSrc, {
// 'tmpl': '',
// 'service': serviceNames.fileName,
// // Please note: The order of substitutions is important here, because ProophBoardInfo contains "aggregateName"
// // but it's a combined name of Service.Aggregate. The template itself requires "aggregateName" without Service
// // which is defined below and therefor has precedence over the variable from ProophBoardInfo
// ...withErrorCheck(updateProophBoardInfo, [command, ctx, tree]),
// serviceNames,
// isAggregateCommand,
// newAggregate: meta.newAggregate,
// aggregateName: nodeNameToPascalCase(aggregate),
// aggregateIdentifier: aggregateStateMeta.identifier,
// toJSON,
// ...cmdNames,
// schema,
// uiSchema,
// dependencies,
// deleteState,
// deleteHistory,
// });
//
// withErrorCheck(register, [command, ctx, tree]);
// await asyncWithErrorCheck(upsertCommandComponent, [command, ctx, tree]);
//
// await formatFiles(tree);

const changes = tree.listChanges();

Expand Down
68 changes: 34 additions & 34 deletions packages/cody/src/lib/hooks/on-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,23 @@ export const onEvent: CodyHook<Context> = async (event: Node, ctx: Context) => {

const {tree} = ctx;

generateFiles(tree, __dirname + '/event-files/shared', ctx.sharedSrc, {
'tmpl': '',
'service': serviceNames.fileName,
'aggregate': aggregateNames.fileName,
serviceNames,
aggregateNames,
aggregateStateNames: {
...aggregateStateNames,
classNameWithNamespace: `${namespaceToJSONPointer(aggregateStateMeta.ns)}${aggregateStateNames.className}`,
},
isAggregateEvent,
aggregateIdentifier: aggregateStateMeta.identifier,
toJSON,
...eventNames,
schema: meta.schema,
...withErrorCheck(updateProophBoardInfo, [event, ctx, tree])
});
// generateFiles(tree, __dirname + '/event-files/shared', ctx.sharedSrc, {
// 'tmpl': '',
// 'service': serviceNames.fileName,
// 'aggregate': aggregateNames.fileName,
// serviceNames,
// aggregateNames,
// aggregateStateNames: {
// ...aggregateStateNames,
// classNameWithNamespace: `${namespaceToJSONPointer(aggregateStateMeta.ns)}${aggregateStateNames.className}`,
// },
// isAggregateEvent,
// aggregateIdentifier: aggregateStateMeta.identifier,
// toJSON,
// ...eventNames,
// schema: meta.schema,
// ...withErrorCheck(updateProophBoardInfo, [event, ctx, tree])
// });

withErrorCheck(register, [event, ctx, tree]);
withErrorCheck(createApplyFunctionRegistryIfNotExists, [syncedAggregate, ctx, tree]);
Expand All @@ -77,23 +77,23 @@ export const onEvent: CodyHook<Context> = async (event: Node, ctx: Context) => {
rules.push(withErrorCheck(alwaysMapPayload, [event, aggregateState, ctx]));
}

generateFiles(tree, __dirname + '/event-files/be', ctx.beSrc, {
'tmpl': '',
'service': serviceNames.fileName,
'aggregate': aggregateNames.fileName,
serviceNames,
aggregateNames,
aggregateStateNames: {
...aggregateStateNames,
fileNameWithNamespace: `${namespaceToFilePath(aggregateStateMeta.ns)}${aggregateStateNames.fileName}`,
},
...eventNames,
rules: withErrorCheck(convertRuleConfigToEventReducerRules, [event, ctx, rules]),
});

withErrorCheck(registerEventReducer, [service, event, syncedAggregate, ctx, tree]);

await formatFiles(tree);
// generateFiles(tree, __dirname + '/event-files/be', ctx.beSrc, {
// 'tmpl': '',
// 'service': serviceNames.fileName,
// 'aggregate': aggregateNames.fileName,
// serviceNames,
// aggregateNames,
// aggregateStateNames: {
// ...aggregateStateNames,
// fileNameWithNamespace: `${namespaceToFilePath(aggregateStateMeta.ns)}${aggregateStateNames.fileName}`,
// },
// ...eventNames,
// rules: withErrorCheck(convertRuleConfigToEventReducerRules, [event, ctx, rules]),
// });
//
// withErrorCheck(registerEventReducer, [service, event, syncedAggregate, ctx, tree]);
//
// await formatFiles(tree);

const changes = tree.listChanges();

Expand Down

0 comments on commit 718a517

Please sign in to comment.