Skip to content

[WIP][POC] Add PatchConfigurator #926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

kbond
Copy link
Member

@kbond kbond commented Jun 2, 2022

A configurator to allow patching existing files.

// manifest.json
{
    "patch": [
        {
            "file": "assets/app.js",
            "position": "end", // appends to end of file
            "value": "\n// activates all of Bootstrap's JavaScrip functionality\nimport 'bootstrap';\n"
        },
        {
            "file": "assets/styles/app.css",
            "position": "start", // prepends to start of file
            "value": "@import \"~bootstrap\";\n"
        },
        {
            "file": "templates/login.html.twig",
            "position": "after_target", // adds after "target" below
            "target": "</button>",
            "value": "\n        <a class=\"btn btn-link\" href=\"{{ path('reset_password_request') }}\">Forgot your password?</a>\n"
        },
        {
            "file": "config/packages/twig.yaml", // manipulate yaml
            "target": "twig.form_themes[]",// adds to this config array (creates path if it does not yet exist)
            "value": ["bootstrap_5_layout.html.twig"]
        },
        {
            "file": "package.json", // manipulate json
            "target": "devDependencies[]",// adds to this array/object (creates path if it does not yet exist)
            "value": {
                "boostrap": "^5.0.0",
                "@popperjs/core": "^2.0.0"
            }
        }
    ]
}

TODO:

  • must be queued and run at end
  • patch json
  • patch yaml
  • tests

@kbond
Copy link
Member Author

kbond commented May 19, 2023

Closing in favor of #975.

@kbond kbond closed this May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant