@accelint/constellation-tracker
v1.0.2
Published
A tool used to keep a project's catalog-info.yaml file up to date for use in Constellation.
Downloads
162
Readme
Constellation Tracker
Constellation Tracker is a CLI tool designed to automatically maintain and update your project's catalog-info.yaml file for use with Constellation (Backstage). It analyzes your project's dependencies and updates the catalog file with the correct dependency information, ensuring your project's metadata is always accurate and up-to-date.
Purpose
When working with Constellation (a Backstage-based developer portal), each project requires a catalog-info.yaml file that describes the project and its dependencies. Manually maintaining this file can be tedious and error-prone, especially as dependencies change over time.
Constellation Tracker solves this by:
- Automatically generating a
catalog-info.yamlfile if one doesn't exist - Scanning your project's dependencies for their own
catalog-info.yamlfiles - Updating your project's
catalog-info.yamlwith the correct dependency information - Maintaining proper formatting and structure of the catalog file
Installation
# From the root of the standard-toolkit repository
pnpm install
# Or install globally
npm install -g @accelint/constellation-trackerIntegration with Git Workflow
Constellation Tracker is designed to be integrated into your Git workflow, typically using tools like lefthook. This ensures your catalog-info.yaml file is always up-to-date before commits are made.
Example lefthook configuration in your project's .lefthook.yml:
pre-commit:
commands:
constellation-tracker:
run: constellation-trackerUsage
# Run with default options (uses current directory)
constellation-tracker
# Specify custom paths
constellation-tracker --node-modules "./custom/node_modules" --catalog-info "./path/to/catalog-info.yaml"
# Regenerate the catalog-info.yaml file completely
constellation-tracker --regenerateCommand Options
--node-modules <path>: Specify a custom path to the node_modules directory--catalog-info <path>: Specify a custom path to the catalog-info.yaml file--regenerate: Completely regenerate the catalog-info.yaml file
Development
# Build the project
pnpm build
# Run linting
pnpm lint
# Format code
pnpm format
# Run tests
pnpm testImportant package.json Fields
Constellation Tracker relies on specific fields in your project's package.json file:
Standard Fields Used
name: Used as the component name in the catalog-info.yamltitle: Used as the component titleversion: Used in the package/version annotationdescription: Used as the component descriptionrepository: Used to generate links and referenceskeywords: Used as tags in the catalog-info.yaml
Custom Fields Used
owner: Specifies the owner of the component (format:default/team-name)subPath: Specifies the path to the component within the repository
Example of these custom fields in package.json:
{
"name": "my-package",
"owner": "default/my-team",
"subPath": "packages/my-package"
}How It Works
- Reads your project's package.json to extract metadata
- Creates or updates the catalog-info.yaml file with this metadata
- Scans your node_modules for dependencies that have their own catalog-info.yaml files
- Updates your catalog-info.yaml with the dependency information
- Saves the updated catalog-info.yaml file
This ensures your project's dependencies are correctly tracked in Constellation, making it easier to visualize and manage dependencies across your organization.
