|
| 1 | +# Persistent Memory |
| 2 | + |
| 3 | +This file stores durable project context so future conversations can resume work with less re-discovery. |
| 4 | + |
| 5 | +## Project Summary |
| 6 | + |
| 7 | +- Repository: `FirefoxCSS-Store.github.io` |
| 8 | +- Purpose: static site that catalogs Firefox `userChrome.css` themes |
| 9 | +- Main data source: `themes.json` |
| 10 | +- Site source: `dev/` |
| 11 | +- Generated site output: `docs/` |
| 12 | + |
| 13 | +## Tooling And Validation |
| 14 | + |
| 15 | +- Package manager: `npm` |
| 16 | +- Build command: `npm run build` |
| 17 | +- Test command: `npm test` |
| 18 | +- Build system: `gulp` |
| 19 | +- Theme validation script: `tests/themes.check.js` |
| 20 | +- Theme metadata refresh script: `scripts/sort_themes.nu` |
| 21 | +- Dev container config: `.devcontainer/devcontainer.json` |
| 22 | +- Devcontainer bootstrap script: `.devcontainer/post-create.sh` |
| 23 | +- Devcontainer automation now runs `.devcontainer/post-create.sh` from `postCreateCommand` to ensure `jq`, `nu`, and project dependencies are installed after container creation/rebuild |
| 24 | +- The build toolchain now runs cleanly on Node 24 with `gulp@5`, `gulp-sass@6`, `gulp-terser`, and a custom `sharp`-based WebP conversion step |
| 25 | +- `npm audit` is currently clean after adding targeted `overrides` for `markdown-it` and `@parcel/watcher` transitive dependencies |
| 26 | + |
| 27 | +## Automation Context |
| 28 | + |
| 29 | +- Active working branch created for automation improvements: `improve-automation` |
| 30 | +- Existing GitHub Actions: |
| 31 | +- `.github/workflows/build.yml` |
| 32 | +- `.github/workflows/check-themes.yml` |
| 33 | +- CI now uses current `actions/checkout@v4` and `actions/setup-node@v4` on Node 24 |
| 34 | +- CI workflows now opt into Node 24 for JavaScript actions explicitly and use `actions/checkout@v6` plus `actions/setup-node@v6` |
| 35 | +- Build workflow now runs automatically on pushes to `main` that affect site/build inputs and commits regenerated `docs/` output back to the branch |
| 36 | +- PR validation now runs `npm test` and `npm run build` for site-related changes instead of only checking `themes.json` |
| 37 | +- The build workflow syntax also requires `workflow_dispatch:` with a trailing colon; missing it makes GitHub mark the workflow file as invalid even if other checks still pass |
| 38 | + |
| 39 | +## Repo Notes |
| 40 | + |
| 41 | +- Local `.codex` file is ignored in `.gitignore` |
| 42 | +- Build workflow currently commits generated files back to the branch after `npm run build` |
| 43 | +- Pull requests touching `themes.json` trigger validation via `npm test` |
| 44 | +- Site pages are generated from Pug in `dev/pug/` |
| 45 | +- Client behavior is implemented in `dev/js/main.js` |
| 46 | +- Styles are authored in SCSS under `dev/scss/` |
| 47 | +- Published site assets live in committed `docs/` |
| 48 | +- Local containerized development is configured to install Node, npm, `jq`, and Nushell |
| 49 | +- The devcontainer also runs `npm ci` automatically, so rebuilds recreate `node_modules` without manual setup |
| 50 | +- `gulpfile.js` now lazy-loads ESM-only Gulp plugins and skips optional directories like `dev/fonts/` when they are absent |
| 51 | +- Hidden config generation now filters non-`.txt` files explicitly so builds do not create stray files like `docs/.robots` |
| 52 | +- Theme entries that depended on fragile remote screenshots have been localized into `images/themes/remote-*` and now build into committed assets under `docs/assets/img/themes/` |
| 53 | +- Binary copies for static images now use `fs.promises.copyFile` instead of `gulp.src().pipe(dest())` because the stream path was corrupting some `.webp` assets in `docs/` |
| 54 | +- Project-facing text should be written in English by default; chat replies should mirror the user's language |
| 55 | + |
| 56 | +## Architecture Snapshot |
| 57 | + |
| 58 | +- `themes.json` is the single catalog source used by the client and copied to `docs/themes.json` during build |
| 59 | +- The frontend is a mostly static site with a small client-side app that fetches `themes.json`, sorts, filters, and renders cards in the browser |
| 60 | +- Gulp handles Pug compilation, SCSS compilation, Babel transpilation, JS minification with Terser, image conversion/copy with Sharp, and config file copying |
| 61 | +- Images from `images/` are emitted to `docs/assets/img/`; many local screenshots are converted to WebP |
| 62 | +- `scripts/sort_themes.nu` enriches theme entries with `pushed_at`, `stargazers_count`, and `avatar` using GitHub/GitLab/Codeberg APIs or git cloning fallback |
| 63 | + |
| 64 | +## Known Technical Risks |
| 65 | + |
| 66 | +- Theme rendering is intentionally throttled with `444ms` per card, which scales poorly for a catalog of 100+ entries |
| 67 | +- Search/filter logic depends on client-side fetch and has no visible loading or error handling |
| 68 | +- Test coverage is narrow: `tests/themes.check.js` validates only basic key order/types and not richer schema or link/image integrity |
| 69 | + |
| 70 | +## Working Agreement For Future Sessions |
| 71 | + |
| 72 | +- Read this file before making assumptions about project state |
| 73 | +- Update this file manually when there are relevant decisions, branch changes, automation updates, or persistent blockers |
| 74 | +- Keep entries concise and durable; avoid transient noise |
| 75 | +- Future agents should create a commit and push after implementing relevant changes or new functionality so work stays traceable and reversible |
| 76 | +- Future agents must not merge without explicit user authorization |
| 77 | +- Future agents must not take actions that could affect the production main branch without explicit user authorization |
0 commit comments