docs: refresh CARE plugin/apps docs to match shipped reality#16468
docs: refresh CARE plugin/apps docs to match shipped reality#16468bodhish wants to merge 5 commits into
Conversation
…ystem Address code-quality review of README: - Update local backend credentials to current fixtures (care-doctor / Ohcn@123 etc.), matching CLAUDE.md; previous volunteer_2_0 / Coronasafe@123 set no longer exists and broke local dev auth. - Correct i18n path from src->Locale->en to public/locale/en.json (src/Locale only holds a script). - Document the plugin system (module federation, pluginTypes.ts manifest contract, REACT_ENABLED_APPS). - Normalize an env code-block comment (#.env -> # .env). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…note Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The dev-mode discovery section showed an incomplete metadata shape
({ name, localPath, package }). Each localDevPluginConfigs entry
actually has a top-level slug plus a meta wrapper, matching the
generated config in vite.config.mts and PlugConfigMeta.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
WalkthroughREADME is updated with new default backend credentials, a new Plugin System section covering manifest contract and ChangesREADME and Plugin Architecture Documentation
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
🎭 Playwright Test ResultsStatus: ⏭️ Skipped No test-related files were changed in this PR. Tests are skipped when changes don't affect:
Run: #9645 |
Deploying care-preview with
|
| Latest commit: |
71af448
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c935115f.care-preview-a7w.pages.dev |
| Branch Preview URL: | https://docs-refresh-care-apps-plugi.care-preview-a7w.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR refreshes CARE’s plugin/apps documentation to align with the currently shipped local-plugin dev workflow and plugin runtime behavior, plus a small Tailwind-related comment correction in Vite config.
Changes:
- Replaces the outdated local plugin “plan” docs with the shipped
apps/*/src/manifest.tsxdev auto-discovery flow (virtual module,@/rewrite,/local-plugins/<slug>assets, Tailwind scanning, dedupe, and HMR). - Clarifies that the override-architecture doc is design-intent only and points readers to the authoritative implementation in
src/lib/override/. - Updates README local backend credentials + adds a Plugin System section; fixes i18n file path reference.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
vite.config.mts |
Comment-only correction: Tailwind scanning of apps/** is via Tailwind content: config (not @source). |
README.md |
Updates local backend credentials, corrects i18n source file path, and documents the plugin system + REACT_ENABLED_APPS. |
docs/care-apps-override-architecture.md |
Adds a prominent note that the doc is design-intent; links to the real override implementation location. |
docs/care-apps-local-dev.md |
Rewrites local plugin dev docs to describe the shipped in-tree apps/ auto-discovery workflow and the standalone remote alternative. |
docs/care-apps-architecture-note.md |
Adds cross-links to src/pluginTypes.ts and the local-dev/clone-component docs. |
| ## Translations | ||
|
|
||
| All strings must be encased in i18n translations. New translation strings must be specified in `src`->`Locale`->`en`. Do not add translations for languages other than english through pull requests. Other language translations can be contributed through [Crowdin](https://crowdin.com/project/ohccarefe) | ||
| All strings must be encased in i18n translations. New translation strings must be specified in `public/locale/en.json`. Do not add translations for languages other than english through pull requests. Other language translations can be contributed through [Crowdin](https://crowdin.com/project/ohccarefe) |
Greptile SummaryThis PR refreshes the CARE plugin/apps documentation to match the shipped implementation, replacing stale "plan" content with accurate descriptions of the
Confidence Score: 4/5Safe to merge — all changes are documentation and a code comment fix with no behavioral impact. The credential table, i18n path, Vite comment, and local-dev workflow docs were each verified against live source files. One minor wording imprecision was found in the new Plugin System README section where the @-suffix is described as remote origin when it carries the full path to remoteEntry.js. README.md — the new Plugin System section has a slightly imprecise description of the @host/path format. Important Files Changed
Reviews (1): Last reviewed commit: "docs: correct local plugin config metada..." | Re-trigger Greptile |
| CARE supports a micro-frontend plugin architecture, letting you extend the app with additional features without forking it. Plugins are self-contained federated React remotes loaded at runtime via [Module Federation](https://github.com/originjs/vite-plugin-federation) (`@originjs/vite-plugin-federation`). | ||
|
|
||
| - **Manifest contract**: each plugin exposes a `PluginManifest` defining the routes, components, tabs, and devices it provides. The source of truth for the manifest types is [`src/pluginTypes.ts`](src/pluginTypes.ts). Key host files are `src/PluginEngine.tsx` and `src/pluginTypes.ts`. | ||
| - **Enabling plugins**: set the `REACT_ENABLED_APPS` environment variable to a comma-separated list of plugins in `org/repo` or `org/repo@host/path` form. With just `org/repo`, the remote is loaded from `https://{org}.github.io/{repo}`; otherwise the `@host` portion is used as the remote origin. |
There was a problem hiding this comment.
The description calls the
@-suffixed portion a "remote origin", but as shown in the example it includes the full path (e.g. /assets/remoteEntry.js), not just the host:port. Using "origin" may mislead readers into thinking only the host is needed. A more precise word is "remote URL" or "remote entry URL".
| - **Enabling plugins**: set the `REACT_ENABLED_APPS` environment variable to a comma-separated list of plugins in `org/repo` or `org/repo@host/path` form. With just `org/repo`, the remote is loaded from `https://{org}.github.io/{repo}`; otherwise the `@host` portion is used as the remote origin. | |
| - **Enabling plugins**: set the `REACT_ENABLED_APPS` environment variable to a comma-separated list of plugins in `org/repo` or `org/repo@host/path` form. With just `org/repo`, the remote is loaded from `https://{org}.github.io/{repo}`; otherwise the full `@host/path` value is used as the remote entry URL. |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/care-apps-local-dev.md`:
- Around line 81-83: The documentation in the "Shared deps / no duplicate React"
bullet point lists federation-shared dependencies but omits i18next, which is
explicitly included in the resolve.dedupe array in vite.config.mts. Update the
dependency list in this section to include i18next alongside the other mentioned
packages (react, react-dom, react-i18next, `@tanstack/react-query`, raviger,
sonner, and decimal.js) to ensure the documentation accurately reflects all
deduplicated dependencies.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 36557c84-439b-4679-adcb-2134590fa67c
📒 Files selected for processing (5)
README.mddocs/care-apps-architecture-note.mddocs/care-apps-local-dev.mddocs/care-apps-override-architecture.mdvite.config.mts
| - **Shared deps / no duplicate React:** federation shares react, react-dom, react-i18next, | ||
| @tanstack/react-query, raviger, sonner, decimal.js, and `resolve.dedupe` forces plugin | ||
| source to use the host's single copy — avoiding "Should have a queue" / hook-order errors. |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify federation shared dependencies and dedupe config
# Search for federation plugin config with shared/dedupe settings
rg -n "federation|shared:|dedupe" vite.config.mts -C 3 | head -30
# Check if all listed packages are in the dedupe/shared list
for pkg in react react-dom react-i18next "`@tanstack/react-query`" raviger sonner "decimal.js"; do
echo "Checking: $pkg"
rg -q "$pkg" vite.config.mts && echo " ✓ Found" || echo " ✗ Not found"
doneRepository: ohcnetwork/care_fe
Length of output: 1181
🏁 Script executed:
# Get the complete shared and dedupe arrays
sed -n '425,515p' vite.config.mtsRepository: ohcnetwork/care_fe
Length of output: 2569
🏁 Script executed:
# Get the complete dedupe array
sed -n '517,535p' vite.config.mtsRepository: ohcnetwork/care_fe
Length of output: 434
Update documentation to include i18next in the list of deduplicated dependencies.
The documentation at lines 81-83 lists the shared dependencies but omits i18next, which is included in the resolve.dedupe array in vite.config.mts (line 524). While i18next is not in the federation shared array, it is explicitly deduplicated. The documentation should either list all deduplicated packages or clarify that the listed items are the primary federation-shared packages while acknowledging additional packages in the dedupe configuration.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/care-apps-local-dev.md` around lines 81 - 83, The documentation in the
"Shared deps / no duplicate React" bullet point lists federation-shared
dependencies but omits i18next, which is explicitly included in the
resolve.dedupe array in vite.config.mts. Update the dependency list in this
section to include i18next alongside the other mentioned packages (react,
react-dom, react-i18next, `@tanstack/react-query`, raviger, sonner, and
decimal.js) to ensure the documentation accurately reflects all deduplicated
dependencies.
What & why
The
care-apps-*plugin docs had drifted from the shipped implementation. This corrects them as part of documenting the plugin internals accurately (companion to care_hello_fe#11, which refreshes the plugin template + adds an authoring skill).Changes
docs/care-apps-local-dev.md— rewrote the stale "Dev-Mode Local Discovery Plan" (described as unbuilt) to document the shippedapps/*/src/manifest.tsxauto-discovery (localPluginDevSupport()invite.config.mts): thevirtual:care-local-pluginsmodule,@/→/@fs/rewrite,/local-plugins/<slug>asset middleware, Tailwindcontent:-array scanning, shared-dep dedupe, and full HMR. Made in-tree dev the primary workflow and the 4173 build-watch loop the standalone alternative. Also corrected the local-plugin config metadata shape ({ slug, meta: {...} }).docs/care-apps-override-architecture.md— added a header noting it's a design-intent doc; the shipped implementation lives insrc/lib/override/.docs/care-apps-architecture-note.md— cross-linkedsrc/pluginTypes.tsandclone-component.README.md— fixed stale local backend credentials (volunteer_2_0/Coronasafe@123→care-doctor/Ohcn@123, matching the current fixtures/CLAUDE.md), corrected the i18n path topublic/locale/en.json, and added a Plugin System section.vite.config.mts— corrected a 3-line code comment that said Tailwind scansapps/**via@source(it's thecontent:array). Comment-only, no behavior change.All doc/comment accuracy fixes — no behavioral changes. Verified against
vite.config.mts,src/pluginTypes.ts, andsrc/lib/override/.🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation