@mittwald/flow-react-components 1.2.0-next.55 → 1.2.0-next.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -0
- package/USAGE.md +29 -0
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/js/tunnel.mjs +6 -0
- package/dist/types/index/tunnel.d.ts +12 -0
- package/package.json +13 -9
package/AGENTS.md
CHANGED
|
@@ -319,11 +319,19 @@ Run: `pnpm nx test:unit components`,
|
|
|
319
319
|
| `.` (default) | Everything listed **manually** in `src/components/public.ts` — new public components must be added there. |
|
|
320
320
|
| `./internal` | Advanced internals (`flowComponent`, prop helper types, …). |
|
|
321
321
|
| `./flr-universal` | Curated subset that works local _and_ remote. Adding to `public.ts` does **not** add here. |
|
|
322
|
+
| `./tunnel` | `@mittwald/react-tunnel` re-exported (`src/index/tunnel.ts`) plus `getTunnelProviderId`, so a consumer's own tunnels share Flow's module instance instead of creating a second React context. |
|
|
322
323
|
| `./nextjs`, `./react-hook-form`, `./mittwald-password-tools-js` | Integrations (`src/integrations/`): wrappers around third-party dependencies that not every consumer should pay for — they get their own export entry instead of entering the core surface. |
|
|
323
324
|
| `./all.css`, `./all-layered.css` | Bundled stylesheet, plain and `@layer`-wrapped. |
|
|
324
325
|
| `./component-index` | Generated consumer-facing index: every public component with its status and its own props (`dev/component-index/`). What the docs site's prop tables read, and the one prop dataset a consumer's agent should use. |
|
|
325
326
|
| `./doc-properties` | `react-docgen-typescript` output in its raw `ComponentDoc[]` shape, filtered to the props a consumer can act on. Prefer `./component-index`. The unfiltered dump the generators above read is `.cache/doc-properties.json`, which is not published. |
|
|
326
327
|
|
|
328
|
+
**Adding any new export entry?** Add the subpath to `keptSubpaths` in
|
|
329
|
+
`packages/codemods/src/migrations/imports-to-package-root/transform.ts`. That
|
|
330
|
+
codemod collapses subpath imports onto the package root with a catch-all `else`,
|
|
331
|
+
so a subpath that is not listed gets flattened onto a root that does not export
|
|
332
|
+
its names. The guard beside the transform fails the codemods unit tests when you
|
|
333
|
+
forget.
|
|
334
|
+
|
|
327
335
|
**Adding a new integration export entry?** Also register it in the component
|
|
328
336
|
status registry so it is covered: add the entry to `STATUS_EXPORT_ENTRIES`
|
|
329
337
|
(`dev/status-registry/exportEntries.ts`) — the `FlowExportEntry` union and the
|
package/USAGE.md
CHANGED
|
@@ -70,6 +70,7 @@ overrides), `RouterProvider` (so `Link` and navigation use your router),
|
|
|
70
70
|
| `@mittwald/flow-react-components/nextjs` | Next.js integration |
|
|
71
71
|
| `@mittwald/flow-react-components/react-hook-form` | react-hook-form integration |
|
|
72
72
|
| `@mittwald/flow-react-components/mittwald-password-tools-js` | password-strength integration |
|
|
73
|
+
| `@mittwald/flow-react-components/tunnel` | Tunnels — see below |
|
|
73
74
|
| `@mittwald/flow-react-components/all.css` | Stylesheet |
|
|
74
75
|
| `@mittwald/flow-react-components/component-index` | Machine-readable component + prop index (below) |
|
|
75
76
|
|
|
@@ -77,6 +78,34 @@ overrides), `RouterProvider` (so `Link` and navigation use your router),
|
|
|
77
78
|
(`flowComponent`, prop helper types, the status registry) and is not a consumer
|
|
78
79
|
API.
|
|
79
80
|
|
|
81
|
+
### Tunnels
|
|
82
|
+
|
|
83
|
+
`@mittwald/flow-react-components/tunnel` re-exports `TunnelProvider`,
|
|
84
|
+
`TunnelEntry` and `TunnelExit`. Import them from there — **never add
|
|
85
|
+
`@mittwald/react-tunnel` to your own dependencies.** Its React context lives in
|
|
86
|
+
a module-level `createContext`, so a second copy of the package is a second,
|
|
87
|
+
unrelated context: your `TunnelEntry` stops finding any provider and
|
|
88
|
+
`useTunnelState` throws at runtime. Nothing in `tsc` or ESLint warns first.
|
|
89
|
+
|
|
90
|
+
The same entry point exports `getTunnelProviderId`, which names the tunnel Flow
|
|
91
|
+
opens around every ui/layout component. That is how you render into a Flow
|
|
92
|
+
component's own exits — a `Heading`'s `headingContent`, for example, the slot
|
|
93
|
+
`Badge` and `AlertBadge` use:
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
import {
|
|
97
|
+
TunnelEntry,
|
|
98
|
+
getTunnelProviderId,
|
|
99
|
+
} from "@mittwald/flow-react-components/tunnel";
|
|
100
|
+
|
|
101
|
+
<Heading>
|
|
102
|
+
<ModelTitle model={model} />
|
|
103
|
+
<TunnelEntry id="headingContent" providerId={getTunnelProviderId("Heading")}>
|
|
104
|
+
{titleSuffix}
|
|
105
|
+
</TunnelEntry>
|
|
106
|
+
</Heading>;
|
|
107
|
+
```
|
|
108
|
+
|
|
80
109
|
## Finding the right component
|
|
81
110
|
|
|
82
111
|
`@mittwald/flow-react-components/component-index` is a JSON index of every
|