Skip to content

Modern WordPress theme starter powered by Vite, and Sass. Optimised for fast development and production.

License

Notifications You must be signed in to change notification settings

rossanoguenci/reactsmith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReactSmith (light) ReactSmith (dark)

A modern WordPress starter theme powered by Vite, and Sass. Optimised for fast development and production.

  • Project homepage (this repo)
  • Docs: see the docs/ folder (core.md, theme.md, filters.md, structure.md, config-keys.md, helpers.md)

Requirements

  • PHP >= 8.3 (per composer.json)
  • Node.js >= 23 (per package.json engines)
  • pnpm >= 10 (package manager used by this project)
  • Composer
  • (Optional) WP-CLI for i18n tasks

Project Setup

  1. Copy environment file:
  • cp .env.sample .env and adjust values as needed.
  1. Install dependencies:
  • pnpm install
  • composer install
  1. Development server:
  • pnpm dev (starts Vite with HMR and HTTPS)
  1. Production build:
  • pnpm build
  1. Deploy build (CI or server):
  • pnpm deploy (installs prod deps via Composer and builds assets)

Getting Started (scripts)

  • pnpm setuppnpm install && composer install
  • pnpm dev → Starts Vite dev server with VITE_DEV=true
  • pnpm build → Production build
  • pnpm startvite build --watch (useful for some environments)
  • pnpm deploypnpm install && composer install --no-dev && vite build
  • pnpm i18n:pot → Generates a POT file at languages/reactsmith.pot
  • pnpm fix → Runs code formatters/linters (JS/CSS/PHP)

Internationalization (POT generation)

  • Install Composer deps (first time): composer install
  • Generate POT with WP-CLI: pnpm i18n:pot
    • Outputs to languages/reactsmith.pot (uses the Text Domain from project config)

Development

Vite dev server is configured for HTTPS and hot module replacement (HMR). PHP file changes trigger a full reload.

Environment variables

  • VITE_PROTOCOL (default: https)
  • VITE_HOST (default: localhost)
  • VITE_PORT (default: 5173)
  • VITE_HMR_PROTOCOL (default: derives from VITE_PROTOCOL)
  • VITE_ORIGIN (default: ${VITE_PROTOCOL}://${VITE_HOST}:${VITE_PORT})
  • VITE_CORS_ORIGIN (default: *)
  • VITE_CORS_METHODS (default: GET,POST,PUT,DELETE,PATCH,OPTIONS)
  • VITE_CORS_HEADERS (default: Content-Type,Authorization)
  • VITE_CORS_CREDENTIALS (default: true)

Optional PWA (Add to Home Screen)

For installable web app functionality, update these files (remove if not needed):

  • _src/static/site.webmanifest
  • _src/images/icon-512.png
  • _src/images/icon-maskable-512.png

Project structure (high‑level)

See docs/structure.md for a full tour. Key points:

  • Core/ — framework pieces (assets, partials/components, WordPress integrations)
  • Theme/ — project‑specific extensions and integrations
  • _src/ — source assets (JS/TS, SCSS, images, static)
  • assets/ — built assets and manifest.json
  • reactsmith.json — project metadata and settings consumed by Core\Config
  • theme.json — WordPress block theme configuration (generated by Vite plugin)

Linting and code quality

  • pnpm fix:styles → Stylelint (SCSS/CSS)
  • pnpm fix:scripts → ESLint
  • pnpm fix:php → PHP CodeSniffer (auto-fix where possible)
  • pnpm php:compat → PHP Compatibility check (targets PHP 8.2+ by default in script; adjust as needed)

Acknowledgements

This project is originally based on and inspired by Wholegrain Digital’s Granola theme (MIT):

Portions of the code remain © 2019 Wholegrain Digital, used under the MIT Licence. See LICENSE for details. ReactSmith is ©2025 Rossano Guenci.


License

MIT — see LICENSE.

About

Modern WordPress theme starter powered by Vite, and Sass. Optimised for fast development and production.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published