diff --git a/build.gradle b/build.gradle index 4f78d95..662d6f0 100644 --- a/build.gradle +++ b/build.gradle @@ -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}" } diff --git a/gradle.properties b/gradle.properties index af1a410..cf47ddf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -cmlVersion=6.11.0 +cmlVersion=6.11.1-SNAPSHOT gradleNodePluginVersion=3.5.0 nodeVersion=18.17.0 diff --git a/package-lock.json b/package-lock.json index fbc4d85..82ba8cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "context-mapper-vscode-extension", - "version": "6.11.0-SNAPSHOT", + "version": "6.12.0-SNAPSHOT", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "context-mapper-vscode-extension", - "version": "6.11.0-SNAPSHOT", + "version": "6.12.0-SNAPSHOT", "license": "Apache-2.0", "dependencies": { "lodash": ">=4.17.21", diff --git a/src/commands/transformations.ts b/src/commands/transformations.ts index be1a98b..d95e9a3 100644 --- a/src/commands/transformations.ts +++ b/src/commands/transformations.ts @@ -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()) diff --git a/src/extension.ts b/src/extension.ts index a8c596e..5639dcf 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -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()), @@ -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 diff --git a/syntaxes/cml.tmLanguage.json b/syntaxes/cml.tmLanguage.json index 142f014..2b526fe 100644 --- a/syntaxes/cml.tmLanguage.json +++ b/syntaxes/cml.tmLanguage.json @@ -31,6 +31,12 @@ { "include": "#tacticDDDKeywords" }, + { + "include": "#stakeholderKeyWords" + }, + { + "include": "#valueRegisterKeyWords" + }, { "include": "#stringsSingle" }, @@ -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", @@ -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": "'",