Skip to content

detect_new_library Pro

Detects newly added direct dependencies in PR-changed pubspec.yaml files. Adds the detect-new-library command to the base monorepo_toolkit.

Version: 1.0.0

Variables

VariableTypeDefaultDescription
appNamestringMyAppThe name of your application
isForMonorepobooleantrueWhether this is being generated as part of a monorepo

Usage

Interactive

bash
archipelago generate detect_new_library

Non-interactive (CI)

bash
archipelago generate detect_new_library --config my_config.json

Config Template

json
{
  "@appName": "The name of your application",
  "appName": "MyApp",
  "@isForMonorepo": "Whether this is being generated as part of a monorepo",
  "isForMonorepo": true
}

Generated Structure

devtools/
└── scripts/
    └── detect_new_library/
        ├── lib/
        │   ├── detect_new_library.dart
        │   └── src/
        │       ├── commands/
        │       │   ├── check_command.dart
        │       │   └── detect_new_library_command.dart
        │       ├── models/
        │       │   └── new_library_config.dart
        │       └── services/
        │           └── detect_new_library_service.dart
        └── pubspec.yaml
.newlibrary.yaml

The post_gen hook registers the detect-new-library command in monorepo_toolkit's command runner and adds the .newlibrary.yaml config file at the workspace root with fail_on_new: false as the default.

Built by Banua Coder