You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The base plugin (`@edufeed-org/oer-finder-plugin`) is installed automatically as a dependency — you do not need to install it separately. All necessary imports (components, types, and adapter registration) are available directly from this React package.
14
-
15
-
> **Important:** Do not install `@edufeed-org/oer-finder-plugin` as a direct dependency alongside the React package. Doing so can result in two separate copies on disk, each with its own adapter registry. Adapters registered via one copy would be invisible to components from the other, causing searches to silently return zero results. Always import from `@edufeed-org/oer-finder-plugin-react` instead.
13
+
The base plugin is a peer dependency of the React package. Both packages must be installed — the React package provides the React component wrappers, while the base plugin provides the Web Components, adapter registry, and adapter entry points.
16
14
17
15
## Operating Modes
18
16
@@ -46,18 +44,19 @@ When `apiUrl` is **omitted**, adapters run directly in the browser. No backend s
46
44
- You are prototyping or building a static site
47
45
- You want full client-side control over adapter behavior
48
46
49
-
You **must register adapters** before the component renders. Call the registration function once at your app's entry point:
47
+
You **must register adapters** before the component renders. Call the registration function once at your app's entry point. Import adapter registration functions directly from `@edufeed-org/oer-finder-plugin`:
50
48
51
49
```typescript
52
50
// Register all built-in adapters
53
-
import {registerAllBuiltInAdapters} from '@edufeed-org/oer-finder-plugin-react/adapters';
51
+
import {registerAllBuiltInAdapters} from '@edufeed-org/oer-finder-plugin/adapters';
54
52
registerAllBuiltInAdapters();
55
53
```
56
54
57
55
Or register only the adapters you need:
58
56
59
57
```typescript
60
-
import {registerOpenverseAdapter, registerArasaacAdapter} from '@edufeed-org/oer-finder-plugin-react/adapters';
58
+
import {registerOpenverseAdapter} from '@edufeed-org/oer-finder-plugin/adapter/openverse';
59
+
import {registerArasaacAdapter} from '@edufeed-org/oer-finder-plugin/adapter/arasaac';
61
60
registerOpenverseAdapter();
62
61
registerArasaacAdapter();
63
62
```
@@ -186,7 +185,8 @@ The component code is identical to the [server-proxy example above](#server-prox
186
185
**1. Register adapters once at your app entry point (e.g., `main.tsx`):**
187
186
188
187
```tsx
189
-
import {registerOpenverseAdapter, registerArasaacAdapter} from '@edufeed-org/oer-finder-plugin-react/adapters';
188
+
import {registerOpenverseAdapter} from '@edufeed-org/oer-finder-plugin/adapter/openverse';
189
+
import {registerArasaacAdapter} from '@edufeed-org/oer-finder-plugin/adapter/arasaac';
190
190
registerOpenverseAdapter();
191
191
registerArasaacAdapter();
192
192
```
@@ -303,22 +303,23 @@ The following built-in adapters are available for direct client mode:
This package depends on `@edufeed-org/oer-finder-plugin` internally — you do not need to install the base plugin separately. All key types (`OerItem`, `OerMetadata`, `OerListResponse`, `SourceConfig`, `LoadMoreMeta`, `SupportedLanguage`) are re-exported from this package.
591
+
Both packages must be installed — the base plugin is a peer dependency of the React package. Import React components from the React package, and adapter registration functions directly from the base plugin.
592
592
593
593
For usage details, see the [React guide](./client-packages-react.md).
- Re-exports all relevant types and the adapter registry API (`registerAdapter`, `getAdapterFactory`) from `oer-finder-plugin`
10
-
-Provides a separate `./adapters` entry point that re-exports `registerAllBuiltInAdapters` for tree-shakeable adapter registration
11
-
-Peer dependency on React 18 or 19
9
+
- Re-exports relevant UI types from `oer-finder-plugin`
10
+
-Peer dependency on `@edufeed-org/oer-finder-plugin` and React 18 or 19
11
+
-Adapter registration and adapter types are imported directly from `@edufeed-org/oer-finder-plugin` by consumers
12
12
13
13
## Key Files
14
14
15
-
-`src/index.ts` — React component wrappers (via `@lit/react`), type re-exports, and adapter registry API
16
-
-`src/adapters.ts` — Re-exports `registerAllBuiltInAdapters` from the plugin's `adapters` entry point
15
+
-`src/index.ts` — React component wrappers (via `@lit/react`) and type re-exports
17
16
18
17
## Build
19
18
@@ -29,8 +28,8 @@ pnpm --filter @edufeed-org/oer-finder-plugin-react format # Prettier
29
28
-**Build:** Vite (ESM-only output) + tsc for declarations. Always rebuilds `oer-finder-plugin` first. CJS was dropped to avoid dual-registry issues — `oer-finder-plugin` is ESM-only, so a CJS build would create separate module instances
30
29
-**Test:** No tests
31
30
-**TypeScript:** ES2020, ESNext modules, bundler resolution, `jsx: react-jsx`, DOM lib
32
-
-**Dependencies:**`oer-finder-plugin` (workspace). `@lit/react` is a dev dependency (bundled by Vite)
33
-
-**Peer deps:**`react ^18.0.0 || ^19.0.0`
31
+
-**Dependencies:**`@lit/react` is a dev dependency (bundled by Vite)
0 commit comments