Skip to content

Coding guidelines~Component templates

Cory Crowley edited this page Apr 21, 2022 · 2 revisions

Component templates

The Cardboard repo contains a Node.js utility script to generate templated files for a new component. This utility allows new component to be scaffolded out without manually writing the basic component code.

To create a new component via the template script, execute: npm run generate <component_name>

Details

  • Templated components will be created @ ./src/Components/<component_name>
  • To see an example of the templated component structure, run npm run generate MyNewComponent
  • Cardboard components should use CamelCase with the first letter capitalized.
  • To view / modify component templates, see the templates folder
  • To view / modify the template creation utility, see the utility script