feat: add redaxo/project skeleton#6549
Merged
Merged
Conversation
c648261 to
fcc7851
Compare
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.
redaxo/project skeleton and use it as the dev instance
redaxo/project skeleton and use it as the dev instanceredaxo/project skeleton
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
redaxo/projectskeleton underproject/— meant to be published standalone via git subtree split and used withcomposer 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 minimalProjectboot class, aDefaultTemplate, an.htaccesssafety net (root deny + public grant), and project metadata.LICENSE/README/.gitattributesareexport-ignored so they don't end up in created projects. Apost-create-project-cmdhook (Redaxo\Core\Composer\ScriptHandler) strips the skeleton's own package identity from the new project'scomposer.json.As the dev instance (replaces
.tools/project):redaxo/project,6.x-dev, versioned in sync with core) and symlinked intovendor/.post-install/post-updaterun.tools/bin/init-project, which writes the gitignoredproject/vendor/autoload_runtime.phpshim delegating to the root runtime.AbstractProject::$corePathnow derives from the core's own location (dirname(__DIR__)), so it resolves both in a regular project and when core is the root package; madefinal/read-only.testmodule1module + 2-sectiontesttemplate) moved to.tools/fixtures/(Redaxo\Core\Fixtures), keeping the shipped skeleton clean; visual-test content uses thetesttemplate..tools/bin/consolereplaced by the skeleton'sproject/bin/consoleeverywhere (CI, refresh, merge-5x).project/and.tools/fixtures(incl. the extensionlessproject/bin/consoleand the config scripts); fixed a deprecatedPhpParser\Node\Expr\ArrayItemusage inrector.phpsurfaced by this.AGENTS.mddocuments the new layout.Follow-ups (not in this PR)
redaxo/projectas a6.xbranch via subtree split, socomposer create-project redaxo/project:6.x-devresolves.default→test).post-create-projecthandler — it only runs during a realcreate-projectand isn't executable in the monorepo (Composer's API isn't in the dependency tree).