Add support for monorepos
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 197
- Forks
- 51
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 94
Description
Problem
The wizard currently fails when run from monorepo root directories. When executed from the root of a workspace containing multiple apps, it cannot locate the target framework (in our case Next.js) and throws an error instead of discovering and installing PostHog in the appropriate subpackage.
Current Behavior
- Must be executed from the specific app directory containing the target framework
- Fails with error when run from monorepo root
- No automatic discovery of workspace structure
Expected Behavior
- Should work when run from monorepo root
- Automatically discover workspace packages containing supported frameworks
- Install PostHog in all relevant packages or prompt user to select specific ones
Our project directories look something like this:
project/
├── package.json
├── pnpm-workspace.yaml
├── apps/
│ ├── web/ # Next.js app
│ │ ├── package.json
│ │ └── src/
│ └── api/ # Fastify API
│ ├── package.json
│ └── src/
└── packages/
└── shared/
├── package.json
└── src/
Proposed Solution
- When framework detection fails in root
package.json, check for workspace indicators:pnpm-workspace.yaml"workspaces"field in rootpackage.json
- Parse workspace configuration to discover all packages
- Scan each package for supported frameworks (Next.js, React, etc.)
- Present options to user:
- Install in all detected compatible packages
- Select specific packages for installation
- Skip packages that already have PostHog configured
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the wizard's framework-detection entry point and inspect how it reads the root package.json. Then review the proposed workspace indicators in pnpm-workspace.yaml and package.json, and trace how detected packages are presented for installation. Done means the wizard can discover supported framework packages from a monorepo root and install in all, selected, or unconfigured packages as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, react, typescript
- Domain
- cli, developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100