locomotive-agency/blockyard
Composer 安装命令:
composer require locomotive-agency/blockyard
包简介
CLI tool for scaffolding and building WordPress blocks
README 文档
README
A Project-Centric PHP tool for scaffolding and building WordPress Block projects with automated environments and remote configuration support.
Features
- Project-Centric Workflow: Manage multiple blocks under a single project container.
- Fast Scaffolding: Create new blocks in < 1 second using local templates.
- Block Templates: Support for specialized block types (e.g.,
accordion). - Magic Previews: Instant testing in WordPress Playground with auto-insertion into a live preview page.
- Shared Dependencies: Save disk space by sharing one
node_modulesacross all projects. - Remote Configuration: (Optional) Sync project metadata and Blueprints from a central API.
Installation
Install Blockyard globally:
composer global require locomotive-agency/blockyard
Note: Ensure your Composer bin directory is in your $PATH.
One-Time Setup
Install global shared dependencies (WordPress build tools):
blockyard setup
Getting Started
1. Initialize a Project
Create a project container. This holds your shared configuration and WordPress environment settings.
# Standard local initialization
blockyard init --name="My Project" --namespace="my-blocks" --author="Your Name"
2. Create a Block
Run this inside your project folder to scaffold a new block:
cd my-project
blockyard create-block --name="Feature Card"
Available Block Templates:
default- Basic content blockaccordion- Collapsible content panelsslider- Image carousel with navigationtabs- Tabbed interface for content organizationhero- Full-width hero section with background image and CTAscard- Versatile card component (image + content + CTA)cta- Prominent call-to-action section
Example with template:
blockyard create-block --name="Image Gallery" --type=slider
3. Build, Preview & Deploy
Navigate to your block folder to develop and test:
cd feature-card
# Build production assets
blockyard build
# Start the magic preview
blockyard preview
# Package as a WordPress Plugin
blockyard deploy
# Package as Static HTML
blockyard deploy --target=html
4. Deploy Your Block
Package the block for WordPress or static sites:
WordPress Plugin (Default):
cd feature-card
blockyard deploy
# Creates: dist/feature-card.zip (ready to upload to WordPress)
Static HTML:
blockyard deploy --target=html
# Creates: dist/static/
# - block.html (clean snippet)
# - index.html (standalone preview)
# - build/ (CSS/JS assets)
The static HTML deployment automatically:
- Boots WordPress Playground
- Renders your block server-side
- Extracts the real HTML
- Generates production-ready files
5. Yard Login and Run Deployment (MVP)
Authenticate once, then deploy app metadata to Yard:
# OAuth login (stores ~/.blockyard/tokens.json)
blockyard login
# Verify current identity from Yard (/v1/me)
blockyard whoami
# Queue a deployment in Yard (/v1/apps/deploy)
blockyard deploy --target=run --app=test --mode=public
--target=run supports:
--app=<slug>: target app slug (defaults from block.json name)--mode=public|private: deployment mode--regions=us,euor explicit regions (us-central1,europe-west1)--commit=<sha>: override commit SHA (defaults togit rev-parse HEAD)--json: machine-readable output
CLI Reference
| Command | Option | Description |
|---|---|---|
init | --remote | Use API to fetch project data. |
create-block | --type | default, accordion, slider, tabs, hero, card, cta. |
deploy | --target | plugin (default), html, run. |
deploy | --out | Output directory (default: dist). |
deploy | --target=run | Queue app deploy in Yard (--app, --mode, --regions, --commit). |
login | --json | OAuth login and local token cache (~/.blockyard/tokens.json). |
whoami | --json | Show current Yard identity using stored token. |
Advanced: Remote Configuration
Blockyard can be integrated with a central API to manage project configurations across a team. This is useful for agencies wanting to standardize namespaces and WordPress Blueprints.
Environment Setup
Create a .env file in the current directory or ~/.blockyard/.env:
YARD_API_URL="https://yard-xxxxx-uc.a.run.app"
BLOCKYARD_OAUTH_CLIENT_ID="...apps.googleusercontent.com"
BLOCKYARD_OAUTH_CLIENT_SECRET="..." # optional
BLOCKYARD_ALLOWED_DOMAIN="company.com"
Using Remote Mode
When initializing, use the --remote flag to pull configuration from your API:
blockyard init --remote --client=123
--remote is Yard-only:
- Requires
YARD_API_URL - Requires a valid login token from
blockyard login - Uses:
GET {YARD_API_URL}/v1/clients/{id}GET {YARD_API_URL}/v1/clients/{id}/blueprint
Author
Locomotive Agency
Website: locomotive.agency
Release Automation
elease-flow.ps1 supports rerunnable prepare/publish release flow for protected main. See scripts/scripts.md for the full release procedure.
License
GPL-2.0-or-later
locomotive-agency/blockyard 适用场景与选型建议
locomotive-agency/blockyard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 38 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cli」 「wordpress」 「scaffolding」 「blocks」 「gutenberg」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 locomotive-agency/blockyard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 locomotive-agency/blockyard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 locomotive-agency/blockyard 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Slim starter / Slim skeleton package to boost your development with Slim framework
Generates a trait to help ease the access of custom repo methods
Layer Architecture for Laravel (Service, Repository, Entity)
Eco CLI for Laravel .env syncing
This project contains the boilerplate functionality that you would expect to see in a Laravel CMS. That way you can start working on your cool features instead of having to worry about the routing and content retrieval.
Must-use plugin integrating WordPress with the Upsun platform: environment awareness, router-cache friendliness, safe preview clones, deploy migrations, Site Health checks, and a wp upsun CLI command.
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-02-05