nodemon.json


Overview

The `nodemon.json` file is a configuration file used by **Nodemon**, a utility that automatically restarts Node.js applications when file changes in the directory are detected. This configuration customizes Nodemon’s behavior specifically for a TypeScript-based project.

The file defines which files or directories Nodemon should watch for changes, which files or directories to ignore, the file extensions to monitor, and the command to execute when a restart is triggered.

In this project, the configuration is tailored to watch compiled TypeScript build info files and source files, ignore certain routes files, and execute a build followed by running the Node.js server.


Detailed Explanation

The file is a JSON object with the following properties:

1. ignore

2. watch

3. ext

4. exec


Usage Example

When running the project with Nodemon using this configuration:

nodemon --config nodemon.json

Implementation Details and Considerations


Interaction with Other Parts of the System


Visual Diagram

flowchart TD
    A[File Changes Detected]
    A -->|Ignore changes in src/routes.ts| B{Is file ignored?}
    B -- Yes --> C[No action]
    B -- No --> D{Is file a .ts or tsbuildinfo?}
    D -- No --> C
    D -- Yes --> E[Nodemon triggers restart]
    E --> F[yarn build]
    F --> G[Build completes]
    G --> H[node dist/base/api/src/app.js]
    H --> I[Application running]

    style A fill:#f9f,stroke:#333,stroke-width:1px
    style E fill:#bbf,stroke:#333,stroke-width:1px
    style F fill:#bbf,stroke:#333,stroke-width:1px
    style H fill:#bbf,stroke:#333,stroke-width:1px

Summary

This configuration plays a critical role in the developer experience and continuous integration of the project by streamlining build and restart cycles.