@playfast/reform-react-native 0.0.7

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/README.md ADDED
@@ -0,0 +1,39 @@
1
+ <div align="center">
2
+
3
+ # `@playfast/react-native`
4
+
5
+ **React Native host for reform — register a scene as a root component.**
6
+
7
+ </div>
8
+
9
+ ---
10
+
11
+ DOM apps mount a scene into a container they own; React Native instead registers a
12
+ **root component**. `createReformRoot` wraps the renderer-neutral `Reform` component from
13
+ [`@playfast/react`](https://www.npmjs.com/package/@playfast/react) — which already owns the
14
+ runtime, boots, and renders the scene — in a zero-argument component you can register with
15
+ Expo's `registerRootComponent` or `AppRegistry.registerComponent`.
16
+
17
+ ```tsx
18
+ import { registerRootComponent } from 'expo'
19
+ import { scene } from '@playfast/reform'
20
+ import { createReformRoot } from '@playfast/reform-react-native'
21
+ import { AppShell } from './shell.compose'
22
+ import { makeAppLayer } from './app.layer'
23
+
24
+ const AppScene = scene(AppShell, { provide: [makeAppLayer()] })
25
+
26
+ registerRootComponent(createReformRoot(AppScene))
27
+ ```
28
+
29
+ All of reform's engine, reactivity, and lifecycle behavior comes from `@playfast/react`
30
+ underneath — this package only adapts the entry point. Peers: `effect`, `react` (`^19`),
31
+ `react-native`, `@playfast/reform`, and `@playfast/react`.
32
+
33
+ See the [API reference](./playbook/api.doc.md). Pair it with the core
34
+ [`@playfast/reform`](https://www.npmjs.com/package/@playfast/reform) and the DOM host
35
+ [`@playfast/react`](https://www.npmjs.com/package/@playfast/react).
36
+
37
+ ## License
38
+
39
+ MIT
@@ -0,0 +1,8 @@
1
+ import { type ComponentType } from 'react';
2
+ import type { Scene } from '@playfast/reform';
3
+ /**
4
+ * Build a React-Native root component that hosts a scene. Register the returned
5
+ * component with Expo's `registerRootComponent` (or `AppRegistry`).
6
+ */
7
+ export declare const createReformRoot: (scene: Scene) => ComponentType;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,OAAO,CAAA;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAQ7C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,KAAK,KAAG,aAG/C,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ import { createElement } from 'react';
2
+ import { Reform } from '@playfast/reform-react';
3
+ // The React-Native host. Unlike the DOM target (which renders a scene into a
4
+ // container the app owns), React Native registers a *root component*. So this
5
+ // wraps the renderer-neutral `Reform` component — which already owns the
6
+ // `ManagedRuntime`, boots, and renders the scene — in a zero-arg component for
7
+ // Expo's `registerRootComponent` / `AppRegistry.registerComponent`.
8
+ /**
9
+ * Build a React-Native root component that hosts a scene. Register the returned
10
+ * component with Expo's `registerRootComponent` (or `AppRegistry`).
11
+ */
12
+ export const createReformRoot = (scene) => {
13
+ const ReformRoot = () => createElement(Reform, { scene });
14
+ return ReformRoot;
15
+ };
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAG/C,6EAA6E;AAC7E,8EAA8E;AAC9E,yEAAyE;AACzE,+EAA+E;AAC/E,oEAAoE;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAY,EAAiB,EAAE;IAC9D,MAAM,UAAU,GAAG,GAAqC,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IAC3F,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@playfast/reform-react-native",
3
+ "playbook": "./playbook",
4
+ "version": "0.0.7",
5
+ "type": "module",
6
+ "description": "React Native host for reform — registers a scene as a zero-arg root component for Expo or bare React Native.",
7
+ "keywords": [
8
+ "reform",
9
+ "effect",
10
+ "react-native",
11
+ "expo",
12
+ "host"
13
+ ],
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/playfast/reform.git",
18
+ "directory": "packages/react-native"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/playfast/reform/issues"
22
+ },
23
+ "sideEffects": false,
24
+ "exports": {
25
+ "./package.json": "./package.json",
26
+ ".": "./src/index.tsx",
27
+ "./*": "./src/*.tsx"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "README.md"
32
+ ],
33
+ "scripts": {
34
+ "clean": "rm -rf dist .tsbuildinfo",
35
+ "check": "tsc --noEmit",
36
+ "build": "tsc -p tsconfig.build.json",
37
+ "test": "vitest run",
38
+ "test:watch": "vitest",
39
+ "coverage": "vitest run --coverage",
40
+ "lint": "oxlint src",
41
+ "lint:fix": "oxlint --fix src"
42
+ },
43
+ "peerDependencies": {
44
+ "effect": "*",
45
+ "react": "^19.0.0",
46
+ "react-native": "*",
47
+ "@playfast/reform": "*",
48
+ "@playfast/reform-react": "*"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ }
53
+ }