Skip to content

fix: Update composer.json start script target folder during migrations - #133

Open
distantnative wants to merge 2 commits into
developfrom
pr-117
Open

fix: Update composer.json start script target folder during migrations#133
distantnative wants to merge 2 commits into
developfrom
pr-117

Conversation

@distantnative

Copy link
Copy Markdown
Member

Review

  • Deep read

Description

Both our kits ship "start": "@php -S localhost:8000 kirby/router.php" in their composer.json. The existing commands to migrate to/from public folder setups moved the document root but left that script unchanged. So composer start kept serving the old location afterwards.

migrate:to:public-folder and migrate:to:root-folder now rewrite the start script's document root.

The command is matched on its -S / -t flags rather, so custom hosts and ports, -t public_html and the reversed flag order are all handled. Both commands share one implementation (RootFolder only overrides documentRoot() to return null). The composer.json is written only when something actually changed.

Changelog

🐛 Bug fixes

  • migrate:to:public-folder and migrate:to:root-folder now update the document root of the start script in your composer.json (thx @lemmon)

lemmon and others added 2 commits August 31, 2026 21:09
- Add updateComposerConfig() method to PublicFolder migration
- Add updateComposerConfig() method to RootFolder migration
- Automatically update PHP built-in server target folder (-t public) flag
- Ensures development server works correctly after folder structure migration

Fixes issue where migrate:to:public-folder and migrate:to:root-folder
didn't update the composer start script's target folder configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants