0
votes

I recently wrote a small hack to enable writing Titanium apps with TypeScript (https://github.com/developer82/Ti.TypeScript). This involves editing the SDK alloy compiler script.

As you can tell from what I've written the script is located at /Users/YOUR_USERNAME/.appcelerator/install/SDK_VERSION/package/node_modules/alloy/Alloy/commands/compile/index.js

When I run my project from Titanium Studio it works great. However when I try to run from command line using ti build -p ios I'm getting an error This project requires the TypeScript hack in Titnaium SDK - which is a validation I wrote that the hack was applied to the compiler.

The reason for this is that running from command line, the CLI is looking for alloy in /usr/local/bin/alloy - I learned that from the following output:

[INFO]  Executing Alloy compile: /usr/local/bin/node /usr/local/bin/alloy compile /Users/ophir/Documents/Appcelerator_Studio_Workspace/MY_PROJECT/app --config platform=ios,version=0,simtype=none,devicefamily=universal,deploytype=development,target=simulator

Why the different location? Why the CLI doesn't work like Appcelerator Studio? how can I make it work like Appc Studio?

1
I believe you've found a workaround as I saw your Medium post. What was it?Fokke Zandbergen
@Fokke-Appcelerator to this problem? no. not yet. Since App Studio doesn't support TypeScript I wanted to work with Atom. And I wanted to run my app (with LiveView) from terminal - and that's the error I got - it tries to run Alloy compiler from wrong location. For now what I'm doing is running the app from AppStudion and writing code in Atom - not idle.developer82
Ah, yes.. LiveView will always use the Alloy version bundled with the Appcelerator CLI. You'd have to hack into the LiveView plugin (found in the Package Contents of Appcelerator Studio) to change that.Fokke Zandbergen
@Fokke-Appcelerator It happens even if I don't run LiveView. Is this the same Alloy as deployed with SDK (can I just work with it)? or do you recommend finding a hack to force it to work with one in SDK?developer82

1 Answers

1
votes

Solution turned up to simpler than I thought... instead of using ti command I started using appc command:

appc run --platform iphone --liveview

I think ti is the open source version (which uses the alloy installed from node) and appc is the Appcelerator platform (that's what Appcelerator Studio runs).