Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci-cookbook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI cookbook-v2
name: CI cookbook

on:
push:
Expand All @@ -17,7 +17,7 @@ jobs:
- run: corepack enable
- run: yarn install

# Build gl-react packages (needed by cookbook-v2)
# Build gl-react packages (needed by cookbook)
- name: Build gl-react packages
run: |
for d in packages/gl-react packages/gl-react-dom; do
Expand All @@ -26,16 +26,16 @@ jobs:

# Install Playwright browsers
- name: Install Playwright
run: yarn workspace gl-react-cookbook-v2 e2e:install
run: yarn workspace gl-react-cookbook e2e:install

# Run Playwright tests
- name: Run Playwright tests
run: yarn workspace gl-react-cookbook-v2 e2e
run: yarn workspace gl-react-cookbook e2e

# Upload test results on failure
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cookbook-v2-test-results
path: packages/cookbook-v2/test-results/
name: cookbook-test-results
path: packages/cookbook/test-results/
retention-days: 7
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy cookbook-v2 to GitHub Pages
name: Deploy cookbook to GitHub Pages

on:
push:
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:

- run: yarn install

# Build gl-react packages (cookbook-v2 imports from src via Vite alias,
# Build gl-react packages (cookbook imports from src via Vite alias,
# but mirrors the existing CI pipeline for consistency).
- name: Build gl-react packages
run: |
Expand All @@ -42,23 +42,23 @@ jobs:

# Run Vite build directly (bypassing the package's "tsc && vite build"
# script which currently has unresolved TS errors unrelated to deploy).
# The Vite dev server is the source of truth for cookbook-v2 today.
- name: Build cookbook-v2
# The Vite dev server is the source of truth for cookbook today.
- name: Build cookbook
env:
GH_PAGES: "true"
working-directory: packages/cookbook-v2
working-directory: packages/cookbook
run: yarn exec vite build

# SPA fallback: GitHub Pages serves 404.html on unknown paths. Copying
# index.html → 404.html lets BrowserRouter handle deep links / refreshes.
- name: SPA fallback (404.html)
run: cp packages/cookbook-v2/dist/index.html packages/cookbook-v2/dist/404.html
run: cp packages/cookbook/dist/index.html packages/cookbook/dist/404.html

- uses: actions/configure-pages@v5

- uses: actions/upload-pages-artifact@v3
with:
path: packages/cookbook-v2/dist
path: packages/cookbook/dist

deploy:
needs: build
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ yarn watch # Watch mode for development
yarn test # Run Jest tests (packages/tests)
yarn test-rewrite-snapshots # Regenerate test snapshots
yarn prettier # Format source files
yarn cookbook-v2 # Start modern cookbook dev server (Vite)
yarn cookbook # Start modern cookbook dev server (Vite)
```

Tests run via `packages/tests/test.sh`, which executes Jest on each `__tests__/*.js` file individually. On CI (Linux), tests require `xvfb-run` for headless OpenGL.
Expand All @@ -31,7 +31,7 @@ Tests run via `packages/tests/test.sh`, which executes Jest on each `__tests__/*
- **`packages/gl-react-expo/`** — React Native via Expo GLView.
- **`packages/gl-react-headless/`** — Node.js implementation using headless-gl.
- **`packages/tests/`** — Shared Jest test suite using `gl-react-headless` + `react-test-renderer`.
- **`packages/cookbook-v2/`** — Modern examples (Vite + TypeScript + Tailwind).
- **`packages/cookbook/`** — Modern examples (Vite + TypeScript + Tailwind).

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Finally, please check that all examples of the cookbook are working correctly.
**Run it**

```sh
yarn cookbook-v2
yarn cookbook
```

## License
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This universal library must be coupled with one of the concrete implementations:

## Links

- **[Cookbook examples](packages/cookbook-v2/)** (`yarn cookbook-v2` to run locally)
- **[Cookbook examples](packages/cookbook/)** (`yarn cookbook` to run locally)
- [Expo Cookbook](packages/cookbook-expo/)
- [JSFiddle hello gl example](https://jsfiddle.net/greweb/cup5feke/)
- [![Join the chat at https://gitter.im/gl-react/Lobby](https://badges.gitter.im/gl-react/Lobby.svg)](https://gitter.im/gl-react/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"preinstall": "node -e \"if (process.env.npm_execpath.indexOf('yarn') === -1) { console.log('\u001b[31mPlease use yarn\u001b[0m'); process.exit(1); }\"",
"build": "./scripts/build.sh",
"watch": "./scripts/watch.sh",
"prettier": "prettier --write 'packages/{gl-react,gl-react-dom,gl-react-expo,gl-react-headless,gl-react-native}/src/**/*.{ts,tsx}' 'packages/cookbook-v2/src/**/*.{ts,tsx}'",
"cookbook-v2": "cd packages/cookbook-v2 && yarn dev",
"prettier": "prettier --write 'packages/{gl-react,gl-react-dom,gl-react-expo,gl-react-headless,gl-react-native}/src/**/*.{ts,tsx}' 'packages/cookbook/src/**/*.{ts,tsx}'",
"cookbook": "cd packages/cookbook && yarn dev",
"test": "cd packages/tests && yarn test",
"test-rewrite-snapshots": "cd packages/tests && yarn test -- -u",
"clean": "rm -rf node_modules packages/*/node_modules/ packages/*/lib",
Expand Down
2 changes: 1 addition & 1 deletion packages/cookbook-expo/examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface ExampleEntry {
Component: ComponentType<any>;
}

// Mirrors packages/cookbook-v2/src/examples/index.ts. Examples that depend
// Mirrors packages/cookbook/src/examples/index.ts. Examples that depend
// on DOM-only APIs (live GLSL editor textarea, video files, custom canvas
// text rendering) are listed in the README's "TODO/unported" section
// instead of this registry.
Expand Down
2 changes: 1 addition & 1 deletion packages/cookbook-expo/shared/colorScales.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Bundled local 1x256 PNG gradients. Matches cookbook-v2.
// Bundled local 1x256 PNG gradients. Matches cookbook.
export const colorScales: Record<string, number> = {
spectral: require("../assets/colorscales/colorscale-spectral.png"),
OrRd: require("../assets/colorscales/colorscale-OrRd.png"),
Expand Down
2 changes: 1 addition & 1 deletion packages/cookbook-expo/shared/useTimeLoop.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect, useRef } from "react";

// Drop-in replacement for cookbook-v2's useTimeLoop, RAF-based.
// Drop-in replacement for cookbook's useTimeLoop, RAF-based.
export function useTimeLoop(refreshRate = 60) {
const [state, setState] = useState({ time: 0, tick: 0 });
const rafRef = useRef<number | null>(null);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GL React Cookbook v2
# GL React Cookbook

A modern, TypeScript-first cookbook for building stunning WebGL experiences with React.

Expand Down Expand Up @@ -30,13 +30,13 @@ From the root of the monorepo:
yarn install

# Start the development server
yarn cookbook-v2
yarn cookbook
```

Or directly from this package:

```bash
cd packages/cookbook-v2
cd packages/cookbook
yarn dev
```

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "gl-react-cookbook-v2",
"name": "gl-react-cookbook",
"version": "1.0.0",
"private": true,
"type": "module",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7631,9 +7631,9 @@ __metadata:
languageName: unknown
linkType: soft

"gl-react-cookbook-v2@workspace:packages/cookbook-v2":
"gl-react-cookbook@workspace:packages/cookbook":
version: 0.0.0-use.local
resolution: "gl-react-cookbook-v2@workspace:packages/cookbook-v2"
resolution: "gl-react-cookbook@workspace:packages/cookbook"
dependencies:
"@babel/core": "npm:^7.29.0"
"@babel/preset-react": "npm:^7.28.5"
Expand Down
Loading