Open bourgeoa opened 5 years ago
I don't remember exactly what I did, I just remember having a lot of trouble.
Basically, if you were to build this plugin, you would have to
tiddlywiki-remotestorage
to a folder inside the folder plugins/tiddlywiki
npm install
and npm build
./tiddlywiki.js editions/whatever --build index
(tiddlywiki.js
is in the root)That will give you an HTML file that is a full TiddlyWiki instance with your plugin available.
Please let me know if I can help you with anything else. I'm also on #tiddlywiki on Freenode.
Considering the error you're seeing, it's because you didn't build the plugin with npm
. But that is out of the scope of TiddlyWiki, it's just the basic thing all JavaScript people do: they use modules from npm as if they were writing Node.js code, then run browserify or something else on them to get a single JavaScript file with all files and dependencies bundled together, then they include that on the HTML.
You don't necessarily need to do that (specially if you're not using any external dependency), but if you want to, take a look at Browserify.
Also, you won't need the remotestorage
package.
Thank you very much. Your 2 mails where a very good explanation.
As a result I take a quick course on nmp. And looked at the intent of browserify.
I don't know where readonly is set and I do not understand your code related to readonly case in getclient().
All the best for Xmas and New Year
readonly
is just a variable specific to this plugin. I set it at the following lines: https://github.com/fiatjaf/tiddlywiki-remotestorage/blob/4e3af0636689b60e8a6e93462d8bd1512f0f83e2/main.js#L19-L21. It's relevant just because you could be browsing a remoteStorage instance that is not yours, thus it will be readonly.
getClient
is also just a helper function for building the RemoteStorage client. Again, shouldn't be relevant to your implementation.
I wanted to build your plugin and followed all steps in https://tiddlywiki.com/dev/ It does compile but when I use the
index.html
I got :It seems that
const remostorage = require("remotstoragejs")
was not resolved.Can you tell me how you did it. I'm using node.js 8.9.4
I'm using your plugin as an example to develop a syncadaptor to node-solid-server.