liferay / liferay-js-themes-toolkit

MIT License
26 stars 28 forks source link

Provide an option (--config config.json) to pass in the configuration #455

Closed david-truong closed 4 years ago

david-truong commented 4 years ago

I would like to provide an option to pass in the configuration so we can skip the prompts similar to what is provided for liferay-js-toolkit.

This will allow us to programmatically invoke the generators for unit tests and for blade-cli without requiring a users input.

jbalsas commented 4 years ago

Hey @david-truong, which versions of the Toolkit will need this option? Can you provide an overview of the setup that will be integrating it?

We might start by adding this to the new major version @izaera is releasing to add Node v12 support and then walk our way back...

david-truong commented 4 years ago

We will need it for 8.x and 9.x.

For blade have a project with the following package.json 8.x

{
    "devDependencies": {
        "generator-liferay-theme": "8.1.2",
        "yo": "3.1.0"
    },
    "scripts": {
        "build-theme": "yo liferay-theme --skip-install",
        "import-theme": "yo liferay-theme:import --skip-install"
    },
    "version": "1.0.0"
}

9.x

{
    "devDependencies": {
        "generator-liferay-fragments": "1.2.1",
        "generator-liferay-js": "2.18.2",
        "generator-liferay-theme": "9.5.0",
        "generator-liferay-theme-themelet": "1.2.0",
        "yo": "3.1.0"
    },
    "scripts": {
        "build-theme": "yo liferay-theme --skip-install",
        "import-theme": "yo liferay-theme:import --skip-install"
    },
    "version": "1.0.0"
}

and we run $YO_PATH liferay-theme --config config.json

izaera commented 4 years ago

See how this feature is used in https://github.com/liferay/liferay-js-themes-toolkit/pull/467

izaera commented 4 years ago

This has been tested and works, so I'm closing it.