Skip to content

Commit

Permalink
Remove Service Cutter features from VSCode Extension
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-ka committed Jan 4, 2024
1 parent 331c053 commit 0761ba5
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 129 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Related repositories are:
* [Context Mapper DSL, Eclipse Plugin, and Language Server (LSP)](https://github.com/ContextMapper/context-mapper-dsl)
* [Context Mapper Example Models](https://github.com/ContextMapper/context-mapper-examples)

With the ContextMapper DSL language you can express DDD Context Maps. Once you have modeled your system with the language, you can use the provided generators to create graphical Context Maps, UML diagrams, service contracts, Spring Boot applications (via JHipster JDL) and calculate proposals for service decompositions with [Service Cutter](https://github.com/ServiceCutter/ServiceCutter).
With the ContextMapper DSL language you can express DDD Context Maps. Once you have modeled your system with the language, you can use the provided generators to create graphical Context Maps, UML diagrams, service contracts and Spring Boot applications (via JHipster JDL).

Checkout our website [https://contextmapper.org/](https://contextmapper.org/) to get started.
The Context Mapper project has been developed as part of projects at [OST (former HSR)](https://www.ost.ch) and you can find the project reports and further background information [here](https://contextmapper.org/background-and-publications/).
Expand Down
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.

50 changes: 0 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,6 @@
"command": "cml.generate.contextmap.proxy",
"title": "Generate Graphical Context Map",
"when": "editorLangId == cml"
},
{
"command": "cml.generate.new.service.cut.proxy",
"title": "Propose New Service Cut",
"when": "editorLangId == cml"
},
{
"command": "cml.generate.servicecutter.input.proxy",
"title": "Generate Service Cutter Input (ERD as JSON)",
"when": "editorLangId == cml"
},
{
"command": "cml.generate.servicecutter.user.representations.proxy",
"title": "Generate Service Cutter User Representations (SCL)",
"when": "editorLangId == cml"
},
{
"command": "cml.generate.servicecutter.user.representation.example.file.proxy",
"title": "Generate SCL Example File (Syntax Sample)",
"when": "editorLangId == cml"
},
{
"command": "scl.generate.user.representations.json.file.proxy",
"title": "Generate Service Cutter User Representation JSON File",
"when": "editorLangId == scl"
}
],
"menus": {
Expand Down Expand Up @@ -151,31 +126,6 @@
"when": "resourceLangId == cml",
"command": "cml.generate.mdsl.proxy",
"group": "cmlGenerators@5"
},
{
"when": "resourceLangId == cml",
"command": "cml.generate.new.service.cut.proxy",
"group": "cmlGenerators@6"
},
{
"when": "resourceLangId == cml",
"command": "cml.generate.servicecutter.input.proxy",
"group": "cmlGenerators@7"
},
{
"when": "resourceLangId == cml",
"command": "cml.generate.servicecutter.user.representations.proxy",
"group": "cmlGenerators@8"
},
{
"when": "resourceLangId == cml",
"command": "cml.generate.servicecutter.user.representation.example.file.proxy",
"group": "cmlGenerators@9"
},
{
"when": "resourceLangId == scl",
"command": "scl.generate.user.representations.json.file.proxy",
"group": "sclGenerators@1"
}
]
},
Expand Down
16 changes: 0 additions & 16 deletions src/commands/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,6 @@ export function generateContextMap(): CommandType {
};
}

export function generateNewServiceCut(): CommandType {
return generate('cml.generate.new.service.cut', 'The new CML model (new service cut) has been created.');
}

export function generateServiceCutterInput(): CommandType {
return generate('cml.generate.servicecutter.input', 'The Service Cutter input file (JSON) has been generated into the src-gen folder.');
}

export function generateServiceCutterUserRepresentations(): CommandType {
return generate('cml.generate.servicecutter.user.representations', 'The Service Cutter user representations file (SCL) has been generated.');
}

export function generateServiceCutterUserRepresentationExampleFile(): CommandType {
return generate('cml.generate.servicecutter.user.representation.example.file', 'The Service Cutter user representation example file file (SCL) has been generated.');
}

function generate(command: string, successMessage: string, ...additionalParameters: any[]): CommandType {
return async () => {
if (editor.isNotCMLEditor())
Expand Down
28 changes: 0 additions & 28 deletions src/commands/sclGenerators.ts

This file was deleted.

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

export function extractSuggestedServiceCut(): CommandType {
return async (...args: any[]) => {
const originalModelURI: string = args[0];
const serviceCutModelURI: string = args[1];
const serviceName: string = args[2];

const newBoundedContextName: string = await input.askForName("Please define how the new Bounded Context shall be named.", "NewBoundedContext");
if (!newBoundedContextName)
return;

const origUri: Uri = Uri.parse(originalModelURI);
if (fs.existsSync(origUri.fsPath))
await commands.executeCommand('vscode.open', origUri, { viewColumn: ViewColumn.Two });

const returnVal: string = await commands.executeCommand('cml.ar.extractSuggestedService', originalModelURI, [serviceCutModelURI, serviceName, newBoundedContextName]);
if (returnVal.startsWith('Error occurred:')) {
window.showErrorMessage(returnVal);
}
};
}

function transform(command: string, ...additionalParameters: any[]): CommandType {
return async () => {
if (editor.isNotCMLEditor())
Expand Down
13 changes: 2 additions & 11 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Trace } from 'vscode-jsonrpc';
import { commands, workspace, ExtensionContext, Uri, InputBoxOptions } from 'vscode';
import { LanguageClient, LanguageClientOptions, ServerOptions, VersionedTextDocumentIdentifier } from 'vscode-languageclient';
import * as generators from "./commands/generators";
import * as sclGenerators from "./commands/sclGenerators";
import * as transformations from "./commands/transformations";
import * as quickfixCommands from "./commands/quickfixcommands";

Expand Down Expand Up @@ -37,14 +36,7 @@ export function activate(context: ExtensionContext) {
commands.registerCommand("cml.generate.sketchminer.proxy", generators.generateSketchMinerDiagrams()),
commands.registerCommand("cml.generate.mdsl.proxy", generators.generateMDSL()),
commands.registerCommand("cml.generate.generic.text.file.proxy", generators.generateGenericTextFile()),
commands.registerCommand("cml.generate.contextmap.proxy", generators.generateContextMap()),
commands.registerCommand("cml.generate.new.service.cut.proxy", generators.generateNewServiceCut()),
commands.registerCommand("cml.generate.servicecutter.input.proxy", generators.generateServiceCutterInput()),
commands.registerCommand("cml.generate.servicecutter.user.representations.proxy", generators.generateServiceCutterUserRepresentations()),
commands.registerCommand("cml.generate.servicecutter.user.representation.example.file.proxy", generators.generateServiceCutterUserRepresentationExampleFile()),

// SCL
commands.registerCommand("scl.generate.user.representations.json.file.proxy", sclGenerators.generateServiceCutterUserRepresentationJSONFile())
commands.registerCommand("cml.generate.contextmap.proxy", generators.generateContextMap())
);

// Register OOAD transformation commands
Expand All @@ -57,8 +49,7 @@ 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.extractSuggestedService.proxy", transformations.extractSuggestedServiceCut())
commands.registerCommand("cml.ar.suspendPartnership.proxy", transformations.suspendPartnership())
);

// Register quickfix commands
Expand Down

0 comments on commit 0761ba5

Please sign in to comment.