I would like to be able to create a module that can be shared between a few of my projects. All of the code currently exists in one of the applications as a "pure JS" CommonJS library. My UI code does a require on it to be able to use it. Manually keeping a copy of the js file in multiple projects works but is so wonky it makes my head hurt even considering it.
There does not seem to be an easy way to take my code and package it as a single module. According to the current docs, this should be achievable.
I've tried using studio to create separate iOS and Android modules. That seems to work ok, but still leaves me with needing 2 modules and some stub Objective-C and Java classes.
I've tried using the titanium CLI to create a module with andriod and ios targets. After importing the project to Studio, it gets confused and just won't let me package it either way.
I'm assuming the "platform: commonjs" used in the manifest for the ti.cloud module (found here: ~Library/Application Support/Titanium/modules/commonjs/ti.cloud) is something that can't be used by us mere mortals.
All I want to do is:
- Have 1 module project that can be used on Android or iOS (like the implementation of ti.cloud)
- Have the module project only contain javascript
- It would be nice if Studio would be capable of packaging the module (one configuration each for iOS and Android would be ok as well)
Any insight would be appreciated.