This repository was archived by the owner on May 31, 2021. It is now read-only.
  
  
  - 
                Notifications
    You must be signed in to change notification settings 
- Fork 118
How to add your template to Stagehand
        Kathy Walrath edited this page Jul 11, 2018 
        ·
        12 revisions
      
    Here's the process for adding templates.
We try not to have too many templates. If we add one, we might want to delete one.
cd my_dir
git clone https://github.com/google/stagehand.git
cd stagehand
- Choose a name for your template, following conventions set by existing generators (e.g. web-something)
- Create a copy of the file that's closest to your template type in lib/src/generators (e.g. copy web_simple.dart to web_something.dart)
- Update the info in the main generator file to match your template
- 
Remove all /packages entries 
- 
Replace all instances of your project’s name with {{projectName}} 
- 
Update pubspec.yaml with entries like: name: {{projectName}} version: 0.0.1 description: A sample command-line application. author: {{author}} <email@example.com> homepage: https://www.example.com
Import its main generator file, and add an instance of its generator to the generators list.
From within your stagehand directory:
pub run build_runner build 
See instructions here in the "As a contributor to open-source" section
pub global deactivate stagehand
pub global activate stagehand