Skip to content

docs: refresh CARE plugin/apps docs to match shipped reality#16468

Open
bodhish wants to merge 5 commits into
developfrom
docs/refresh-care-apps-plugin-docs
Open

docs: refresh CARE plugin/apps docs to match shipped reality#16468
bodhish wants to merge 5 commits into
developfrom
docs/refresh-care-apps-plugin-docs

Conversation

@bodhish

@bodhish bodhish commented Jun 21, 2026

Copy link
Copy Markdown
Member

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 shipped apps/*/src/manifest.tsx auto-discovery (localPluginDevSupport() in vite.config.mts): the virtual:care-local-plugins module, @//@fs/ rewrite, /local-plugins/<slug> asset middleware, Tailwind content:-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 in src/lib/override/.
  • docs/care-apps-architecture-note.md — cross-linked src/pluginTypes.ts and clone-component.
  • README.md — fixed stale local backend credentials (volunteer_2_0/Coronasafe@123care-doctor/Ohcn@123, matching the current fixtures/CLAUDE.md), corrected the i18n path to public/locale/en.json, and added a Plugin System section.
  • vite.config.mts — corrected a 3-line code comment that said Tailwind scans apps/** via @source (it's the content: array). Comment-only, no behavior change.

All doc/comment accuracy fixes — no behavioral changes. Verified against vite.config.mts, src/pluginTypes.ts, and src/lib/override/.

🤖 Generated with Claude Code

Summary by CodeRabbit

Documentation

  • Expanded plugin architecture documentation with detailed local development workflows and setup guidance
  • Updated configuration setup instructions and environment variable examples
  • Added cross-references connecting related technical materials
  • Refined guidance for localization contributions

bodhish and others added 5 commits June 21, 2026 18:49
…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>
…ource)

The host scans apps/** through the content: array in tailwind.config.js
(wired into Tailwind v4 via @config in src/style/index.css), not a CSS
@source directive. Fix the doc claim and the matching vite.config.mts comment.

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>
@bodhish bodhish requested review from a team and Copilot June 21, 2026 15:21
@netlify

netlify Bot commented Jun 21, 2026

Copy link
Copy Markdown

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 71af448
🔍 Latest deploy log https://app.netlify.com/projects/care-ohc/deploys/6a3801740120020008f8c6f7
😎 Deploy Preview https://deploy-preview-16468.preview.ohc.network
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

⚠️ Merge Checklist Incomplete

Thank you for your contribution! To help us review your PR efficiently, please complete the merge checklist in your PR description.

Your PR will be reviewed once you have marked the appropriate checklist items.

To update the checklist:

  • Change - [ ] to - [x] for completed items
  • Only check items that are relevant to your PR
  • Leave items unchecked if they don't apply

The checklist helps ensure code quality, testing coverage, and documentation are properly addressed.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

README is updated with new default backend credentials, a new Plugin System section covering manifest contract and REACT_ENABLED_APPS, a corrected translation key path, and a fixed .env comment. Plugin architecture docs receive a full local dev workflow rewrite, a design-intent disclaimer, cross-references to src/pluginTypes.ts, and a reworded Vite config comment.

Changes

README and Plugin Architecture Documentation

Layer / File(s) Summary
README: credentials, plugin system section, and minor fixes
README.md
Replaces the default backend credentials table with new role-based values, adds a "🧩 Plugin System" section documenting the manifest contract and REACT_ENABLED_APPS, changes the documented translation key location from src/Locale/en to public/locale/en.json, and corrects the .env comment header in the Playwright section.
Plugin architecture docs: local dev rewrite, design-intent notes, and cross-references
docs/care-apps-local-dev.md, docs/care-apps-override-architecture.md, docs/care-apps-architecture-note.md, vite.config.mts
Rewrites care-apps-local-dev.md with primary in-tree and standalone workflows, covering auto-discovery, virtual module wiring, @//@fs/ alias rewriting, asset serving, Tailwind scanning via apps/**, shared-deps expectations, and HMR behavior. Inserts a design-intent disclaimer in care-apps-override-architecture.md pointing to src/lib/override/ as the authoritative source. Adds a "See also" block in care-apps-architecture-note.md referencing src/pluginTypes.ts and care-apps-local-dev.md. Rewords the Vite config Tailwind import-stripping comment to reference apps/** content scanning.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides comprehensive context, detailed changes, and verification notes but does not follow the repository's standard template structure. Consider restructuring the description to match the template format with explicit 'Proposed Changes' section, 'Fixes' reference, and 'Merge Checklist' for consistency with repository standards.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: refreshing documentation to match the shipped plugin system implementation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/refresh-care-apps-plugin-docs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

🎭 Playwright Test Results

Status: ⏭️ Skipped

No test-related files were changed in this PR.

Tests are skipped when changes don't affect:

  • tests/**
  • src/**
  • package.json
  • playwright.config.ts

Run: #9645

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying care-preview with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.tsx dev 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.

Comment thread README.md
## 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-apps

greptile-apps Bot commented Jun 21, 2026

Copy link
Copy Markdown

Greptile Summary

This PR refreshes the CARE plugin/apps documentation to match the shipped implementation, replacing stale "plan" content with accurate descriptions of the localPluginDevSupport() Vite plugin, correcting backend fixture credentials, fixing the i18n file path, and patching a three-line code comment in vite.config.mts. No behavioral changes are made.

  • docs/care-apps-local-dev.md: stale "Dev-Mode Local Discovery Plan" section replaced with accurate documentation of the in-tree apps/*/src/manifest.tsx auto-discovery flow, including the virtual module shape, @//@fs/ rewrite, asset middleware, Tailwind scanning via content:, dedupe, and HMR — all verified against vite.config.mts.
  • README.md: fixture credentials updated to match CLAUDE.md (care-doctor/Ohcn@123 etc.), i18n path corrected to public/locale/en.json, and a new Plugin System section added.
  • vite.config.mts: comment corrected from "via @source" to "via the content: array in tailwind.config.js", matching the actual Tailwind v4 config wired in via @config in src/style/index.css.

Confidence Score: 4/5

Safe 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

Filename Overview
README.md Credential table updated to match CLAUDE.md fixtures; i18n path corrected to public/locale/en.json; new Plugin System section added. Minor wording imprecision: "@host portion" is described as "remote origin" but actually includes the full path to remoteEntry.js.
vite.config.mts Three-line comment corrected: "via @source" → "via the content: array in tailwind.config.js", which matches the actual tailwind.config.js configuration. No behavior change.
docs/care-apps-local-dev.md Replaced stale "Dev-Mode Local Discovery Plan" with accurate documentation of the shipped localPluginDevSupport() implementation in vite.config.mts. Config shape, virtual module names, HMR behavior, and Tailwind scanning mechanism verified against source.
docs/care-apps-override-architecture.md Added a note clarifying this is a design-intent document and that src/lib/override/ is the authoritative implementation. No other changes.
docs/care-apps-architecture-note.md Added cross-links to src/pluginTypes.ts and docs/care-apps-local-dev.md. Additive and accurate.

Reviews (1): Last reviewed commit: "docs: correct local plugin config metada..." | Re-trigger Greptile

Comment thread README.md
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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".

Suggested change
- **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!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between dcec6e9 and 71af448.

📒 Files selected for processing (5)
  • README.md
  • docs/care-apps-architecture-note.md
  • docs/care-apps-local-dev.md
  • docs/care-apps-override-architecture.md
  • vite.config.mts

Comment on lines +81 to +83
- **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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 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"
done

Repository: ohcnetwork/care_fe

Length of output: 1181


🏁 Script executed:

# Get the complete shared and dedupe arrays
sed -n '425,515p' vite.config.mts

Repository: ohcnetwork/care_fe

Length of output: 2569


🏁 Script executed:

# Get the complete dedupe array
sed -n '517,535p' vite.config.mts

Repository: 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.

@nihal467 nihal467 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants