Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DB_PASSWORD=db

# Local URL
WP_HOME=https://sympress-starter.ddev.site
WP_SITEURL=${WP_HOME}/wp
WP_SITEURL=${WP_HOME}

# Local WordPress installer
WP_ADMIN_USERNAME=admin
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ddev-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
ddev-smoke:
uses: sympress/workflows/.github/workflows/ddev-playwright.yml@v1
uses: sympress/workflows/.github/workflows/ddev-playwright.yml@b68ed03c15db6d2fac85d8345bc22a6229b4f4b2
with:
php_version: '8.5'
allow_custom_commands: true
Expand All @@ -32,4 +32,6 @@ jobs:
test -n "$primary_url"
curl -k -I --fail --max-time 20 "$primary_url"
secrets:
SSH_KEY: ${{ secrets.COMPOSER_SSH_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.COMPOSER_SSH_KNOWN_HOSTS }}
COMPOSER_AUTH_JSON: ${{ secrets.COMPOSER_AUTH_JSON }}
4 changes: 3 additions & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ permissions:

jobs:
qa:
uses: sympress/workflows/.github/workflows/sympress-qa.yml@v1
uses: sympress/workflows/.github/workflows/sympress-qa.yml@b68ed03c15db6d2fac85d8345bc22a6229b4f4b2
with:
include_root: true
package_glob: .github/no-composer-packages/*
php_version: '8.5'
secrets:
SSH_KEY: ${{ secrets.COMPOSER_SSH_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.COMPOSER_SSH_KNOWN_HOSTS }}
COMPOSER_AUTH_JSON: ${{ secrets.COMPOSER_AUTH_JSON }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
!.env.example
.env.cached.php
wp-cli.yml
/wp-cli*.phar
/wp-config.php

### Dependencies and generated WordPress runtime
public
Expand All @@ -25,6 +27,7 @@ var
.ddev/apache/
.ddev/commands/.gitattributes
.ddev/config.local.y*ml
.ddev/docker-compose.*.local.yaml
.ddev/config.*.local.y*ml
.ddev/db_snapshots/
.ddev/homeadditions/
Expand Down
2 changes: 1 addition & 1 deletion .sympress/cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"label": "SymPress Starter",
"packageName": "sympress/starter",
"repositoryUrl": "https://github.com/SymPress/starter",
"description": "DDEV-ready SymPress WordPress starter with WPStarter, Composer-managed WordPress, SymPress kernel, WP-CLI console and quality tooling.",
"description": "DDEV-ready SymPress WordPress starter with SymPress Runtime, Composer-managed WordPress, SymPress kernel, WP-CLI console and quality tooling.",
"defaultVersion": "1.0.x-dev",
"setupCommand": [
"bin/console",
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ddev composer qa
```

Use the matching focused scripts (`cs`, `static-analysis`, `test`) while iterating.
Changes to setup, Composer/WPStarter wiring, DDEV, database or HTTP behavior also
Changes to setup, Composer/SymPress Runtime wiring, DDEV, database or HTTP behavior also
require the DDEV Smoke workflow or an equivalent fresh local setup. Commands in
`bin/console` must continue to work before `vendor/autoload.php` exists.

Expand All @@ -37,7 +37,7 @@ require the DDEV Smoke workflow or an equivalent fresh local setup. Commands in
- `.sympress/cli.json` must match the starter package, setup command and supported
project profiles; update it with starter behavior.
- Never restore a shared default admin password. Setup generates or accepts one.
- Keep WordPress core/content locations aligned across Composer, WPStarter and DDEV.
- Keep WordPress core/content locations aligned across Composer, SymPress Runtime and DDEV.
- Extract behavior to a package only after more than one real consumer needs it.

## Definition of done
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Composer project starter and GitHub template for new WordPress websites in the S
- SymPress kernel, Monolog bundle, WP-CLI console, and optional profiler
- Base MU plugins in `packages/base-mu-plugins`
- DDEV configuration for PHP 8.5, MariaDB 11.8, and nginx-fpm
- WPStarter orchestration for first install and repeatable local setup
- SymPress Runtime orchestration for first install and repeatable local setup
- PHPCS, PHPStan, PHPUnit, Composer audit, Dependabot/Renovate, and DDEV smoke-test wiring

## Requirements
Expand Down Expand Up @@ -78,12 +78,12 @@ ddev start
ddev composer install
```

WPStarter runs through Composer and creates the generated WordPress files/configuration. On a fresh database it installs WordPress with these development credentials unless overridden via environment variables:
SymPress Runtime runs through Composer and creates the generated WordPress files/configuration. On a fresh database it installs WordPress with these development credentials unless overridden via environment variables:

- Username: `admin`
- Password: generated during `bin/console setup` or set through `WP_ADMIN_PASSWORD`

WPStarter is intentionally part of the Composer install/update flow because it installs, syncs, and regenerates the WordPress project files and plugin/theme layout.
SymPress Runtime is intentionally part of the Composer install/update flow because it installs, syncs, and regenerates the WordPress project files and plugin/theme layout.

Open the site:

Expand Down Expand Up @@ -147,7 +147,7 @@ bin/console diagnose-login --env-file=.env.example
├── .ddev/ DDEV local environment
├── bin/console Single starter command surface
├── config/ SymPress and WordPress configuration
├── dev-ops/ WPStarter and server support files
├── dev-ops/ SymPress Runtime and server support files
├── packages/base-mu-plugins/ Starter MU plugin package
├── .sympress/cli.json SymPress CLI project creation/update manifest
├── public/ Generated WordPress webroot, ignored by Git
Expand Down
52 changes: 43 additions & 9 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function runStarterCommand(string $commandName, array $args, string $projectDir)
'setup', 'starter:setup' => starterSetup($projectDir, $args),
'diagnose-login', 'starter:diagnose-login' => starterDiagnoseLogin($projectDir, $args),
'check', 'starter:check' => starterCheck($projectDir),
'doctor', 'starter:doctor' => starterDoctor($projectDir),
'doctor', 'starter:doctor' => starterDoctor($projectDir, $args),
'perf', 'starter:perf' => starterPerf($projectDir, $args),
'reset', 'starter:reset' => starterReset($projectDir, $args),
default => 1,
Expand All @@ -107,7 +107,7 @@ function showStarterHelp(): void
echo "SymPress Starter commands:\n";
echo " bin/console setup [project-name]\n";
echo " bin/console check\n";
echo " bin/console doctor\n";
echo " bin/console doctor [--json]\n";
echo " bin/console diagnose-login [--env-file=.env]\n";
echo " bin/console perf [env-file]\n";
echo " bin/console reset --yes [project-name]\n";
Expand Down Expand Up @@ -161,7 +161,7 @@ function starterSetup(string $projectDir, array $args): int
echo "DDEV_PROJECT_NAME={$projectName}\n";
echo "DDEV_PROJECT_TLD={$projectTld}\n";
echo "WP_HOME={$wpHome}\n";
echo "WP_SITEURL=\${WP_HOME}/wp\n";
echo "WP_SITEURL=\${WP_HOME}\n";
echo "DDEV_CONFIG_ARGS=--project-name={$projectName} --project-tld={$projectTld} --project-type=php --docroot=public --webserver-type=nginx-fpm\n";

return 0;
Expand Down Expand Up @@ -206,7 +206,7 @@ function starterSetup(string $projectDir, array $args): int
$envFile,
[
'WP_HOME' => $wpHome,
'WP_SITEURL' => '${WP_HOME}/wp',
'WP_SITEURL' => '${WP_HOME}',
'WP_ADMIN_PASSWORD' => $adminPassword,
],
);
Expand Down Expand Up @@ -334,6 +334,7 @@ function starterCheck(string $projectDir): int
['ddev', 'composer', 'validate', '--no-check-publish'],
['ddev', 'composer', 'audit', '--locked', '--no-interaction'],
['ddev', 'composer', 'qa'],
['ddev', 'exec', 'php', 'vendor/bin/sympress-runtime', 'check'],
['ddev', 'exec', 'wp', '--info'],
['ddev', 'exec', 'wp', 'core', 'is-installed'],
['ddev', 'exec', 'wp', 'db', 'check'],
Expand All @@ -359,8 +360,19 @@ function starterCheck(string $projectDir): int
return 0;
}

function starterDoctor(string $projectDir): int
/** @param list<string> $args */
function starterDoctor(string $projectDir, array $args): int
{
foreach ($args as $arg) {
if ($arg !== '--json') {
fwrite(STDERR, "Unknown doctor option: {$arg}\n");

return 1;
}
}
if (in_array('--json', $args, true)) {
return runtimeDoctor($projectDir, $args);
}
$status = 0;

$status = checkCommand('ddev') ? $status : 1;
Expand All @@ -370,7 +382,7 @@ function starterDoctor(string $projectDir): int
checkFile($projectDir . '/.env.example', '.env.example');
checkFile($projectDir . '/composer.json', 'composer.json');
checkFile($projectDir . '/.ddev/config.yaml', '.ddev/config.yaml');
checkFile($projectDir . '/dev-ops/wpstarter.json', 'dev-ops/wpstarter.json');
checkFile($projectDir . '/dev-ops/runtime.json', 'dev-ops/runtime.json');
checkFile($projectDir . '/dev-ops/orchestrate.php', 'dev-ops/orchestrate.php');

$ddevConfig = $projectDir . '/.ddev/config.yaml';
Expand Down Expand Up @@ -406,16 +418,38 @@ function starterDoctor(string $projectDir): int
? json_decode((string) file_get_contents($composerFile), true)
: [];

if (($composer['config']['allow-plugins']['wecodemore/wpstarter'] ?? false) === true) {
echo "[OK] WPStarter Composer plugin is allowed\n";
if (($composer['config']['allow-plugins']['sympress/runtime'] ?? false) === true) {
echo "[OK] SymPress Runtime Composer plugin is allowed\n";
} else {
echo "[ERROR] WPStarter Composer plugin is not allowed in composer.json\n";
echo "[ERROR] SymPress Runtime Composer plugin is not allowed in composer.json\n";
$status = 1;
}

if (is_file($projectDir . '/vendor/bin/sympress-runtime')) {
$runtimeStatus = runtimeDoctor($projectDir, []);

return $status !== 0 ? $status : $runtimeStatus;
}

return $status;
}

/** @param list<string> $args */
function runtimeDoctor(string $projectDir, array $args): int
{
if (!is_file($projectDir . '/vendor/bin/sympress-runtime')) {
fwrite(STDERR, "Runtime is not installed. Run bin/console setup first.\n");

return 1;
}
$command = ['php', 'vendor/bin/sympress-runtime', 'doctor', ...$args];
if (getenv('IS_DDEV_PROJECT') !== 'true' && commandExists('ddev')) {
$command = ['ddev', 'exec', ...$command];
}

return runProcess($command);
}

/**
* @param list<string> $args
*/
Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
"sympress/base-mu-plugins": "^1.0@dev",
"sympress/kernel": "dev-main as 1.0.x-dev",
"sympress/monolog-bundle": "dev-main as 1.0.x-dev",
"sympress/runtime": "dev-main",
"sympress/wp-cli-console": "dev-main as 1.0.x-dev",
"johnpbloch/wordpress": "^7.0.0",
"wecodemore/wpstarter": "^3.0.1",
"wp-cli/wp-cli-bundle": "^2.12.0",
"wpackagist-theme/twentytwentyfive": "^1.5.0"
},
"require-dev": {
Expand All @@ -26,7 +25,7 @@
"extra": {
"wordpress-install-dir": "public/wp",
"wordpress-content-dir": "public/wp-content",
"wpstarter": "dev-ops/wpstarter.json",
"sympress-runtime": "dev-ops/runtime.json",
"installer-paths": {
"public/wp-content/mu-plugins/{$name}": [
"type:wordpress-muplugin"
Expand Down Expand Up @@ -70,13 +69,17 @@
"johnpbloch/wordpress-core-installer": true,
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"wecodemore/wpstarter": true,
"sympress/runtime": true,
"phpstan/extension-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "git",
"url": "git@github.com:SymPress/runtime.git"
},
{
"type": "path",
"url": "./packages/*",
Expand Down
Loading
Loading