twcloud / tiddlyweb-sse

MIT License
10 stars 3 forks source link

Release a plugin in proper format #5

Open linonetwo opened 1 year ago

linonetwo commented 1 year ago

Hi @Arlen22 , the tiddlers field in plugin you released will be wiped out by

https://github.com/Jermolene/TiddlyWiki5/blob/a12a9bd93941748e20c5748170ed22cf5fb7cff0/core/modules/deserializers.js#L30-L38

So the generated plugin is not passing the plugin-library building process (while is useable by drag into a wiki)

Please do as other plugins does:

Change

    "dependents": "",
    "type": "application/json",
    "tiddlers": {
        "$:/plugins/twcloud/tiddlyweb-sse/readme": {
            "title": "$:/plugins/twcloud/tiddlyweb-sse/readme",
            "text": "This plugin runs in both the browser and server to sync changes immediately instead of waiting for polling. It adds a route to the server which sends server-sent events to the client, and loads an EventSource in the client to call $tw.syncer.syncFromServer(). \n\n[[Source code|https://github.com/twcloud/tiddlyweb-sse]]\r\n"
        },

To

    "dependents": "",
    "type": "application/json",
    "text": "{\"tiddlers\":{\"$:/plugins/twcloud/tiddlyweb-sse/readme\":{\"title\":\"$:/plugins/twcloud/tiddlyweb-sse/readme\",\"text\":\"This plugin runs in both the browser and server to sync changes immediately instead of waiting for polling. It adds a route to the server which sends server-sent events to the client, and loads an EventSource in the client to call $tw.syncer.syncFromServer(). \\n\\n[[Source code|https://github.com/twcloud/tiddlyweb-sse]]\\r\\n\"},

Like other authors does:

{"title":"$:/plugins/dullroar/sitemap","description":"TiddlyWiki5 plugin to generate sitemap.xml.","author":"Jim Lehmer","version":"0.0.2","core-version":">=5.0.8","source":"https://github.com/dullroar/TW5-sitemap","plugin-type":"plugin","dependents":"","type":"application/json","text":"{\"tiddlers\":{\"RenderSitemap\":{\"title\":\"RenderSitemap\",\"created\":\"20150104141300000\",\"creator\":\"Jim\",\"extension\":\".xml\",\"modified\":\"20150104141300000\",\"modifier\":\"Jim\",\"tags\":\"static $:/tags/Exporter\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"\\define renderContent()\n<$text text=<<sitemapentries filter:\\"\\"\\"$(exportFilter)$\\"\\"\\">>/>\n\\end\n<>\"},\"sitemap\":{\"title\":\"sitemap\",

linonetwo commented 1 year ago

I have to hard code this to workaround.

Also I recommend using https://github.com/tiddly-gittly/Modern.TiddlyDev for a standardized dev pipeline, can avoid many bugs like this and #3 (I mean forget to release)

linonetwo commented 1 year ago

Nevermind, I'm using a modified version in https://github.com/tiddly-gittly/TidGi-Desktop/blob/1f7c96ca4057907e66469dd274e8d6455a612b42/src/services/wiki/plugin/ipcSyncAdaptor/ipc-syncadaptor.ts#L53

which is using electron IPC instead of HTTP, so is faster in TidGi.

linonetwo commented 6 months ago

@Arlen22 Hi, are you still there? I want to install tw sse from CPL and find it is still mailformed, can you take time to change it? thanks.