mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 02:51:10 +08:00
DEV: Keep styleguide samples synchronized with source Styleguide code samples were hand-written strings that could silently drift from the markup they described. This caused the char counter sample to advertise a nonexistent `CharCounter` module while rendering `DCharCounter`. Add a `discourse-source-imports` bundler plugin that imports another module's untranspiled source as a string. `?source=file` returns the complete file, while `?source=template` extracts the contents of the module's single `<template>` block. Imports use normal module resolution and pass the result to `StyleguideExample` through its `@code` argument. Move the spinner and char counter examples into `components/examples/` and source their displayed code through the new plugin. Register the plugin with both the core Rolldown build and the asset processor. Each pipeline injects its own `readSource(id)` implementation: the asset processor reads from its in-memory module map, while core reads from disk and rejects paths outside the project root. --------- Co-authored-by: David Taylor <david@taylorhq.com> |
||
|---|---|---|
| .. | ||
| automation | ||
| chat | ||
| checklist | ||
| discourse-adplugin | ||
| discourse-affiliate | ||
| discourse-ai | ||
| discourse-apple-auth | ||
| discourse-assign | ||
| discourse-cakeday | ||
| discourse-calendar | ||
| discourse-captcha | ||
| discourse-chat-integration | ||
| discourse-data-explorer | ||
| discourse-details | ||
| discourse-gamification | ||
| discourse-github | ||
| discourse-graphviz | ||
| discourse-lazy-videos | ||
| discourse-local-dates | ||
| discourse-login-with-amazon | ||
| discourse-lti | ||
| discourse-math | ||
| discourse-microsoft-auth | ||
| discourse-narrative-bot | ||
| discourse-oauth2-basic | ||
| discourse-openid-connect | ||
| discourse-patreon | ||
| discourse-policy | ||
| discourse-post-voting | ||
| discourse-presence | ||
| discourse-reactions | ||
| discourse-rewind | ||
| discourse-rss-polling | ||
| discourse-solved | ||
| discourse-subscriptions | ||
| discourse-templates | ||
| discourse-topic-voting | ||
| discourse-user-notes | ||
| discourse-workflows | ||
| discourse-zendesk-plugin | ||
| footnote | ||
| poll | ||
| spoiler-alert | ||
| styleguide | ||