Closed AppWerft closed 8 years ago
We extended the package.json spec to include references to native packages. It follows the shape of the other deps declarations:
{
"dependencies": { "pkg": "^1.2.3" },
"nativeDependencies": { "some.ti.module": "1.2.2" }
}
You get 2 boosts from using this notation:
require()
them and the call will pass to the Titanium implementation, therefore requiring the actual module, andI hope it solves you issue. Re-open if you feel it's necessary.
I have embedded by
"nativeDependencies": {
"./lib/ts.httprequest" : "*",
"./lib/ts.videoprovider" :"*",
"./lib/ti.promises" : "*"
},
In my module I have to use:
ar HTTPRequest = require('./lib/ts.httprequest/ts.httprequest');
var VideoProvider = require('./lib/ts.videoprovider/ts.videoprovider');
var Promise = require('./lib/org.favo.promise');
Without this double reference the modules are not found.
videoprovider depends on twice subsubmodules and now this subsub modules are not found:
Error: Cannot find module './lib/ts.cryptojs256/ts.cryptojs256.js' from '/Users/fuerst/Documents/Appcelerator_Studio_Workspace/Ti.YoutubeProxy/lib/ts.videoprovider'
Any ideas?
Ok. So, first of all lets force some terms in the discussion:
require()
d in JS that uses Node style require; can be installed with npm, jspm or manually.If you want to use Titanium modules in your titaniumified package, follow the mini-guide above.
If those modules are titaniumified packages themselves you need to add theirs nativeDependencies
on top of yours. Sad but required, consider it a workaround.
If those are packages (titaniumified or not) and they are published through npm (they should!) you can add them as simple deoendencies
and let npm handle the installation.
If they are neither available through gitTio nor npm you are left with copy paste or got sub modules. Avoid this scenario as much as possible.
I'm reopening as I'm pretty sure I'm not hitting your scenario 😖
I'll have a look at the source and try to be more specific and on point.
Did you solve your issue?
Please re-open if you feel this is not ‘closed’ :)
Hello,
how can I link modules as submodule.
https://github.com/AppWerft/Ti.YoutubeProxy
Cheers!
Rainer