Skip to content

Commit

Permalink
JEDi features for CM (preparing next release)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-ka committed Aug 22, 2024
1 parent 41adb71 commit f649d24
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

plugins {
id 'nebula.release' version '13.0.0'
id 'nebula.release' version '19.0.10'
id 'com.github.node-gradle.node' version "${gradleNodePluginVersion}"
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cmlVersion=6.11.0
cmlVersion=6.11.1-SNAPSHOT
gradleNodePluginVersion=3.5.0
nodeVersion=18.17.0
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/commands/transformations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ export function suspendPartnership(): CommandType {
};
}

export function executeGenericCommandWithSingleStringArg(command: string): CommandType {
return async (...args: any[]) => {
const singleInputId: string = args[1];
const transformFunction: Function = transform(command, singleInputId);
transformFunction();
}
}

function transform(command: string, ...additionalParameters: any[]): CommandType {
return async () => {
if (editor.isNotCMLEditor())
Expand Down
10 changes: 8 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function activate(context: ExtensionContext) {
commands.registerCommand("cml.generate.contextmap.proxy", generators.generateContextMap())
);

// Register OOAD transformation commands
// Register transformation commands
context.subscriptions.push(
commands.registerCommand("cml.ar.deriveSubdomainFromURs.proxy", transformations.deriveSubdomainFromUserRequirements()),
commands.registerCommand("cml.ar.deriveBoundedContextFromSDs.proxy", transformations.deriveBoundedContextFromSubdomains()),
Expand All @@ -49,7 +49,13 @@ export function activate(context: ExtensionContext) {
commands.registerCommand("cml.ar.extractAggregatesByCohesion.proxy", transformations.extractAggregatesByCohesion()),
commands.registerCommand("cml.ar.mergeAggregates.proxy", transformations.mergeAggregates()),
commands.registerCommand("cml.ar.mergeBoundedContexts.proxy", transformations.mergeBoundedContexts()),
commands.registerCommand("cml.ar.suspendPartnership.proxy", transformations.suspendPartnership())
commands.registerCommand("cml.ar.suspendPartnership.proxy", transformations.suspendPartnership()),
commands.registerCommand("cml.ar.moveStakeholderToGroup.proxy", transformations.executeGenericCommandWithSingleStringArg("cml.ar.moveStakeholderToGroup")),
commands.registerCommand("cml.ar.createValueForStakeholder.proxy", transformations.executeGenericCommandWithSingleStringArg("cml.ar.createValueForStakeholder")),
commands.registerCommand("cml.ar.addEthicalValueAssessment.proxy", transformations.executeGenericCommandWithSingleStringArg("cml.ar.addEthicalValueAssessment")),
commands.registerCommand("cml.ar.wrapValueInCluster.proxy", transformations.executeGenericCommandWithSingleStringArg("cml.ar.wrapValueInCluster")),
commands.registerCommand("cml.ar.createStakeholderForUserStoryRole.proxy", transformations.executeGenericCommandWithSingleStringArg("cml.ar.createStakeholderForUserStoryRole")),
commands.registerCommand("cml.ar.createValueRegisterForBoundedContext.proxy", transformations.executeGenericCommandWithSingleStringArg("cml.ar.createValueRegisterForBoundedContext")),
);

// Register quickfix commands
Expand Down
16 changes: 15 additions & 1 deletion syntaxes/cml.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
{
"include": "#tacticDDDKeywords"
},
{
"include": "#stakeholderKeyWords"
},
{
"include": "#valueRegisterKeyWords"
},
{
"include": "#stringsSingle"
},
Expand Down Expand Up @@ -63,7 +69,7 @@
},
"userRequirementKeywords": {
"name": "keyword.control.cml",
"match": "\\b(UseCase|UserStory|actor|secondaryActors|interactions|benefit|scope|level|As a|As an|I want to|so that|true|a|an|the|with its|with their|in|for|to|create|read|update|delete|supports|split by)\\b"
"match": "\\b(UseCase|UserStory|actor|secondaryActors|interactions|benefit|scope|level|As a|As an|I want to|so that|true|a|an|the|with its|with their|in|for|to|create|read|update|delete|supports|split by|and that|is|are|promoted|accepting that|reduced|harmed)\\b"
},
"applicationLayerKeywords": {
"name": "keyword.control.cml",
Expand All @@ -73,6 +79,14 @@
"name": "keyword.control.cml",
"match": "\\b(Module|external|basePackage|hint|Aggregate|responsibilities|useCases|userRequirements|userStories|features|owner|knowledgeLevel|likelihoodForChange|structuralVolatility|contentVolatility|availabilityCriticality|consistencyCriticality|storageSimilarity|securityCriticality|securityZone|securityAccessGroup|Service|gap|nogap|webservice|Resource|scaffold|path|Consumer|unmarshall to|queueName|topicName|subscribe to|eventBus|publish|to|void|throws|hint|path|return|GET|POST|PUT|DELETE|abstract|Entity|extends|with|optimisticLocking|optimisticLocking|auditable|cache|databaseTable|discriminatorValue|discriminatorColumn|discriminatorType|discriminatorLength|inheritanceType|validate|aggregateRoot|belongsTo|ValueObject|DomainEvent|Event|CommandEvent|Command|Trait|package|def|DataTransferObject|BasicType|immutable|key|unique|changeable|required|nullable|index|digits|email|future|past|max|min|decimalMax|decimalMin|notEmpty|notBlank|pattern|range|size|length|scriptAssert|url|validate|transient|databaseColumn|databaseType|cascade|fetch|orderby|orderColumn|Repository|enum|ordinal|JOINED|SINGLE_TABLE|STRING|CHAR|INTEGER|String|int|Integer|long|Long|boolean|Boolean|Date|DateTime|Timestamp|BigDecimal|BigInteger|double|Double|float|Float|Key|PagingParameter|PagedResult|Blob|Clob|Object|Set|List|Bag|Collection|Map|public|protected|private|package|not|delegates|to|opposite|reference|aggregateLifecycle|read|-only|write)\\b"
},
"stakeholderKeyWords": {
"name": "keyword.control.cml",
"match": "\\b(Stakeholders|of|StakeholderGroup|Stakeholder|influence|interest|description|UNDEFINED|HIGH|MEDIUM|LOW)\\b"
},
"valueRegisterKeyWords": {
"name": "keyword.control.cml",
"match": "\\b(ValueRegister|for|ValueCluster|core|demonstrator|relatedValue|opposingValue|Value|isCore|Stakeholder|Stakeholders|priority|impact|consequences|ValueEpic|As a|I value|as demonstrated in|realization of|reduction of|ValueNarrative|When the SOI executes|stakeholders expect it to promote|protect or create|possibly degrading or prohibiting|with the following externally observable and|or internally auditable behavior|ValueWeigthing|In the context of the SOI|stakeholder|values|more than|expecting benefits such as|running the risk of harms such as|good|bad|neutral|action|ACT|MONITOR|UNDEFINED|HIGH|MEDIUM|LOW|AUTONOMY|CARE|CONTROL|FAIRNESS|INCLUSIVENESS|INNOVATION|PERFECTION|PRIVACY|RESPECT|SUSTAINABILITY|TRANSPARENCY|TRUST)\\b"
},
"stringsSingle": {
"name": "string.quoted.single.cml",
"begin": "'",
Expand Down

0 comments on commit f649d24

Please sign in to comment.