npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cjkihl/changeset-dep-resolver

v1.0.10

Published

Tool to resolve workspace dependencies before publishing

Downloads

138

Readme

@cjkihl/changeset-dep-resolver

A CLI tool to resolve workspace dependencies before publishing packages in a monorepo. This tool automatically converts workspace: dependencies to specific versions for publishing.

Features

  • 🔄 Automatic Resolution: Converts workspace: dependencies to specific versions
  • 📦 Release Plan Aware: Uses changesets release plan to determine new versions
  • 🛡️ Backup & Restore: Creates backups and provides restore functionality
  • 🔍 NPM Integration: Falls back to npm for external packages
  • 🚀 CLI Interface: Easy-to-use command line interface
  • 📝 Detailed Logging: Clear output showing what's being resolved

Installation

# Install globally
npm install -g @cjkihl/changeset-dep-resolver

# Or use with npx
npx @cjkihl/changeset-dep-resolver

Usage

Resolve Dependencies

Before publishing, resolve all workspace dependencies:

# Resolve dependencies in current directory
resolve-deps resolve

# Or with npx
npx @cjkihl/changeset-dep-resolver resolve

Restore Dependencies

After publishing, restore the original workspace dependencies:

# Restore original dependencies
resolve-deps restore

# Or with npx
npx @cjkihl/changeset-dep-resolver restore

How It Works

  1. Reads Changesets: Analyzes your changesets to understand which packages are being released
  2. Assembles Release Plan: Uses changesets to determine new versions for packages
  3. Scans Dependencies: Finds all workspace: dependencies in package.json files
  4. Resolves Versions: Converts workspace dependencies to specific versions:
    • For packages being released: Uses the new version from the release plan
    • For local packages: Uses the current local version
    • For external packages: Fetches the latest version from npm
  5. Creates Backup: Saves original package.json files before making changes
  6. Updates Files: Writes the resolved dependencies back to package.json files

Supported Dependency Types

The tool processes all dependency types:

  • dependencies
  • devDependencies
  • peerDependencies
  • optionalDependencies

Workspace Range Resolution

| Workspace Range | Resolution Strategy | |----------------|-------------------| | workspace:* | Exact version | | workspace:^ | Caret range with resolved version | | workspace:~ | Tilde range with resolved version | | workspace:1.0.0 | Caret range with resolved version |

Example

Before Resolution

{
  "dependencies": {
    "@cjkihl/utils": "workspace:*",
    "@cjkihl/core": "workspace:^",
    "lodash": "workspace:~"
  }
}

After Resolution

{
  "dependencies": {
    "@cjkihl/utils": "1.2.3",
    "@cjkihl/core": "^2.0.0",
    "lodash": "~4.17.21"
  }
}

Integration with Changesets

This tool is designed to work seamlessly with the changesets workflow:

# 1. Create changesets
changeset

# 2. Version packages
changeset version

# 3. Resolve dependencies (this tool)
resolve-deps resolve

# 4. Publish packages
changeset publish

# 5. Restore dependencies (optional)
resolve-deps restore

Backup and Restore

The tool automatically creates a backup file (.workspace-deps-backup.json) containing:

  • List of modified packages
  • Original package.json contents
  • Timestamp of the operation

You can restore the original dependencies at any time using the restore command.

Error Handling

The tool provides detailed error messages and handles various edge cases:

  • Missing packages on npm
  • Invalid workspace ranges
  • File system errors
  • Changesets configuration issues

Requirements

  • Node.js >= 18.0.0
  • Changesets setup in your monorepo
  • Workspace packages with workspace: dependencies

License

MIT