Fastree config

This file is your blueprint for generating project structures automatically. Let's break it down step by step. šŸš€

fastree.config.json is the configuration file that defines the folder and file structure of your project. It allows you to automate the creation of directories, files, and templates by running a single command.

šŸŽÆ Example Configuration

Here's a sample .fastree.config.json file:

{
  "structure": [
    {
      "path": "src/components",
      "folders": [
        {
          "name": "<feature-name>",
          "files": [],
          "folders": []
        }
      ],
      "files": [
        {
          "name": "<feature-name>-component.tsx",
          "template": "ReactComponent"
        }
      ]
    }
  ]
}

šŸ” Breaking It Down

  1. structure (Array) : This is the main section that defines the folders and files Fastree will generate.

  2. path (String) : Specifies the base directory where new components or features will be created. In the example above, everything will be created inside src/components.

  3. folders (Array) : Defines nested folders within the base path. The { "name": "<feature-name>" } section means that when you generate a feature, <feature-name> will be replaced dynamically.

  4. files (Array) : Defines files that should be created inside the specified directory. The { "name": "<feature-name>-component.tsx", "template": "ReactComponent" } means: The file name will be replaced dynamically with the feature name. It will use the "ReactComponent" template.

šŸš€ Using Fastree Now that you have set up your configuration, you can generate features using:

npx fastree generate auth

What Happens?

A new folder named Auth will be created inside src/components/. A file Auth-component.tsx will be generated using the ReactComponent template. Final Output Structure:

src/
ā”œā”€ā”€ components/
ā”‚ ā”œā”€ā”€ auth/
ā”‚ ā”‚ ā”œā”€ā”€ auth-component.tsx (Generated using template)

Now you're all set to automate your project structure like a pro! šŸŽ‰ Happy coding! šŸš€