How to develop plugins efficiently? #6108
-
I find myself making a few plugins here and there and I still struggle with doing it efficiently. My first attempt was to create the plugin directory following the instructions on (dev documentation)[https://tiddlywiki.com/dev/] and then after every change run Now I am trying to use Clearly there must be a smarter way but either it's undocumented, it's hidden or I am missing something obvious - so what's the best way to develop plugins efficiently? And to explain what I mean efficiently, in the order of desirability:
Is any of this attainable? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 6 replies
-
I use the node.js server for all development work and combined with nodemon, I only need a browser refresh after making changes to the code.
Then use a npm run script to start the server with nodemon, see for example: I assume this isn't set up in the official repo to avoid the nodemon dev dependency. I also wrote starter scripts to create a skeleton directory for a new plugin, and also for adding a skeleton for a new widget or filter or startup module. |
Beta Was this translation helpful? Give feedback.
-
PlaygroundYou can use TiddlyGit to set up a local workspace, and use And after you build up the plugin (using nodemon or webpack devserver or manually build), just click "restart service" in the context menu to reload the plugin. PluginI use rollup to build typescript plugin to js plugin , example in https://github.com/tiddly-gittly/tiddlywiki-plugins/tree/master/src/pinyin-fuzzy-search I separate the wiki playground and plugin code, so the git change will be cleaner. |
Beta Was this translation helpful? Give feedback.
-
I do use 3 different directories. With a plugin I also need to create an edition that contains the documentation and I need a second edition to start the development server. I know that it's possible to start a server without an extra server edition with My approach has some big advantages over the start command above:
The whole setup can be found at: https://github.com/wikilabs .. There are 3 repos: editions, plugins and themes. ... I'm using VSCode and the "Workspace Sidebar Plugin", that lets me see all 3 directories in 1 editor session. On windows I'm using the following environment variables, so TW will find the directories.
|
Beta Was this translation helpful? Give feedback.
-
If you, by any chance, only create wikitext plugins then maybe creating them directly in TW is more efficient, by using Andreas Hahns "Tinka Plugin Packer" plugin. I.e you create the tiddlers and use Tinka to pack them into a single plugin with the original tids as shadows. |
Beta Was this translation helpful? Give feedback.
-
@EvidentlyCube Almost all kookma plugins were developed using a customized ThirdFlow! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
I use the node.js server for all development work and combined with nodemon, I only need a browser refresh after making changes to the code.
Then use a npm run script to start the server with nodemon, see for example:
https://github.com/saqimtiaz/tw5-file-uploads/blob/c37ae9f580b2e052135b8876e3ae62002a18b4d5/package.json#L14
I assume this isn't set up in the official repo to avoid the nodemon dev dependency.
I also wrote starter scripts to create a skeleton directory for a new plugin, and also for adding a skeleton for a new widget or filter or startup module.