Project-files and public-files in composer.json

Silverstripe Version: 5.3

Question:

I just created a fresh install for testing purposes and noticed that there’s now two additional sections in composer.json “extra”. I’m familiar with “project-files-installed” and “public-files-installed”, but haven’t seen the "project-files’ and “public-files” before. Can someone please explain their purpose to me as I cannot find any documentation on this (the example given only shows the two “-installed” sections).


        "project-files": [
            "app/_config/*",
            ".env.example",
            ".graphql-generated/*"
        ],
        "public-files": [
            "assets/*",
            "favicon.ico"
        ],
        "project-files-installed": [
            ".htaccess",
            "app/.htaccess",
            "app/_config/mimevalidator.yml",
            "app/_config/mysite.yml",
            "app/src/Page.php",
            "app/src/PageController.php"
        ],
        "public-files-installed": [
            ".htaccess",
            "index.php",
            "web.config"
        ]

"project-files’ and “public-files” are what recipes use to let silverstripe/recipe-plugin know what files to add to “project-files-installed” and “public-files-installed” on installation.

Since you used composer create-project, the recipe’s composer.json files becomes your composer.json file, so it includes everything the recipe’s included.

You can safely remove those unless you are explicitly creating a recipe (which it sounds like you aren’t).

1 Like

That’s very helpful - thanks

1 Like