internals/isolate-monorepo-package/README.md
Tool to isolate a package within a monorepo, locally replicating the release flow to ensure dependencies will work together post build.
Aiming to simulate how packages work once published to npm, it:
While it uses yarn behind the scenes, it should work with any package manager that supports workspaces.
This tool is automatically available in the Inquirer workspace. No separate installation needed.
Let me know if you'd like to see this published.
# Basic usage - outputs the path to isolated directory
isolate-monorepo-package @inquirer/demo
# One-liner approach - CD directly into the isolated directory
cd $(yarn isolate-monorepo-package @inquirer/demo)
yarn set version stable # specific to yarn, this repo isn't setup, so it'll need to know which version to run.
yarn install
yarn test
cd -
# Or with npm
cd $(yarn isolate-monorepo-package @inquirer/demo)
npm install
npm test
cd -
<package-name>: The workspace package to isolate (required)-v, --verbose: Show detailed progress informationThe tool outputs only the path to the isolated directory to stdout. All other messages go to stderr, making it easy to capture the path in scripts:
# Capture path in variable
TEST_DIR=$(isolate-monorepo-package @inquirer/demo)
# Or CD directly
cd $(isolate-monorepo-package @inquirer/demo)
If the tool fails:
.yarnrc.yml must exist)-v flag for detailed output/tmp/artifacts/ is writableCopyright (c) 2025 Simon Boudrias (twitter: @vaxilart)
Licensed under the MIT license.