grab 0.0.80 → 0.0.82
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 +156 -0
- package/dist/chunk-STRAHFDU.js +94 -0
- package/dist/chunk-VX5TI23F.cjs +94 -0
- package/dist/cli.cjs +121 -121
- package/dist/core.cjs +1 -30
- package/dist/core.js +1 -1
- package/dist/index.cjs +2 -60
- package/dist/index.global.js +2 -2
- package/dist/index.js +2 -34
- package/package.json +1 -1
- package/dist/chunk-2OKPQEMK.cjs +0 -8761
- package/dist/chunk-VO4Y6JSD.js +0 -8754
package/README.md
CHANGED
|
@@ -280,6 +280,162 @@ export default function RootLayout({ children }) {
|
|
|
280
280
|
}
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
+
### Codex
|
|
284
|
+
|
|
285
|
+
#### Server Setup
|
|
286
|
+
|
|
287
|
+
The server runs on port `7567` and interfaces with the OpenAI Codex SDK. Add to your `package.json`:
|
|
288
|
+
|
|
289
|
+
```json
|
|
290
|
+
{
|
|
291
|
+
"scripts": {
|
|
292
|
+
"dev": "npx @react-grab/codex@latest && next dev"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
> **Note:** You must have [Codex](https://github.com/openai/codex) installed (`npm i -g @openai/codex`).
|
|
298
|
+
|
|
299
|
+
#### Client Setup
|
|
300
|
+
|
|
301
|
+
```html
|
|
302
|
+
<script src="//unpkg.com/grab/dist/index.global.js"></script>
|
|
303
|
+
<!-- add this in the <head> -->
|
|
304
|
+
<script src="//unpkg.com/@react-grab/codex/dist/client.global.js"></script>
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Or using Next.js `Script` component in your `app/layout.tsx`:
|
|
308
|
+
|
|
309
|
+
```jsx
|
|
310
|
+
import Script from "next/script";
|
|
311
|
+
|
|
312
|
+
export default function RootLayout({ children }) {
|
|
313
|
+
return (
|
|
314
|
+
<html>
|
|
315
|
+
<head>
|
|
316
|
+
{process.env.NODE_ENV === "development" && (
|
|
317
|
+
<>
|
|
318
|
+
<Script
|
|
319
|
+
src="//unpkg.com/grab/dist/index.global.js"
|
|
320
|
+
strategy="beforeInteractive"
|
|
321
|
+
/>
|
|
322
|
+
<Script
|
|
323
|
+
src="//unpkg.com/@react-grab/codex/dist/client.global.js"
|
|
324
|
+
strategy="lazyOnload"
|
|
325
|
+
/>
|
|
326
|
+
</>
|
|
327
|
+
)}
|
|
328
|
+
</head>
|
|
329
|
+
<body>{children}</body>
|
|
330
|
+
</html>
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Gemini
|
|
336
|
+
|
|
337
|
+
#### Server Setup
|
|
338
|
+
|
|
339
|
+
The server runs on port `8567` and interfaces with the Gemini CLI. Add to your `package.json`:
|
|
340
|
+
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
"scripts": {
|
|
344
|
+
"dev": "npx @react-grab/gemini@latest && next dev"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
> **Note:** You must have [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed.
|
|
350
|
+
|
|
351
|
+
#### Client Setup
|
|
352
|
+
|
|
353
|
+
```html
|
|
354
|
+
<script src="//unpkg.com/grab/dist/index.global.js"></script>
|
|
355
|
+
<!-- add this in the <head> -->
|
|
356
|
+
<script src="//unpkg.com/@react-grab/gemini/dist/client.global.js"></script>
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Or using Next.js `Script` component in your `app/layout.tsx`:
|
|
360
|
+
|
|
361
|
+
```jsx
|
|
362
|
+
import Script from "next/script";
|
|
363
|
+
|
|
364
|
+
export default function RootLayout({ children }) {
|
|
365
|
+
return (
|
|
366
|
+
<html>
|
|
367
|
+
<head>
|
|
368
|
+
{process.env.NODE_ENV === "development" && (
|
|
369
|
+
<>
|
|
370
|
+
<Script
|
|
371
|
+
src="//unpkg.com/grab/dist/index.global.js"
|
|
372
|
+
strategy="beforeInteractive"
|
|
373
|
+
/>
|
|
374
|
+
<Script
|
|
375
|
+
src="//unpkg.com/@react-grab/gemini/dist/client.global.js"
|
|
376
|
+
strategy="lazyOnload"
|
|
377
|
+
/>
|
|
378
|
+
</>
|
|
379
|
+
)}
|
|
380
|
+
</head>
|
|
381
|
+
<body>{children}</body>
|
|
382
|
+
</html>
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### Amp
|
|
388
|
+
|
|
389
|
+
#### Server Setup
|
|
390
|
+
|
|
391
|
+
The server runs on port `9567` and interfaces with the [Amp SDK](https://ampcode.com/manual/sdk). Add to your `package.json`:
|
|
392
|
+
|
|
393
|
+
```json
|
|
394
|
+
{
|
|
395
|
+
"scripts": {
|
|
396
|
+
"dev": "npx @react-grab/amp@latest && next dev"
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
> **Note:** You must have an [Amp API key](https://ampcode.com/settings) set via `AMP_API_KEY` environment variable.
|
|
402
|
+
|
|
403
|
+
#### Client Setup
|
|
404
|
+
|
|
405
|
+
```html
|
|
406
|
+
<script src="//unpkg.com/grab/dist/index.global.js"></script>
|
|
407
|
+
<!-- add this in the <head> -->
|
|
408
|
+
<script src="//unpkg.com/@react-grab/amp/dist/client.global.js"></script>
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
Or using Next.js `Script` component in your `app/layout.tsx`:
|
|
412
|
+
|
|
413
|
+
```jsx
|
|
414
|
+
import Script from "next/script";
|
|
415
|
+
|
|
416
|
+
export default function RootLayout({ children }) {
|
|
417
|
+
return (
|
|
418
|
+
<html>
|
|
419
|
+
<head>
|
|
420
|
+
{process.env.NODE_ENV === "development" && (
|
|
421
|
+
<>
|
|
422
|
+
<Script
|
|
423
|
+
src="//unpkg.com/grab/dist/index.global.js"
|
|
424
|
+
strategy="beforeInteractive"
|
|
425
|
+
/>
|
|
426
|
+
<Script
|
|
427
|
+
src="//unpkg.com/@react-grab/amp/dist/client.global.js"
|
|
428
|
+
strategy="lazyOnload"
|
|
429
|
+
/>
|
|
430
|
+
</>
|
|
431
|
+
)}
|
|
432
|
+
</head>
|
|
433
|
+
<body>{children}</body>
|
|
434
|
+
</html>
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
283
439
|
## Extending React Grab
|
|
284
440
|
|
|
285
441
|
React Grab provides an public customization API. Check out the [type definitions](https://github.com/aidenybai/react-grab/blob/main/packages/react-grab/src/types.ts) to see all available options for extending React Grab.
|