1. lazykit.config.json

The lazykit.config.json or package.lazykit file is a configuration file generated by the LazyKit CLI during the initialization process. This file serves as a central hub for customizing and managing your LazyKit settings within your project. It allows you to define preferences that dictate how LazyKit integrates with your codebase.

1. Structure of lazykit.config.json

The configuration file is structured in JSON format, making it easy to read and edit. Below are the key components typically included in this file:

  • v: A string that indicates the version of the LazyKit CLI used to generate this configuration file.

  • language: Indicates the chosen programming language for your project, either "typescript" or "javascript".

  • separate: A boolean value that determines whether the configuration settings are stored in this separate file (true) or in the package.json file under the lazykit property (false).

  • paths: An object that specifies where to store utility functions and React hooks:

    • helperFunctions: Indicate the directory where you want to keep your helper functions from root of the project
    • reactHooks: Indicate the directory where you want to keep your React hooks from root of the project
  • filenameConvention: An object that defines the casing convention for filenames:

    • helperFunctions: The naming convention for utility functions, allowing for camelCase or kebab-case.
    • reactHooks: The naming convention for React hooks, also allowing for camelCase or kebab-case.

2. Example of lazykit.config.json

Here's an example of what the lazykit.config.json file might look like:

1.
{
2.
"v": "2.0.0",
3.
"language": "typescript",
4.
"separate": true,
5.
"paths": {
6.
"helperFunctions": "@/helpers",
7.
"reactHooks": "@/hooks"
8.
},
9.
"filenameConvention": {
10.
"helperFunctions": "camelCase",
11.
"reactHooks": "kebab-case"
12.
}
13.
}