Detalhes do pacote

@alienfast/find-monorepo-root

alienfast38.5k1.0.9

Find the root path of a monorepo using various strategies.

monorepo, find, root

readme (leia-me)

MIT Version CI PRs Welcome

@alienfast/find-monorepo-root

Find the root directory of a monorepo using any of the following strategies:

  • Lerna
  • Yarn
  • Bolt
  • pnpm
  • npm

Install

yarn install @alienfast/find-monorepo-root

Usage

npx

For easy use in a shell script anywhere in your monorepo, execute with the -y

npx -y @alienfast/find-monorepo-root
# output: /Users/rosskevin/projects/archetype

or

#!/usr/bin/env bash

ROOT=`npx -y @alienfast/find-monorepo-root`

echo "My monorepo root is ${ROOT}"

Api

import { findMonorepoRoot } from '@alienfast/find-monorepo-root'
const cwd = process.cwd()

console.log(await findMonorepoRoot(cwd))
// {
//   strategy: 'lerna', // 'bolt' | 'yarn' | 'pnpm' | 'lerna' | 'npm'
//   dir: '/Users/rosskevin/projects/archetype',     // the monorepo root directory
// }

Contributing

PRs are accepted! This project is configured with auto, so feel free to submit a PR and auto will automatically create a canary release for you to try out.

Prior art

This was originally forked from https://github.com/bubkoo/find-monorepo-root/ because it a) did not work for me in it's current form; and b) I wanted to exec it simply with npx. Thanks to the original author and contributors.

changelog (log de mudanças)

v1.0.9 (Sat Aug 26 2023)

⚠️ Pushed to main

Authors: 1


v1.0.8 (Sat Aug 26 2023)

⚠️ Pushed to main

Authors: 1


v1.0.7 (Sat Aug 26 2023)

⚠️ Pushed to main

  • I’m not crazy, NPM_TOKEN should work and is not filtered by gh (@rosskevin)
  • link fix (@rosskevin)

Authors: 1


v1.0.6 (Sat Aug 26 2023)

⚠️ Pushed to main

Authors: 1


v1.0.5 (Sat Aug 26 2023)

⚠️ Pushed to main

  • Use NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} instead to see if npm recognizes it (@rosskevin)

Authors: 1


v1.0.4 (Sat Aug 26 2023)

⚠️ Pushed to main

  • remove workflow split and move secondary publish up in conditional step (@rosskevin)

Authors: 1


v1.0.3 (Sat Aug 26 2023)

🐛 Bug Fix

Authors: 1


v1.0.2 (Tue Aug 01 2023)

⚠️ Pushed to main

  • [bug] some yarn projects with packageManager specified were giving false positive as the monorepo root (@rosskevin)

Authors: 1


v1.0.1 (Fri Jul 28 2023)

:tada: This release contains work from a new contributor! :tada:

Thank you, Kevin Ross (@rosskevin), for all your work!

🐛 Bug Fix

  • Initial refactoring/implementation of expanded tests and support for npm #1 (@rosskevin)

⚠️ Pushed to main

Authors: 1