@wp-operations/wp-ide
v0.2.0
Published
Project and monorepo tooling for wp-operations: .local data convention, project resolution, blueprint runner.
Maintainers
Readme
@wp-operations/wp-ide
Project and monorepo tooling for wp-operations. Library, no CLI — wp-app serves, wp-ops orchestrates, wp-ide knows where things live.
The .local convention
All runtime data for a repository — SQLite databases, uploads, per-app wp-content — lives in one gitignored .local/ directory at the repo root. Delete it and every app resets. Nothing hides in the user's home folder.
<repo>/.local/
└── wp-content/
├── my-theme/ wp-content + SQLite db for the my-theme app
└── my-plugin/API
import {
resolveProject, // walk up to repo root, read wp-operations.json
localPath, // localPath(root, 'wp-content', 'my-app')
ensureLocalDir, // same, but creates it
appServerOptions, // build wp-app startServer options with .local wpContentPath
runBlueprint, // run blueprint steps against a running wp-app php instance
} from '@wp-operations/wp-ide';Start an app with its data in .local instead of ~/.wp-app:
import { startServer } from '@wp-operations/wp-app';
import { appServerOptions, runBlueprint } from '@wp-operations/wp-ide';
const options = appServerOptions('./apps/my-theme', { wp: 'classicpress' });
const { php, url } = await startServer(options);
await runBlueprint(php, {
steps: [
{ step: 'defineWpConfigConsts', consts: { WP_DEBUG: true } },
{ step: 'login', username: 'admin', password: 'password' },
],
});Supported blueprint steps: defineWpConfigConsts, login, activatePlugin, activateTheme, runPHP, writeFile. Unknown steps are reported as skipped, never fatal.
wp-operations.json
Optional repo-root config consumed by resolveProject / appServerOptions:
{
"php": "8.0",
"wp": "classicpress",
"apps": {
"my-theme": "apps/my-theme"
}
}License
GPL-2.0-or-later.
