diff --git a/templates/module/default/template/README.ejs b/templates/module/default/template/README.md.ejs similarity index 89% rename from templates/module/default/template/README.ejs rename to templates/module/default/template/README.md.ejs index 3e554d9cef3..ee736549722 100644 --- a/templates/module/default/template/README.ejs +++ b/templates/module/default/template/README.md.ejs @@ -36,9 +36,9 @@ Simply run `ti build -p [ios|android] --build-only` which will compile and packa ## Linting -You can use `clang` to lint your code. A default Axway linting style is included inside the module main folder. +You can use `clang` to lint your code. A default linting style is included inside the module main folder. Run `clang-format -style=file -i SRC_FILE` in the module root to lint the `SRC_FILE`. You can also patterns, -like `clang-format -style=file -i Classes/*` +like `clang-format -style=file -i Classes/*` ## Install @@ -98,10 +98,4 @@ ti build -p [ios|android] This will execute the app.js in the example/ folder as a Titanium application. -## Distribution - -You have a variety of choises for distributing your module -- [Gitt.io](http://gitt.io/) -- [Axway Marketplace](https://marketplace.axway.com/home) - Code strong! diff --git a/templates/module/default/template/example/app.js.ejs b/templates/module/default/template/example/app.js.ejs index 6e7f0f71fcc..fa844f0069d 100644 --- a/templates/module/default/template/example/app.js.ejs +++ b/templates/module/default/template/example/app.js.ejs @@ -5,15 +5,13 @@ // open a single window -var win = Ti.UI.createWindow({ - backgroundColor:'white' -}); -var label = Ti.UI.createLabel(); +const win = Ti.UI.createWindow(); +const label = Ti.UI.createLabel(); win.add(label); win.open(); // TODO: write your module tests here -var <%- moduleNameJSSafe %> = require('<%- moduleId %>'); +import <%- moduleNameJSSafe %> from '<%- moduleId %>'; Ti.API.info("module is => " + <%- moduleNameJSSafe %>); label.text = <%- moduleNameJSSafe %>.example(); @@ -22,7 +20,7 @@ Ti.API.info("module exampleProp is => " + <%- moduleNameJSSafe %>.exampleProp); <%- moduleNameJSSafe %>.exampleProp = "This is a test value"; if (Ti.Platform.name == "android") { - var proxy = <%- moduleNameJSSafe %>.createExample({ + const proxy = <%- moduleNameJSSafe %>.createExample({ message: "Creating an example Proxy", backgroundColor: "red", width: 100, @@ -36,4 +34,3 @@ if (Ti.Platform.name == "android") { proxy.printMessage("Hello world!"); win.add(proxy); } -