Skip to content

Commit

Permalink
Merge branch 'master' into multi-wiki-support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jermolene committed May 21, 2024
2 parents d8eb5cb + 4d2aa1d commit 92a1c56
Show file tree
Hide file tree
Showing 90 changed files with 349 additions and 113 deletions.
1 change: 1 addition & 0 deletions core/language/en-GB/Fields.multids
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ name: The human readable name associated with a plugin tiddler
parent-plugin: For a plugin, specifies which plugin of which it is a sub-plugin
plugin-priority: A numerical value indicating the priority of a plugin tiddler
plugin-type: The type of plugin in a plugin tiddler
stability: The development status of a plugin: deprecated, experimental, stable, or legacy
revision: The revision of the tiddler held at the server
released: Date of a TiddlyWiki release
source: The source URL associated with a tiddler
Expand Down
27 changes: 1 addition & 26 deletions core/modules/commands/makelibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,8 @@ var Command = function(params,commander,callback) {

Command.prototype.execute = function() {
var wiki = this.commander.wiki,
fs = require("fs"),
path = require("path"),
upgradeLibraryTitle = this.params[0] || UPGRADE_LIBRARY_TITLE,
tiddlers = {};
// Collect up the library plugins
var collectPlugins = function(folder) {
var pluginFolders = $tw.utils.getSubdirectories(folder) || [];
for(var p=0; p<pluginFolders.length; p++) {
if(!$tw.boot.excludeRegExp.test(pluginFolders[p])) {
pluginFields = $tw.loadPluginFolder(path.resolve(folder,"./" + pluginFolders[p]));
if(pluginFields && pluginFields.title) {
tiddlers[pluginFields.title] = pluginFields;
}
}
}
},
collectPublisherPlugins = function(folder) {
var publisherFolders = $tw.utils.getSubdirectories(folder) || [];
for(var t=0; t<publisherFolders.length; t++) {
if(!$tw.boot.excludeRegExp.test(publisherFolders[t])) {
collectPlugins(path.resolve(folder,"./" + publisherFolders[t]));
}
}
};
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.pluginsPath,$tw.config.pluginsEnvVar),collectPublisherPlugins);
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.themesPath,$tw.config.themesEnvVar),collectPublisherPlugins);
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.languagesPath,$tw.config.languagesEnvVar),collectPlugins);
tiddlers = $tw.utils.getAllPlugins();
// Save the upgrade library tiddler
var pluginFields = {
title: upgradeLibraryTitle,
Expand Down
48 changes: 48 additions & 0 deletions core/modules/utils/repository.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*\
title: $:/core/modules/utils/repository.js
type: application/javascript
module-type: utils
Utilities for working with the TiddlyWiki repository file structure
\*/
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

/*
Get an object containing all the plugins as a hashmap by title of the JSON representation of the plugin
*/
exports.getAllPlugins = function() {
var fs = require("fs"),
path = require("path"),
tiddlers = {};
// Collect up the library plugins
var collectPlugins = function(folder) {
var pluginFolders = $tw.utils.getSubdirectories(folder) || [];
for(var p=0; p<pluginFolders.length; p++) {
if(!$tw.boot.excludeRegExp.test(pluginFolders[p])) {
var pluginFields = $tw.loadPluginFolder(path.resolve(folder,"./" + pluginFolders[p]));
if(pluginFields && pluginFields.title) {
tiddlers[pluginFields.title] = pluginFields;
}
}
}
},
collectPublisherPlugins = function(folder) {
var publisherFolders = $tw.utils.getSubdirectories(folder) || [];
for(var t=0; t<publisherFolders.length; t++) {
if(!$tw.boot.excludeRegExp.test(publisherFolders[t])) {
collectPlugins(path.resolve(folder,"./" + publisherFolders[t]));
}
}
};
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.pluginsPath,$tw.config.pluginsEnvVar),collectPublisherPlugins);
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.themesPath,$tw.config.themesEnvVar),collectPublisherPlugins);
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.languagesPath,$tw.config.languagesEnvVar),collectPlugins);
return tiddlers;
};

})();
3 changes: 2 additions & 1 deletion core/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"author": "JeremyRuston",
"core-version": ">=5.0.0",
"plugin-priority": "0",
"list": "readme"
"list": "readme",
"stability": "STABILITY_2_STABLE"
}
12 changes: 11 additions & 1 deletion core/ui/Components/plugin-info.tid
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@ $:/config/Plugins/Disabled/$(currentTiddler)$
<$view field="title"/>
</h2>
<h2>
<div><em><$view field="version"/></em></div>
<div>
<%if [<currentTiddler>get[stability]match[STABILITY_0_DEPRECATED]] %>
<span class="tc-plugin-info-stability tc-plugin-info-stability-deprecated">DEPRECATED</span>
<%elseif [<currentTiddler>get[stability]match[STABILITY_1_EXPERIMENTAL]] %>
<span class="tc-plugin-info-stability tc-plugin-info-stability-experimental">EXPERIMENTAL</span>
<%elseif [<currentTiddler>get[stability]match[STABILITY_2_STABLE]] %>
<span class="tc-plugin-info-stability tc-plugin-info-stability-stable">STABLE</span>
<%elseif [<currentTiddler>get[stability]match[STABILITY_3_LEGACY]] %>
<span class="tc-plugin-info-stability tc-plugin-info-stability-legacy">LEGACY</span>
<%endif%>
<em><$view field="version"/></em></div>
</h2>
</div>
\end
Expand Down
15 changes: 13 additions & 2 deletions core/ui/ControlPanel/Modals/AddPlugins.tid
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,20 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
<div class="tc-plugin-info-chunk tc-plugin-info-description">
<h1><strong><$text text={{{ [<assetInfo>get[name]] ~[<assetInfo>get[original-title]split[/]last[1]] }}}/></strong>:
&#32;
<$view tiddler=<<assetInfo>> field="description"/></h1>
<$view tiddler=<<assetInfo>> field="description"/>
</h1>
<h2><$view tiddler=<<assetInfo>> field="original-title"/></h2>
<div><em><$view tiddler=<<assetInfo>> field="version"/></em></div>
<div>
<%if [<assetInfo>get[stability]match[STABILITY_0_DEPRECATED]] %>
<span class="tc-plugin-info-stability tc-plugin-info-stability-deprecated">DEPRECATED</span>
<%elseif [<assetInfo>get[stability]match[STABILITY_1_EXPERIMENTAL]] %>
<span class="tc-plugin-info-stability tc-plugin-info-stability-experimental">EXPERIMENTAL</span>
<%elseif [<assetInfo>get[stability]match[STABILITY_2_STABLE]] %>
<span class="tc-plugin-info-stability tc-plugin-info-stability-stable">STABLE</span>
<%elseif [<assetInfo>get[stability]match[STABILITY_3_LEGACY]] %>
<span class="tc-plugin-info-stability tc-plugin-info-stability-legacy">LEGACY</span>
<%endif%>
<em><$view tiddler=<<assetInfo>> field="version"/></em></div>
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion"><div><em>{{$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint}}</em></div></$list>
</div>
<div class="tc-plugin-info-chunk tc-plugin-info-buttons">
Expand Down
8 changes: 4 additions & 4 deletions core/wiki/config/OfficialPluginLibrary.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: $:/config/OfficialPluginLibrary
tags: $:/tags/PluginLibrary
url: https://tiddlywiki.com/library/v5.3.3/index.html
caption: {{$:/language/OfficialPluginLibrary}}
tags: $:/tags/PluginLibrary
title: $:/config/OfficialPluginLibrary
url: https://tiddlywiki5-git-plugin-stability-badges-jermolenes-projects.vercel.app/library/v5.3.3/index.html

{{$:/language/OfficialPluginLibrary/Hint}}
Plugin library for https://tiddlywiki5-git-plugin-stability-badges-jermolenes-projects.vercel.app
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: $:/config/OfficialPluginLibrary
caption: {{$:/language/OfficialPluginLibrary}}
tags: $:/tags/PluginLibrary
url: https://tiddlywiki.com/prerelease/library/v5.3.3/index.html
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease)
title: $:/config/OfficialPluginLibrary
url: https://tiddlywiki5-git-plugin-stability-badges-jermolenes-projects.vercel.app/library/v5.3.3/index.html

The prerelease version of the official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
Plugin library for https://tiddlywiki5-git-plugin-stability-badges-jermolenes-projects.vercel.app
47 changes: 47 additions & 0 deletions editions/test/tiddlers/tests/test-plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*\
title: test-plugins.js
type: application/javascript
tags: [[$:/tags/test-spec]]
Tests for integrity of the core plugins, languages, themes and editions
\*/
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

if($tw.node) {

describe("Plugin tests", function() {

// Get all the plugins as a hashmap by title of a JSON string with the plugin content
var tiddlers = $tw.utils.getAllPlugins();
// console.log(JSON.stringify(Object.keys(tiddlers),null,4));
describe("every plugin should have the required standard fields", function() {
var titles = Object.keys(tiddlers);
$tw.utils.each(titles,function(title) {
it("plugin " + title + " should have the required standard fields",function() {
var fields = tiddlers[title];
expect(fields["plugin-type"]).toMatch(/^(?:plugin|language|theme)$/);
switch(fields["plugin-type"]) {
case "plugin":
expect(!!(fields.name && fields.description && fields.list)).toEqual(true);
expect(fields.stability).toMatch(/^(?:STABILITY_0_DEPRECATED|STABILITY_1_EXPERIMENTAL|STABILITY_2_STABLE|STABILITY_3_LEGACY)$/);
break;
case "language":
expect(!!(fields.name && fields.description)).toEqual(true);
break;
case "theme":
expect(!!(fields.name && fields.description)).toEqual(true);
break;
}
});
});
});
});
}


})();
3 changes: 2 additions & 1 deletion editions/tw5.com/tiddlers/concepts/TiddlerFields.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20130825213300000
modified: 20240416103247799
modified: 20240520162904479
tags: Concepts
title: TiddlerFields
type: text/vnd.tiddlywiki
Expand Down Expand Up @@ -39,6 +39,7 @@ Other fields used by the core are:
|`name` |<<lingo name>> |
|`plugin-priority` |<<lingo plugin-priority>> |
|`plugin-type` |<<lingo plugin-type>> |
|`stability` |<<lingo stability>> |
|`source` |<<lingo source>> |
|`subtitle` |<<lingo subtitle>> |
|`throttle.refresh` |<<lingo throttle.refresh>> |
Expand Down
6 changes: 5 additions & 1 deletion editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
created: 20130826122000000
modified: 20220613124446953
modified: 20240520162828577
tags: Mechanisms
title: PluginMechanism
type: text/vnd.tiddlywiki
Expand All @@ -16,6 +16,10 @@ By convention, plugin titles have the form `$:/plugins/<publisher>/<name>`. Plug

When [[running TiddlyWiki under Node.js|TiddlyWiki on Node.js]], plugins can also be stored as individual tiddler files in [[PluginFolders]].

! Plugin Stability

{{Plugin Stability}}

! Plugin Types

{{Plugin Types}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags: [[Releases]]
title: TiddlyWiki5 Versioning
type: text/vnd.tiddlywiki

Each release of TiddlyWiki5 is identified by a version number that complies with the [[Semantic Versioning 2.0.0|http://semver.org/]] standard.
Each release of TiddlyWiki5 is identified by a version number that complies with a variant of [[Semantic Versioning 2.0.0|http://semver.org/]] standard.

! TiddlyWiki Core Version

Expand Down
14 changes: 14 additions & 0 deletions editions/tw5.com/tiddlers/plugins/Plugin Stability.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
created: 20240520155341641
modified: 20240520162820882
tags: PluginMechanism
title: Plugin Stability
type: text/vnd.tiddlywiki

Plugins are recommended to have a `stability` field that communicates the state of development of the plugin. It can contain the following values:

* ''STABILITY_0_DEPRECATED'' - Deprecated. This plugin is not recommended for new projects
* ''STABILITY_1_EXPERIMENTAL'' - Experimental. Non-backward compatible changes or removal may occur in any future release. Use of the plugin is not recommended in production environments
* ''STABILITY_2_STABLE'' - Stable.
* ''STABILITY_3_LEGACY'' - Legacy. Although this plugin is unlikely to be removed, it is no longer actively maintained, and other alternatives are available

These stability levels are taken from the Node.js project - https://nodejs.org/api/documentation.html#stability-index.
6 changes: 6 additions & 0 deletions languages/zh-Hans/ControlPanel.multids
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ Stylesheets/Caption: 样式表
Stylesheets/Expand/Caption: 全部展开
Stylesheets/Hint: 这是当前标签为 <<tag "$:/tags/Stylesheet">> 的样式表条目呈现的 CSS
Stylesheets/Restore/Caption: 复原
TestCases/Caption: 测试案例
TestCases/Hint: 测试案例是用于测试和学习的自给自足的范例
TestCases/All/Caption: 所有测试案例
TestCases/All/Hint: 所有测试案例
TestCases/Failed/Caption: 失败的测试案例
TestCases/Failed/Hint: 仅失败的测试案例
Theme/Caption: 布局主题
Theme/Prompt: 当前的布局主题:
TiddlerColour/Caption: 条目颜色
Expand Down
3 changes: 3 additions & 0 deletions languages/zh-Hans/Docs/PaletteColours.multids
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ sidebar-tab-foreground-selected: 侧边栏选定页签前景
sidebar-tab-foreground: 侧边栏页签前景
sidebar-tiddler-link-foreground-hover: 侧边栏悬停条目链结前景
sidebar-tiddler-link-foreground: 侧边栏条目链结前景
testcase-accent-level-1: 无嵌套的测试案例强调色
testcase-accent-level-2: 第二级嵌套的测试案例强调色
testcase-accent-level-3: 第三级或更高级别嵌套的测试案例强调色
site-title-foreground: 网站标题前景
static-alert-foreground: 静态提醒前景
tab-background-selected: 选定的页签背景
Expand Down
6 changes: 6 additions & 0 deletions languages/zh-Hant/ControlPanel.multids
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ Stylesheets/Caption: 樣式表
Stylesheets/Expand/Caption: 全部展開
Stylesheets/Hint: 這是當前標籤為 <<tag "$:/tags/Stylesheet">> 的樣式表條目呈現的 CSS
Stylesheets/Restore/Caption: 復原
TestCases/Caption: 測試案例
TestCases/Hint: 測試案例是用於測試和學習的自給自足的範例
TestCases/All/Caption: 所有測試案例
TestCases/All/Hint: 所有測試案例
TestCases/Failed/Caption: 失敗的測試案例
TestCases/Failed/Hint: 僅失敗的測試案例
Theme/Caption: 佈景主題
Theme/Prompt: 當前的佈景主題:
TiddlerColour/Caption: 條目顏色
Expand Down
3 changes: 3 additions & 0 deletions languages/zh-Hant/Docs/PaletteColours.multids
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ sidebar-tab-foreground-selected: 側邊欄選定頁籤前景
sidebar-tab-foreground: 側邊欄頁籤前景
sidebar-tiddler-link-foreground-hover: 側邊欄懸停條目鏈結前景
sidebar-tiddler-link-foreground: 側邊欄條目鏈結前景
testcase-accent-level-1: 無嵌套的測試案例強調色
testcase-accent-level-2: 第二級嵌套的測試案例強調色
testcase-accent-level-3: 第三級或更高級別嵌套的測試案例強調色
site-title-foreground: 網站標題前景
static-alert-foreground: 靜態警示前景
tab-background-selected: 選定的頁籤背景
Expand Down
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/async/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"name": "Async",
"description": "async.js library",
"author": "Caolan McMahon",
"list": "readme license"
"list": "readme license",
"stability": "STABILITY_2_STABLE"
}
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/aws/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"name": "AWS",
"description": "Amazon Web Services extensions and tools",
"list": "readme setup commands lambda",
"dependents": ["$:/plugins/tiddlywiki/async","$:/plugins/tiddlywiki/jszip"]
"dependents": ["$:/plugins/tiddlywiki/async","$:/plugins/tiddlywiki/jszip"],
"stability": "STABILITY_2_STABLE"
}
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/bibtex/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"name": "BibTeX",
"description": "BibTeX importer",
"author": "Henrik Muehe and Mikola Lysenko",
"list": "readme license"
"list": "readme license",
"stability": "STABILITY_2_STABLE"
}
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/blog/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/blog",
"name": "Blog",
"description": "Blog publishing tools",
"list": "readme docs"
"list": "readme docs",
"stability": "STABILITY_0_DEPRECATED"
}
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/browser-sniff/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/browser-sniff",
"name": "Browser Sniff",
"description": "Browser feature detection",
"list": "readme usage"
"list": "readme usage",
"stability": "STABILITY_2_STABLE"
}
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/browser-storage/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/browser-storage",
"name": "Browser Storage",
"description": "Local storage in the browser",
"list": "readme settings"
"list": "readme settings",
"stability": "STABILITY_2_STABLE"
}
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/cecily/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/cecily",
"name": "Cecily",
"description": "Zoomable storyview (Cecily)",
"list": "readme"
"list": "readme",
"stability": "STABILITY_0_DEPRECATED"
}
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/classictools/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"title": "$:/plugins/tiddlywiki/classictools",
"name": "Classic Tools",
"description": "TiddlyWiki Classic tools",
"list": "readme"
"list": "readme",
"stability": "STABILITY_2_STABLE"
}
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/codemirror-autocomplete/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"description": "Autocompletion for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"dependents": ["$:/plugins/tiddlywiki/codemirror-mode-css"],
"list": "readme"
"list": "readme",
"stability": "STABILITY_2_STABLE"
}
3 changes: 2 additions & 1 deletion plugins/tiddlywiki/codemirror-closebrackets/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"name": "CodeMirror Close Brackets",
"description": "Close brackets for CodeMirror",
"parent-plugin": "$:/plugins/tiddlywiki/codemirror",
"list": "readme"
"list": "readme",
"stability": "STABILITY_2_STABLE"
}
Loading

0 comments on commit 92a1c56

Please sign in to comment.