What is @changesets/get-release-plan?
@changesets/get-release-plan is a utility package that helps you generate a release plan for your project. It is part of the Changesets ecosystem, which is designed to manage versioning and changelogs for multi-package repositories. This package specifically focuses on reading changeset files and generating a release plan based on the changes described in those files.
What are @changesets/get-release-plan's main functionalities?
Generate Release Plan
This feature allows you to generate a release plan by reading changeset files in the current working directory. The `getReleasePlan` function returns an object that includes information about the releases that need to be made, including the packages to be released and their new versions.
const { getReleasePlan } = require('@changesets/get-release-plan');
async function generateReleasePlan() {
const cwd = process.cwd();
const releasePlan = await getReleasePlan(cwd);
console.log(releasePlan);
}
generateReleasePlan();
Custom Directory
This feature allows you to specify a custom directory from which to read changeset files. This is useful if your changeset files are not located in the current working directory.
const { getReleasePlan } = require('@changesets/get-release-plan');
async function generateReleasePlan(customDir) {
const releasePlan = await getReleasePlan(customDir);
console.log(releasePlan);
}
generateReleasePlan('/path/to/your/project');
Other packages similar to @changesets/get-release-plan
lerna
Lerna is a popular tool for managing JavaScript projects with multiple packages. It offers functionalities for versioning, publishing, and managing dependencies across multiple packages. Unlike @changesets/get-release-plan, Lerna provides a more comprehensive suite of tools for monorepo management, including bootstrapping and linking local dependencies.
semantic-release
semantic-release automates the versioning and package publishing process based on the commit messages. It ensures that the package is always released with the correct version and changelog. While @changesets/get-release-plan focuses on generating a release plan from changeset files, semantic-release automates the entire release process based on commit history.
standard-version
standard-version is a tool for versioning and changelog generation based on conventional commits. It is simpler than semantic-release and focuses on generating changelogs and bumping versions. Unlike @changesets/get-release-plan, which reads changeset files, standard-version relies on commit messages to determine the next version.
@changesets/get-release-plan
A function that reads information about the current repository
import getReleasePlan from "@changesets/get-release-plan";
const releasePlan = await getReleasePlan(cwd, since, passedConfig);
cwd: string
The directory to run getReleasePlan
in - most often process.cwd()
since: string
Sets whether to use all changesets present, or only those changesets that are new since the branch
diverged from another one.
passedConfig?: Config
The changeset config options as defined in @changesets/types
. This is optional, and can be used to overwrite any written config options.