From 9b9ff1e843d1fb526dfef08aff2f5bae03c1ae56 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Tue, 15 Nov 2022 09:18:58 +0100 Subject: [PATCH] Extend pluginlibrary edition with a minimal test server (#6588) * pluginlibrary - minimal test server * changes suggested by Jeremy * use tmp instead of the files directory * new tmp-route * rename edition to test-pluginlibrary * fix .gitignore * remove StoryList tiddler * improve GettingStarted text * rename edtion test-pluginlibrary back to pluginlibrary * remove 2 tiddlers that shouldn't be there --- .gitignore | 1 + ...run a local plugin library for testing.tid | 42 +++++++++++++++++ .../pluginlibrary/tiddlers/GettingStarted.tid | 45 +++++++++++++++++++ .../tiddlers/PrereleaseLocalPluginLibrary.tid | 6 +++ .../tiddlers/meta/SiteSubtitle.tid | 3 ++ .../pluginlibrary/tiddlers/meta/SiteTitle.tid | 3 ++ ...ddlywiki_vanilla_options_sidebarlayout.tid | 3 ++ editions/pluginlibrary/tiddlywiki.info | 7 +++ 8 files changed, 110 insertions(+) create mode 100644 editions/dev/tiddlers/How to run a local plugin library for testing.tid create mode 100644 editions/pluginlibrary/tiddlers/GettingStarted.tid create mode 100644 editions/pluginlibrary/tiddlers/PrereleaseLocalPluginLibrary.tid create mode 100644 editions/pluginlibrary/tiddlers/meta/SiteSubtitle.tid create mode 100644 editions/pluginlibrary/tiddlers/meta/SiteTitle.tid create mode 100644 editions/pluginlibrary/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid diff --git a/.gitignore b/.gitignore index 0727034e1..ad7e8e07f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ tmp/ output/ node_modules/ + diff --git a/editions/dev/tiddlers/How to run a local plugin library for testing.tid b/editions/dev/tiddlers/How to run a local plugin library for testing.tid new file mode 100644 index 000000000..5662e0767 --- /dev/null +++ b/editions/dev/tiddlers/How to run a local plugin library for testing.tid @@ -0,0 +1,42 @@ +created: 20221114225038703 +modified: 20221114230502925 +tags: howto +title: How to run a local plugin library for testing +type: text/vnd.tiddlywiki + +!! Start the Library Server + +The "pluginlibrary" edition contains the components needed to set up a local server for ~TiddlyWiki plugin library testing or development. + +The following commands will create the library files and start a test server at http://localhost:8888 + +``` +cd /your/path/to/TiddlyWiki5/editions/pluginlibrary +tiddlywiki --build test-server +``` + +!! Important + +''This server is read-only. Nothing is saved back to the filesystem'' + +!! Test the Library with a Single File Wiki + +* Open a single file wiki and import the configuration tiddler form http://localhost:8888/#%24%3A%2Fconfig%2FLocalPluginLibrary +* Open the ''$:/ControlPanel : Plugins : "Get More Plugins"'' modal + +!! Test the Library with a Node.js Wiki + +* Create a new wiki with eg: + +<<< +``` +cd /temp/ +tiddlywiki my-wiki --init server +tiddlywiki my-wiki --listen +``` +<<< + +* Open "my-wiki" from http://localhost:8080 +* Import the http://localhost:8888/#%24%3A%2Fconfig%2FLocalPluginLibrary tiddler into "my-wiki" +* Open the ''$:/ControlPanel : Plugins : "Get More Plugins"'' modal + diff --git a/editions/pluginlibrary/tiddlers/GettingStarted.tid b/editions/pluginlibrary/tiddlers/GettingStarted.tid new file mode 100644 index 000000000..53c35cf11 --- /dev/null +++ b/editions/pluginlibrary/tiddlers/GettingStarted.tid @@ -0,0 +1,45 @@ +title: GettingStarted + +This edition contains the components needed to set up a local server for ~TiddlyWiki plugin library testing or development. + +!! Import Configuration + +Import the configuration tiddler: $:/config/LocalPluginLibrary to your "test wiki". + +!! Important + +''This server is read-only. Nothing is saved back to the filesystem'' + +!! Start the Library Server + +The following commands will create the library files and start a test server at http://localhost:8888 + +``` +cd /your/path/to/TiddlyWiki5/editions/pluginlibrary +tiddlywiki --build test-server +``` + +!! Test the Library with a Single File Wiki + +* Open a single file wiki and import the configuration tiddler form http://localhost:8888/#%24%3A%2Fconfig%2FLocalPluginLibrary +* Open the ''$:/ControlPanel : Plugins : "Get More Plugins"'' modal + +!! Test the Library with a Node.js Wiki + +* Create a new wiki with eg: + +<<< +``` +cd /temp/ +tiddlywiki my-wiki --init server +tiddlywiki my-wiki --listen +``` +<<< + +* Open my-wiki from http://localhost:8080 +* Import the http://localhost:8888/#%24%3A%2Fconfig%2FLocalPluginLibrary tiddler into "my-wiki" +* Open the ''~$:/ControlPanel : Plugins : "Get More Plugins"'' modal + +!! ~ControlPanel Plugin Tab + +{{$:/core/ui/ControlPanel/Plugins}} \ No newline at end of file diff --git a/editions/pluginlibrary/tiddlers/PrereleaseLocalPluginLibrary.tid b/editions/pluginlibrary/tiddlers/PrereleaseLocalPluginLibrary.tid new file mode 100644 index 000000000..f3cb2fd0d --- /dev/null +++ b/editions/pluginlibrary/tiddlers/PrereleaseLocalPluginLibrary.tid @@ -0,0 +1,6 @@ +title: $:/config/LocalPluginLibrary +tags: $:/tags/PluginLibrary +url: http://localhost:8888/files/local/library/tmp/index.html +caption: Local TiddlyWiki Plugin Library Test Server + +A locally installed version of the plugin library //Requires a local web server to share the library// diff --git a/editions/pluginlibrary/tiddlers/meta/SiteSubtitle.tid b/editions/pluginlibrary/tiddlers/meta/SiteSubtitle.tid new file mode 100644 index 000000000..07d2ed13d --- /dev/null +++ b/editions/pluginlibrary/tiddlers/meta/SiteSubtitle.tid @@ -0,0 +1,3 @@ +title: $:/SiteSubtitle + +<> \ No newline at end of file diff --git a/editions/pluginlibrary/tiddlers/meta/SiteTitle.tid b/editions/pluginlibrary/tiddlers/meta/SiteTitle.tid new file mode 100644 index 000000000..988a3cfcc --- /dev/null +++ b/editions/pluginlibrary/tiddlers/meta/SiteTitle.tid @@ -0,0 +1,3 @@ +title: $:/SiteTitle + +Library test edition, plugin development \ No newline at end of file diff --git a/editions/pluginlibrary/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid b/editions/pluginlibrary/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid new file mode 100644 index 000000000..2bfa95e13 --- /dev/null +++ b/editions/pluginlibrary/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid @@ -0,0 +1,3 @@ +title: $:/themes/tiddlywiki/vanilla/options/sidebarlayout + +fluid-fixed \ No newline at end of file diff --git a/editions/pluginlibrary/tiddlywiki.info b/editions/pluginlibrary/tiddlywiki.info index b47af15ff..4f1ab1409 100644 --- a/editions/pluginlibrary/tiddlywiki.info +++ b/editions/pluginlibrary/tiddlywiki.info @@ -4,10 +4,17 @@ "tiddlywiki/pluginlibrary" ], "themes": [ + "tiddlywiki/vanilla", + "tiddlywiki/snowwhite" ], "includeWikis": [ ], "build": { + "test-server": [ + "--output", "./files/local/library/tmp", + "--build", "library", + "--listen", "port=8888" + ], "library": [ "--makelibrary","$:/UpgradeLibrary", "--savelibrarytiddlers","$:/UpgradeLibrary","[prefix[$:/]] -[[$:/plugins/tiddlywiki/upgrade]] -[[$:/plugins/tiddlywiki/translators]] -[[$:/plugins/tiddlywiki/pluginlibrary]] -[[$:/plugins/tiddlywiki/jasmine]]","recipes/library/tiddlers/","$:/UpgradeLibrary/List",