Well, I thought I had finally sorted out how how to structure a demo site for developing a new widget plugin on tiddlywiki/node, but I have one more problem:
Making tiddlywiki see the external library I need.
I have a local TW/Node site like this:
TW-Demo
+------------plugins
+--------myPlugin
+------------myPlugin.js
+
|
+-----------files
+------myExtLibrary.js
How do I refer to myExtLIbrary.js within myPlugin.js? I tried the following:
var extLib = require("$:/plugins/myPlugin/files/myExtLibrary.js");
var extLib = require("$:/plugins/myPlugin/myExtLibrary.js");
var extLib = require("$:/myExtLibrary.js");
var extLib = require("$:files/myExtLibrary.js");
(I am clueless, obviously)
Everytime I get a "Cannot find module" error. I would immensely grateful to anyone kind enough to explain to me the semantics of the expression in the require statement. How is the path computed? Is it relative to the tiddliwiki module? That seems to implied by the standard use of a statement like:
var Widget = require("$:/core/modules/widgets/widget.js").widget;
But that can't be true, otherwise no local installation would ever use a plugin...
There's gotta be some magic somewhere that escapes me.
Cheers,
Stefano