1.0.2 • Published 2 months ago

refit v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
2 months ago

📦 Refit - Dependency Manager

npm npm GitHub

A CLI tool for reviewing, adding, updating, and viewing the changelog for dependencies in your Node.js project.

refit example

Features

🚀 Monorepo Support: Manage all the dependencies in your monorepo with ease.

🛠️ Package Managers: Works with npm, yarn, and pnpm.

🔥 Interactive: Interactively bulk update dependencies or manage them individually in detail.

🧙 Wizard: Provides a step by step interactive wizard for full control over managing your dependencies in your project and monorepo workspaces.

📜 Changelogs: View changelogs for dependencies, even during interactive mode, so you never have to leave your terminal making dependency updates more efficient.

Installation

npm install -g refit

Or run with npx:

npx refit

!NOTE
Requires Node.js 18+

List

List the project dependencies. By default, only dependencies that need to be updated are shown and are grouped by semver update type.

list command example

refit [options]

# or
refit ls [options]

# Examples:
# Display all dependencies in the project
refit --all

# Display all dependencies in the project grouped by package
refit --all --groupByPackage

# Only display dependencies with patch updates
refit --semver patch

# Only display dependencies in a specific workspace
refit --workspace workspace-name
OptionType choicesDefaultDescription
--all , -abooleanfalseshow all dependencies including up to date ones
--deprecatedbooleanfalseallow updating to deprecated versions
--depTypes , -darray dev, prod, optionalfilter by dependency type
--global , -gbooleanfalsecheck global node modules instead of local ones
--groupByPackage , -Gbooleanfalselist dependencies grouped by package
--noIssues , -nbooleanfalsehide issues section from list output
--prereleasebooleanfalseallow updating to prerelease versions
--sortstring name, date, typetypesort dependencies
--updateTo , -tostring latest, wantedlatestupdate dependencies to semver type
--semver , -sarray major, minor, patchfilter by update type
--verbose , -vbooleanfalsedisplay all columns of dependency information
--workspace , -warrayfilter dependencies by workspace

Warnings and Errors

The list command will also display warnings and errors found with your dependencies. This can be turned off with the noIssues option.

⚠️ Warnings:

  • Dependencies that have multiple versions installed across workspaces

❌ Errors:

  • Dependencies that are deprecated
  • Dependencies that are not on the registry
  • Dependencies that require an install
    • a dependency could require install because the node_modules directory is missing
    • changes were pulled down from the remote that include dependency updates and npm install hasn't been ran yet to sync up the local node modules

Update

Updates outdated dependencies. This command only modifies the package.json file and does not run npm install or any other install command. By default, it will update all outdated dependencies to the latest version.

update command example

refit update [...dependencies] [options]

# or
refit up [...dependencies] [options]

# Examples:
# Update dependencies that only have patch updates
refit up --semver patch

# Update dev dependencies only
refit up --depTypes dev

# Update a single package
refit up package-name
OptionType choicesDefaultDescription
--deprecatedbooleanfalseallow updating to deprecated versions
--depTypes , -darray dev, prod, optionalfilter by dependency type
--interactive , -ibooleanfalseinteractively bulk update dependencies
--prereleasebooleanfalseallow updating to prerelease versions
--updateTo , -tostring latest, wantedlatestupdate dependencies to semver type
--semver , -sarray major, minor, patchfilter by update type
--workspace , -warrayfilter dependencies by workspace

Interactive Mode

Interactive mode allows you to select multiple dependencies to update at once across all workspaces. It also provides the ability to view the changelog for each dependency before updating by pressing the tab key.

interactive command example

refit up -i

Wizard

A step by step wizard to add or update dependencies. Provides the ability to view the changelog for each dependency before updating by pressing the tab key on the dependency select step. This command is useful for granular control over monorepo workspace dependencies.

wizard command example

refit wizard [options]

# or
refit w [options]
OptionType choicesDefaultDescription
--deprecatedbooleanfalseallow updating to deprecated versions
--depTypes , -darray dev, prod, optionalfilter by dependency type
--prereleasebooleanfalseallow updating to prerelease versions
--workspace , -warrayfilter dependencies by workspace

Changelogs

View the changelog for a dependency. By default, the changelog will only display the versions newer than the current version of the dependency. Use the full option to display the full changelog.

changes command example

refit changes [dependency[@version]] [options]

# Examples:
# View the changelog for a dependency
refit changes package-name

# View the full changelog for a dependency
refit changes package-name --full

# View the changelog for a dependency from a specific version
refit changes package-name@1.0.0
OptionType choicesDefaultDescription
--full , -fbooleanfalseshow full changelog

Sources

The changes for each version is available from 2 sources:

  • GitHub Releases
  • CHANGELOG.md file in the package

If both are available, the s key switches between the two sources.

Global Options

These options can be used with any command:

OptionType choicesDefaultDescription
--packageManagerstring npm, yarn, pnpmnpmpackage manager to use
--workspacesarraydirectories of the monorepo workspaces

Configuration File

Refit supports a configuration file in the root of your project called .refitrc.json. This file can be used to set default options for the CLI tool. All command options and global options can be set in the configuration file.

Example .refitrc.json:

{
	"workspaces": ["packages/*"],
	"packageManager": "npm",
	"depTypes": ["prod", "dev"],
	"semver": ["major", "minor", "patch"],
	"deprecated": false
}