Beta.28#170
Conversation
…sion 0.1.0-beta.28 feat: add renderer plugin documentation and examples - Introduced new renderer plugin capabilities in the documentation. - Added examples for creating a renderer plugin, including main plugin file, renderer component, and editor component. - Updated sidebar badges for improved visibility of new content.
✅ Deploy Preview for studiocms-dev-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughRemoves the studiocms git submodule and its setup scripts; deletes TypeDoc configuration and related plugins; removes Coolify URL helpers; updates build/site config to use DOKPLOY_DEPLOY_URL; updates dependencies and adds/edits documentation pages and frontmatter metadata. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Astro as Astro Config
participant Env as Environment
participant HostUtils as Host Utilities (removed)
Note over HostUtils: Previously provided getCoolifyURL
Env->>Astro: DOKPLOY_DEPLOY_URL (new)
Astro->>Astro: build site URL from DOKPLOY_DEPLOY_URL or default
note right of Astro #f9f3d7: Typedoc plugins removed\n(no plugin factory call)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (8)
src/content/docs/en/plugins/renderers.mdx (5)
12-12: Remove unused import.
ReadMoreisn’t used on this page. Drop the import to avoid MDX/TS warnings.-import ReadMore from '~/components/ReadMore.astro'
24-31: Clean up unused import and add usage guidance.
AstroIntegrationis unused in this snippet. Remove to reduce noise.- Consider adding a short “Register the plugin” snippet for
astro.config.mjsso readers know how to enable it.import { definePlugin } from 'studiocms/plugins'; import { createResolver } from 'astro-integration-kit'; -import { AstroIntegration } from 'astro'; const { resolve } = createResolver(import.meta.url);Add to the doc (outside this block) for clarity:
import studiocms from 'studiocms'; import { myPlugin } from './src/plugins/my-plugin'; export default { integrations: [ studiocms({ plugins: [myPlugin()], }), ], };
41-45: Fix TS/JS mismatch in renderer sample.The sample is titled “render.js” but uses
import typeandsatisfies, which are TypeScript-only. Either:
- Rename to
.tsand keep the types, and update the reference in the plugin, or- Keep
.jsand switch to JSDoc types withoutsatisfies.Option A (TypeScript, preferred):
- rendererComponent: resolve('./components/render.js'), + rendererComponent: resolve('./components/render.ts'),import type { PluginRenderer } from 'studiocms/types'; const render: PluginRenderer = { name: 'my-custom-renderer', renderer: async (content: string) => { return content; }, sanitizeOpts: {}, }; export default render;Option B (JavaScript with JSDoc):
/** @typedef {import('studiocms/types').PluginRenderer} PluginRenderer */ /** @type {PluginRenderer} */ const render = { name: 'my-custom-renderer', renderer: async (content) => { return content; }, sanitizeOpts: {}, }; export default render;Also applies to: 57-70
76-83: Use the imported prop type (or remove it).Currently
PluginPageTypeEditorPropsis imported but not applied. Either type the destructure or remove the type import.-import type { PluginPageTypeEditorProps } from 'studiocms/types'; - -interface Props extends PluginPageTypeEditorProps {} - -const { content } = Astro.props; +import type { PluginPageTypeEditorProps } from 'studiocms/types'; +type Props = PluginPageTypeEditorProps; +const { content }: Props = Astro.props;
72-75: Minor copy edit for variation.Replace repeated “you need to” phrasing for style variety.
-For the editor component, you need to create an Astro component that provides a user interface for editing the content of your custom page type. +For the editor component, create an Astro component that provides a UI for editing your custom page type’s content.src/content/docs/en/guides/upgrade/version-guides/0-1-0-beta-28.mdx (3)
15-16: Remove unused import.
Asideisn’t used on this page.-import { Aside } from '@astrojs/starlight/components'
21-22: Provide concise migration steps for renderer changes.Linking to the doc is good; adding a 2–3 step checklist here will reduce friction for plugin authors.
- <ReadMore>See the [Plugin Renderer Documentation][plugin-renderer-docs] for more details on how to migrate existing renderers to the new system.</ReadMore> + <ReadMore> + See the [Plugin Renderer Documentation][plugin-renderer-docs]. Migration at a glance: + 1) Update your plugin hook to use `setRendering({ pageTypes: [...] })`. + 2) Provide a `rendererComponent` (TS/JS module) and `pageContentComponent` (Astro) per page type. + 3) If on JS, use JSDoc types instead of TS `satisfies`; if on TS, prefer `.ts` modules. + </ReadMore>
32-43: Consistency and capitalization nits.Unify tense and capitalize proper nouns for polish.
-- Fixes zod error parsing for first-time setup api route responses. +- Fixes Zod error parsing for first-time setup API route responses. -- Improve page creation and edit data processing for better consistency and reliability. -- Move avatar loading to client-side to eliminate render blocking. +- Improves page creation and edit data processing for better consistency and reliability. +- Moves avatar loading to client-side to eliminate render blocking.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (16)
.gitmodules(0 hunks)astro.config.mts(1 hunks)ec.config.mjs(1 hunks)hostUtils.ts(0 hunks)knip.config.ts(1 hunks)package.json(1 hunks)setup-gitmodules.bat(0 hunks)setup-gitmodules.sh(0 hunks)src/content/docs/en/guides/upgrade/version-guides/0-1-0-beta-27.mdx(0 hunks)src/content/docs/en/guides/upgrade/version-guides/0-1-0-beta-28.mdx(1 hunks)src/content/docs/en/plugins/extended.mdx(2 hunks)src/content/docs/en/plugins/renderers.mdx(1 hunks)src/plugins/frontmatter.js(0 hunks)src/plugins/readmes.js(0 hunks)studiocms(0 hunks)typedoc.config.ts(0 hunks)
💤 Files with no reviewable changes (9)
- .gitmodules
- studiocms
- src/plugins/frontmatter.js
- setup-gitmodules.sh
- hostUtils.ts
- src/content/docs/en/guides/upgrade/version-guides/0-1-0-beta-27.mdx
- src/plugins/readmes.js
- setup-gitmodules.bat
- typedoc.config.ts
🧰 Additional context used
🪛 LanguageTool
src/content/docs/en/plugins/renderers.mdx
[style] ~74-~74: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...omponent For the editor component, you need to create an Astro component that provides...
(REP_NEED_TO_VB)
🔇 Additional comments (8)
src/content/docs/en/plugins/extended.mdx (3)
7-9: Sidebar badge appropriately added.The "Updated" badge with "success" variant correctly indicates this documentation section has been refreshed. The YAML syntax is proper and placement is correct.
95-108: Translation structure is well-designed and exemplary.The translations object demonstrates solid i18n practices: clear language-scoped structure (en, fr), parallel keys between translations, and alignment with the dashboard grid item identifier ('example' on line 116). The nested structure with kebab-case property names ('other-text') follows convention. This is a helpful example for developers implementing multi-language plugin dashboards.
1-5: Verify i18nReady flag consistency.Line 2 declares
i18nReady: true, and the documentation now includes translation examples. Confirm that this flag accurately reflects the page's translation-ready state and that localized versions will be properly tracked in Lunaria (as noted in the PR comments about localization updates).ec.config.mjs (1)
15-15: LGTM!The addition of TypeScript error code 2345 (argument type mismatch) to the handbook options is appropriate and expands error handling coverage for the twoslash plugin.
knip.config.ts (1)
24-24: LGTM!The re-addition of
@astrojs/dbtoignoreDependenciesis appropriate, and the removal of TypeDoc-related plugins aligns with the broader TypeDoc cleanup in this PR.package.json (2)
36-36: LGTM!The version update for
@studiocms/uifrom1.0.0-beta.1to1.0.0-beta.3is appropriate for the beta.28 release.
25-34: Verify whether pkg.pr.new dependencies are intended for merge to main or temporary branch testing.The review concern is technically sound: pkg.pr.new publishes temporary preview package releases for commits/PRs, typically used in CI/workflows to test unreleased code before npm publishing. All 11 dependencies (10 @studiocms packages + @lunariajs/core) point to commit hash
af43330, which will expire.However, context shows:
- This is on review branch
coderabbit_170(not main)- Project is in active beta (0.1.0-beta.28)
- Other dependencies use semantic versioning (e.g.,
@studiocms/ui@1.0.0-beta.3)Confirm whether these preview URLs are intended for a permanent merge or temporary testing. If merging to main, ensure a documented plan exists to replace them with published npm versions before release.
astro.config.mts (1)
13-15: No changes needed - code is correctly implemented.The code properly handles the
DOKPLOY_DEPLOY_URLenvironment variable with an appropriate fallback. DOKPLOY_DEPLOY_URL is automatically provided by Dokploy's platform in preview deployment environments and does not require manual configuration in.envfiles. The ternary operator correctly uses this variable when available and falls back to the StudioCMS documentation URL otherwise, covering all deployment scenarios (Dokploy preview deployments, local development, and production environments).Likely an incorrect or invalid review comment.
This pull request removes all TypeDoc-related functionality and dependencies from the project, updates StudioCMS-related packages to use preview builds, and introduces documentation and configuration improvements for the latest StudioCMS release. The changes streamline the codebase by eliminating unused submodules, scripts, and plugins, while also updating documentation for new features and breaking changes.
BEFORE MERGE:
TypeDoc and plugin removal:
astro.config.mts,package.json, andknip.config.ts, including custom plugins insrc/plugins/frontmatter.jsandsrc/plugins/readmes.js. [1] [2] [3] [4] [5] [6] [7]studiocmsgit submodule and setup scripts (.gitmodules,setup-gitmodules.bat,setup-gitmodules.sh) have been removed, reflecting the move away from submodule-based development. [1] [2] [3] [4]Dependency and configuration updates:
pkg.pr.new, and@studiocms/uiis updated to version1.0.0-beta.3.getCoolifyURLutility and its references have been removed; site URL is now set using theDOKPLOY_DEPLOY_URLenvironment variable. [1] [2]Documentation improvements:
0.1.0-beta.28, including breaking changes, new features, and bug fixes.Minor configuration changes:
2345to the TypeScript twoslash handbook options inec.config.mjs.0.1.0-beta.27.Summary by CodeRabbit