Extract the demo_server plugin into python_packages
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
Extract the demo server plugin from kolibri/plugins/demo_server into its own package under python_packages/. It is an internal, demo-deployment-only plugin that need not ship in the Kolibri package. The extraction is bootstrapped with kolibri plugin create, then the existing code — the banner component and its user_auth page injection — is moved across.
Complexity: Medium Target branch: develop
Context
- The in-tree plugin
DemoServerregistersDemoServerAsset(WebpackBundleHook)for its bundle. DemoServerInclusionHook(UserAuthSyncHook)injects that bundle intouser_authsign-in pages.- The bundle pushes
DemoServerBannerContent.vueontowindow._coreBannerContent. - Files:
kolibri_plugin.py,buildConfig.js,package.json(alreadykolibri-demo-server-plugin, workspace deps),frontend/module.js,frontend/DemoServerBannerContent.vue(8 translatable$trs). - Closest
kolibri plugin createsurface is global-injector (WebpackBundleHook+FrontEndBaseSyncHook). - Depends on
kolibri.plugins.user_auth.hooks, a core in-tree plugin that stays importable from the package.
The Change
- Scaffold
python_packages/kolibri-demo-server-plugin/withkolibri plugin create(global-injector surface), then move the plugin's code across. - Swap the generated inclusion hook for
user_auth'sUserAuthSyncHook. - Move
DemoServerBannerContent.vue,module.js, andbuildConfig.jsacross. - Carry
package.jsonacross, adding itsbuild/clean/devscripts andkolibri-buildtoolchain deps. - Add a
Makefiledisttarget so the member builds and compresses its own bundle. - Gitignore the built
static/; drop any committed build artifacts. - Declare the
kolibri.pluginsentry point in the package'spyproject.toml. - Remove
kolibri/plugins/demo_server/and its entry in the rootpyproject.toml.
Acceptance Criteria
General
- [ ]
python_packages/kolibri-demo-server-plugin/exists as a uv workspace member with its ownpyproject.tomldeclaring thekolibri.pluginsentry point. - [ ] The plugin injects
DemoServerBannerContentintouser_authsign-in pages viaUserAuthSyncHook, identical to the in-tree behaviour. - [ ] The package has a
buildscript and aMakefiledisttarget that build the bundle and compress its static; builtstatic/is gitignored, not committed. - [ ] The banner's 8 translatable strings are extracted into the package's own locale via the per-package i18n recipes.
- [ ]
kolibri/plugins/demo_server/and its rootpyproject.tomlentry-point line are removed.
Testing
- [ ] Building the package's wheel and enabling it in a Kolibri install renders the demo banner on
user_authsign-in pages.
References
- In-tree plugin being extracted:
kolibri/plugins/demo_server - Frontend-member exemplar (build scripts + packaging):
python_packages/kolibri-sentry-plugin - Injection hook:
UserAuthSyncHookinkolibri/plugins/user_auth/hooks.py
AI usage
Drafted with Claude Code, which read the in-tree plugin, its user_auth hook dependency, and the build/publish tooling; I drove every scope decision. I verified the surface mapping, the translatable strings, and the frontend-build gap against the repo before creating the issue.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.