diff --git a/.gitignore b/.gitignore index ade4e14..89b7b0b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ out gen -test/testModel1Output \ No newline at end of file +test/testModel1Output +copyFiles.sh \ No newline at end of file diff --git a/README.md b/README.md index 40089ed..5924250 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,39 @@ # StarUMLJS + JavaScript code generation plugin for StarUML diagramming tool. + +## Current Status + +* Currently supports one way generation of JS code from a UML model. +* Uses the standard prototype JS definition of a "class" + +### Supported UML Concepts + +* The tool currently supports a subset of the StarUML model: + + * Classes + * Methods of classes (all treated as public) + * Attributes of classes + * Class Documentation + * Method Documentation + * Method Specification + * Method Precondition + * Method Postcondition + * Method Parameters + * Dependencies + * Direct Association + * Generalization + + +## Developers + +* Please contribute, this project is by no means complete and is currently not stable. +* Open dev tasks are: + * Reverse code engineering + * Other "class" definition styles + * More advanced UML concept support + +### Useful Links + +* StarUML application page: [http://staruml.io/](http://staruml.io/) +* StarUML extension developer guide: [https://github.com/staruml/staruml-dev-docs/wiki](https://github.com/staruml/staruml-dev-docs/wiki) diff --git a/main.js b/main.js index 65de19a..ff9cc6a 100644 --- a/main.js +++ b/main.js @@ -4,8 +4,6 @@ */ define(function (require, exports, module) { - "use strict"; - var Commands = app.getModule('command/Commands'); var CommandManager = app.getModule("command/CommandManager"); var MenuManager = app.getModule("menu/MenuManager"); @@ -15,16 +13,8 @@ define(function (require, exports, module) { var JSGen = require("JSCodeGenerator"); - function handleHelloWorld() { - - window.alert("hello world"); - - } - function handleGenerate(base, path, opts) { - console.log("handleGenerate()"); - var result = new $.Deferred(); // If base is not assigned, popup ElementPicker @@ -81,9 +71,9 @@ define(function (require, exports, module) { } - var CMD = "tools.helloworld"; + var CMD = "tools.javascript"; - CommandManager.register("Hello World", CMD, handleGenerate); + CommandManager.register("Generate JavaScript", CMD, handleGenerate); var menu = MenuManager.getMenu(Commands.TOOLS); diff --git a/package.json b/package.json new file mode 100644 index 0000000..07ab491 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "sdiemert.starumljs", + "title": "StarUMLJS", + "description": "JavaScript Code Generation Plugin", + "homepage": "https://github.com/sdiemert/StarUMLJS", + "version": "0.1.0", + "keywords": ["javascript", "staruml", "js", "UML"], + "author": { + "name": "Simon Diemert", + "email": "simon.diemert@gmail.com", + "url": "https://github.com/sdiemert" + }, + "license": "MIT", + "engines": { + "staruml": ">=2.0.0" + } +} \ No newline at end of file