So I’m curious what is everyone’s best workflow for plugin development?
The article on tiddlywiki.com/dev gives a good overview of how to setup the git
structure and to use the tiddlywiki node package, but it’s very light on the workflow of development itself.
Do people edit the files in a 3rd party editor (Vs code, vim etc), and if so do you just restart the tiddlywiki server? Or are you just doing everything in the tiddlywiki interface?
I’ve been using watch-fs plugin as I like using vscode for rapid development, but it crashes a lot when I am using tiddlers that become json due to field manipulation. I also noticed that watch-fs doesn’t seem to track the files in the plugins folder.
How is everyone solving these issues? Is their a better workflow that I should be using?
I put the plugin development environment together with the notebook tiddlywiki wiki, since the plugin environment is local, there is no need to set any additional environment variables, Therefore, it is also very convenient to build plugin library for personal
Previously, I often used Gatha to quickly package plugins when I was unskilled, it was really convenient for convenient plugin developers, but after I used it for a while, I found that the tiddlers generated by Gatha were a little unfriendly to me, so I gave up temporarily took it
The $:/Import tiddler will appear. DO NOT press the “Import” button!
Instead, EDIT the $:/Import tiddler
Change the tiddler’s title to your desired plugin name (e.g., $:/plugins/yourname/pluginname)
Scroll to the bottom of the tiddler to see the “extra” fields
Change the value of the plugin-type field from “import” to “plugin”
Delete the status field
Scroll back to the top of the tiddler and press the “done” (checkmark) button to save the tiddler changes.
That’s it! You now have an INSTALLED plugin containing the “imported” tiddlers, which are all available as shadow tiddlers! Note that if there are any .js tiddlers in your plugin, you will need to save-and-reload for those tiddlers to take effect.
To install your plugin in another TiddlyWiki, you can simply drag-and-drop the newly created plugin tiddler (e.g. $:/plugins/yourname/pluginname) into that other TiddlyWiki.
I’ve developed my own—probably inefficient—workflow, since I haven’t been able to understand how people do this. I’m eager to learn, but I really can’t relate to what you’re saying in this thread.
This is for my Javascript-based Markdown export plugin:
I create all content tiddlers (readme, license, test data, and so on) in the browser in the single-file demo wiki. This is saved to the html file using the Timimi extension.
I have extracted these tiddlers to .tid files during the build stage below, and update them using Visual Studio Code.
I have created a plugin.info file using Visual Studio Code
Rebuild single-file wiki from folder and replace the previous version with the new one.
Remove the wiki folder created in #1.
This currently takes 8 seconds. Then I either refresh the single-file wiki in the browser to do some manual testing, or run a test script, that exports my test data and compares with expected output.
I realize now that I can probably make this faster by not removing and re-creating the wiki folder after each update and test. Then I should split the make script into several scripts:
Prepare: Split/extract single-file wiki to a folder
Build: Compile Typescript to Javascript and copy Javascript and .tid files to the correct folder
Publish: Update plugin.info, generate JSON file and rebuild single-file wiki
Such kind of recipes must be collected at least at https://tiddlywiki.com/dev/. In forum they get mixed with less technical content and the chances to find them go below 100% because of it.
I made my first plugin while learning with Tinka and the only additional thing it does is autobumping versions. But the huge didactic advantage of this over Tinka is that it explains much better what’s happening.