Add Syncpack Scripts for Dependency Management
This pull request introduces Syncpack scripts to streamline dependency management within our monorepo.
What is Syncpack?
Syncpack is a tool designed to enforce consistency in package.json files across a monorepo. It helps prevent dependency drift, ensures all packages use compatible versions, and simplifies dependency upgrades. By keeping dependencies synchronized, Syncpack reduces the risk of unexpected issues and improves overall project maintainability.
What do these scripts do?
The following scripts have been added to package.json:
sp:check: A convenience script that runs both sp:format and sp:lint to ensure dependencies are formatted correctly and adhere to our linting rules.
sp:fix:mm: Automatically fixes dependency mismatches across packages. This script will update versions to ensure consistency. Use with caution and review changes before committing!
sp:format: Formats package.json files to a consistent style, including dependency sorting and indentation.
sp:lint: Lints package.json files to identify potential issues like unused dependencies or incorrect version ranges.
sp:ls:mm: Lists all dependency mismatches found within the monorepo, allowing you to review them before attempting a fix.
How to use them:
These scripts can be run using npm run <script-name> (e.g., npm run sp:check).
Benefits:
- Improved Dependency Consistency: Reduces the risk of version conflicts and unexpected behavior.
- Simplified Upgrades: Makes it easier to upgrade dependencies across the entire monorepo.
- Enhanced Maintainability: Keeps
package.json files clean and consistent, improving readability and maintainability.