Skip to content

Recipes for Using sintesi-monorepo-root CLI Tool

This document provides practical examples and use cases to demonstrate how to effectively use the CLI tool within the sintesi-monorepo-root project. The CLI tool is designed to streamline various development tasks, including building, testing, linting, and generating documentation.

Table of Contents

Getting Started

Before using the CLI tool, ensure you have the necessary dependencies installed. You can install them using pnpm:

bash
pnpm install

Once the dependencies are installed, you can access the CLI commands defined in the project's package.json.

Building Packages

To build all packages in the monorepo, use the following command:

bash
pnpm run build

This command compiles the code for all packages, ensuring they are ready for production use.

Example

If you have made changes to the core package, running the build command will compile the latest changes across all packages, including core.

Running Tests

To run tests for all packages, execute the following command:

bash
pnpm run test

This command will run the test suites defined in each package, providing a consolidated output of the test results.

Example

After implementing a new feature in the cli package, run the test command to ensure that all existing and new tests pass.

Linting Code

To lint the codebase across all packages, use:

bash
pnpm run lint

This command checks the code for stylistic errors and enforces coding standards as defined in your linting configuration.

Example

If you want to ensure that your code adheres to the project's coding standards before committing changes, run the lint command to catch any issues early.

Cleaning Build Artifacts

To clean up build artifacts across all packages, run:

bash
pnpm run clean

This command removes any generated files, allowing you to start fresh if needed.

Example

If you encounter issues with stale build artifacts, running the clean command can help resolve these problems.

Generating Documentation

To generate documentation for the project, use the following command:

bash
pnpm run docs:build

This command triggers the documentation generation process, creating up-to-date documentation based on the current state of the codebase.

Example

After adding new features or making significant changes, run the documentation build command to ensure that the documentation reflects the latest updates.

Releasing Packages

To handle versioning and publishing of packages, use the following command:

bash
pnpm run release

This command utilizes changeset to version and publish the packages, ensuring that all changes are properly documented and released.

Example

When you're ready to release a new version of the core package after a series of updates, run the release command to publish it to the package registry.

Forcing Full Regeneration of README and Docs

To force a full regeneration of the README and documentation, you can use the --force flag. This clears the diff and rebuilds from the current context when the output is missing.

Command

bash
pnpm run docs:build --force

Explanation

When using the --force flag, if the documentation directory is empty or the README file does not exist, the command will reset the git diff, ensuring that the documentation is generated based on the full current context rather than relying on previous commits.

Example

If you find that the README is missing or outdated, running the command with the --force flag will regenerate it completely, ensuring that it reflects the latest state of your project.

Conclusion

The sintesi-monorepo-root CLI tool provides a robust set of commands to facilitate development tasks within a monorepo structure. By utilizing these commands, developers can streamline their workflows, maintain code quality, and ensure that documentation is always up-to-date. For further assistance, refer to the project's documentation or reach out to the development team.