I've developed a Symfony bundle, and I am trying to create a recipe. Before submitting it to recipes-contrib, I want to test it, so I followed the instructions for private recipes -- not because I want a private recipe (that is, neither the bundle nor the recipe is "private" in the sense of a private GitHub project).
I have read, re-read, then read again the documentation for creating a recipe, and I feel like I'm missing a very important step. The documentation for a private repository only talks about the package.version.json file, e.g.
{
"manifests": {
"acme/private-bundle": {
"manifest": {
"bundles": {
"Acme\\PrivateBundle\\AcmePrivateBundle": [
"all"
]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%"
}
},
"files": {
"config/packages/acme_private.yaml": {
"contents": [
"acme_private:",
" encode: true",
""
],
"executable": false
}
},
"ref": "7405f3af1312d1f9121afed4dddef636c6c7ff00"
}
}
}
This file appears to be the output of some command that reads the file in the format as expected for a contrib recipe: a directory structure that has a config directory for routes and packages, maybe a src directory, etc.
Obviously, no one is typing in by hand line by line a YAML file (or PHP!) as a list of strings in the content key.
It appears that the master branch of recipes and recipes-contrib contains the directory structure, and flex/main branch contains the "compiled" JSON recipe file.
But in the private recipe instructions, there are no instructions as to how to get from the DX-friendly files to the JSON recipe.
TL;DR; How do I create a package.version.json recipe from the package/version/ directory that contains manifest.json, config, etc.?
I had the same problem few hours ago and I finally get it. Clues were given by the blog post https://symfony.com/blog/symfony-flex-is-going-serverless were we can see that a script and a tool exist.
I duplicated the Github Actions and adapted those files in one of my repositories: https://github.com/web-token/recipes
mainbranch contains the compiled files, including theindex.json: this is what you want to have to get it working.treebranch is the one where developer friendly files live.The
treebranch contains the Github Actions workflows that update themainbranch. Feel free to copy and adapt the folder https://github.com/web-token/recipes/tree/tree/.github with your parameters.Note that the server URL to declare in the composer file will look like
https://api.github.com/repos/web-token/recipes/contents/index.json?ref=main