Make your existing component ready for template updates
Components created with commodore component new with a Commodore version older than v1.9.0 may not yet contain a .cruft.json.
The easiest way to get a suitable .cruft.json for such a component is to run commodore component new with command line options which mimic the component’s current state.
-
Create
.cruft.jsonby runningcommodore component new <component-slug> \ (1) --name "Component Name" \ (2) --golden-tests \ (3) --matrix-tests \ (3) --output-dir . (4)1 <component-slug>should be the component’s repository name without thecomponent-prefix.2 Component Nameist the user-friendly name to use for the component documentation.3 Provide command line options based on whether your component uses golden tests, matrix tests, etc. 4 Specify that the component should be rendered into a folder in your current working directory. Check the command line parameter documentation for
component newfor the full list of options. -
Copy the
.cruft.jsonfrom the freshly generated component to an existing checkout of the component you want to make ready.You can run
commodore component update --dry-run .in the component directory to see what will be updated from the template. You need a workingcommodorecommand to do so. Please note that the command only works if there’s no uncommitted changes in the component repository. The command will create a commit with the changes on the current branch. -
Commit the file and push the changes.