0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 02:51:10 +08:00
discourse/plugins
Sérgio Saquetim a8b1606ff8
DEV: Derive styleguide code samples from the rendered example (#42100)
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>
2026-07-29 13:48:35 -03:00
..
automation I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
chat FEATURE: Add /me actions to chat 2026-07-29 14:36:34 +00:00
checklist DEV: Remove rich_editor site setting (#41873) 2026-07-23 19:49:20 -03:00
discourse-adplugin I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-affiliate I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-ai I18N: Update translations (#42127) 2026-07-29 11:27:01 +02:00
discourse-apple-auth
discourse-assign I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-cakeday I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-calendar FEATURE: Promote Ideas & Events category types to permanent status (#42080) 2026-07-29 09:20:40 +10:00
discourse-captcha I18N: Update translations (#42127) 2026-07-29 11:27:01 +02:00
discourse-chat-integration I18N: Update translations (#42127) 2026-07-29 11:27:01 +02:00
discourse-data-explorer DEV: Penalize pageviews with no engagement in CrawlerScorer (#42118) 2026-07-29 13:13:42 +08:00
discourse-details I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-gamification I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-github I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-graphviz UX: Fit large Graphviz graphs to the box instead of overflowing (#40915) 2026-06-15 22:44:39 +01:00
discourse-lazy-videos Update discourse-lazy-videos plugin URL (#41835) 2026-07-22 22:31:04 +05:30
discourse-local-dates SECURITY: Prevent HTML injection in discourse-local-dates rendering 2026-07-28 16:40:22 +02:00
discourse-login-with-amazon I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-lti PERF: Avoid replacing CSP nonces in non-cacheable responses (#42008) 2026-07-24 09:49:01 +08:00
discourse-math I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-microsoft-auth
discourse-narrative-bot I18N: Update translations (#42127) 2026-07-29 11:27:01 +02:00
discourse-oauth2-basic I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-openid-connect I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-patreon I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-policy I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-post-voting I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-presence SECURITY: Authorization bypass in wiki edit presence leaks editor identities (#41474) 2026-07-06 12:53:23 -05:00
discourse-reactions I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-rewind I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-rss-polling I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-solved I18N: Update translations (#42127) 2026-07-29 11:27:01 +02:00
discourse-subscriptions I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
discourse-templates SECURITY: Templates endpoint exposes hidden tag names 2026-07-28 16:40:22 +02:00
discourse-topic-voting I18N: Update translations (#42127) 2026-07-29 11:27:01 +02:00
discourse-user-notes I18N: Update translations (#40680) 2026-06-09 17:21:49 +02:00
discourse-workflows FEATURE: adds gt/gte/lt/lte operators to if and filter nodes (#42097) 2026-07-28 17:07:32 +02:00
discourse-zendesk-plugin I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
footnote DEV: Remove rich_editor site setting (#41873) 2026-07-23 19:49:20 -03:00
poll I18N: Update translations (#42016) 2026-07-28 16:55:49 +02:00
spoiler-alert DEV: Remove rich_editor site setting (#41873) 2026-07-23 19:49:20 -03:00
styleguide DEV: Derive styleguide code samples from the rendered example (#42100) 2026-07-29 13:48:35 -03:00