Add a pwa:create:config command to bootstrap the configuration file - #458
Open
Spomky wants to merge 1 commit into
Open
Add a pwa:create:config command to bootstrap the configuration file#458Spomky wants to merge 1 commit into
Spomky wants to merge 1 commit into
Conversation
Spomky
force-pushed
the
feature/create-config-command
branch
4 times, most recently
from
August 16, 2026 20:53
5152d16 to
fb8ecc1
Compare
Creating a PWA required copying config/packages/pwa.yaml from another project and tweaking it by hand. The new command generates it, either step by step or from options only. Every value has a dedicated option, so the command can be scripted with --no-interaction, and --dry-run prints the configuration on the standard output instead of writing it. The image processor is auto-detected, the favicons are wired on the source image and, when the service worker is enabled, the empty source file Asset Mapper expects is created. Closes #84
Spomky
force-pushed
the
feature/create-config-command
branch
from
August 17, 2026 06:47
fb8ecc1 to
dff76e0
Compare
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.
Target branch: 1.6.x
Resolves issue # #84
Creating a PWA currently starts by copying
config/packages/pwa.yamlfrom another project and tweaking the name and the description. This PR adds apwa:create:configcommand that generates that file, either step by step or from options only.Interactive mode
Option mode
Every value has a dedicated option, so the command can be scripted:
bin/console pwa:create:config --no-interaction \ --name="HackerNews PWA" \ --description="A HackerNews implementation based on Symfony" \ --icon=images/logo.svgBoth modes combine:
interact()only asks for what was not passed as an option, and--no-interactionfalls back to the defaults.--dry-runwrites the configuration on the standard output and nothing else, so it can be redirected:bin/console pwa:create:config -n --dry-run > config/packages/pwa.yamlGenerated file
Notes
gdorimagickwithout the extension fails with an explicit message instead of writing a configuration that breaks the container.--force(or a confirmation in interactive mode).Processorto guarantee it is actually loadable.The documentation lives in another repository.
installation.mdstill says a configuration file has to be written by hand — happy to open a companion PR there.Options
--name--short-name--description--start-url--displayfullscreen,standalone,minimal-ui,browser)--theme-color--background-color--icon--favicons/--no-favicons--serviceworker/--no-serviceworker--serviceworker-src--image-processorimagick,gd,none)--path-f,--force--dry-run