ditoh
v1.0.2
Published
A tool for monorepos to run meta scripts in subpackages.
Maintainers
Readme
Ditoh
Ditoh is a lightweight tool designed for monorepos (Turborepo, etc.) to run centralized meta-scripts from within subpackages.
It solves the problem of needing to access root-level scripts or configurations while working inside a nested package directory. Ditoh recursively searches up the directory tree for a ditoh.config.json file and executes the defined commands from the context of where you called it.
Features
- 🔍 Recursive Config Search: Automatically finds
ditoh.config.jsonin parent directories. - 🚀 Context-Aware Execution: Runs scripts with the current working directory preserved.
- 🛠️ Simple Configuration: Define scripts in a simple JSON file.
Installation
pnpm add -Dw ditoh
# or
npm install -D --save-workspace-root ditoh
# or
yarn add -D -W ditohUsage
- Create a
ditoh.config.jsonin your repository root:
{
"scripts": {
"my-script": "echo 'Running my shared script!'"
}
}- Run the script from any subpackage:
cd packages/my-app
pnpm exec ditoh my-scriptOr add it to your package's package.json scripts:
{
"scripts": {
"echo": "ditoh my-script"
}
}CLI Reference
ditoh <script-name> [flags]
Flags:
--debug Enable verbose logging to debug config resolution and execution.License
MIT © Kevin Reynolds
