From 20f06e8eecfc4b74dff221cd19e3b833f147a5d5 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 26 Aug 2013 13:28:23 +0100 Subject: [PATCH] Ensure that the core plugins inherit their version number from the main `package.info` --- boot/boot.js | 5 +++++ core/plugin.info | 1 - editions/tw5.com/tiddlers/DeveloperDocs.tid | 5 +++-- .../tiddlers/TiddlyWiki5 Development Environment.tid | 7 ++++++- editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid | 9 +++++++-- plugins/tiddlywiki/classictools/plugin.info | 1 - plugins/tiddlywiki/codemirror/plugin.info | 1 - plugins/tiddlywiki/d3/plugin.info | 1 - plugins/tiddlywiki/filesystem/plugin.info | 1 - plugins/tiddlywiki/fullscreen/plugin.info | 1 - plugins/tiddlywiki/jasmine/plugin.info | 1 - plugins/tiddlywiki/tahoelafs/plugin.info | 1 - plugins/tiddlywiki/tiddlyweb/plugin.info | 1 - themes/tiddlywiki/centralised/plugin.info | 1 - themes/tiddlywiki/snowwhite/plugin.info | 1 - themes/tiddlywiki/starlight/plugin.info | 1 - themes/tiddlywiki/stickytitles/plugin.info | 1 - 17 files changed, 21 insertions(+), 18 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 2e6c2e9b6..2d61d8ec0 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1168,6 +1168,10 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) { } } } + // Give the plugin the same version number as the core if it doesn't have one + if(!("version" in pluginInfo)) { + pluginInfo.version = $tw.packageInfo.version; + } // Save the plugin tiddler if(pluginInfo) { var fields = { @@ -1176,6 +1180,7 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) { text: JSON.stringify(pluginInfo,null,4), "plugin-priority": pluginInfo["plugin-priority"], "name": pluginInfo["name"], + "version": pluginInfo["version"], "thumbnail": pluginInfo["thumbnail"], "description": pluginInfo["description"], "plugin-type": pluginInfo["plugin-type"] || "plugin" diff --git a/core/plugin.info b/core/plugin.info index 4fc7c1c5e..5ad83fcc0 100644 --- a/core/plugin.info +++ b/core/plugin.info @@ -2,7 +2,6 @@ "title": "$:/core", "description": "TiddlyWiki5 core plugin", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0", "plugin-priority": "0" } diff --git a/editions/tw5.com/tiddlers/DeveloperDocs.tid b/editions/tw5.com/tiddlers/DeveloperDocs.tid index cfb50b43e..b89b091be 100644 --- a/editions/tw5.com/tiddlers/DeveloperDocs.tid +++ b/editions/tw5.com/tiddlers/DeveloperDocs.tid @@ -1,6 +1,6 @@ created: 201308251537 creator: JeremyRuston -modified: 201308252143 +modified: 201308260831 modifier: JeremyRuston tags: introduction dev title: DeveloperDocs @@ -9,7 +9,8 @@ This is the developer documentation hub for TiddlyWiki. ! Overview -TiddlyWikiArchitecture +* TiddlyWikiArchitecture +* [[TiddlyWiki5 Development Environment]] ! Developer Cookbooks diff --git a/editions/tw5.com/tiddlers/TiddlyWiki5 Development Environment.tid b/editions/tw5.com/tiddlers/TiddlyWiki5 Development Environment.tid index c3c1f9337..854e30702 100644 --- a/editions/tw5.com/tiddlers/TiddlyWiki5 Development Environment.tid +++ b/editions/tw5.com/tiddlers/TiddlyWiki5 Development Environment.tid @@ -1,6 +1,6 @@ created: 201308251618 creator: JeremyRuston -modified: 201308251618 +modified: 201308260848 modifier: JeremyRuston tags: dev title: TiddlyWiki5 Development Environment @@ -14,3 +14,8 @@ title: TiddlyWiki5 Development Environment ``` npm link ``` + +! Bumping version numbers + +As releases are made during development it is necessary to adjust the version number of various TiddlyWiki5 components. This is done with the [[npm version|https://npmjs.org/doc/version.html]] command. +** As described in #10 in [[this article by npm's author|http://blog.izs.me/post/1675072029/10-cool-things-you-probably-didnt-realize-npm-could-do]], when run from within a git repo this command will also commit the change and tag it diff --git a/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid b/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid index 57e1b7d69..895bae0a7 100644 --- a/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid +++ b/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid @@ -1,6 +1,9 @@ -modified: 201305011454 -title: PluginMechanism +created: 201308261220 +creator: JeremyRuston +modified: 201308261220 +modifier: JeremyRuston tags: mechanism +title: PluginMechanism [[Plugins]] are bundles of tiddlers that are distributed and managed as a single unit by being packed into a single JSON tiddler. If a tiddler isn't found in the main store, then the registered plugins are searched for it instead. @@ -47,6 +50,8 @@ On the server, plugins can be stored as ordinary JSON tiddlers but it is often m The `plugin.info` file should contain the same JSON as given for plugin tiddlers above, with the `tiddlers` object omitted. +Note that if the `version` field is omitted from a `plugin.info` file when the plugin folder is packed then it is automatically filled in by the core to the current core version number. This is to ensure that all the core plugins carry the correct version number. Generally plugin authors will want to ensure that they do explicitly specify a version number. + ! Plugin library The standard distribution of TiddlyWiki includes a number of standard plugins in the `plugins` directory. diff --git a/plugins/tiddlywiki/classictools/plugin.info b/plugins/tiddlywiki/classictools/plugin.info index cf651eaa9..b5294481a 100644 --- a/plugins/tiddlywiki/classictools/plugin.info +++ b/plugins/tiddlywiki/classictools/plugin.info @@ -2,6 +2,5 @@ "title": "$:/plugins/tiddlywiki/classictools", "description": "Tools for working with classic TiddlyWiki documents", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/codemirror/plugin.info b/plugins/tiddlywiki/codemirror/plugin.info index f0cf4de77..099b2d659 100644 --- a/plugins/tiddlywiki/codemirror/plugin.info +++ b/plugins/tiddlywiki/codemirror/plugin.info @@ -2,6 +2,5 @@ "title": "$:/plugins/tiddlywiki/codemirror", "description": "Codemirror plugin", "author": "JeremyRuston", - "version": "0.0.0", "coreVersion": ">=5.0.0" } diff --git a/plugins/tiddlywiki/d3/plugin.info b/plugins/tiddlywiki/d3/plugin.info index 4a425b986..b5e98542f 100644 --- a/plugins/tiddlywiki/d3/plugin.info +++ b/plugins/tiddlywiki/d3/plugin.info @@ -2,6 +2,5 @@ "title": "$:/plugins/tiddlywiki/d3", "description": "d3.js plugin for TiddlyWiki5", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/filesystem/plugin.info b/plugins/tiddlywiki/filesystem/plugin.info index d279057db..943a60336 100644 --- a/plugins/tiddlywiki/filesystem/plugin.info +++ b/plugins/tiddlywiki/filesystem/plugin.info @@ -2,6 +2,5 @@ "title": "$:/plugins/tiddlywiki/filesystem", "description": "File system synchronisation", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/fullscreen/plugin.info b/plugins/tiddlywiki/fullscreen/plugin.info index 2ab0534b5..a0f5a32ae 100644 --- a/plugins/tiddlywiki/fullscreen/plugin.info +++ b/plugins/tiddlywiki/fullscreen/plugin.info @@ -2,6 +2,5 @@ "title": "$:/plugins/tiddlywiki/fullscreen", "description": "Adds support for HTML5 full screen mode", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/jasmine/plugin.info b/plugins/tiddlywiki/jasmine/plugin.info index a92ef03b6..08ac29ad4 100644 --- a/plugins/tiddlywiki/jasmine/plugin.info +++ b/plugins/tiddlywiki/jasmine/plugin.info @@ -2,6 +2,5 @@ "title": "$:/plugins/tiddlywiki/jasmine", "description": "Jasmine test framework plugin for TiddlyWiki5", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/tahoelafs/plugin.info b/plugins/tiddlywiki/tahoelafs/plugin.info index 6b57c8377..920b2e4c7 100644 --- a/plugins/tiddlywiki/tahoelafs/plugin.info +++ b/plugins/tiddlywiki/tahoelafs/plugin.info @@ -2,6 +2,5 @@ "title": "$:/plugins/tiddlywiki/tahoelafs", "description": "Support for saving changes to Tahoe-LAFS", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/tiddlyweb/plugin.info b/plugins/tiddlywiki/tiddlyweb/plugin.info index 1ce0093e8..4412627ec 100644 --- a/plugins/tiddlywiki/tiddlyweb/plugin.info +++ b/plugins/tiddlywiki/tiddlyweb/plugin.info @@ -2,6 +2,5 @@ "title": "$:/plugins/tiddlywiki/tiddlyweb", "description": "TiddlyWeb and TiddlySpace components", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0" } diff --git a/themes/tiddlywiki/centralised/plugin.info b/themes/tiddlywiki/centralised/plugin.info index 1658e2db0..20ef04742 100644 --- a/themes/tiddlywiki/centralised/plugin.info +++ b/themes/tiddlywiki/centralised/plugin.info @@ -2,7 +2,6 @@ "title": "$:/themes/tiddlywiki/centralised", "name": "Centralised", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0", "plugin-type": "theme", "description": "Experimental theme with a centred text column", diff --git a/themes/tiddlywiki/snowwhite/plugin.info b/themes/tiddlywiki/snowwhite/plugin.info index 2f79eb50d..dcfbdb9f7 100644 --- a/themes/tiddlywiki/snowwhite/plugin.info +++ b/themes/tiddlywiki/snowwhite/plugin.info @@ -2,7 +2,6 @@ "title": "$:/themes/tiddlywiki/snowwhite", "name": "Snow White", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0", "plugin-type": "theme", "description": "A plain simple theme that emphasises individual tiddlers" diff --git a/themes/tiddlywiki/starlight/plugin.info b/themes/tiddlywiki/starlight/plugin.info index 2e83a63a3..6018e733c 100644 --- a/themes/tiddlywiki/starlight/plugin.info +++ b/themes/tiddlywiki/starlight/plugin.info @@ -2,7 +2,6 @@ "title": "$:/themes/tiddlywiki/starlight", "name": "Starlight", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0", "plugin-type": "theme", "description": "An alternate theme", diff --git a/themes/tiddlywiki/stickytitles/plugin.info b/themes/tiddlywiki/stickytitles/plugin.info index bd1aad46c..f66b7cdc8 100644 --- a/themes/tiddlywiki/stickytitles/plugin.info +++ b/themes/tiddlywiki/stickytitles/plugin.info @@ -2,7 +2,6 @@ "title": "$:/themes/tiddlywiki/stickytitles", "name": "Sticky Titles", "author": "JeremyRuston", - "version": "0.0.0", "core-version": ">=5.0.0", "plugin-type": "theme", "description": "Experimental theme with titles that stick to the top of the window",