Get a Titanium™ SDK CommonJS module out of a Node package!
Build your Titanium CommonJS Modules as they should be: as CommonJS packages, allowing more than one file.
Developed around substack’s browserify, titaniumifier is a tool that can be used to build a zip file following Titanium SDK conventions with a package.json
as its starting point.
The Titaniumifier Wiki is where you’ll find the most up to date documentation.
If you’re serious with it you can use the Grunt plugin.
If you just want to test it out you can use the titaniumifier
CLI (good for quick tests):
# install it globally
$ [sudo] npm install --global titaniumifier
# move into a node package
$ cd path/to/project
# this will build dist/NAME-commonjs.VERSION.zip
$ titaniumifier --out dist
You’ll want to give titaniumifier
a try if you want to write
npm
dependencies;npm
.Once you’re done writing your package you’ll be able to publish it on npm
for users to
Even with titaniumifier
you still wont be ablo to
socket.io
without work;npm install ...
;gitTio
;Buffer
with Titanium.Buffer
TypedArrays
,set/clearImmediate
,process.nextTick
;http
,net
(with Titanium.Network.TCPSocket
),stream
(and make fs
work with it.)The shimming process could be a community effort into the development of ti-http
, ti-net
etc. Contact us if you’re interested in working on it. In case don’t limit yourself to pure JS, give native development a chance.
The reference packages have been tested extensively from Titanium SDK 3.2 onward. There should be no reson for titaniumified packages to not work on older SDK versions.
Issues with Titanium SDK 3.x will be considered critical. With older versions we’ll try to do our best.
Because it does not mangle your Resources
folder it is compatible with Alloy and TiShadow (and similars.) Please report any issue you have.
Currently Node.js 0.10 environment is shimmed in the packaging process. Once Node.js 0.12 is out there will be some interesting challenge to cope with (generators, WeakMap etc.)
Once that happens we’ll shim whatever is necessary.
This code is tested against Node.js 0.10 and 0.11.
At the moment, you’ll use titaniumifier
through its grunt
plugin, grunt-titaniumifier
.
There are 2 reference packages at the moment:
ti-superagent
Which wraps @visionmedia’s superagent
liferay-connector
Which is a connector for our Portal Framework of choice, LiferayIf you feel like helping, we’ll accept pull requests with great joy.
Here are a few ideas to help this project:
Please, don’t be afraid in opening new issues, even just for asking some help.
Humbly made by the spry ladies and gents at SMC.
This library, titaniumifier, is free software ("Licensed Software"); you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; including but not limited to, the implied warranty of MERCHANTABILITY, NONINFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA