Skip to content

feat: add redaxo/project skeleton#6549

Merged
gharlan merged 1 commit into
6.xfrom
project-skeleton
Jun 4, 2026
Merged

feat: add redaxo/project skeleton#6549
gharlan merged 1 commit into
6.xfrom
project-skeleton

Conversation

@gharlan
Copy link
Copy Markdown
Member

@gharlan gharlan commented Jun 3, 2026

Summary

Adds a redaxo/project skeleton under project/ — meant to be published standalone via git subtree split and used with composer create-project — and makes it this repo's local development instance, replacing .tools/project.

What's included

The skeleton (project/) — entry points (frontend/backend/console), a minimal Project boot class, a DefaultTemplate, an .htaccess safety net (root deny + public grant), and project metadata. LICENSE/README/.gitattributes are export-ignored so they don't end up in created projects. A post-create-project-cmd hook (Redaxo\Core\Composer\ScriptHandler) strips the skeleton's own package identity from the new project's composer.json.

As the dev instance (replaces .tools/project):

  • Loaded as a Composer path repo (redaxo/project, 6.x-dev, versioned in sync with core) and symlinked into vendor/. post-install/post-update run .tools/bin/init-project, which writes the gitignored project/vendor/autoload_runtime.php shim delegating to the root runtime.
  • AbstractProject::$corePath now derives from the core's own location (dirname(__DIR__)), so it resolves both in a regular project and when core is the root package; made final/read-only.
  • Test fixtures (testmodule1 module + 2-section test template) moved to .tools/fixtures/ (Redaxo\Core\Fixtures), keeping the shipped skeleton clean; visual-test content uses the test template.
  • .tools/bin/console replaced by the skeleton's project/bin/console everywhere (CI, refresh, merge-5x).
  • Static analysis / cs-fixer point at project/ and .tools/fixtures (incl. the extensionless project/bin/console and the config scripts); fixed a deprecated PhpParser\Node\Expr\ArrayItem usage in rector.php surfaced by this.

AGENTS.md documents the new layout.

Follow-ups (not in this PR)

  • Push redaxo/project as a 6.x branch via subtree split, so composer create-project redaxo/project:6.x-dev resolves.
  • Regenerate the visual-test screenshots in CI (article template defaulttest).
  • Runtime smoke-test of the post-create-project handler — it only runs during a real create-project and isn't executable in the monorepo (Composer's API isn't in the dependency tree).

@gharlan gharlan added this to the REDAXO 6.0 milestone Jun 3, 2026
@rex-bot rex-bot added the feature Additional functionality label Jun 3, 2026
@gharlan gharlan force-pushed the project-skeleton branch 2 times, most recently from c648261 to fcc7851 Compare June 4, 2026 09:59
Add a `redaxo/project` skeleton under `project/`, meant to be split out into a
standalone read-only repo and used via `composer create-project`. It contains
the entry points (frontend/backend/console), a minimal `Project` boot class, a
`DefaultTemplate`, an .htaccess safety net (root deny + public grant) and the
project metadata. LICENSE/README/.gitattributes are export-ignored so they
don't end up in created projects. After `create-project`, a
`post-create-project-cmd` hook (`Redaxo\Core\Composer\ScriptHandler`) resets the
new project's composer.json (dropping the skeleton's identity) and writes a
project README.

The skeleton also replaces the former `.tools/project` as this repo's local
development instance:

- `project/` is loaded as a Composer path repo (`redaxo/project`, 6.x-dev,
  versioned in sync with core) and symlinked into `vendor/`.
  `post-install`/`post-update` run `.tools/bin/init-project`, which writes the
  gitignored `project/vendor/autoload_runtime.php` shim that delegates to the
  root runtime.
- `AbstractProject::$corePath` now derives from the core's own location
  (`dirname(__DIR__)`) instead of `projectPath/vendor/redaxo/core`, so it
  resolves both in a regular project and when core is the root package. Made it
  `final`/read-only — there is no use case for overriding it.
- The test fixtures (the `testmodule1` module and a 2-section `test` template)
  move to `.tools/fixtures/` (`Redaxo\Core\Fixtures`), keeping the shipped
  skeleton clean; the visual-test content now uses the `test` template.
- Replace `.tools/bin/console` with the skeleton's `project/bin/console`
  everywhere (CI workflows, refresh, merge-5x).
- Point php-cs-fixer/phpstan/psalm/rector at `project/` and `.tools/fixtures`,
  and analyse the extensionless `project/bin/console` and the config scripts
  explicitly. Fix a deprecated `PhpParser\Node\Expr\ArrayItem` usage in
  rector.php surfaced by this.

Document the new layout in AGENTS.md.
@gharlan gharlan force-pushed the project-skeleton branch from fcc7851 to 7f4c4ad Compare June 4, 2026 10:04
@gharlan gharlan marked this pull request as ready for review June 4, 2026 10:04
@gharlan gharlan changed the title feat: add redaxo/project skeleton and use it as the dev instance feat: add redaxo/project skeleton and use it as the dev instance Jun 4, 2026
@gharlan gharlan changed the title feat: add redaxo/project skeleton and use it as the dev instance feat: add redaxo/project skeleton Jun 4, 2026
@rex-bot rex-bot added feature Additional functionality and removed feature Additional functionality labels Jun 4, 2026
@gharlan gharlan merged commit c2aecf7 into 6.x Jun 4, 2026
21 of 30 checks passed
@gharlan gharlan deleted the project-skeleton branch June 4, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Additional functionality

Development

Successfully merging this pull request may close these issues.

2 participants