diff --git a/AGENTS.md b/AGENTS.md index 71a9668..6cb4106 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ Ely GPUI Component. A component library for GPUI, in light and dark. - `cargo run --example gallery -- --narrow 280 --capture ` lays each page, header and body, at that width in a padded card and shoots it without its script, whose aims are measured at full width. Demos that set their own width run past the card. - `RUSTC_BOOTSTRAP=1 cargo check --lib --target wasm32-unknown-unknown` checks the web build; gpui_web's `wasm_thread` needs the bootstrap, as Zed's web examples do. - `ELY_GALLERY_ASSETS=
scripts/web.sh ` builds the gallery for the browser, profile `web`, and fails past Cloudflare's 25 MiB. It opens at `?page=&story=&theme=light|dark`; the host page calls `gallery.setTheme(mode)` or posts `{ ely: "theme", theme }`, before the wasm runs or after, and the page posts `{ ely: "ready" }` to its parent once it runs. -- In `frontend/`: `ELY_GALLERY_ASSETS=<site>/gallery/assets/ pnpm gallery` builds the gallery into `public/gallery`, `pnpm dev` serves the site, `pnpm build` checks types and writes `dist`, `pnpm deploy` runs `wrangler deploy`, `pnpm showcase` writes the showcase catalog into `src/showcase.json` and `public/showcase` (both ignored): it downloads the commit `showcase.lock` pins, installs that commit's packages and runs its own validator, so a bad catalog fails the build; `dev` and `build` run it first, and `ELY_SHOWCASE=<checkout>` reads a local catalog instead. `pnpm test` runs the iso engine's, the mark's and the showcase list's tests, and `pnpm local` builds the gallery for localhost, builds the site and serves both on http://localhost:4173/ (wasm-bindgen and wasm-opt on PATH, as `scripts/web.sh` says). `node scripts/og.mjs`, with `pnpm preview` up, renders `public/og.png` from the hero and the header's mark. `node scripts/favicon.mjs` writes `public/favicon.svg`, which follows the system's mode, and `public/apple-touch-icon.png` from the mark, in the colors `styles.css` sets. The site reads `examples/gallery/stories.json` for its chapters, stories and search. +- In `frontend/`: `ELY_GALLERY_ASSETS=<site>/gallery/assets/ pnpm gallery` builds the gallery into `public/gallery`, `pnpm dev` serves the site, `pnpm build` checks types and writes `dist`, `pnpm deploy` runs `wrangler deploy`, `pnpm showcase` writes the showcase catalog into `src/showcase.json` and `public/showcase` (both ignored): it downloads the commit `showcase.lock` pins, installs that commit's packages and runs its own validator, so a bad catalog fails the build; `dev` and `build` run it first, and `ELY_SHOWCASE=<checkout>` reads a local catalog instead. `pnpm test` runs the iso engine's, the mark's and the showcase list's tests, and `pnpm local` builds the gallery for localhost, builds the site and serves both on http://localhost:4173/ (wasm-bindgen and wasm-opt on PATH, as `scripts/web.sh` says). `node scripts/og.mjs`, with `pnpm preview` up, renders `public/og.png` from the hero and the header's mark. `node scripts/favicon.mjs` writes `public/favicon.svg`, which follows the system's mode, `public/apple-touch-icon.png` and the repo's `logo.png` (2048px, transparent) from the mark, in the colors `styles.css` sets. The site reads `examples/gallery/stories.json` for its chapters, stories and search. - `python3 scripts/stories.py` writes `examples/gallery/stories.json`, every page's sections in drawing order with their components, for the site: the names in a title, and in its `SHOWN` table what a story draws beyond them. It fails on a section opened inside another and on a ticked entry with a home of its own that no story names. `scripts/check.sh` refuses a stale one. - `cargo test --lib --features test-support`, `cargo clippy --all-targets --features test-support -- -D warnings`, `cargo fmt --check`. `scripts/check.sh` runs them with the house rules and lints the gallery for wasm32. - `rm -rf target/debug/incremental` and `cargo clean -p ely-gpui-component` after each task item keep the disk lean. Cargo keeps every old build of the crate and its tests under a new hash; by T25 they had filled the disk. diff --git a/README.md b/README.md index ae93a56..99a0809 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ ELY_GALLERY_ASSETS=https://<site>/gallery/assets/ pnpm gallery # the wasm gall pnpm dev # or: pnpm build && pnpm preview; both fetch the showcase at showcase.lock's commit ELY_SHOWCASE=../../Ely-GPUI-Showcases pnpm dev # the showcase from a local checkout node scripts/og.mjs # with pnpm preview up: public/og.png from the hero -node scripts/favicon.mjs # public/favicon.svg and apple-touch-icon.png from the mark +node scripts/favicon.mjs # public/favicon.svg, apple-touch-icon.png and ../logo.png from the mark pnpm deploy # Cloudflare, through wrangler ``` diff --git a/frontend/scripts/favicon.mjs b/frontend/scripts/favicon.mjs index 7b01a47..896a3aa 100644 --- a/frontend/scripts/favicon.mjs +++ b/frontend/scripts/favicon.mjs @@ -1,4 +1,4 @@ -// Writes public/favicon.svg and public/apple-touch-icon.png from the header's mark. +// Writes public/favicon.svg, public/apple-touch-icon.png and the repo's logo.png from the header's mark. import { chromium } from "@playwright/test"; import { readFileSync, writeFileSync } from "node:fs"; import { mark, points } from "../src/iso/mark.ts"; @@ -37,5 +37,8 @@ const browser = await chromium.launch(); const page = await browser.newPage({ viewport: { width: 180, height: 180 } }); await page.setContent(`<style>body{margin:0}svg{display:block;width:180px;height:180px}</style>${svg(0.18, 0.16, rules(LIGHT), LIGHT.top)}`); await page.screenshot({ path: "public/apple-touch-icon.png" }); +await page.setViewportSize({ width: 2048, height: 2048 }); +await page.setContent(`<style>body{margin:0;background:none}svg{display:block;width:2048px;height:2048px}</style>${svg(0.04, 0.1, rules(LIGHT))}`); +await page.screenshot({ path: "../logo.png", omitBackground: true }); await browser.close(); -console.log("favicon: wrote public/favicon.svg and public/apple-touch-icon.png"); +console.log("favicon: wrote public/favicon.svg, public/apple-touch-icon.png and ../logo.png"); diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..1e0965f Binary files /dev/null and b/logo.png differ