@rudra-js/react 0.7.5 → 0.8.0
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 +11 -5
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @rudra-js/react
|
|
2
2
|
|
|
3
|
+
This package is part of [rudra-js](https://rudrajs.com).
|
|
4
|
+
|
|
5
|
+
rudra-js is an open-source TypeScript library (MIT) you install from npm. A language model designs one product-recommendation block for a page in your shop, rudra-js checks it against your catalog, and React renders it.
|
|
6
|
+
|
|
7
|
+
It is not a hosted platform, a visual or low-code app builder, or a workspace you sign up for.
|
|
8
|
+
|
|
3
9
|
Renders a component specification from
|
|
4
10
|
[`@rudra-js/core`](https://github.com/clivedsouza1010/rudra-js/tree/main/packages/core) with React
|
|
5
11
|
18 or 19.
|
|
@@ -44,8 +50,8 @@ the model wrote is rendered as escaped text.
|
|
|
44
50
|
| Tone, headline, the words in each block | Every price |
|
|
45
51
|
| Only in per-shopper mode: which products, and how each is described | Every image and link |
|
|
46
52
|
|
|
47
|
-
In the default cohort mode
|
|
48
|
-
|
|
53
|
+
In the default cohort mode core fills in the products, their order and the reason under each,
|
|
54
|
+
per request, and a badge the model wrote gets dropped. The model picks those only under
|
|
49
55
|
`generation: 'per-shopper'`. In either mode it still chooses the product a hero names. You'll find
|
|
50
56
|
the full split in
|
|
51
57
|
[What the model decides, by mode](https://github.com/clivedsouza1010/rudra-js/tree/main/packages/core#what-the-model-decides-by-mode).
|
|
@@ -54,8 +60,8 @@ The specification has no field carrying a title, a price, an image or a URL. Pro
|
|
|
54
60
|
resolved at render time from `products`, keyed by a SKU reconciliation has already checked.
|
|
55
61
|
|
|
56
62
|
**Validate `products` with `productSchema` from `@rudra-js/core`**, the same schema your candidates
|
|
57
|
-
already passed. This prop is a second
|
|
58
|
-
and `productSchema` is what rejects a protocol-relative `//evil.example/pixel.png` or a `data:` URL.
|
|
63
|
+
already passed. This prop is a second way for data to reach the page. `imageUrl` lands in an
|
|
64
|
+
`<img src>`, and `productSchema` is what rejects a protocol-relative `//evil.example/pixel.png` or a `data:` URL.
|
|
59
65
|
It reads a path the way a browser does, so `/\evil.example/pixel.png` and the same trick written
|
|
60
66
|
with a tab or a newline in it are rejected too — each one resolves to someone else's host. React
|
|
61
67
|
neutralises a `javascript:` URL by itself, but not any of those. And if a price isn't a finite
|
|
@@ -192,7 +198,7 @@ page is broken.
|
|
|
192
198
|
The sets your shop sells together, the same way `products` is your catalog. The model only asks for
|
|
193
199
|
a bundle block. It never invents one, and it _never_ sees a price.
|
|
194
200
|
|
|
195
|
-
You offer the sets, and
|
|
201
|
+
You offer the sets, and core picks which one fills each block. That happens inside
|
|
196
202
|
`reconcileSpec` as the page is served, after the spec was generated rather than before, and it goes on what this
|
|
197
203
|
shopper has in their basket, has looked at, or is browsing right now. The spec then carries the id
|
|
198
204
|
it picked. This prop supplies the rest: that set's members, its price, the currency that price is
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rudra-js/react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "React renderer for rudra-js: renders an LLM-designed product-recommendation block from your own catalog, on the server or in the browser",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"rudra-js",
|
|
7
|
+
"product-recommendations",
|
|
6
8
|
"react",
|
|
7
9
|
"react-server-components",
|
|
8
10
|
"rsc",
|
|
9
11
|
"llm",
|
|
10
12
|
"recommendations",
|
|
11
13
|
"ecommerce",
|
|
12
|
-
"ssr"
|
|
14
|
+
"ssr",
|
|
15
|
+
"typescript"
|
|
13
16
|
],
|
|
14
17
|
"license": "MIT",
|
|
15
18
|
"author": "Clive Dsouza",
|
|
@@ -51,11 +54,11 @@
|
|
|
51
54
|
"access": "public"
|
|
52
55
|
},
|
|
53
56
|
"peerDependencies": {
|
|
54
|
-
"@rudra-js/core": "^0.
|
|
57
|
+
"@rudra-js/core": "^0.8.0",
|
|
55
58
|
"react": "^18.2.0 || ^19.0.0"
|
|
56
59
|
},
|
|
57
60
|
"devDependencies": {
|
|
58
|
-
"@rudra-js/core": "0.
|
|
61
|
+
"@rudra-js/core": "0.8.0",
|
|
59
62
|
"@types/react": "^19.3.0",
|
|
60
63
|
"@types/react-dom": "^19.3.0",
|
|
61
64
|
"react": "^19.3.0",
|