https://github.com/evlist/codespaces-grafting
A codespace to debug WordPress plugins
https://github.com/evlist/codespaces-grafting
bash devcontainer devops github-codespaces template wordpress
Last synced: 27 days ago
JSON representation
A codespace to debug WordPress plugins
- Host: GitHub
- URL: https://github.com/evlist/codespaces-grafting
- Owner: evlist
- License: other
- Created: 2025-12-26T09:34:46.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-02-23T13:37:01.000Z (about 1 month ago)
- Last Synced: 2026-02-23T21:46:59.546Z (about 1 month ago)
- Topics: bash, devcontainer, devops, github-codespaces, template, wordpress
- Language: Shell
- Homepage:
- Size: 183 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=evlist/codespaces-grafting)
[](https://github.com/evlist/codespaces-grafting/releases)
[](LICENSES/GPL-3.0-or-later.txt)
[](LICENSES/MIT.txt)
[](https://github.com/evlist/codespaces-grafting)

# codespaces-grafting (aka cs-grafting)
A lightweight, shareable "live Codespace" / devcontainer scaffold. Graft this Codespace into an existing repository to give it an instant, reproducible development environment.
π± Quick metaphor (attention)
This project is to Codespaces what grafting is to gardening: you graft this Codespace template (the scion) into an existing repository (the stock) to add a ready-to-run development environment.
Who this is for
- Primary: WordPress plugin and theme authors (current templates and examples target WP).
- Secondary: Any project that wants a small, repeatable Codespace/devcontainer setup β the approach is intentionally generic.
Why use this
- β¨ Live Codespace: click the badge to create a Codespace from this template and export the scion into your repo (fastest path).
- βοΈ Minimal & conservative: provides PHP, WPβCLI and common tooling while preserving your project/editor settings.
- π Simple updater: graft.sh grafts the scion into your repo and helps you adopt template improvements safely.
Development tools included
- **Web stack**: Apache, MariaDB, PHP (with Xdebug)
- **WordPress**: WP-CLI for command-line WordPress management
- **Code quality**: Composer, PHP_CodeSniffer (phpcs) with WordPress Coding Standards
- **DevOps**: GitHub CLI (gh), REUSE tool for license compliance
- **Common utilities**: curl, jq, less, unzip
Terminology (short)
- scion β the Codespace/devcontainer template (.devcontainer/.vscode/.github)
- stock β your repository getting the scion grafted
- graft β the act of applying the scion (graft.sh)
Quick start
- Easiest (live Codespace): click the Codespaces badge β create a Codespace β export the scion into your repository via the Codespace UI.
- From a workstation:
```bash
curl -L -o ~/Downloads/graft.sh \
https://raw.githubusercontent.com/evlist/codespaces-grafting/stable/.devcontainer/bin/graft.sh
chmod +x ~/Downloads/graft.sh
cd /path/to/your-repo
bash ~/Downloads/graft.sh
```
Inspect the changes, commit and push the files you want to keep.
Docs and maintainers
- Short maintainer docs ship with the scion at `.devcontainer/docs/` so detailed guidance travels with the template and does not pollute stock repos.
- Current examples target WordPress; the pattern is reusable for other ecosystems.
Project structure (high level)
```
.
βββ README.md
βββ .devcontainer/ # scion (grafted into stock)
β βββ README.md # scion maintainer notes
β βββ docs/ # extended scion docs (maintainers)
β βββ assets/ # icons, images used in scion docs
β βββ devcontainer.json
β βββ Dockerfile
β βββ .cs_env # base environment variables
β βββ .cs_env.d/ # additional env files (Debian .d style)
β βββ bin/
β β βββ graft.sh # installer/updater (graft)
β βββ sbin/
β β βββ bootstrap.sh # container startup script
β β βββ bootstrap.sh.d/ # modular bootstrap hooks (Debian .d style)
β β βββ merge-env.sh # merges .cs_env and .cs_env.d/*
β βββ tmp/ # temporary files (gitignored)
β βββ var/ # runtime data (gitignored)
β βββ wp-content/ # WordPress content customizations
βββ .vscode/ # editor templates & stubs (managed)
βββ .github/ # workflows templates (managed)
βββ plugins-src/ # example/sample plugin(s) (WP-focused examples)
```
The scion uses **Debian-style `.d` directories** for modular configuration:
- **`.cs_env.d/`**: Environment variable overrides loaded in alphabetical order
- **`bootstrap.sh.d/`**: Startup hooks (10-aliases.sh, 20-plugins.sh, etc.) sourced sequentially
This makes customization easy: create `.local.sh` hooks (e.g., `25-themes.local.sh` for themes, `40-import.local.sh` for WP-CLI commands) that won't be overwritten during upgrades. See the [FAQ](.devcontainer/docs/FAQ.md#8-customization) for examples.
## GitHub Workflows (Configurable CI/CD)
Ready-to-use GitHub Actions workflows included:
- **`cs-grafting-ci.yml`** β Run tests (PHPUnit, PHP CodeSniffer, custom lint scripts)
- **`cs-grafting-plugin-zip.yml`** β Build and publish plugin ZIPs, manage nightly releases
All workflows are **fully configurable** via GitHub Variables:
- Enable/disable workflows
- Choose which branches trigger them
- Configure plugin directory (for monorepos)
- Select which tests to run
- Customize artifact exclusions
See [.devcontainer/docs/WORKFLOWS_CONFIG.md](.devcontainer/docs/WORKFLOWS_CONFIG.md) for complete configuration guide.
Want more?
- Maintainers: see [.devcontainer/README.md](.devcontainer/README.md) for upgrade semantics and structure
- [FAQ](.devcontainer/docs/FAQ.md) β frequently asked questions
- [MAINTAINER.md](.devcontainer/docs/MAINTAINER.md) β detailed procedures
- [Workflows Guide](.devcontainer/docs/WORKFLOWS_CONFIG.md) β GitHub Actions configuration
π Note: This root `README.md` is **not copied** when grafting. Your stock repository keeps its own README. `.devcontainer/`, managed `.vscode/`, and managed `.github/` files are grafted.
## Support & Community
- **Questions?** Check the [FAQ](.devcontainer/docs/FAQ.md)
- **Report bugs** or suggest features via [GitHub Issues](https://github.com/evlist/codespaces-grafting/issues)
- **Contribute**: See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines
- **Discussions**: Open a [GitHub Discussion](https://github.com/evlist/codespaces-grafting/discussions) for ideas and feedback
## License
This project is dual-licensed:
- GPL-3.0-or-later OR
- MIT
You may choose either license. See the LICENSE file and LICENSES/ directory for full texts.