commit dd67b20525f7583a2dc6c05fb9c754d2f7bbe1c4 Author: Dymas Date: Mon Oct 26 09:40:21 2026 +0100 Publish starter plugin and theme resource catalog diff --git a/README.md b/README.md new file mode 100644 index 0000000..6b26068 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Web Framework Resources + +Reusable plugins and theme templates for [Web Framework](https://gitea.coreplay.eu/Dymas/web-framework). + +The default catalog is `https://gitea.coreplay.eu/Dymas/web-framework-resources/raw/branch/main/catalog.json`. +Open **Config → Add resources**, search, and install a plugin or theme. Restart the application, then enable it under **Plugins** or select it under **Themes**. Existing bundled plugins and default themes remain available without downloading anything. + +Each `plugins//plugin.json` or `themes//theme.json` declares an ID, name, description, and version. Plugins include `plugin.py`; the starter templates reuse the framework's factories. Themes declare `mode` (`dark`, `light`, `system`), `accent` (`violet`, `blue`, `green`), and `density` (`comfortable`, `compact`). Theme templates reuse the framework's design tokens and layouts. + +## Publish resources + +Store newly developed plugins and themes here. Keep source directories and versioned ZIP archives in the repository. ZIP files contain resource files at their root, with no enclosing directory. Add entries to `catalog.json` with `type`, all metadata fields, a relative `archive` URL and the archive's SHA-256 digest. Increment a resource's version whenever its files change. Framework installs do not overwrite existing resources; operators back up and remove an old installed directory before installing a replacement. Installed data stays in the application's control store. + +Catalog schema version 1 uses a top-level `resources` array. Custom catalogs follow this same format. Only configure trusted repositories: installing plugins allows their Python code to execute at the next application startup. Downloads require no repository credentials, so publish catalogs and archives for read access by the application. + +The initial six resources can be regenerated using `PYTHONPATH=. python tools/prepare_resources.py /path/to/web-framework-resources` in the framework repository. Add custom entries separately before publishing; the exporter regenerates the bundled catalog. diff --git a/archives/plugin-bookmarks-0.1.0.zip b/archives/plugin-bookmarks-0.1.0.zip new file mode 100644 index 0000000..1df492f Binary files /dev/null and b/archives/plugin-bookmarks-0.1.0.zip differ diff --git a/archives/plugin-notes-0.1.0.zip b/archives/plugin-notes-0.1.0.zip new file mode 100644 index 0000000..6857991 Binary files /dev/null and b/archives/plugin-notes-0.1.0.zip differ diff --git a/archives/plugin-status-0.1.0.zip b/archives/plugin-status-0.1.0.zip new file mode 100644 index 0000000..3fa1572 Binary files /dev/null and b/archives/plugin-status-0.1.0.zip differ diff --git a/archives/theme-default-0.1.0.zip b/archives/theme-default-0.1.0.zip new file mode 100644 index 0000000..22dc6fc Binary files /dev/null and b/archives/theme-default-0.1.0.zip differ diff --git a/archives/theme-mint-0.1.0.zip b/archives/theme-mint-0.1.0.zip new file mode 100644 index 0000000..dda8616 Binary files /dev/null and b/archives/theme-mint-0.1.0.zip differ diff --git a/archives/theme-ocean-0.1.0.zip b/archives/theme-ocean-0.1.0.zip new file mode 100644 index 0000000..cd4cc73 Binary files /dev/null and b/archives/theme-ocean-0.1.0.zip differ diff --git a/catalog.json b/catalog.json new file mode 100644 index 0000000..ff74e1c --- /dev/null +++ b/catalog.json @@ -0,0 +1,68 @@ +{ + "schema_version": 1, + "resources": [ + { + "id": "notes", + "name": "Notes", + "description": "Shared notes with persistent content.", + "version": "0.1.0", + "type": "plugin", + "archive": "archives/plugin-notes-0.1.0.zip", + "sha256": "e31e7f5183b26529b4d1dde5a6d63a9bb89a2c711fcd6df016c5ceaa94fcd192" + }, + { + "id": "bookmarks", + "name": "Bookmarks", + "description": "A shared collection of useful links.", + "version": "0.1.0", + "type": "plugin", + "archive": "archives/plugin-bookmarks-0.1.0.zip", + "sha256": "108d9d997b6ada86085f24c365c0ecca84c751cf97e5908bb1ef7994440fd291" + }, + { + "id": "status", + "name": "Workspace status", + "description": "Local uptime and configured integration counts. No external polling.", + "version": "0.1.0", + "type": "plugin", + "archive": "archives/plugin-status-0.1.0.zip", + "sha256": "d27edcc6dea923dac0d2ee8ffe3d097b14bf3937873ab0cdad0c1767c4b82260" + }, + { + "id": "default", + "name": "Default", + "description": "The bundled default workspace theme template.", + "version": "0.1.0", + "mode": "dark", + "accent": "violet", + "density": "comfortable", + "type": "theme", + "archive": "archives/theme-default-0.1.0.zip", + "sha256": "c97e167fc1ba89739047c8fc1c7df2c3e8aee4b43be38c6ac3e0aba62f95f85f" + }, + { + "id": "mint", + "name": "Mint", + "description": "The bundled mint workspace theme template.", + "version": "0.1.0", + "mode": "dark", + "accent": "green", + "density": "comfortable", + "type": "theme", + "archive": "archives/theme-mint-0.1.0.zip", + "sha256": "e1f377986a0bd8bd575b2d1df1f368d7c46c17018bdc71baad90b9358f66a3cb" + }, + { + "id": "ocean", + "name": "Ocean", + "description": "The bundled ocean workspace theme template.", + "version": "0.1.0", + "mode": "dark", + "accent": "blue", + "density": "comfortable", + "type": "theme", + "archive": "archives/theme-ocean-0.1.0.zip", + "sha256": "73441601fdbb60efc37c754bb1042374945f217daab3c850f56ae539fd8b78c8" + } + ] +} diff --git a/plugins/bookmarks/README.md b/plugins/bookmarks/README.md new file mode 100644 index 0000000..15157ac --- /dev/null +++ b/plugins/bookmarks/README.md @@ -0,0 +1,5 @@ +# Bookmarks + +Generated from the bookmarks template. Restart the workspace, then enable this plugin in Config → Plugins. + +Add business logic in plugin.py. Use require_permission('content.write') for mutations; include csrf_token() in forms. Do not store secrets in templates. diff --git a/plugins/bookmarks/plugin.json b/plugins/bookmarks/plugin.json new file mode 100644 index 0000000..9afd277 --- /dev/null +++ b/plugins/bookmarks/plugin.json @@ -0,0 +1,6 @@ +{ + "id": "bookmarks", + "name": "Bookmarks", + "description": "A shared collection of useful links.", + "version": "0.1.0" +} diff --git a/plugins/bookmarks/plugin.py b/plugins/bookmarks/plugin.py new file mode 100644 index 0000000..f2481bd --- /dev/null +++ b/plugins/bookmarks/plugin.py @@ -0,0 +1,3 @@ +from web_framework.starter_plugins import make_bookmarks + +plugin = make_bookmarks() diff --git a/plugins/bookmarks/plugin.toml b/plugins/bookmarks/plugin.toml new file mode 100644 index 0000000..587ca1c --- /dev/null +++ b/plugins/bookmarks/plugin.toml @@ -0,0 +1,5 @@ +[plugin] +id = "bookmarks" +name = "Bookmarks" +version = "0.1.0" +api_version = 1 diff --git a/plugins/notes/README.md b/plugins/notes/README.md new file mode 100644 index 0000000..511a06d --- /dev/null +++ b/plugins/notes/README.md @@ -0,0 +1,5 @@ +# Notes + +Generated from the notes template. Restart the workspace, then enable this plugin in Config → Plugins. + +Add business logic in plugin.py. Use require_permission('content.write') for mutations; include csrf_token() in forms. Do not store secrets in templates. diff --git a/plugins/notes/plugin.json b/plugins/notes/plugin.json new file mode 100644 index 0000000..429fe89 --- /dev/null +++ b/plugins/notes/plugin.json @@ -0,0 +1,6 @@ +{ + "id": "notes", + "name": "Notes", + "description": "Shared notes with persistent content.", + "version": "0.1.0" +} diff --git a/plugins/notes/plugin.py b/plugins/notes/plugin.py new file mode 100644 index 0000000..a5edec1 --- /dev/null +++ b/plugins/notes/plugin.py @@ -0,0 +1,3 @@ +from web_framework.starter_plugins import make_notes + +plugin = make_notes() diff --git a/plugins/notes/plugin.toml b/plugins/notes/plugin.toml new file mode 100644 index 0000000..22b8330 --- /dev/null +++ b/plugins/notes/plugin.toml @@ -0,0 +1,5 @@ +[plugin] +id = "notes" +name = "Notes" +version = "0.1.0" +api_version = 1 diff --git a/plugins/status/README.md b/plugins/status/README.md new file mode 100644 index 0000000..80dca95 --- /dev/null +++ b/plugins/status/README.md @@ -0,0 +1,5 @@ +# Status + +Generated from the status template. Restart the workspace, then enable this plugin in Config → Plugins. + +Add business logic in plugin.py. Use require_permission('content.write') for mutations; include csrf_token() in forms. Do not store secrets in templates. diff --git a/plugins/status/plugin.json b/plugins/status/plugin.json new file mode 100644 index 0000000..fe1d273 --- /dev/null +++ b/plugins/status/plugin.json @@ -0,0 +1,6 @@ +{ + "id": "status", + "name": "Workspace status", + "description": "Local uptime and configured integration counts. No external polling.", + "version": "0.1.0" +} diff --git a/plugins/status/plugin.py b/plugins/status/plugin.py new file mode 100644 index 0000000..08c05b8 --- /dev/null +++ b/plugins/status/plugin.py @@ -0,0 +1,3 @@ +from web_framework.starter_plugins import make_status + +plugin = make_status() diff --git a/plugins/status/plugin.toml b/plugins/status/plugin.toml new file mode 100644 index 0000000..8124a1d --- /dev/null +++ b/plugins/status/plugin.toml @@ -0,0 +1,5 @@ +[plugin] +id = "status" +name = "Status" +version = "0.1.0" +api_version = 1 diff --git a/themes/default/theme.json b/themes/default/theme.json new file mode 100644 index 0000000..b0ba23c --- /dev/null +++ b/themes/default/theme.json @@ -0,0 +1,9 @@ +{ + "id": "default", + "name": "Default", + "description": "The bundled default workspace theme template.", + "version": "0.1.0", + "mode": "dark", + "accent": "violet", + "density": "comfortable" +} diff --git a/themes/mint/theme.json b/themes/mint/theme.json new file mode 100644 index 0000000..9f9a79f --- /dev/null +++ b/themes/mint/theme.json @@ -0,0 +1,9 @@ +{ + "id": "mint", + "name": "Mint", + "description": "The bundled mint workspace theme template.", + "version": "0.1.0", + "mode": "dark", + "accent": "green", + "density": "comfortable" +} diff --git a/themes/ocean/theme.json b/themes/ocean/theme.json new file mode 100644 index 0000000..24869cd --- /dev/null +++ b/themes/ocean/theme.json @@ -0,0 +1,9 @@ +{ + "id": "ocean", + "name": "Ocean", + "description": "The bundled ocean workspace theme template.", + "version": "0.1.0", + "mode": "dark", + "accent": "blue", + "density": "comfortable" +}