I am having trouble finding documentation about the module. Maybe a README.md would be a good idea? I am willing to help out with this. Below is what I gathered from several issues/ blog posts etc. This might be a quick first start of documentation here actually ;-)
From what I gather there are at least to ways to use this module.
- Via UI
-- go to Configuration -> Management -> Development -> Config Devel (or /admin/config/development/config_devel)
-- Fill out the Auto Import and/or Auto Export fields, to set which files check be automatically checked or updated.
- Via Drush
There are 3 commands you can use with drush;
-config-devel-export Write back configuration to module's config directory.
-config-devel-import Import configuration from module's config directory to active storage.
-config-devel-import-one Import a single configuration item from module's config directory to active storage.
The drush command explanations do not seem to be correct here, except for the first line there are all identical. Thi does not make sense to me. Maybe the drush documentation was addressed in #2726411: errors in drush command help ?
- Anyway, the help that is currently in Drush suggests that it is also possible to use config_devel in a third way. Namely in you own module, I assume in the mymodule.info.yml file then? Or where else do the config_devel settings go?
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2926778-11.config_devel.How-to-use--documentation.patch | 3.01 KB | joachim |
| #8 | 2926778-8-add_instructions.patch | 3.1 KB | bserem |
Comments
Comment #2
joachim commentedYes, we definitely need a README with clear instructions.
Though I think there are only two ways to use this -- the details you put into mymodule.info.yml are what is needed for the Drush commands.
Comment #3
firfin commentedAh ok, so what I put into mymodule.info.yml determines what is im- or exported by the drush commands?
The drush output states (for cdi, cde and cdi1):
List which configuration settings you want to export in the
module's info file by listing them under 'config_devel', as shown below:
config_devel:
install:
- entity.view_display.node.article.default
- entity.view_display.node.article.teaser
- field.instance.node.article.body
optional:
- field.instance.node.article.tags
I can imagine that the same syntax may be used for import and export, though that might not be exactly what you want. But I don't see how that syntax helps with cdi1?
And what does the optional fit into this? Does it trigger a y/n question from drush?
Comment #4
joachim commentedAh I'm afraid I don't know about the cd1 command.
I became co-maintainer of this module precisely because I wanted to improve the UX and documentation! :)
Its original author is @chx on twitter; might be worth asking him questions about specific aspects of this.
> And what does the optional fit into this? Does it trigger a y/n question from drush?
That I *can* tell you. The install/optional correspond to where the config YML files live in the config folder.
Comment #5
firfin commentedAh yeah, that makes sense. I'll try to contact chx this week and provide a patch afterward.
A README.md will suffice right?
Comment #6
joachim commented> A README.md will suffice right?
Yup, though I'm generally happy to see docs added in other places, such as the UI and drush help. As you see fit :)
Comment #7
firfin commentedComment #8
bserem commentedI believe I can help a bit here.
Patch attached. It is a Readme file, not complete with all that this module does, but enough information on how to export a "feature" without spending 2 hours reading on 5 year old articles and patch files around the web :)
Comment #9
firfin commentedLooks good to me, with the exception of
the its should be is I think?
Probably needs some more refinement, but I say it's a lot better than before :-)
Comment #10
firfin commentedComment #11
joachim commentedNice work! Thanks!
I've combined this with a few notes I had kicking around and reformatted it. I've streamlined some of the section on creating a new module, as there's plenty of documentation about writing info files, which we shouldn't duplicate.
Comment #12
bserem commentedNice catch on the typo!
I like the new version. It is still unclear to me whether we keep the 80 chars width on MD files too, but I guess thats irrelevant here.
I say we move this forward and apply it. After all it breaks nothing (its a Readme) and it has information that is not exactly easy to find right now.
My next step would be to document how updates to the export modules can be imported on other sites.
This seems to work fine if you have config_devel installed, but the project author suggests to not have it installed on production.
Comment #13
joachim commented> It is still unclear to me whether we keep the 80 chars width on MD files too, but I guess thats irrelevant here.
I'd say yes, even though it's a pain to do the wrapping, because it's much easier to read when you open it in a text editor.
Thanks for reviewing. Committed!